UNPKG

524 BTypeScriptView Raw
1import { ConfigAPI, NodePath, types } from '@babel/core';
2
3interface Attribute {
4 name: string;
5 value?: boolean | number | string | null;
6 spread?: boolean;
7 literal?: boolean;
8 position?: 'start' | 'end';
9}
10interface Options {
11 elements: string[];
12 attributes: Attribute[];
13}
14declare const addJSXAttribute: (_: ConfigAPI, opts: Options) => {
15 visitor: {
16 JSXOpeningElement(path: NodePath<types.JSXOpeningElement>): void;
17 };
18};
19
20export { Attribute, Options, addJSXAttribute as default };