index.d.ts 524 B

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