1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | import * as Babel from '@babel/core';
|
10 |
|
11 | export = babelPluginMacros;
|
12 |
|
13 | declare namespace babelPluginMacros {
|
14 | interface References {
|
15 | [key: string]: Babel.NodePath[];
|
16 | }
|
17 |
|
18 | interface Options {
|
19 | configName?: string | undefined;
|
20 | }
|
21 |
|
22 | interface MacroParams {
|
23 | references: { default: Babel.NodePath[] } & References;
|
24 | state: Babel.PluginPass;
|
25 | babel: typeof Babel;
|
26 | config?: { [key: string]: any } | undefined;
|
27 | }
|
28 |
|
29 | type MacroHandler = (params: MacroParams) => void;
|
30 |
|
31 | class MacroError extends Error {}
|
32 |
|
33 | function createMacro(handler: MacroHandler, options?: Options): any;
|
34 | }
|
35 |
|
36 | declare function babelPluginMacros(babel: typeof Babel, options: any): Babel.PluginObj;
|