forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated browserify.d.ts to allow require without import.
- Loading branch information
Jeff May
committed
Oct 4, 2014
1 parent
4598e7d
commit 405be51
Showing
2 changed files
with
53 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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: []}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |