@vue-jsx-vapor/compiler 2.2.0 → 2.3.1

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.d.cts CHANGED
@@ -1,9 +1,9 @@
1
- import { IRFor as IRFor$1, VaporCodegenResult as VaporCodegenResult$1 } from '@vue/compiler-vapor';
2
- export { generate } from '@vue/compiler-vapor';
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
- import { Prettify } from '@vue/shared';
1
+ import { IRFor as IRFor$1, VaporCodegenResult, generate } from "@vue/compiler-vapor";
2
+ import { CommentNode, CompilerCompatOptions, CompilerOptions as CompilerOptions$1, CompoundExpressionNode, DirectiveNode, SimpleExpressionNode, TransformOptions as TransformOptions$1 } from "@vue/compiler-dom";
3
+ import { JSXAttribute, JSXElement, JSXFragment, Node } from "@babel/types";
4
+ import { Prettify } from "@vue/shared";
6
5
 
6
+ //#region src/transform.d.ts
7
7
  type NodeTransform = (node: BlockIRNode['node'], context: TransformContext<BlockIRNode['node']>) => void | (() => void) | (() => void)[];
8
8
  type DirectiveTransform = (dir: JSXAttribute, node: JSXElement, context: TransformContext<JSXElement>) => DirectiveTransformResult | void;
9
9
  interface DirectiveTransformResult {
@@ -50,6 +50,8 @@ declare function transform(node: RootNode, options?: TransformOptions): RootIRNo
50
50
  declare function transformNode(context: TransformContext<BlockIRNode['node']>): void;
51
51
  declare function createStructuralDirectiveTransform(name: string | string[], fn: StructuralDirectiveTransform): NodeTransform;
52
52
 
53
+ //#endregion
54
+ //#region src/ir/component.d.ts
53
55
  interface IRProp extends Omit<DirectiveTransformResult, 'value'> {
54
56
  values: SimpleExpressionNode[];
55
57
  }
@@ -105,6 +107,8 @@ interface IRSlotsExpression {
105
107
  type IRSlotDynamic = IRSlotDynamicBasic | IRSlotDynamicLoop | IRSlotDynamicConditional;
106
108
  type IRSlots = IRSlotsStatic | IRSlotDynamic | IRSlotsExpression;
107
109
 
110
+ //#endregion
111
+ //#region src/ir/index.d.ts
108
112
  declare enum IRNodeTypes {
109
113
  ROOT = 0,
110
114
  BLOCK = 1,
@@ -201,6 +205,12 @@ interface SetDynamicEventsIRNode extends BaseIRNode {
201
205
  element: number;
202
206
  event: SimpleExpressionNode;
203
207
  }
208
+ interface SetTextIRNode extends BaseIRNode {
209
+ type: IRNodeTypes.SET_TEXT;
210
+ element: number;
211
+ values: SimpleExpressionNode[];
212
+ generated?: boolean;
213
+ }
204
214
  interface SetNodesIRNode extends BaseIRNode {
205
215
  type: IRNodeTypes.SET_NODES;
206
216
  element: number;
@@ -291,7 +301,7 @@ interface GetTextChildIRNode extends BaseIRNode {
291
301
  parent: number;
292
302
  }
293
303
  type IRNode = OperationNode | RootIRNode;
294
- type OperationNode = SetPropIRNode | SetDynamicPropsIRNode | SetNodesIRNode | SetEventIRNode | SetDynamicEventsIRNode | SetHtmlIRNode | SetTemplateRefIRNode | CreateNodesIRNode | InsertNodeIRNode | PrependNodeIRNode | DirectiveIRNode | IfIRNode | ForIRNode | CreateComponentIRNode | DeclareOldRefIRNode | SlotOutletIRNode | GetTextChildIRNode;
304
+ type OperationNode = SetPropIRNode | SetDynamicPropsIRNode | SetTextIRNode | SetNodesIRNode | SetEventIRNode | SetDynamicEventsIRNode | SetHtmlIRNode | SetTemplateRefIRNode | CreateNodesIRNode | InsertNodeIRNode | PrependNodeIRNode | DirectiveIRNode | IfIRNode | ForIRNode | CreateComponentIRNode | DeclareOldRefIRNode | SlotOutletIRNode | GetTextChildIRNode;
295
305
  declare enum DynamicFlag {
296
306
  NONE = 0,
297
307
  /**
@@ -332,11 +342,13 @@ type VaporDirectiveNode = Overwrite<DirectiveNode, {
332
342
  type InsertionStateTypes = IfIRNode | ForIRNode | SlotOutletIRNode | CreateComponentIRNode;
333
343
  declare function isBlockOperation(op: OperationNode): op is InsertionStateTypes;
334
344
 
335
- interface VaporCodegenResult extends Omit<VaporCodegenResult$1, 'ast'> {
345
+ //#endregion
346
+ //#region src/compile.d.ts
347
+ interface VaporCodegenResult$1 extends Omit<VaporCodegenResult, 'ast'> {
336
348
  ast: RootIRNode;
337
349
  customHelpers: Set<string>;
338
350
  }
339
- declare function compile(source: JSXElement | JSXFragment | string, options?: CompilerOptions): VaporCodegenResult;
351
+ declare function compile(source: JSXElement | JSXFragment | string, options?: CompilerOptions): VaporCodegenResult$1;
340
352
  type CompilerOptions = HackOptions<CompilerOptions$1> & {
341
353
  source?: string;
342
354
  };
@@ -345,37 +357,65 @@ type TransformPreset = [
345
357
  Record<string, DirectiveTransform>
346
358
  ];
347
359
 
348
- declare function resolveNode(node: JSXElement, context: TransformContext): ElementNode;
349
- declare function resolveDirectiveNode(node: JSXAttribute, context: TransformContext, withFn?: boolean): VaporDirectiveNode;
350
-
360
+ //#endregion
361
+ //#region src/transforms/transformText.d.ts
351
362
  declare const transformText: NodeTransform;
352
363
 
364
+ //#endregion
365
+ //#region src/transforms/transformElement.d.ts
353
366
  declare const transformElement: NodeTransform;
354
367
 
368
+ //#endregion
369
+ //#region src/transforms/transformChildren.d.ts
355
370
  declare const transformChildren: NodeTransform;
356
371
 
372
+ //#endregion
373
+ //#region src/transforms/transformTemplateRef.d.ts
357
374
  declare const transformTemplateRef: NodeTransform;
358
375
 
376
+ //#endregion
377
+ //#region src/transforms/vBind.d.ts
359
378
  declare const transformVBind: DirectiveTransform;
360
379
 
380
+ //#endregion
381
+ //#region src/transforms/vOn.d.ts
361
382
  declare const transformVOn: DirectiveTransform;
362
383
 
384
+ //#endregion
385
+ //#region src/transforms/vSlot.d.ts
363
386
  declare const transformVSlot: NodeTransform;
364
387
 
388
+ //#endregion
389
+ //#region src/transforms/vSlots.d.ts
365
390
  declare const transformVSlots: DirectiveTransform;
366
391
 
392
+ //#endregion
393
+ //#region src/transforms/vModel.d.ts
367
394
  declare const transformVModel: DirectiveTransform;
368
395
 
396
+ //#endregion
397
+ //#region src/transforms/vShow.d.ts
369
398
  declare const transformVShow: DirectiveTransform;
370
399
 
400
+ //#endregion
401
+ //#region src/transforms/vHtml.d.ts
371
402
  declare const transformVHtml: DirectiveTransform;
372
403
 
404
+ //#endregion
405
+ //#region src/transforms/vFor.d.ts
373
406
  declare const transformVFor: NodeTransform;
374
407
 
408
+ //#endregion
409
+ //#region src/transforms/vIf.d.ts
375
410
  declare const transformVIf: NodeTransform;
376
411
 
412
+ //#endregion
413
+ //#region src/transforms/vOnce.d.ts
377
414
  declare const transformVOnce: NodeTransform;
378
415
 
416
+ //#endregion
417
+ //#region src/transforms/vText.d.ts
379
418
  declare const transformVText: DirectiveTransform;
380
419
 
381
- export { type BaseIRNode, type BlockIRNode, type CompilerOptions, type CreateComponentIRNode, type CreateNodesIRNode, type DeclareOldRefIRNode, type DirectiveIRNode, type DirectiveTransform, type DirectiveTransformResult, DynamicFlag, type ForIRNode, type GetTextChildIRNode, type HackOptions, type IRDynamicInfo, IRDynamicPropsKind, type IREffect, type IRFor, type IRNode, IRNodeTypes, type IRProp, type IRProps, type IRPropsDynamicAttribute, type IRPropsDynamicExpression, type IRPropsStatic, type IRSlotDynamic, type IRSlotDynamicBasic, type IRSlotDynamicConditional, type IRSlotDynamicLoop, IRSlotType, type IRSlots, type IRSlotsExpression, type IRSlotsStatic, type IfIRNode, type InsertNodeIRNode, type InsertionStateTypes, type KeyOverride, type NodeTransform, type OperationNode, type PrependNodeIRNode, type RootIRNode, type RootNode, type SetDynamicEventsIRNode, type SetDynamicPropsIRNode, type SetEventIRNode, type SetHtmlIRNode, type SetNodesIRNode, type SetPropIRNode, type SetTemplateRefIRNode, type SlotBlockIRNode, type SlotOutletIRNode, type StructuralDirectiveTransform, TransformContext, type TransformOptions, type TransformPreset, type VaporDirectiveNode, compile, createStructuralDirectiveTransform, isBlockOperation, resolveDirectiveNode, resolveNode, transform, transformChildren, transformElement, transformNode, transformTemplateRef, transformText, transformVBind, transformVFor, transformVHtml, transformVIf, transformVModel, transformVOn, transformVOnce, transformVShow, transformVSlot, transformVSlots, transformVText };
420
+ //#endregion
421
+ export { BaseIRNode, BlockIRNode, CompilerOptions, CreateComponentIRNode, CreateNodesIRNode, DeclareOldRefIRNode, DirectiveIRNode, DirectiveTransform, DirectiveTransformResult, DynamicFlag, ForIRNode, GetTextChildIRNode, HackOptions, IRDynamicInfo, IRDynamicPropsKind, IREffect, IRFor, IRNode, IRNodeTypes, IRProp, IRProps, IRPropsDynamicAttribute, IRPropsDynamicExpression, IRPropsStatic, IRSlotDynamic, IRSlotDynamicBasic, IRSlotDynamicConditional, IRSlotDynamicLoop, IRSlotType, IRSlots, IRSlotsExpression, IRSlotsStatic, IfIRNode, InsertNodeIRNode, InsertionStateTypes, KeyOverride, NodeTransform, OperationNode, PrependNodeIRNode, RootIRNode, RootNode, SetDynamicEventsIRNode, SetDynamicPropsIRNode, SetEventIRNode, SetHtmlIRNode, SetNodesIRNode, SetPropIRNode, SetTemplateRefIRNode, SetTextIRNode, SlotBlockIRNode, SlotOutletIRNode, StructuralDirectiveTransform, TransformContext, TransformOptions, TransformPreset, VaporDirectiveNode, compile, createStructuralDirectiveTransform, generate, isBlockOperation, transform, transformChildren, transformElement, transformNode, transformTemplateRef, transformText, transformVBind, transformVFor, transformVHtml, transformVIf, transformVModel, transformVOn, transformVOnce, transformVShow, transformVSlot, transformVSlots, transformVText };
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { IRFor as IRFor$1, VaporCodegenResult as VaporCodegenResult$1 } from '@vue/compiler-vapor';
2
- export { generate } from '@vue/compiler-vapor';
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
- import { Prettify } from '@vue/shared';
1
+ import { IRFor as IRFor$1, VaporCodegenResult, generate } from "@vue/compiler-vapor";
2
+ import { Prettify } from "@vue/shared";
3
+ import { CommentNode, CompilerCompatOptions, CompilerOptions as CompilerOptions$1, CompoundExpressionNode, DirectiveNode, SimpleExpressionNode, TransformOptions as TransformOptions$1 } from "@vue/compiler-dom";
4
+ import { JSXAttribute, JSXElement, JSXFragment, Node } from "@babel/types";
6
5
 
6
+ //#region src/transform.d.ts
7
7
  type NodeTransform = (node: BlockIRNode['node'], context: TransformContext<BlockIRNode['node']>) => void | (() => void) | (() => void)[];
8
8
  type DirectiveTransform = (dir: JSXAttribute, node: JSXElement, context: TransformContext<JSXElement>) => DirectiveTransformResult | void;
9
9
  interface DirectiveTransformResult {
@@ -50,6 +50,8 @@ declare function transform(node: RootNode, options?: TransformOptions): RootIRNo
50
50
  declare function transformNode(context: TransformContext<BlockIRNode['node']>): void;
51
51
  declare function createStructuralDirectiveTransform(name: string | string[], fn: StructuralDirectiveTransform): NodeTransform;
52
52
 
53
+ //#endregion
54
+ //#region src/ir/component.d.ts
53
55
  interface IRProp extends Omit<DirectiveTransformResult, 'value'> {
54
56
  values: SimpleExpressionNode[];
55
57
  }
@@ -105,6 +107,8 @@ interface IRSlotsExpression {
105
107
  type IRSlotDynamic = IRSlotDynamicBasic | IRSlotDynamicLoop | IRSlotDynamicConditional;
106
108
  type IRSlots = IRSlotsStatic | IRSlotDynamic | IRSlotsExpression;
107
109
 
110
+ //#endregion
111
+ //#region src/ir/index.d.ts
108
112
  declare enum IRNodeTypes {
109
113
  ROOT = 0,
110
114
  BLOCK = 1,
@@ -201,6 +205,12 @@ interface SetDynamicEventsIRNode extends BaseIRNode {
201
205
  element: number;
202
206
  event: SimpleExpressionNode;
203
207
  }
208
+ interface SetTextIRNode extends BaseIRNode {
209
+ type: IRNodeTypes.SET_TEXT;
210
+ element: number;
211
+ values: SimpleExpressionNode[];
212
+ generated?: boolean;
213
+ }
204
214
  interface SetNodesIRNode extends BaseIRNode {
205
215
  type: IRNodeTypes.SET_NODES;
206
216
  element: number;
@@ -291,7 +301,7 @@ interface GetTextChildIRNode extends BaseIRNode {
291
301
  parent: number;
292
302
  }
293
303
  type IRNode = OperationNode | RootIRNode;
294
- type OperationNode = SetPropIRNode | SetDynamicPropsIRNode | SetNodesIRNode | SetEventIRNode | SetDynamicEventsIRNode | SetHtmlIRNode | SetTemplateRefIRNode | CreateNodesIRNode | InsertNodeIRNode | PrependNodeIRNode | DirectiveIRNode | IfIRNode | ForIRNode | CreateComponentIRNode | DeclareOldRefIRNode | SlotOutletIRNode | GetTextChildIRNode;
304
+ type OperationNode = SetPropIRNode | SetDynamicPropsIRNode | SetTextIRNode | SetNodesIRNode | SetEventIRNode | SetDynamicEventsIRNode | SetHtmlIRNode | SetTemplateRefIRNode | CreateNodesIRNode | InsertNodeIRNode | PrependNodeIRNode | DirectiveIRNode | IfIRNode | ForIRNode | CreateComponentIRNode | DeclareOldRefIRNode | SlotOutletIRNode | GetTextChildIRNode;
295
305
  declare enum DynamicFlag {
296
306
  NONE = 0,
297
307
  /**
@@ -332,11 +342,13 @@ type VaporDirectiveNode = Overwrite<DirectiveNode, {
332
342
  type InsertionStateTypes = IfIRNode | ForIRNode | SlotOutletIRNode | CreateComponentIRNode;
333
343
  declare function isBlockOperation(op: OperationNode): op is InsertionStateTypes;
334
344
 
335
- interface VaporCodegenResult extends Omit<VaporCodegenResult$1, 'ast'> {
345
+ //#endregion
346
+ //#region src/compile.d.ts
347
+ interface VaporCodegenResult$1 extends Omit<VaporCodegenResult, 'ast'> {
336
348
  ast: RootIRNode;
337
349
  customHelpers: Set<string>;
338
350
  }
339
- declare function compile(source: JSXElement | JSXFragment | string, options?: CompilerOptions): VaporCodegenResult;
351
+ declare function compile(source: JSXElement | JSXFragment | string, options?: CompilerOptions): VaporCodegenResult$1;
340
352
  type CompilerOptions = HackOptions<CompilerOptions$1> & {
341
353
  source?: string;
342
354
  };
@@ -345,37 +357,65 @@ type TransformPreset = [
345
357
  Record<string, DirectiveTransform>
346
358
  ];
347
359
 
348
- declare function resolveNode(node: JSXElement, context: TransformContext): ElementNode;
349
- declare function resolveDirectiveNode(node: JSXAttribute, context: TransformContext, withFn?: boolean): VaporDirectiveNode;
350
-
360
+ //#endregion
361
+ //#region src/transforms/transformText.d.ts
351
362
  declare const transformText: NodeTransform;
352
363
 
364
+ //#endregion
365
+ //#region src/transforms/transformElement.d.ts
353
366
  declare const transformElement: NodeTransform;
354
367
 
368
+ //#endregion
369
+ //#region src/transforms/transformChildren.d.ts
355
370
  declare const transformChildren: NodeTransform;
356
371
 
372
+ //#endregion
373
+ //#region src/transforms/transformTemplateRef.d.ts
357
374
  declare const transformTemplateRef: NodeTransform;
358
375
 
376
+ //#endregion
377
+ //#region src/transforms/vBind.d.ts
359
378
  declare const transformVBind: DirectiveTransform;
360
379
 
380
+ //#endregion
381
+ //#region src/transforms/vOn.d.ts
361
382
  declare const transformVOn: DirectiveTransform;
362
383
 
384
+ //#endregion
385
+ //#region src/transforms/vSlot.d.ts
363
386
  declare const transformVSlot: NodeTransform;
364
387
 
388
+ //#endregion
389
+ //#region src/transforms/vSlots.d.ts
365
390
  declare const transformVSlots: DirectiveTransform;
366
391
 
392
+ //#endregion
393
+ //#region src/transforms/vModel.d.ts
367
394
  declare const transformVModel: DirectiveTransform;
368
395
 
396
+ //#endregion
397
+ //#region src/transforms/vShow.d.ts
369
398
  declare const transformVShow: DirectiveTransform;
370
399
 
400
+ //#endregion
401
+ //#region src/transforms/vHtml.d.ts
371
402
  declare const transformVHtml: DirectiveTransform;
372
403
 
404
+ //#endregion
405
+ //#region src/transforms/vFor.d.ts
373
406
  declare const transformVFor: NodeTransform;
374
407
 
408
+ //#endregion
409
+ //#region src/transforms/vIf.d.ts
375
410
  declare const transformVIf: NodeTransform;
376
411
 
412
+ //#endregion
413
+ //#region src/transforms/vOnce.d.ts
377
414
  declare const transformVOnce: NodeTransform;
378
415
 
416
+ //#endregion
417
+ //#region src/transforms/vText.d.ts
379
418
  declare const transformVText: DirectiveTransform;
380
419
 
381
- export { type BaseIRNode, type BlockIRNode, type CompilerOptions, type CreateComponentIRNode, type CreateNodesIRNode, type DeclareOldRefIRNode, type DirectiveIRNode, type DirectiveTransform, type DirectiveTransformResult, DynamicFlag, type ForIRNode, type GetTextChildIRNode, type HackOptions, type IRDynamicInfo, IRDynamicPropsKind, type IREffect, type IRFor, type IRNode, IRNodeTypes, type IRProp, type IRProps, type IRPropsDynamicAttribute, type IRPropsDynamicExpression, type IRPropsStatic, type IRSlotDynamic, type IRSlotDynamicBasic, type IRSlotDynamicConditional, type IRSlotDynamicLoop, IRSlotType, type IRSlots, type IRSlotsExpression, type IRSlotsStatic, type IfIRNode, type InsertNodeIRNode, type InsertionStateTypes, type KeyOverride, type NodeTransform, type OperationNode, type PrependNodeIRNode, type RootIRNode, type RootNode, type SetDynamicEventsIRNode, type SetDynamicPropsIRNode, type SetEventIRNode, type SetHtmlIRNode, type SetNodesIRNode, type SetPropIRNode, type SetTemplateRefIRNode, type SlotBlockIRNode, type SlotOutletIRNode, type StructuralDirectiveTransform, TransformContext, type TransformOptions, type TransformPreset, type VaporDirectiveNode, compile, createStructuralDirectiveTransform, isBlockOperation, resolveDirectiveNode, resolveNode, transform, transformChildren, transformElement, transformNode, transformTemplateRef, transformText, transformVBind, transformVFor, transformVHtml, transformVIf, transformVModel, transformVOn, transformVOnce, transformVShow, transformVSlot, transformVSlots, transformVText };
420
+ //#endregion
421
+ export { BaseIRNode, BlockIRNode, CompilerOptions, CreateComponentIRNode, CreateNodesIRNode, DeclareOldRefIRNode, DirectiveIRNode, DirectiveTransform, DirectiveTransformResult, DynamicFlag, ForIRNode, GetTextChildIRNode, HackOptions, IRDynamicInfo, IRDynamicPropsKind, IREffect, IRFor, IRNode, IRNodeTypes, IRProp, IRProps, IRPropsDynamicAttribute, IRPropsDynamicExpression, IRPropsStatic, IRSlotDynamic, IRSlotDynamicBasic, IRSlotDynamicConditional, IRSlotDynamicLoop, IRSlotType, IRSlots, IRSlotsExpression, IRSlotsStatic, IfIRNode, InsertNodeIRNode, InsertionStateTypes, KeyOverride, NodeTransform, OperationNode, PrependNodeIRNode, RootIRNode, RootNode, SetDynamicEventsIRNode, SetDynamicPropsIRNode, SetEventIRNode, SetHtmlIRNode, SetNodesIRNode, SetPropIRNode, SetTemplateRefIRNode, SetTextIRNode, SlotBlockIRNode, SlotOutletIRNode, StructuralDirectiveTransform, TransformContext, TransformOptions, TransformPreset, VaporDirectiveNode, compile, createStructuralDirectiveTransform, generate, isBlockOperation, transform, transformChildren, transformElement, transformNode, transformTemplateRef, transformText, transformVBind, transformVFor, transformVHtml, transformVIf, transformVModel, transformVOn, transformVOnce, transformVShow, transformVSlot, transformVSlots, transformVText };