mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 04:49:15 +08:00
Added definitions for browserify.
This commit is contained in:
7
browserify/browserify-tests.ts
Normal file
7
browserify/browserify-tests.ts
Normal 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
39
browserify/browserify.d.ts
vendored
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user