DefinitelyTyped/types/babel-plugin-macros/index.d.ts
Jan Potoms 4fccaa038e
Add missing return types for babel__traverse unshiftContainer and replaceWithMultiple (#42407)
* Add missing return types

* try this

* Fix test

* babel core depends on babel traverse

* increase ts version on plugin-macros

* this should be the last one depending on babel/traverse

* try a rerun

* trigger a rerun
2020-02-20 10:25:41 -08:00

29 lines
813 B
TypeScript

// Type definitions for babel-plugin-macros 2.8
// Project: https://github.com/kentcdodds/babel-plugin-macros
// Definitions by: Billy Kwok <https://github.com/billykwok>
// Jake Runzer <https://github.com/coffee-cup>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// Minimum TypeScript Version: 3.4
import * as Babel from '@babel/core';
export interface References {
[key: string]: Babel.NodePath[];
}
export interface Options {
configName?: string;
}
export interface MacroParams {
references: { default: Babel.NodePath[] } & References;
state: any;
babel: typeof Babel;
}
export type MacroHandler = (params: MacroParams) => void;
export class MacroError extends Error {}
export function createMacro(handler: MacroHandler, options?: Options): any;