UNPKG

1.16 kBTypeScriptView Raw
1import * as BabelCore from '@babel/core';
2import { Options } from '@vue/babel-plugin-resolve-type';
3
4type State = {
5 get: (name: string) => any;
6 set: (name: string, value: any) => any;
7 opts: VueJSXPluginOptions;
8 file: BabelCore.BabelFile;
9};
10interface 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
30declare const _default: (api: object, options: VueJSXPluginOptions | null | undefined, dirname: string) => BabelCore.PluginObj<State>;
31
32export { type VueJSXPluginOptions, _default as default };