feat: closure-compiler type definitions.

This commit is contained in:
Martin Probst
2015-10-18 07:34:33 +01:00
parent af5b8275d1
commit b4e6999d56
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;
}