mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* update babel-plugin-macros types to match docs * babel-plugin-macros update version and ts version * babel-plugin-macros update createMacro and MacroError types * babel-plugin-macros: revert typescript version to 2.9
15 lines
461 B
TypeScript
15 lines
461 B
TypeScript
import { createMacro, MacroError, References, Options, MacroParams, MacroHandler } from 'babel-plugin-macros';
|
|
|
|
const macro = createMacro(
|
|
({ references, state, babel }) => {
|
|
Object.keys(references).forEach(() => {});
|
|
references.default.forEach(() => {});
|
|
state.abc = 123;
|
|
babel.parse("console.log('Hello world!')");
|
|
throw new MacroError('testing');
|
|
},
|
|
{ configName: 'test' },
|
|
);
|
|
|
|
macro() === 'Hello world!';
|