1 |
|
2 |
|
3 |
|
4 |
|
5 | import stream = require("stream");
|
6 | import babel = require("babel-core");
|
7 |
|
8 | declare function Babelify(filename: string, opts?: Babelify.BabelifyOptions): Babelify.BabelifyObject;
|
9 |
|
10 | declare namespace Babelify {
|
11 | export interface BabelifyConstructor {
|
12 | (filename: string, opts: Babelify.BabelifyOptions): Babelify.BabelifyObject;
|
13 | }
|
14 |
|
15 |
|
16 | export interface BabelifyOptions extends babel.TransformOptions {
|
17 | |
18 |
|
19 |
|
20 | extensions?: string | string[] | undefined;
|
21 |
|
22 | |
23 |
|
24 |
|
25 | sourceMapsAbsolute?: boolean | undefined;
|
26 | }
|
27 |
|
28 | export class BabelifyObject extends stream.Transform {
|
29 | _transform(buf: string | Buffer, encoding: string, callback: () => void): void;
|
30 | _flush(callback: () => void): void;
|
31 | }
|
32 |
|
33 | export function configure(opts: Babelify.BabelifyOptions): (filename: string) => Babelify.BabelifyObject;
|
34 | }
|
35 |
|
36 | export = Babelify;
|