@vue/runtime-vapor 3.6.0-beta.12 → 3.6.0-beta.13
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/runtime-vapor.d.ts +43 -27
- package/dist/runtime-vapor.esm-bundler.js +720 -387
- package/package.json +4 -4
package/dist/runtime-vapor.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ type NodeRef = string | Ref | ((ref: Element | VaporComponentInstance, refs: Rec
|
|
|
7
7
|
type RefEl = Element | VaporComponentInstance | DynamicFragment | VaporFragment;
|
|
8
8
|
type setRefFn = (el: RefEl, ref: NodeRef, refFor?: boolean, refKey?: string) => NodeRef | undefined;
|
|
9
9
|
export declare function createTemplateRefSetter(): setRefFn;
|
|
10
|
+
export declare function setStaticTemplateRef(el: RefEl, ref: NodeRef, refFor?: boolean, refKey?: string): NodeRef | undefined;
|
|
11
|
+
export declare function setTemplateRefBinding(el: RefEl, getter: () => any, setter?: setRefFn, refFor?: boolean, refKey?: string): void;
|
|
10
12
|
//#endregion
|
|
11
13
|
//#region temp/packages/runtime-vapor/src/keepAlive.d.ts
|
|
12
14
|
export interface VaporKeepAliveContext {
|
|
@@ -27,8 +29,11 @@ export declare class VaporFragment<T extends Block = Block> implements Transitio
|
|
|
27
29
|
validityPending?: boolean;
|
|
28
30
|
insert?: (parent: ParentNode, anchor: Node | null, transitionHooks?: TransitionHooks) => void;
|
|
29
31
|
remove?: (parent?: ParentNode, transitionHooks?: TransitionHooks) => void;
|
|
30
|
-
hydrate
|
|
32
|
+
hydrate?(...args: any[]): void;
|
|
31
33
|
setRef?: (instance: VaporComponentInstance, ref: NodeRef, refFor: boolean, refKey: string | undefined) => void;
|
|
34
|
+
onBeforeInsert?: ((nodes: Block) => void)[];
|
|
35
|
+
onBeforeRemove?: ((scope: EffectScope$1) => boolean)[];
|
|
36
|
+
onBeforeUpdate?: (() => void)[];
|
|
32
37
|
onUpdated?: ((nodes?: Block) => void)[];
|
|
33
38
|
readonly renderInstance: GenericComponentInstance | null;
|
|
34
39
|
readonly slotOwner: VaporComponentInstance | null;
|
|
@@ -49,16 +54,16 @@ export declare class DynamicFragment extends VaporFragment {
|
|
|
49
54
|
pending?: {
|
|
50
55
|
render?: BlockFn;
|
|
51
56
|
key: any;
|
|
57
|
+
noScope: boolean;
|
|
52
58
|
};
|
|
53
59
|
anchorLabel?: string;
|
|
54
60
|
keyed?: boolean;
|
|
55
61
|
inTransition?: boolean;
|
|
56
|
-
|
|
57
|
-
constructor(anchorLabel?: string, keyed?: boolean, locate?: boolean);
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
hydrate: (isEmpty?: boolean, isSlot?: boolean) => void;
|
|
62
|
+
hasFallthroughAttrs?: true;
|
|
63
|
+
constructor(anchorLabel?: string, keyed?: boolean, locate?: boolean, trackSlotBoundary?: boolean);
|
|
64
|
+
update(render?: BlockFn, key?: any, noScope?: boolean): void;
|
|
65
|
+
renderBranch(render: BlockFn | undefined, transition: VaporTransitionHooks | undefined, parent: ParentNode | null, key: any, noScope?: boolean): void;
|
|
66
|
+
hydrate(isEmpty?: boolean, isSlot?: boolean): void;
|
|
62
67
|
}
|
|
63
68
|
interface SlotBoundaryContext {
|
|
64
69
|
parent: SlotBoundaryContext | null;
|
|
@@ -93,20 +98,20 @@ export declare function remove(block: Block, parent?: ParentNode): void;
|
|
|
93
98
|
declare const interopKey: unique symbol;
|
|
94
99
|
//#endregion
|
|
95
100
|
//#region temp/packages/runtime-vapor/src/componentProps.d.ts
|
|
96
|
-
type RawProps = Record<string,
|
|
101
|
+
type RawProps = Record<string, unknown> & {
|
|
97
102
|
$?: DynamicPropsSource[] & {
|
|
98
103
|
[interopKey]?: boolean;
|
|
99
104
|
};
|
|
100
105
|
};
|
|
101
|
-
type DynamicPropsSource = (() => Record<string, unknown>) | Record<string,
|
|
106
|
+
type DynamicPropsSource = (() => Record<string, unknown>) | Record<string, unknown>;
|
|
102
107
|
//#endregion
|
|
103
108
|
//#region temp/packages/runtime-vapor/src/renderEffect.d.ts
|
|
104
109
|
declare class RenderEffect extends ReactiveEffect {
|
|
105
|
-
render: () => void;
|
|
106
110
|
i: VaporComponentInstance | null;
|
|
107
111
|
job: SchedulerJob;
|
|
108
|
-
updateJob
|
|
109
|
-
|
|
112
|
+
updateJob?: SchedulerJob;
|
|
113
|
+
render: () => void;
|
|
114
|
+
constructor(render: () => void, noLifecycle?: boolean);
|
|
110
115
|
fn(): void;
|
|
111
116
|
notify(): void;
|
|
112
117
|
}
|
|
@@ -132,7 +137,7 @@ type DynamicSlotSource = StaticSlots | DynamicSlotFn;
|
|
|
132
137
|
* 2. elements inherit the slot owner's scopeId
|
|
133
138
|
*/
|
|
134
139
|
export declare function withVaporCtx(fn: Function): BlockFn;
|
|
135
|
-
export declare function createSlot(name
|
|
140
|
+
export declare function createSlot(name?: string | (() => string), rawProps?: LooseRawProps | null, fallback?: VaporSlot, flags?: number): Block;
|
|
136
141
|
//#endregion
|
|
137
142
|
//#region temp/packages/runtime-vapor/src/apiDefineComponent.d.ts
|
|
138
143
|
export type VaporPublicProps = ReservedProps & AllowedComponentProps & ComponentCustomProps;
|
|
@@ -195,7 +200,7 @@ declare class TeleportFragment extends VaporFragment {
|
|
|
195
200
|
mountContainer?: ParentNode | null;
|
|
196
201
|
mountAnchor?: Node | null;
|
|
197
202
|
private mountToTargetJob?;
|
|
198
|
-
constructor(props: LooseRawProps, slots?:
|
|
203
|
+
constructor(props: LooseRawProps, slots?: RawSlots | null);
|
|
199
204
|
get parent(): ParentNode | null;
|
|
200
205
|
private initChildren;
|
|
201
206
|
private ensureChildrenInitialized;
|
|
@@ -258,12 +263,12 @@ interface SharedInternalOptions {
|
|
|
258
263
|
*/
|
|
259
264
|
__emitsOptions?: ObjectEmitsOptions;
|
|
260
265
|
}
|
|
261
|
-
type LooseRawProps = Record<string,
|
|
266
|
+
type LooseRawProps = Record<string, unknown> & {
|
|
262
267
|
$?: DynamicPropsSource[];
|
|
263
268
|
};
|
|
264
|
-
type LooseRawSlots = Record<string, VaporSlot | DynamicSlotSource[]> & {
|
|
269
|
+
type LooseRawSlots = VaporSlot | (Record<string, VaporSlot | DynamicSlotSource[]> & {
|
|
265
270
|
$?: DynamicSlotSource[];
|
|
266
|
-
};
|
|
271
|
+
});
|
|
267
272
|
export declare function createComponent(component: VaporComponent, rawProps?: LooseRawProps | null, rawSlots?: LooseRawSlots | null, isSingleRoot?: boolean, once?: boolean, appContext?: GenericAppContext, managedMount?: boolean): VaporComponentInstance;
|
|
268
273
|
export declare class VaporComponentInstance<Props extends Record<string, any> = {}, Emits extends EmitsOptions = {}, Slots extends StaticSlots = StaticSlots, Exposed extends Record<string, any> = Record<string, any>, TypeBlock extends Block = Block, TypeRefs extends Record<string, any> = Record<string, any>> implements GenericComponentInstance {
|
|
269
274
|
vapor: true;
|
|
@@ -302,6 +307,7 @@ export declare class VaporComponentInstance<Props extends Record<string, any> =
|
|
|
302
307
|
shapeFlag?: number;
|
|
303
308
|
$key?: any;
|
|
304
309
|
oncePropsCache?: Record<string | symbol, any>;
|
|
310
|
+
isOnce: boolean;
|
|
305
311
|
isMounted: boolean;
|
|
306
312
|
isUnmounted: boolean;
|
|
307
313
|
isDeactivated: boolean;
|
|
@@ -338,7 +344,7 @@ export declare class VaporComponentInstance<Props extends Record<string, any> =
|
|
|
338
344
|
* @deprecated only used for JSX to detect props types.
|
|
339
345
|
*/
|
|
340
346
|
$props: Props;
|
|
341
|
-
constructor(comp: VaporComponent, rawProps?: RawProps | null, rawSlots?:
|
|
347
|
+
constructor(comp: VaporComponent, rawProps?: RawProps | null, rawSlots?: LooseRawSlots | null, appContext?: GenericAppContext, once?: boolean);
|
|
342
348
|
/**
|
|
343
349
|
* Expose `getKeysFromRawProps` on the instance so it can be used in code
|
|
344
350
|
* paths where it's needed, e.g. `useModel`
|
|
@@ -347,6 +353,12 @@ export declare class VaporComponentInstance<Props extends Record<string, any> =
|
|
|
347
353
|
}
|
|
348
354
|
export declare function isVaporComponent(value: unknown): value is VaporComponentInstance;
|
|
349
355
|
/**
|
|
356
|
+
* Resolve an asset component by name before passing it to the fallback helper;
|
|
357
|
+
* a string passed directly to `createComponentWithFallback` is plain element
|
|
358
|
+
* fallback, not a component name.
|
|
359
|
+
*/
|
|
360
|
+
export declare function createAssetComponent(name: string, rawProps?: LooseRawProps | null, rawSlots?: LooseRawSlots | null, isSingleRoot?: boolean, once?: boolean, maybeSelfReference?: boolean, appContext?: GenericAppContext): HTMLElement | VaporComponentInstance;
|
|
361
|
+
/**
|
|
350
362
|
* Used when a component cannot be resolved at compile time
|
|
351
363
|
* and needs rely on runtime resolution - where it might fallback to a plain
|
|
352
364
|
* element if the resolution fails.
|
|
@@ -437,7 +449,7 @@ export declare function setInsertionState(parent: ParentNode & {
|
|
|
437
449
|
}, anchor?: Node | 0 | null, logicalIndex?: number): void;
|
|
438
450
|
//#endregion
|
|
439
451
|
//#region temp/packages/runtime-vapor/src/dom/template.d.ts
|
|
440
|
-
export declare function template(html: string,
|
|
452
|
+
export declare function template(html: string, flags?: number, ns?: Namespace): () => Node & {
|
|
441
453
|
$root?: true;
|
|
442
454
|
};
|
|
443
455
|
//#endregion
|
|
@@ -489,16 +501,20 @@ export declare function setBlockHtml(block: Block & {
|
|
|
489
501
|
export declare function setDynamicProps(el: any, args: any[], isSVG?: boolean): void;
|
|
490
502
|
//#endregion
|
|
491
503
|
//#region temp/packages/runtime-vapor/src/dom/event.d.ts
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
export declare function
|
|
504
|
+
type EventHandler = (...args: any[]) => any;
|
|
505
|
+
type EventHandlerValue = EventHandler | EventHandler[];
|
|
506
|
+
type MaybeEventHandlerValue = EventHandlerValue | null | undefined;
|
|
507
|
+
export declare function on(el: Element, event: string, handler: EventHandlerValue, options?: AddEventListenerOptions): void;
|
|
508
|
+
export declare function onBinding(el: Element, event: string, handler: EventHandlerValue, options?: AddEventListenerOptions): void;
|
|
509
|
+
export declare function delegate(el: any, event: string, handler: EventHandler): void;
|
|
496
510
|
export declare const delegateEvents: (...names: string[]) => void;
|
|
497
|
-
export declare function setDynamicEvents(el: HTMLElement, events: Record<string,
|
|
498
|
-
export declare function
|
|
511
|
+
export declare function setDynamicEvents(el: HTMLElement, events: Record<string, EventHandlerValue>): void;
|
|
512
|
+
export declare function withVaporModifiers<T extends (event: Event, ...args: unknown[]) => any>(fn: T | null | undefined, modifiers: string[]): T;
|
|
513
|
+
export declare function withVaporKeys<T extends (event: KeyboardEvent) => any>(fn: T | null | undefined, modifiers: string[]): T;
|
|
514
|
+
export declare function createInvoker(handler: MaybeEventHandlerValue): EventHandler;
|
|
499
515
|
//#endregion
|
|
500
516
|
//#region temp/packages/runtime-vapor/src/apiCreateIf.d.ts
|
|
501
|
-
export declare function createIf(condition: () => any, b1: BlockFn, b2?: BlockFn,
|
|
517
|
+
export declare function createIf(condition: () => any, b1: BlockFn, b2?: BlockFn, flags?: number): Block;
|
|
502
518
|
//#endregion
|
|
503
519
|
//#region temp/packages/runtime-vapor/src/apiCreateFragment.d.ts
|
|
504
520
|
/**
|
|
@@ -551,7 +567,7 @@ export declare function setBlockKey(block: (Block & {
|
|
|
551
567
|
}) | null | undefined, key: any): void;
|
|
552
568
|
//#endregion
|
|
553
569
|
//#region temp/packages/runtime-vapor/src/apiCreateDynamicComponent.d.ts
|
|
554
|
-
export declare function createDynamicComponent(getter: () => any, rawProps?: RawProps | null, rawSlots?:
|
|
570
|
+
export declare function createDynamicComponent(getter: () => any, rawProps?: RawProps | null, rawSlots?: LooseRawSlots | null, isSingleRoot?: boolean, once?: boolean): VaporFragment;
|
|
555
571
|
//#endregion
|
|
556
572
|
//#region temp/packages/runtime-vapor/src/apiSetupHelpers.d.ts
|
|
557
573
|
export declare function withAsyncContext(getAwaitable: () => any): [any, () => void];
|