index.d.ts 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. import * as BabelCore from "@babel/core";
  2. import { Options } from "@vue/babel-plugin-resolve-type";
  3. //#region src/interface.d.ts
  4. type State = {
  5. get: (name: string) => any;
  6. set: (name: string, value: any) => any;
  7. opts: VueJSXPluginOptions;
  8. file: BabelCore.BabelFile;
  9. };
  10. interface VueJSXPluginOptions {
  11. /** transform `on: { click: xx }` to `onClick: xxx` */
  12. transformOn?: boolean;
  13. /** enable optimization or not. */
  14. optimize?: boolean;
  15. /** merge static and dynamic class / style attributes / onXXX handlers */
  16. mergeProps?: boolean;
  17. /** configuring custom elements */
  18. isCustomElement?: (tag: string) => boolean;
  19. /** enable object slots syntax */
  20. enableObjectSlots?: boolean;
  21. /** Replace the function used when compiling JSX expressions */
  22. pragma?: string;
  23. /**
  24. * (**Experimental**) Infer component metadata from types (e.g. `props`, `emits`, `name`)
  25. * @default false
  26. */
  27. resolveType?: Options | boolean;
  28. }
  29. //#endregion
  30. //#region src/index.d.ts
  31. declare const plugin: (api: object, options: VueJSXPluginOptions | null | undefined, dirname: string) => BabelCore.PluginObj<State>;
  32. //#endregion
  33. export { VueJSXPluginOptions, plugin as default };