@vue-jsx-vapor/compiler 1.6.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +323 -325
- package/dist/index.d.cts +47 -47
- package/dist/index.d.ts +47 -47
- package/dist/index.js +332 -334
- package/package.json +4 -4
package/dist/index.d.cts
CHANGED
@@ -1,9 +1,54 @@
|
|
1
1
|
import { IRFor as IRFor$1, VaporCodegenResult as VaporCodegenResult$1 } from '@vue/compiler-vapor';
|
2
2
|
export { generate } from '@vue/compiler-vapor';
|
3
|
-
import { SimpleExpressionNode,
|
4
|
-
import {
|
3
|
+
import { SimpleExpressionNode, TransformOptions as TransformOptions$1, CompilerCompatOptions, CommentNode, DirectiveNode, CompoundExpressionNode, CompilerOptions as CompilerOptions$1, ElementNode } from '@vue/compiler-dom';
|
4
|
+
import { JSXElement, JSXFragment, JSXAttribute, Node } from '@babel/types';
|
5
5
|
import { Prettify } from '@vue/shared';
|
6
6
|
|
7
|
+
type NodeTransform = (node: BlockIRNode['node'], context: TransformContext<BlockIRNode['node']>) => void | (() => void) | (() => void)[];
|
8
|
+
type DirectiveTransform = (dir: JSXAttribute, node: JSXElement, context: TransformContext<JSXElement>) => DirectiveTransformResult | void;
|
9
|
+
interface DirectiveTransformResult {
|
10
|
+
key: SimpleExpressionNode;
|
11
|
+
value: SimpleExpressionNode;
|
12
|
+
modifier?: '.' | '^';
|
13
|
+
runtimeCamelize?: boolean;
|
14
|
+
handler?: boolean;
|
15
|
+
model?: boolean;
|
16
|
+
modelModifiers?: string[];
|
17
|
+
}
|
18
|
+
type StructuralDirectiveTransform = (node: JSXElement, dir: JSXAttribute, context: TransformContext) => void | (() => void);
|
19
|
+
type TransformOptions = HackOptions<TransformOptions$1>;
|
20
|
+
declare class TransformContext<T extends BlockIRNode['node'] = BlockIRNode['node']> {
|
21
|
+
ir: RootIRNode;
|
22
|
+
node: T;
|
23
|
+
parent: TransformContext<RootNode | JSXElement | JSXFragment> | null;
|
24
|
+
root: TransformContext<RootNode>;
|
25
|
+
index: number;
|
26
|
+
block: BlockIRNode;
|
27
|
+
options: Required<Omit<TransformOptions, 'filename' | keyof CompilerCompatOptions>>;
|
28
|
+
template: string;
|
29
|
+
childrenTemplate: (string | null)[];
|
30
|
+
dynamic: IRDynamicInfo;
|
31
|
+
inVOnce: boolean;
|
32
|
+
inVFor: number;
|
33
|
+
comment: CommentNode[];
|
34
|
+
component: Set<string>;
|
35
|
+
directive: Set<string>;
|
36
|
+
slots: IRSlots[];
|
37
|
+
private globalId;
|
38
|
+
constructor(ir: RootIRNode, node: T, options?: TransformOptions);
|
39
|
+
enterBlock(ir: BlockIRNode, isVFor?: boolean): () => void;
|
40
|
+
increaseId: () => number;
|
41
|
+
reference(): number;
|
42
|
+
pushTemplate(content: string): number;
|
43
|
+
registerTemplate(): number;
|
44
|
+
registerEffect(expressions: SimpleExpressionNode[], ...operations: OperationNode[]): void;
|
45
|
+
registerOperation(...node: OperationNode[]): void;
|
46
|
+
create<E extends T>(node: E, index: number): TransformContext<E>;
|
47
|
+
}
|
48
|
+
declare function transform(node: RootNode, options?: TransformOptions): RootIRNode;
|
49
|
+
declare function transformNode(context: TransformContext<BlockIRNode['node']>): void;
|
50
|
+
declare function createStructuralDirectiveTransform(name: string | string[], fn: StructuralDirectiveTransform): NodeTransform;
|
51
|
+
|
7
52
|
interface IRProp extends Omit<DirectiveTransformResult, 'value'> {
|
8
53
|
values: SimpleExpressionNode[];
|
9
54
|
}
|
@@ -276,51 +321,6 @@ type VaporDirectiveNode = Overwrite<DirectiveNode, {
|
|
276
321
|
arg: Exclude<DirectiveNode['arg'], CompoundExpressionNode>;
|
277
322
|
}>;
|
278
323
|
|
279
|
-
type NodeTransform = (node: BlockIRNode['node'], context: TransformContext<BlockIRNode['node']>) => void | (() => void) | (() => void)[];
|
280
|
-
type DirectiveTransform = (dir: JSXAttribute, node: JSXElement, context: TransformContext<JSXElement>) => DirectiveTransformResult | void;
|
281
|
-
interface DirectiveTransformResult {
|
282
|
-
key: SimpleExpressionNode;
|
283
|
-
value: SimpleExpressionNode;
|
284
|
-
modifier?: '.' | '^';
|
285
|
-
runtimeCamelize?: boolean;
|
286
|
-
handler?: boolean;
|
287
|
-
model?: boolean;
|
288
|
-
modelModifiers?: string[];
|
289
|
-
}
|
290
|
-
type StructuralDirectiveTransform = (node: JSXElement, dir: JSXAttribute, context: TransformContext) => void | (() => void);
|
291
|
-
type TransformOptions = HackOptions<TransformOptions$1>;
|
292
|
-
declare class TransformContext<T extends BlockIRNode['node'] = BlockIRNode['node']> {
|
293
|
-
ir: RootIRNode;
|
294
|
-
node: T;
|
295
|
-
parent: TransformContext<RootNode | JSXElement | JSXFragment> | null;
|
296
|
-
root: TransformContext<RootNode>;
|
297
|
-
index: number;
|
298
|
-
block: BlockIRNode;
|
299
|
-
options: Required<Omit<TransformOptions, 'filename' | keyof CompilerCompatOptions>>;
|
300
|
-
template: string;
|
301
|
-
childrenTemplate: (string | null)[];
|
302
|
-
dynamic: IRDynamicInfo;
|
303
|
-
inVOnce: boolean;
|
304
|
-
inVFor: number;
|
305
|
-
comment: CommentNode[];
|
306
|
-
component: Set<string>;
|
307
|
-
directive: Set<string>;
|
308
|
-
slots: IRSlots[];
|
309
|
-
private globalId;
|
310
|
-
constructor(ir: RootIRNode, node: T, options?: TransformOptions);
|
311
|
-
enterBlock(ir: BlockIRNode, isVFor?: boolean): () => void;
|
312
|
-
increaseId: () => number;
|
313
|
-
reference(): number;
|
314
|
-
pushTemplate(content: string): number;
|
315
|
-
registerTemplate(): number;
|
316
|
-
registerEffect(expressions: SimpleExpressionNode[], ...operations: OperationNode[]): void;
|
317
|
-
registerOperation(...node: OperationNode[]): void;
|
318
|
-
create<E extends T>(node: E, index: number): TransformContext<E>;
|
319
|
-
}
|
320
|
-
declare function transform(node: RootNode, options?: TransformOptions): RootIRNode;
|
321
|
-
declare function transformNode(context: TransformContext<BlockIRNode['node']>): void;
|
322
|
-
declare function createStructuralDirectiveTransform(name: string | string[], fn: StructuralDirectiveTransform): NodeTransform;
|
323
|
-
|
324
324
|
interface VaporCodegenResult extends Omit<VaporCodegenResult$1, 'ast'> {
|
325
325
|
ast: RootIRNode;
|
326
326
|
}
|
package/dist/index.d.ts
CHANGED
@@ -1,9 +1,54 @@
|
|
1
1
|
import { IRFor as IRFor$1, VaporCodegenResult as VaporCodegenResult$1 } from '@vue/compiler-vapor';
|
2
2
|
export { generate } from '@vue/compiler-vapor';
|
3
|
-
import { SimpleExpressionNode,
|
4
|
-
import {
|
3
|
+
import { SimpleExpressionNode, TransformOptions as TransformOptions$1, CompilerCompatOptions, CommentNode, DirectiveNode, CompoundExpressionNode, CompilerOptions as CompilerOptions$1, ElementNode } from '@vue/compiler-dom';
|
4
|
+
import { JSXElement, JSXFragment, JSXAttribute, Node } from '@babel/types';
|
5
5
|
import { Prettify } from '@vue/shared';
|
6
6
|
|
7
|
+
type NodeTransform = (node: BlockIRNode['node'], context: TransformContext<BlockIRNode['node']>) => void | (() => void) | (() => void)[];
|
8
|
+
type DirectiveTransform = (dir: JSXAttribute, node: JSXElement, context: TransformContext<JSXElement>) => DirectiveTransformResult | void;
|
9
|
+
interface DirectiveTransformResult {
|
10
|
+
key: SimpleExpressionNode;
|
11
|
+
value: SimpleExpressionNode;
|
12
|
+
modifier?: '.' | '^';
|
13
|
+
runtimeCamelize?: boolean;
|
14
|
+
handler?: boolean;
|
15
|
+
model?: boolean;
|
16
|
+
modelModifiers?: string[];
|
17
|
+
}
|
18
|
+
type StructuralDirectiveTransform = (node: JSXElement, dir: JSXAttribute, context: TransformContext) => void | (() => void);
|
19
|
+
type TransformOptions = HackOptions<TransformOptions$1>;
|
20
|
+
declare class TransformContext<T extends BlockIRNode['node'] = BlockIRNode['node']> {
|
21
|
+
ir: RootIRNode;
|
22
|
+
node: T;
|
23
|
+
parent: TransformContext<RootNode | JSXElement | JSXFragment> | null;
|
24
|
+
root: TransformContext<RootNode>;
|
25
|
+
index: number;
|
26
|
+
block: BlockIRNode;
|
27
|
+
options: Required<Omit<TransformOptions, 'filename' | keyof CompilerCompatOptions>>;
|
28
|
+
template: string;
|
29
|
+
childrenTemplate: (string | null)[];
|
30
|
+
dynamic: IRDynamicInfo;
|
31
|
+
inVOnce: boolean;
|
32
|
+
inVFor: number;
|
33
|
+
comment: CommentNode[];
|
34
|
+
component: Set<string>;
|
35
|
+
directive: Set<string>;
|
36
|
+
slots: IRSlots[];
|
37
|
+
private globalId;
|
38
|
+
constructor(ir: RootIRNode, node: T, options?: TransformOptions);
|
39
|
+
enterBlock(ir: BlockIRNode, isVFor?: boolean): () => void;
|
40
|
+
increaseId: () => number;
|
41
|
+
reference(): number;
|
42
|
+
pushTemplate(content: string): number;
|
43
|
+
registerTemplate(): number;
|
44
|
+
registerEffect(expressions: SimpleExpressionNode[], ...operations: OperationNode[]): void;
|
45
|
+
registerOperation(...node: OperationNode[]): void;
|
46
|
+
create<E extends T>(node: E, index: number): TransformContext<E>;
|
47
|
+
}
|
48
|
+
declare function transform(node: RootNode, options?: TransformOptions): RootIRNode;
|
49
|
+
declare function transformNode(context: TransformContext<BlockIRNode['node']>): void;
|
50
|
+
declare function createStructuralDirectiveTransform(name: string | string[], fn: StructuralDirectiveTransform): NodeTransform;
|
51
|
+
|
7
52
|
interface IRProp extends Omit<DirectiveTransformResult, 'value'> {
|
8
53
|
values: SimpleExpressionNode[];
|
9
54
|
}
|
@@ -276,51 +321,6 @@ type VaporDirectiveNode = Overwrite<DirectiveNode, {
|
|
276
321
|
arg: Exclude<DirectiveNode['arg'], CompoundExpressionNode>;
|
277
322
|
}>;
|
278
323
|
|
279
|
-
type NodeTransform = (node: BlockIRNode['node'], context: TransformContext<BlockIRNode['node']>) => void | (() => void) | (() => void)[];
|
280
|
-
type DirectiveTransform = (dir: JSXAttribute, node: JSXElement, context: TransformContext<JSXElement>) => DirectiveTransformResult | void;
|
281
|
-
interface DirectiveTransformResult {
|
282
|
-
key: SimpleExpressionNode;
|
283
|
-
value: SimpleExpressionNode;
|
284
|
-
modifier?: '.' | '^';
|
285
|
-
runtimeCamelize?: boolean;
|
286
|
-
handler?: boolean;
|
287
|
-
model?: boolean;
|
288
|
-
modelModifiers?: string[];
|
289
|
-
}
|
290
|
-
type StructuralDirectiveTransform = (node: JSXElement, dir: JSXAttribute, context: TransformContext) => void | (() => void);
|
291
|
-
type TransformOptions = HackOptions<TransformOptions$1>;
|
292
|
-
declare class TransformContext<T extends BlockIRNode['node'] = BlockIRNode['node']> {
|
293
|
-
ir: RootIRNode;
|
294
|
-
node: T;
|
295
|
-
parent: TransformContext<RootNode | JSXElement | JSXFragment> | null;
|
296
|
-
root: TransformContext<RootNode>;
|
297
|
-
index: number;
|
298
|
-
block: BlockIRNode;
|
299
|
-
options: Required<Omit<TransformOptions, 'filename' | keyof CompilerCompatOptions>>;
|
300
|
-
template: string;
|
301
|
-
childrenTemplate: (string | null)[];
|
302
|
-
dynamic: IRDynamicInfo;
|
303
|
-
inVOnce: boolean;
|
304
|
-
inVFor: number;
|
305
|
-
comment: CommentNode[];
|
306
|
-
component: Set<string>;
|
307
|
-
directive: Set<string>;
|
308
|
-
slots: IRSlots[];
|
309
|
-
private globalId;
|
310
|
-
constructor(ir: RootIRNode, node: T, options?: TransformOptions);
|
311
|
-
enterBlock(ir: BlockIRNode, isVFor?: boolean): () => void;
|
312
|
-
increaseId: () => number;
|
313
|
-
reference(): number;
|
314
|
-
pushTemplate(content: string): number;
|
315
|
-
registerTemplate(): number;
|
316
|
-
registerEffect(expressions: SimpleExpressionNode[], ...operations: OperationNode[]): void;
|
317
|
-
registerOperation(...node: OperationNode[]): void;
|
318
|
-
create<E extends T>(node: E, index: number): TransformContext<E>;
|
319
|
-
}
|
320
|
-
declare function transform(node: RootNode, options?: TransformOptions): RootIRNode;
|
321
|
-
declare function transformNode(context: TransformContext<BlockIRNode['node']>): void;
|
322
|
-
declare function createStructuralDirectiveTransform(name: string | string[], fn: StructuralDirectiveTransform): NodeTransform;
|
323
|
-
|
324
324
|
interface VaporCodegenResult extends Omit<VaporCodegenResult$1, 'ast'> {
|
325
325
|
ast: RootIRNode;
|
326
326
|
}
|