mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Merge pull request #6340 from mprobst/closure-compiler
feat: closure-compiler type definitions.
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
/// <reference path="closure-compiler.d.ts"/>
|
||||
import {compile} from 'closure-compiler';
|
||||
|
||||
compile('some.source()', {'check-only': null},
|
||||
(err: Error, stdout: string, stderr: string): void => {
|
||||
console.log('Got', err, 'stdout', stdout, 'stderr', stderr);
|
||||
});
|
||||
|
||||
// No options, Callback wins.
|
||||
compile('some.source()', (err: Error, stdout: string, stderr: string): void => {
|
||||
console.log('Got', err, 'stdout', stdout, 'stderr', stderr);
|
||||
});
|
||||
|
||||
compile(null, {'js': ['a/f.js', 'a/f2.js'], 'check-only': null},
|
||||
(err: Error, stdout: string, stderr: string): void => {
|
||||
console.log('Got', err, 'stdout', stdout, 'stderr', stderr);
|
||||
});
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// Type definitions for closure-compiler
|
||||
// Project: https://github.com/tim-smart/node-closure/
|
||||
// Definitions by: Martin Probst <https://github.com/mprobst>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module 'closure-compiler' {
|
||||
type Callback = (err: Error, stdout: string, stderr: string) => any;
|
||||
function compile(src: string, callback: Callback): void;
|
||||
function compile(src: string, options: {[k: string]: string | string[]},
|
||||
callback: Callback): void;
|
||||
}
|
||||
Reference in New Issue
Block a user