UNPKG

@types/babel-plugin-macros

Version:
50 lines (36 loc) 1.59 kB
# Installation > `npm install --save @types/babel-plugin-macros` # Summary This package contains type definitions for babel-plugin-macros (https://github.com/kentcdodds/babel-plugin-macros). # Details Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/babel-plugin-macros. ## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/babel-plugin-macros/index.d.ts) ````ts import * as Babel from "@babel/core"; export = babelPluginMacros; declare namespace babelPluginMacros { interface References { [key: string]: Babel.NodePath[]; } interface Options { configName?: string | undefined; } interface MacroParams { references: { default: Babel.NodePath[] } & References; state: Babel.PluginPass; babel: typeof Babel; config?: { [key: string]: any } | undefined; source: string; isBabelMacrosCall: boolean; } type MacroHandler = (params: MacroParams) => void; class MacroError extends Error {} function createMacro(handler: MacroHandler, options?: Options): any; } declare function babelPluginMacros(babel: typeof Babel, options: any): Babel.PluginObj; ```` ### Additional Details * Last updated: Mon, 06 Nov 2023 22:41:04 GMT * Dependencies: [@types/babel__core](https://npmjs.com/package/@types/babel__core) # Credits 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).