mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Merge pull request #2921 from jeffmay/browserify
Updated browserify.d.ts to allow require without import.
This commit is contained in:
@@ -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: []});
|
||||
|
||||
Vendored
+41
-38
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user