1 | # Installation
|
2 | > `npm install --save @types/babel-plugin-macros`
|
3 |
|
4 | # Summary
|
5 | This package contains type definitions for babel-plugin-macros (https://github.com/kentcdodds/babel-plugin-macros).
|
6 |
|
7 | # Details
|
8 | Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/babel-plugin-macros.
|
9 | ## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/babel-plugin-macros/index.d.ts)
|
10 | ````ts
|
11 | import * as Babel from "@babel/core";
|
12 |
|
13 | export = babelPluginMacros;
|
14 |
|
15 | declare namespace babelPluginMacros {
|
16 | interface References {
|
17 | [key: string]: Babel.NodePath[];
|
18 | }
|
19 |
|
20 | interface Options {
|
21 | configName?: string | undefined;
|
22 | }
|
23 |
|
24 | interface MacroParams {
|
25 | references: { default: Babel.NodePath[] } & References;
|
26 | state: Babel.PluginPass;
|
27 | babel: typeof Babel;
|
28 | config?: { [key: string]: any } | undefined;
|
29 | source: string;
|
30 | isBabelMacrosCall: boolean;
|
31 | }
|
32 |
|
33 | type MacroHandler = (params: MacroParams) => void;
|
34 |
|
35 | class MacroError extends Error {}
|
36 |
|
37 | function createMacro(handler: MacroHandler, options?: Options): any;
|
38 | }
|
39 |
|
40 | declare function babelPluginMacros(babel: typeof Babel, options: any): Babel.PluginObj;
|
41 |
|
42 | ````
|
43 |
|
44 | ### Additional Details
|
45 | * Last updated: Mon, 06 Nov 2023 22:41:04 GMT
|
46 | * Dependencies: [@types/babel__core](https://npmjs.com/package/@types/babel__core)
|
47 |
|
48 | # Credits
|
49 | These definitions were written by [Billy Kwok](https://github.com/billykwok), [Jake Runzer](https://github.com/coffee-cup), and [Ifiok Jr.](https://github.com/ifiokjr).
|
50 |
|
\ | No newline at end of file |