Updated browserify.d.ts to allow require without import.

This commit is contained in:
Jeff May
2014-10-04 11:57:04 -04:00
parent 4598e7d76b
commit 405be518fc
2 changed files with 53 additions and 45 deletions
+12 -7
View File
@@ -1,7 +1,12 @@
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'));
/// <reference path="browserify.d.ts"/>
import browserify = require("browserify");
import fs = require("fs");
var b: BrowserifyObject = browserify();
b.add('./browser/main.js');
b.transform('deamdify');
b.bundle().pipe(fs.createWriteStream('bundle.js'));
var customBrowsify: Browserify = require("browserify");
customBrowsify({entries: []});
+41 -38
View File
@@ -1,38 +1,41 @@
// 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 extends NodeJS.EventEmitter {
add(file: string): BrowserifyObject;
require(file: string, opts?: {
expose: string;
}): BrowserifyObject;
bundle(opts?: {
insertGlobals?: boolean;
detectGlobals?: boolean;
debug?: boolean;
standalone?: string;
insertGlobalVars?: any;
}, cb?: (err: any, src: any) => void): NodeJS.ReadableStream;
external(file: string): BrowserifyObject;
ignore(file: string): BrowserifyObject;
transform(tr: string): BrowserifyObject;
transform(tr: Function): BrowserifyObject;
plugin(plugin: string, opts?: any): BrowserifyObject;
plugin(plugin: Function, opts?: any): BrowserifyObject;
}
declare module "browserify" {
function browserify(): BrowserifyObject;
function browserify(files: string[]): BrowserifyObject;
function browserify(opts: {
entries?: string[];
noParse?: string[];
}): BrowserifyObject;
export = browserify;
}
// 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 extends NodeJS.EventEmitter {
add(file:string): BrowserifyObject;
require(file:string, opts?:{
expose: string;
}): BrowserifyObject;
bundle(opts?:{
insertGlobals?: boolean;
detectGlobals?: boolean;
debug?: boolean;
standalone?: string;
insertGlobalVars?: any;
}, cb?:(err:any, src:any) => void): NodeJS.ReadableStream;
external(file:string): BrowserifyObject;
ignore(file:string): BrowserifyObject;
transform(tr:string): BrowserifyObject;
transform(tr:Function): BrowserifyObject;
plugin(plugin:string, opts?:any): BrowserifyObject;
plugin(plugin:Function, opts?:any): BrowserifyObject;
}
interface Browserify {
(): BrowserifyObject;
(files:string[]): BrowserifyObject;
(opts:{
entries?: string[];
noParse?: string[];
}): BrowserifyObject;
}
declare module "browserify" {
var browserify: Browserify;
export = browserify;
}