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