DefinitelyTyped/browserify/browserify.d.ts
John Vilk 87ac1b3421 [Node] Updating stream interfaces and removing redundant interfaces.
We duplicated the EventEmitter and Stream interfaces in the "event" module, so I removed the redundant interface definitions.

I have updated the ReadableStream/WritableStream interfaces in accordance with the current documentation:
http://nodejs.org/api/stream.html

I added class definitions for Writable/Transform/Duplex/PassThrough in 'event'. These classes are described in the following Node documentation:
http://nodejs.org/api/stream.html#stream_api_for_stream_implementors

As a result of these changes, I needed to slightly alter other typings to refer to the new interface name. This was unavoidable; I had to rename the `EventEmitter` interface to `NodeEventEmitter` to avoid clashing with the `events.EventEmitter` class that implements `NodeEventEmitter`.
2014-02-05 14:28:10 -05:00

36 lines
1.0 KiB
TypeScript

// 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 NodeEventEmitter {
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): ReadableStream;
external(file: string): BrowserifyObject;
ignore(file: string): BrowserifyObject;
transform(tr: string): BrowserifyObject;
transform(tr: Function): BrowserifyObject;
}
declare module "browserify" {
function browserify(): BrowserifyObject;
function browserify(files: string[]): BrowserifyObject;
function browserify(opts: {
entries?: string[];
noParse?: string[];
}): BrowserifyObject;
export = browserify;
}