Merge pull request #6340 from mprobst/closure-compiler

feat: closure-compiler type definitions.
This commit is contained in:
Alex Eagle
2015-10-20 14:59:18 +01:00
2 changed files with 28 additions and 0 deletions
@@ -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
View File
@@ -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;
}