Merge pull request #869 from AndrewGaspar/browserify

Added definitions for browserify.
This commit is contained in:
Diullei Gomes
2013-08-16 05:44:11 -07:00
2 changed files with 46 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
import browserify = require("browserify");
import fs = require("fs");
var b = browserify();
b.add('./browser/main.js');
b.transform('deamdify');
b.bundle().pipe(fs.createWriteStream('bundle.js'));
+39
View File
@@ -0,0 +1,39 @@
// Type definitions for Browserify
// Project: http://browserify.org/
// Definitions by: Andrew Gaspar <https://github.com/AndrewGaspar/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
interface BrowserifyObject {
add(file: string);
require(file: string, opts?: {
expose: string;
});
bundle(opts?: {
insertGlobals?: boolean;
detectGlobals?: boolean;
debug?: boolean;
standalone?: string;
insertGlobalVars? ;
}, cb?: (err, src) => void): ReadableStream;
external(file: string);
ignore(file: string);
transform(tr: string);
transform(tr: Function);
on(event: string, action: Function): void;
on(event: "file", action: (file, id, parent) => void);
}
declare module "browserify" {
function browserify(): BrowserifyObject;
function browserify(files: string[]): BrowserifyObject;
function browserify(opts: {
entries?: string[];
noParse?: string[];
}): BrowserifyObject;
export = browserify;
}