mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-24 05:06:02 +08:00
simplify interfaces
This commit is contained in:
47
babelify/babelify.d.ts
vendored
47
babelify/babelify.d.ts
vendored
@@ -13,40 +13,33 @@ declare module 'babelify' {
|
||||
import babel = require("babel-core");
|
||||
|
||||
|
||||
/** In addition to the various purposes documented here, all of the babelify options are passed to babel which passes them on to babel.transform() when each file is transformed */
|
||||
interface babelifyOptions extends babel.TransformOptions {
|
||||
/** These are passed to babel.util.canCompile() for each filename
|
||||
* default: null (see babel.
|
||||
*/
|
||||
extensions?: string | string[];
|
||||
|
||||
/** if true, a 'sourceFileName' property with a value equal to the current file being transformed is included with the options passed to babel.transform()
|
||||
* default: false
|
||||
*/
|
||||
sourceMapsAbsolute?: boolean;
|
||||
}
|
||||
|
||||
|
||||
class babelifyObject extends stream.Transform {
|
||||
|
||||
_transform(buf: string | Buffer, encoding: string, callback: () => void): void;
|
||||
|
||||
_flush(callback: () => void): void;
|
||||
}
|
||||
|
||||
|
||||
function Babelify(filename: string, opts?: babelifyOptions): babelifyObject;
|
||||
function Babelify(filename: string, opts?: Babelify.BabelifyOptions): Babelify.BabelifyObject;
|
||||
|
||||
module Babelify {
|
||||
|
||||
export interface BabelifyConstructor {
|
||||
(filename: string, opts: babelifyOptions): babelifyObject;
|
||||
(filename: string, opts: Babelify.BabelifyOptions): Babelify.BabelifyObject;
|
||||
}
|
||||
|
||||
export interface BabelifyOptions extends babelifyOptions { }
|
||||
/** In addition to the various purposes documented here, all of the babelify options are passed to babel which passes them on to babel.transform() when each file is transformed */
|
||||
export interface BabelifyOptions extends babel.TransformOptions {
|
||||
/** These are passed to babel.util.canCompile() for each filename
|
||||
* default: null
|
||||
*/
|
||||
extensions?: string | string[];
|
||||
|
||||
export class BabelifyObject extends babelifyObject { }
|
||||
/** if true, a 'sourceFileName' property with a value equal to the current file being transformed is included with the options passed to babel.transform()
|
||||
* default: false
|
||||
*/
|
||||
sourceMapsAbsolute?: boolean;
|
||||
}
|
||||
|
||||
export function configure(opts: babelifyOptions): (filename: string) => babelifyObject;
|
||||
export class BabelifyObject extends stream.Transform {
|
||||
_transform(buf: string | Buffer, encoding: string, callback: () => void): void;
|
||||
_flush(callback: () => void): void;
|
||||
}
|
||||
|
||||
export function configure(opts: Babelify.BabelifyOptions): (filename: string) => Babelify.BabelifyObject;
|
||||
}
|
||||
|
||||
export = Babelify;
|
||||
|
||||
Reference in New Issue
Block a user