Added definitions for browserify.

This commit is contained in:
Andrew Gaspar
2013-08-15 19:38:11 -05:00
parent e4c97e410c
commit 97a95c41a0
2 changed files with 46 additions and 0 deletions

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
browserify/browserify.d.ts vendored Normal file
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;
}