@types/babel-plugin-macros
TypeScript icon, indicating that this package has built-in type declarations

3.1.3 • Public • Published

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

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

Credits

These definitions were written by Billy Kwok, Jake Runzer, and Ifiok Jr..

Versions

Current Tags

Version History

Package Sidebar

Install

npm i @types/babel-plugin-macros

Weekly Downloads

23,083

Version

3.1.3

License

MIT

Unpacked Size

4.68 kB

Total Files

5

Last publish

Collaborators

  • types