Skip to content

Commit 689ceea

Browse files
committed
feat: export interface VueJSXPluginOptions
1 parent 764afcd commit 689ceea

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

packages/babel-plugin-jsx/src/index.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,19 @@ import sugarFragment from './sugar-fragment';
1010
export type State = {
1111
get: (name: string) => any;
1212
set: (name: string, value: any) => any;
13-
opts: Opts;
13+
opts: VueJSXPluginOptions;
1414
}
1515

16-
export interface Opts {
16+
export interface VueJSXPluginOptions {
17+
/** transform `on: { click: xx }` to `onClick: xxx` */
1718
transformOn?: boolean;
19+
/** enable optimization or not. */
1820
optimize?: boolean;
21+
/** merge static and dynamic class / style attributes / onXXX handlers */
1922
mergeProps?: boolean;
23+
/** configuring custom elements */
2024
isCustomElement?: (tag: string) => boolean;
25+
/** enable object slots syntax */
2126
enableObjectSlots?: boolean;
2227
}
2328

packages/babel-plugin-jsx/test/snapshot.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { transform } from '@babel/core';
2-
import JSX, { Opts } from '../src';
2+
import JSX, { VueJSXPluginOptions } from '../src';
33

44
interface Test {
55
name: string;
66
from: string;
77
}
88

99
const transpile = (
10-
source: string, options: Opts = {},
10+
source: string, options: VueJSXPluginOptions = {},
1111
) => new Promise((resolve, reject) => transform(
1212
source,
1313
{

packages/babel-plugin-jsx/tsconfig.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@
44
"rootDirs": ["./src"],
55
"outDir": "dist",
66
"downlevelIteration": true,
7-
"types": ["node", "jest"]
7+
"types": ["node", "jest"],
8+
"declaration": true
89
},
9-
"include": [
10-
"src/**/*",
11-
"global.d.ts"
12-
],
10+
"include": ["src/**/*", "global.d.ts"],
1311
"exclude": ["node_modules"]
1412
}

0 commit comments

Comments
 (0)