@vue/runtime-vapor 3.6.0-beta.1 → 3.6.0-beta.10
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 +423 -393
- package/dist/runtime-vapor.esm-bundler.js +4717 -4688
- package/package.json +4 -4
package/dist/runtime-vapor.d.ts
CHANGED
|
@@ -1,426 +1,441 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { AllowedComponentProps, AsyncComponentInternalOptions, AsyncComponentLoader, AsyncComponentOptions, ComponentCustomProps, ComponentInternalOptions, ComponentObjectPropsOptions, ComponentPropsOptions, ComponentTypeEmits, CreateAppFunction, CustomElementOptions, DirectiveModifiers, EffectScope, EmitFn, EmitsOptions, EmitsToProps, ExtractDefaultPropTypes, ExtractPropTypes, GenericAppContext, GenericComponentInstance, KeepAliveProps, LifecycleHook, NULL_DYNAMIC_COMPONENT, NormalizedPropsOptions, ObjectEmitsOptions, Plugin, ReservedProps, SchedulerJob, ShallowUnwrapRef, SuspenseBoundary, TeleportProps, TransitionGroupProps, TransitionHooks, TransitionProps, TransitionState, TypeEmitsToOptions, VNode, VueElementBase } from "@vue/runtime-dom";
|
|
2
|
+
import { EffectScope as EffectScope$1, ReactiveEffect, Ref, ShallowRef } from "@vue/reactivity";
|
|
3
|
+
import { IsKeyValues, Namespace, NormalizedStyle, Prettify } from "@vue/shared";
|
|
4
4
|
|
|
5
|
+
//#region temp/packages/runtime-vapor/src/apiTemplateRef.d.ts
|
|
5
6
|
type NodeRef = string | Ref | ((ref: Element | VaporComponentInstance, refs: Record<string, any>) => void);
|
|
6
|
-
type RefEl = Element | VaporComponentInstance;
|
|
7
|
-
type setRefFn = (el: RefEl, ref: NodeRef,
|
|
7
|
+
type RefEl = Element | VaporComponentInstance | DynamicFragment | VaporFragment;
|
|
8
|
+
type setRefFn = (el: RefEl, ref: NodeRef, refFor?: boolean, refKey?: string) => NodeRef | undefined;
|
|
8
9
|
export declare function createTemplateRefSetter(): setRefFn;
|
|
9
|
-
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region temp/packages/runtime-vapor/src/componentSlots.d.ts
|
|
12
|
+
type RawSlots = Record<string, VaporSlot> & {
|
|
13
|
+
$?: DynamicSlotSource[];
|
|
14
|
+
};
|
|
15
|
+
type StaticSlots = Record<string, VaporSlot>;
|
|
16
|
+
export type VaporSlot = BlockFn;
|
|
17
|
+
type DynamicSlot = {
|
|
18
|
+
name: string;
|
|
19
|
+
fn: VaporSlot;
|
|
20
|
+
};
|
|
21
|
+
type DynamicSlotFn = () => DynamicSlot | DynamicSlot[];
|
|
22
|
+
type DynamicSlotSource = StaticSlots | DynamicSlotFn;
|
|
23
|
+
/**
|
|
24
|
+
* Wrap a slot function to track the slot owner.
|
|
25
|
+
*
|
|
26
|
+
* This ensures:
|
|
27
|
+
* 1. createSlot gets rawSlots from the correct instance (slot owner)
|
|
28
|
+
* 2. elements inherit the slot owner's scopeId
|
|
29
|
+
*/
|
|
30
|
+
export declare function withVaporCtx(fn: Function): BlockFn;
|
|
31
|
+
export declare function createSlot(name: string | (() => string), rawProps?: LooseRawProps | null, fallback?: VaporSlot, noSlotted?: boolean, once?: boolean): Block;
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region temp/packages/runtime-vapor/src/apiDefineComponent.d.ts
|
|
34
|
+
export type VaporPublicProps = ReservedProps & AllowedComponentProps & ComponentCustomProps;
|
|
35
|
+
export type VaporRenderResult<T = Block> = VNode | T | VaporRenderResult<T>[];
|
|
36
|
+
type VaporComponentInstanceConstructor<T extends VaporComponentInstance> = {
|
|
37
|
+
__isFragment?: never;
|
|
38
|
+
__isTeleport?: never;
|
|
39
|
+
__isSuspense?: never;
|
|
40
|
+
new (...args: any[]): T;
|
|
41
|
+
};
|
|
42
|
+
export type DefineVaporComponent<RuntimePropsOptions = {}, RuntimePropsKeys extends string = string, InferredProps = (string extends RuntimePropsKeys ? ComponentObjectPropsOptions extends RuntimePropsOptions ? {} : ExtractPropTypes<RuntimePropsOptions> : { [key in RuntimePropsKeys]?: any }), Emits extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Slots extends StaticSlots = StaticSlots, Exposed extends Record<string, any> = Record<string, any>, TypeBlock extends Block = Block, TypeRefs extends Record<string, unknown> = {}, MakeDefaultsOptional extends boolean = true, PublicProps = VaporPublicProps, ResolvedProps = InferredProps & EmitsToProps<Emits>, Defaults = ExtractDefaultPropTypes<RuntimePropsOptions>> = VaporComponentInstanceConstructor<VaporComponentInstance<MakeDefaultsOptional extends true ? keyof Defaults extends never ? Prettify<ResolvedProps> & PublicProps : Partial<Defaults> & Omit<Prettify<ResolvedProps> & PublicProps, keyof Defaults> : Prettify<ResolvedProps> & PublicProps, Emits, Slots, Exposed, TypeBlock, TypeRefs>> & VaporComponentOptions<RuntimePropsOptions | RuntimePropsKeys[], Emits, RuntimeEmitsKeys, Slots, Exposed>;
|
|
43
|
+
type DefineVaporSetupFnComponent<Props extends Record<string, any> = {}, Emits extends EmitsOptions = {}, Slots extends StaticSlots = StaticSlots, Exposed extends Record<string, any> = Record<string, any>, TypeBlock extends Block = Block, ResolvedProps extends Record<string, any> = Props & EmitsToProps<Emits> & VaporPublicProps> = new () => VaporComponentInstance<ResolvedProps, Emits, Slots, Exposed, TypeBlock>;
|
|
44
|
+
export declare function defineVaporComponent<Props extends Record<string, any>, Emits extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Slots extends StaticSlots = StaticSlots, Exposed extends Record<string, any> = Record<string, any>, TypeBlock extends Block = Block>(setup: (props: Props, ctx: {
|
|
45
|
+
emit: EmitFn<Emits>;
|
|
46
|
+
slots: Slots;
|
|
47
|
+
attrs: Record<string, any>;
|
|
48
|
+
expose: (exposed: Exposed) => void;
|
|
49
|
+
}) => VaporRenderResult<TypeBlock> | void, extraOptions?: VaporComponentOptions<(keyof Props)[], Emits, RuntimeEmitsKeys, Slots, Exposed> & ThisType<void>): DefineVaporSetupFnComponent<Props, Emits, Slots, Exposed, TypeBlock>;
|
|
50
|
+
export declare function defineVaporComponent<Props extends Record<string, any>, Emits extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Slots extends StaticSlots = StaticSlots, Exposed extends Record<string, any> = Record<string, any>, TypeBlock extends Block = Block>(setup: (props: Props, ctx: {
|
|
51
|
+
emit: EmitFn<Emits>;
|
|
52
|
+
slots: Slots;
|
|
53
|
+
attrs: Record<string, any>;
|
|
54
|
+
expose: (exposed: Exposed) => void;
|
|
55
|
+
}) => VaporRenderResult<TypeBlock> | void, extraOptions?: VaporComponentOptions<ComponentObjectPropsOptions<Props>, Emits, RuntimeEmitsKeys, Slots, Exposed> & ThisType<void>): DefineVaporSetupFnComponent<Props, Emits, Slots, Exposed, TypeBlock>;
|
|
56
|
+
export declare function defineVaporComponent<TypeProps, RuntimePropsOptions extends ComponentObjectPropsOptions = ComponentObjectPropsOptions, RuntimePropsKeys extends string = string, TypeEmits extends ComponentTypeEmits = {}, RuntimeEmitsOptions extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Slots extends StaticSlots = StaticSlots, Exposed extends Record<string, any> = Record<string, any>, ResolvedEmits extends EmitsOptions = ({} extends RuntimeEmitsOptions ? TypeEmitsToOptions<TypeEmits> : RuntimeEmitsOptions), InferredProps = (IsKeyValues<TypeProps> extends true ? TypeProps : string extends RuntimePropsKeys ? ComponentObjectPropsOptions extends RuntimePropsOptions ? {} : ExtractPropTypes<RuntimePropsOptions> : { [key in RuntimePropsKeys]?: any }), TypeRefs extends Record<string, unknown> = {}, TypeBlock extends Block = Block>(options: VaporComponentOptions<RuntimePropsOptions | RuntimePropsKeys[], ResolvedEmits, RuntimeEmitsKeys, Slots, Exposed, TypeBlock, InferredProps> & {
|
|
57
|
+
[key: string]: any;
|
|
58
|
+
/**
|
|
59
|
+
* @private for language-tools use only
|
|
60
|
+
*/
|
|
61
|
+
__typeProps?: TypeProps;
|
|
62
|
+
/**
|
|
63
|
+
* @private for language-tools use only
|
|
64
|
+
*/
|
|
65
|
+
__typeEmits?: TypeEmits;
|
|
66
|
+
/**
|
|
67
|
+
* @private for language-tools use only
|
|
68
|
+
*/
|
|
69
|
+
__typeRefs?: TypeRefs;
|
|
70
|
+
/**
|
|
71
|
+
* @private for language-tools use only
|
|
72
|
+
*/
|
|
73
|
+
__typeEl?: TypeBlock;
|
|
74
|
+
} & ThisType<void>): DefineVaporComponent<RuntimePropsOptions, RuntimePropsKeys, InferredProps, ResolvedEmits, RuntimeEmitsKeys, Slots, Exposed extends Block ? Record<string, any> : Exposed, TypeBlock, TypeRefs, unknown extends TypeProps ? true : false>;
|
|
75
|
+
//#endregion
|
|
76
|
+
//#region temp/packages/runtime-vapor/src/components/KeepAlive.d.ts
|
|
77
|
+
export interface VaporKeepAliveContext {
|
|
78
|
+
processShapeFlag(block: Block): CacheKey | false;
|
|
79
|
+
cacheBlock(block?: Block): void;
|
|
80
|
+
cacheScope(cacheKey: CacheKey, scopeLookupKey: any, scope: EffectScope$1): void;
|
|
81
|
+
getScope(key: any): EffectScope$1 | undefined;
|
|
82
|
+
}
|
|
83
|
+
type CacheKey = any;
|
|
84
|
+
export declare const VaporKeepAlive: DefineVaporComponent<{}, string, KeepAliveProps>;
|
|
85
|
+
//#endregion
|
|
86
|
+
//#region temp/packages/runtime-vapor/src/fragment.d.ts
|
|
10
87
|
export declare class VaporFragment<T extends Block = Block> implements TransitionOptions {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
88
|
+
$key?: any;
|
|
89
|
+
$transition?: VaporTransitionHooks | undefined;
|
|
90
|
+
nodes: T;
|
|
91
|
+
vnode?: VNode | null;
|
|
92
|
+
anchor?: Node;
|
|
93
|
+
parentComponent?: GenericComponentInstance | null;
|
|
94
|
+
fallback?: BlockFn;
|
|
95
|
+
insert?: (parent: ParentNode, anchor: Node | null, transitionHooks?: TransitionHooks) => void;
|
|
96
|
+
remove?: (parent?: ParentNode, transitionHooks?: TransitionHooks) => void;
|
|
97
|
+
hydrate?: (...args: any[]) => void;
|
|
98
|
+
setRef?: (instance: VaporComponentInstance, ref: NodeRef, refFor: boolean, refKey: string | undefined) => void;
|
|
99
|
+
onUpdated?: ((nodes?: Block) => void)[];
|
|
100
|
+
readonly slotOwner: VaporComponentInstance | null;
|
|
101
|
+
readonly keepAliveCtx: VaporKeepAliveContext | null;
|
|
102
|
+
constructor(nodes: T);
|
|
103
|
+
protected runWithRenderCtx<R>(fn: () => R): R;
|
|
24
104
|
}
|
|
25
105
|
declare class ForFragment extends VaporFragment<Block[]> {
|
|
26
|
-
|
|
106
|
+
constructor(nodes: Block[]);
|
|
27
107
|
}
|
|
28
|
-
declare class DynamicFragment extends VaporFragment {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
constructor(anchorLabel?: string);
|
|
45
|
-
update(render?: BlockFn, key?: any): void;
|
|
46
|
-
renderBranch(render: BlockFn | undefined, transition: VaporTransitionHooks | undefined, parent: ParentNode | null, instance: GenericComponentInstance | null): void;
|
|
47
|
-
hydrate: (isEmpty?: boolean) => void;
|
|
108
|
+
export declare class DynamicFragment extends VaporFragment {
|
|
109
|
+
anchor: Node;
|
|
110
|
+
isAnchorPending?: boolean;
|
|
111
|
+
scope: EffectScope$1 | undefined;
|
|
112
|
+
current?: BlockFn;
|
|
113
|
+
pending?: {
|
|
114
|
+
render?: BlockFn;
|
|
115
|
+
key: any;
|
|
116
|
+
};
|
|
117
|
+
anchorLabel?: string;
|
|
118
|
+
keyed?: boolean;
|
|
119
|
+
attrs?: Record<string, any>;
|
|
120
|
+
constructor(anchorLabel?: string, keyed?: boolean, locate?: boolean);
|
|
121
|
+
update(render?: BlockFn, key?: any): void;
|
|
122
|
+
renderBranch(render: BlockFn | undefined, transition: VaporTransitionHooks | undefined, parent: ParentNode | null, key: any): void;
|
|
123
|
+
hydrate: (isEmpty?: boolean, isSlot?: boolean) => void;
|
|
48
124
|
}
|
|
49
125
|
export declare function isFragment(val: NonNullable<unknown>): val is VaporFragment;
|
|
50
|
-
|
|
126
|
+
//#endregion
|
|
127
|
+
//#region temp/packages/runtime-vapor/src/block.d.ts
|
|
51
128
|
export interface VaporTransitionHooks extends TransitionHooks {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
129
|
+
state: TransitionState;
|
|
130
|
+
props: TransitionProps;
|
|
131
|
+
instance: VaporComponentInstance;
|
|
132
|
+
disabled?: boolean;
|
|
133
|
+
applyGroup?: (block: Block, props: TransitionProps, state: TransitionState, instance: VaporComponentInstance) => void;
|
|
56
134
|
}
|
|
57
135
|
interface TransitionOptions {
|
|
58
|
-
|
|
59
|
-
|
|
136
|
+
$key?: any;
|
|
137
|
+
$transition?: VaporTransitionHooks;
|
|
60
138
|
}
|
|
61
139
|
export type Block = Node | VaporFragment | DynamicFragment | VaporComponentInstance | Block[];
|
|
62
140
|
type BlockFn = (...args: any[]) => Block;
|
|
63
141
|
export declare function insert(block: Block, parent: ParentNode & {
|
|
64
|
-
|
|
65
|
-
}, anchor?: Node | null | 0,
|
|
66
|
-
parentSuspense?: any): void;
|
|
142
|
+
$fc?: Node | null;
|
|
143
|
+
}, anchor?: Node | null | 0, parentSuspense?: any): void;
|
|
67
144
|
export declare function prepend(parent: ParentNode, ...blocks: Block[]): void;
|
|
68
145
|
export declare function remove(block: Block, parent?: ParentNode): void;
|
|
69
|
-
|
|
146
|
+
//#endregion
|
|
147
|
+
//#region temp/packages/runtime-vapor/src/vdomInterop.d.ts
|
|
70
148
|
declare const interopKey: unique symbol;
|
|
71
149
|
export declare const vaporInteropPlugin: Plugin;
|
|
72
|
-
|
|
150
|
+
//#endregion
|
|
151
|
+
//#region temp/packages/runtime-vapor/src/componentProps.d.ts
|
|
73
152
|
type RawProps = Record<string, () => unknown> & {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
153
|
+
$?: DynamicPropsSource[] & {
|
|
154
|
+
[interopKey]?: boolean;
|
|
155
|
+
};
|
|
77
156
|
};
|
|
78
157
|
type DynamicPropsSource = (() => Record<string, unknown>) | Record<string, () => unknown>;
|
|
79
|
-
|
|
158
|
+
//#endregion
|
|
159
|
+
//#region temp/packages/runtime-vapor/src/renderEffect.d.ts
|
|
80
160
|
declare class RenderEffect extends ReactiveEffect {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
161
|
+
render: () => void;
|
|
162
|
+
i: VaporComponentInstance | null;
|
|
163
|
+
job: SchedulerJob;
|
|
164
|
+
updateJob: SchedulerJob;
|
|
165
|
+
constructor(render: () => void);
|
|
166
|
+
fn(): void;
|
|
167
|
+
notify(): void;
|
|
88
168
|
}
|
|
89
169
|
export declare function renderEffect(fn: () => void, noLifecycle?: boolean): void;
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
$?: DynamicSlotSource[];
|
|
93
|
-
};
|
|
94
|
-
type StaticSlots = Record<string, VaporSlot>;
|
|
95
|
-
export type VaporSlot = BlockFn;
|
|
96
|
-
type DynamicSlot = {
|
|
97
|
-
name: string;
|
|
98
|
-
fn: VaporSlot;
|
|
99
|
-
};
|
|
100
|
-
type DynamicSlotFn = () => DynamicSlot | DynamicSlot[];
|
|
101
|
-
type DynamicSlotSource = StaticSlots | DynamicSlotFn;
|
|
102
|
-
/**
|
|
103
|
-
* Wrap a slot function to track the slot owner.
|
|
104
|
-
*
|
|
105
|
-
* This ensures:
|
|
106
|
-
* 1. createSlot gets rawSlots from the correct component (slot owner)
|
|
107
|
-
* 2. Elements inherit the slot owner's scopeId
|
|
108
|
-
*/
|
|
109
|
-
export declare function withVaporCtx(fn: Function): BlockFn;
|
|
110
|
-
export declare function createSlot(name: string | (() => string), rawProps?: LooseRawProps | null, fallback?: VaporSlot, noSlotted?: boolean, once?: boolean): Block;
|
|
111
|
-
|
|
112
|
-
export declare const VaporTeleportImpl: {
|
|
113
|
-
name: string;
|
|
114
|
-
__isTeleport: boolean;
|
|
115
|
-
__vapor: boolean;
|
|
116
|
-
process(props: LooseRawProps, slots: LooseRawSlots): TeleportFragment;
|
|
117
|
-
};
|
|
170
|
+
//#endregion
|
|
171
|
+
//#region temp/packages/runtime-vapor/src/components/Teleport.d.ts
|
|
118
172
|
declare class TeleportFragment extends VaporFragment {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
173
|
+
anchor?: Node;
|
|
174
|
+
private rawProps?;
|
|
175
|
+
private resolvedProps?;
|
|
176
|
+
private rawSlots?;
|
|
177
|
+
isDisabled?: boolean;
|
|
178
|
+
private isMounted;
|
|
179
|
+
private childrenInitialized;
|
|
180
|
+
private readonly ownerInstance;
|
|
181
|
+
target?: ParentNode | null;
|
|
182
|
+
targetAnchor?: Node | null;
|
|
183
|
+
targetStart?: Node | null;
|
|
184
|
+
placeholder?: Node;
|
|
185
|
+
mountContainer?: ParentNode | null;
|
|
186
|
+
mountAnchor?: Node | null;
|
|
187
|
+
private mountToTargetJob?;
|
|
188
|
+
constructor(props: LooseRawProps, slots?: LooseRawSlots | null);
|
|
189
|
+
get parent(): ParentNode | null;
|
|
190
|
+
private initChildren;
|
|
191
|
+
private ensureChildrenInitialized;
|
|
192
|
+
private registerUpdateCssVars;
|
|
193
|
+
private bindChildren;
|
|
194
|
+
private handleChildrenUpdate;
|
|
195
|
+
private mount;
|
|
196
|
+
private mountToTarget;
|
|
197
|
+
private clearMainViewChildren;
|
|
198
|
+
private handlePropsUpdate;
|
|
199
|
+
insert: (container: ParentNode, anchor: Node | null) => void;
|
|
200
|
+
remove: (parent?: ParentNode | undefined) => void;
|
|
201
|
+
private hydrateTargetAnchors;
|
|
202
|
+
private hydrateDisabledTeleport;
|
|
203
|
+
private mountChildren;
|
|
204
|
+
hydrate: () => void;
|
|
142
205
|
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
type
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
}) => VaporRenderResult<TypeBlock> | void, extraOptions?: ObjectVaporComponent<(keyof Props)[], Emits, RuntimeEmitsKeys, Slots, Exposed> & ThisType<void>): DefineVaporSetupFnComponent<Props, Emits, Slots, Exposed, TypeBlock>;
|
|
162
|
-
export declare function defineVaporComponent<Props extends Record<string, any>, Emits extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Slots extends StaticSlots = StaticSlots, Exposed extends Record<string, any> = Record<string, any>, TypeBlock extends Block = Block>(setup: (props: Props, ctx: {
|
|
163
|
-
emit: EmitFn<Emits>;
|
|
164
|
-
slots: Slots;
|
|
165
|
-
attrs: Record<string, any>;
|
|
166
|
-
expose: (exposed: Exposed) => void;
|
|
167
|
-
}) => VaporRenderResult<TypeBlock> | void, extraOptions?: ObjectVaporComponent<ComponentObjectPropsOptions<Props>, Emits, RuntimeEmitsKeys, Slots, Exposed> & ThisType<void>): DefineVaporSetupFnComponent<Props, Emits, Slots, Exposed, TypeBlock>;
|
|
168
|
-
export declare function defineVaporComponent<TypeProps, RuntimePropsOptions extends ComponentObjectPropsOptions = ComponentObjectPropsOptions, RuntimePropsKeys extends string = string, TypeEmits extends ComponentTypeEmits = {}, RuntimeEmitsOptions extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Slots extends StaticSlots = StaticSlots, Exposed extends Record<string, any> = Record<string, any>, ResolvedEmits extends EmitsOptions = {} extends RuntimeEmitsOptions ? TypeEmitsToOptions<TypeEmits> : RuntimeEmitsOptions, InferredProps = IsKeyValues<TypeProps> extends true ? TypeProps : string extends RuntimePropsKeys ? ComponentObjectPropsOptions extends RuntimePropsOptions ? {} : ExtractPropTypes<RuntimePropsOptions> : {
|
|
169
|
-
[key in RuntimePropsKeys]?: any;
|
|
170
|
-
}, TypeRefs extends Record<string, unknown> = {}, TypeBlock extends Block = Block>(options: ObjectVaporComponent<RuntimePropsOptions | RuntimePropsKeys[], ResolvedEmits, RuntimeEmitsKeys, Slots, Exposed, TypeBlock, InferredProps> & {
|
|
171
|
-
/**
|
|
172
|
-
* @private for language-tools use only
|
|
173
|
-
*/
|
|
174
|
-
__typeProps?: TypeProps;
|
|
175
|
-
/**
|
|
176
|
-
* @private for language-tools use only
|
|
177
|
-
*/
|
|
178
|
-
__typeEmits?: TypeEmits;
|
|
179
|
-
/**
|
|
180
|
-
* @private for language-tools use only
|
|
181
|
-
*/
|
|
182
|
-
__typeRefs?: TypeRefs;
|
|
183
|
-
/**
|
|
184
|
-
* @private for language-tools use only
|
|
185
|
-
*/
|
|
186
|
-
__typeEl?: TypeBlock;
|
|
187
|
-
} & ThisType<void>): DefineVaporComponent<RuntimePropsOptions, RuntimePropsKeys, ResolvedEmits, RuntimeEmitsKeys, Slots, Exposed extends Block ? Record<string, any> : Exposed, TypeBlock, TypeRefs, unknown extends TypeProps ? true : false, InferredProps>;
|
|
188
|
-
|
|
189
|
-
export type VaporComponent = FunctionalVaporComponent | ObjectVaporComponent | DefineVaporComponent;
|
|
190
|
-
export type FunctionalVaporComponent<Props = {}, Emits extends EmitsOptions = {}, Slots extends StaticSlots = StaticSlots, Exposed extends Record<string, any> = Record<string, any>> = ((props: Readonly<Props & EmitsToProps<Emits>>, ctx: {
|
|
206
|
+
export declare const VaporTeleport: DefineVaporSetupFnComponent<TeleportProps>;
|
|
207
|
+
//#endregion
|
|
208
|
+
//#region temp/packages/runtime-vapor/src/component.d.ts
|
|
209
|
+
export type VaporComponent = FunctionalVaporComponent<any> | VaporComponentOptions | DefineVaporComponent;
|
|
210
|
+
export type FunctionalVaporComponent<Props = {}, Emits extends EmitsOptions = {}, Slots extends StaticSlots = StaticSlots, Exposed extends Record<string, any> = Record<string, any>> = ((props: Props & EmitsToProps<Emits>, ctx: {
|
|
211
|
+
emit: EmitFn<Emits>;
|
|
212
|
+
slots: Slots;
|
|
213
|
+
attrs: Record<string, any>;
|
|
214
|
+
expose: <T extends Record<string, any> = Exposed>(exposed: T) => void;
|
|
215
|
+
}) => VaporRenderResult) & Omit<VaporComponentOptions<ComponentPropsOptions<Props>, Emits, string, Slots>, "setup"> & {
|
|
216
|
+
displayName?: string;
|
|
217
|
+
} & SharedInternalOptions;
|
|
218
|
+
export interface VaporComponentOptions<Props = {}, Emits extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Slots extends StaticSlots = StaticSlots, Exposed extends Record<string, any> = Record<string, any>, TypeBlock extends Block = Block, InferredProps = (ComponentObjectPropsOptions extends Props ? {} : ExtractPropTypes<Props>)> extends ComponentInternalOptions, AsyncComponentInternalOptions<VaporComponentOptions, VaporComponentInstance>, SharedInternalOptions {
|
|
219
|
+
inheritAttrs?: boolean;
|
|
220
|
+
props?: Props;
|
|
221
|
+
emits?: Emits | RuntimeEmitsKeys[];
|
|
222
|
+
slots?: Slots;
|
|
223
|
+
setup?: (props: Readonly<InferredProps>, ctx: {
|
|
191
224
|
emit: EmitFn<Emits>;
|
|
192
225
|
slots: Slots;
|
|
193
226
|
attrs: Record<string, any>;
|
|
194
227
|
expose: <T extends Record<string, any> = Exposed>(exposed: T) => void;
|
|
195
|
-
}) =>
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
props?: Props;
|
|
201
|
-
emits?: Emits | RuntimeEmitsKeys[];
|
|
202
|
-
slots?: Slots;
|
|
203
|
-
setup?: (props: Readonly<InferredProps>, ctx: {
|
|
204
|
-
emit: EmitFn<Emits>;
|
|
205
|
-
slots: Slots;
|
|
206
|
-
attrs: Record<string, any>;
|
|
207
|
-
expose: <T extends Record<string, any> = Exposed>(exposed: T) => void;
|
|
208
|
-
}) => TypeBlock | Exposed | Promise<Exposed> | void;
|
|
209
|
-
render?(ctx: Exposed extends Block ? undefined : ShallowUnwrapRef<Exposed>, props: Readonly<InferredProps>, emit: EmitFn<Emits>, attrs: any, slots: Slots): VaporRenderResult<TypeBlock> | void;
|
|
210
|
-
name?: string;
|
|
211
|
-
vapor?: boolean;
|
|
212
|
-
components?: Record<string, VaporComponent>;
|
|
228
|
+
}) => TypeBlock | Exposed | Promise<Exposed> | void;
|
|
229
|
+
render?(ctx: Exposed extends Block ? undefined : ShallowUnwrapRef<Exposed>, props: Readonly<InferredProps>, emit: EmitFn<Emits>, attrs: any, slots: Slots): VaporRenderResult<TypeBlock> | void;
|
|
230
|
+
name?: string;
|
|
231
|
+
vapor?: boolean;
|
|
232
|
+
components?: Record<string, VaporComponent>;
|
|
213
233
|
}
|
|
214
234
|
interface SharedInternalOptions {
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
235
|
+
/**
|
|
236
|
+
* Cached normalized props options.
|
|
237
|
+
* In vapor mode there are no mixins so normalized options can be cached
|
|
238
|
+
* directly on the component
|
|
239
|
+
*/
|
|
240
|
+
__propsOptions?: NormalizedPropsOptions;
|
|
241
|
+
/**
|
|
242
|
+
* Cached normalized props proxy handlers.
|
|
243
|
+
*/
|
|
244
|
+
__propsHandlers?: [ProxyHandler<any> | null, ProxyHandler<any>];
|
|
245
|
+
/**
|
|
246
|
+
* Cached normalized emits options.
|
|
247
|
+
*/
|
|
248
|
+
__emitsOptions?: ObjectEmitsOptions;
|
|
229
249
|
}
|
|
230
250
|
type LooseRawProps = Record<string, (() => unknown) | DynamicPropsSource[]> & {
|
|
231
|
-
|
|
251
|
+
$?: DynamicPropsSource[];
|
|
232
252
|
};
|
|
233
253
|
type LooseRawSlots = Record<string, VaporSlot | DynamicSlotSource[]> & {
|
|
234
|
-
|
|
254
|
+
$?: DynamicSlotSource[];
|
|
235
255
|
};
|
|
236
|
-
export declare function createComponent(component: VaporComponent, rawProps?: LooseRawProps | null, rawSlots?: LooseRawSlots | null, isSingleRoot?: boolean, once?: boolean, appContext?: GenericAppContext): VaporComponentInstance;
|
|
256
|
+
export declare function createComponent(component: VaporComponent, rawProps?: LooseRawProps | null, rawSlots?: LooseRawSlots | null, isSingleRoot?: boolean, once?: boolean, appContext?: GenericAppContext, managedMount?: boolean): VaporComponentInstance;
|
|
237
257
|
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 {
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
258
|
+
vapor: true;
|
|
259
|
+
uid: number;
|
|
260
|
+
type: VaporComponent;
|
|
261
|
+
root: GenericComponentInstance | null;
|
|
262
|
+
parent: GenericComponentInstance | null;
|
|
263
|
+
appContext: GenericAppContext;
|
|
264
|
+
block: TypeBlock;
|
|
265
|
+
scope: EffectScope;
|
|
266
|
+
rawProps: RawProps;
|
|
267
|
+
rawSlots: RawSlots;
|
|
268
|
+
props: Readonly<Props>;
|
|
269
|
+
attrs: Record<string, any>;
|
|
270
|
+
propsDefaults: Record<string, any> | null;
|
|
271
|
+
slots: Slots;
|
|
272
|
+
scopeId?: string | null;
|
|
273
|
+
rawPropsRef?: ShallowRef<any>;
|
|
274
|
+
rawSlotsRef?: ShallowRef<any>;
|
|
275
|
+
emit: EmitFn<Emits>;
|
|
276
|
+
emitted: Record<string, boolean> | null;
|
|
277
|
+
expose: (<T extends Record<string, any> = Exposed>(exposed: T) => void) & string[];
|
|
278
|
+
exposed: Exposed | null;
|
|
279
|
+
exposeProxy: Prettify<ShallowUnwrapRef<Exposed>> | null;
|
|
280
|
+
refs: TypeRefs;
|
|
281
|
+
provides: Record<string, any>;
|
|
282
|
+
ids: [string, number, number];
|
|
283
|
+
suspense: SuspenseBoundary | null;
|
|
284
|
+
suspenseId: number;
|
|
285
|
+
asyncDep: Promise<any> | null;
|
|
286
|
+
asyncResolved: boolean;
|
|
287
|
+
restoreAsyncContext?: () => void | (() => void);
|
|
288
|
+
deferredHydrationBoundary?: () => void;
|
|
289
|
+
renderEffects?: RenderEffect[];
|
|
290
|
+
hasFallthrough: boolean;
|
|
291
|
+
shapeFlag?: number;
|
|
292
|
+
$key?: any;
|
|
293
|
+
oncePropsCache?: Record<string | symbol, any>;
|
|
294
|
+
isMounted: boolean;
|
|
295
|
+
isUnmounted: boolean;
|
|
296
|
+
isDeactivated: boolean;
|
|
297
|
+
isUpdating: boolean;
|
|
298
|
+
bc?: LifecycleHook;
|
|
299
|
+
c?: LifecycleHook;
|
|
300
|
+
bm?: LifecycleHook;
|
|
301
|
+
m?: LifecycleHook;
|
|
302
|
+
bu?: LifecycleHook;
|
|
303
|
+
u?: LifecycleHook;
|
|
304
|
+
um?: LifecycleHook;
|
|
305
|
+
bum?: LifecycleHook;
|
|
306
|
+
da?: LifecycleHook;
|
|
307
|
+
a?: LifecycleHook;
|
|
308
|
+
rtg?: LifecycleHook;
|
|
309
|
+
rtc?: LifecycleHook;
|
|
310
|
+
ec?: LifecycleHook;
|
|
311
|
+
sp?: LifecycleHook<() => Promise<unknown>>;
|
|
312
|
+
setupState?: Exposed extends Block ? undefined : ShallowUnwrapRef<Exposed>;
|
|
313
|
+
devtoolsRawSetupState?: any;
|
|
314
|
+
hmrRerender?: () => void;
|
|
315
|
+
hmrReload?: (newComp: VaporComponent) => void;
|
|
316
|
+
parentTeleport?: TeleportFragment | null;
|
|
317
|
+
propsOptions?: NormalizedPropsOptions;
|
|
318
|
+
emitsOptions?: ObjectEmitsOptions | null;
|
|
319
|
+
isSingleRoot?: boolean;
|
|
320
|
+
/**
|
|
321
|
+
* dev only flag to track whether $attrs was used during render.
|
|
322
|
+
* If $attrs was used during render then the warning for failed attrs
|
|
323
|
+
* fallthrough can be suppressed.
|
|
324
|
+
*/
|
|
325
|
+
accessedAttrs: boolean;
|
|
326
|
+
/**
|
|
327
|
+
* @deprecated only used for JSX to detect props types.
|
|
328
|
+
*/
|
|
329
|
+
$props: Props;
|
|
330
|
+
constructor(comp: VaporComponent, rawProps?: RawProps | null, rawSlots?: RawSlots | null, appContext?: GenericAppContext, once?: boolean);
|
|
331
|
+
/**
|
|
332
|
+
* Expose `getKeysFromRawProps` on the instance so it can be used in code
|
|
333
|
+
* paths where it's needed, e.g. `useModel`
|
|
334
|
+
*/
|
|
335
|
+
rawKeys(): string[];
|
|
309
336
|
}
|
|
310
337
|
export declare function isVaporComponent(value: unknown): value is VaporComponentInstance;
|
|
311
338
|
/**
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
export declare function createComponentWithFallback(comp: VaporComponent | string, rawProps?: LooseRawProps | null, rawSlots?: LooseRawSlots | null, isSingleRoot?: boolean, once?: boolean, appContext?: GenericAppContext): HTMLElement | VaporComponentInstance;
|
|
339
|
+
* Used when a component cannot be resolved at compile time
|
|
340
|
+
* and needs rely on runtime resolution - where it might fallback to a plain
|
|
341
|
+
* element if the resolution fails.
|
|
342
|
+
*/
|
|
343
|
+
export declare function createComponentWithFallback(comp: VaporComponent | typeof NULL_DYNAMIC_COMPONENT | string, rawProps?: LooseRawProps | null, rawSlots?: LooseRawSlots | null, isSingleRoot?: boolean, once?: boolean, appContext?: GenericAppContext): HTMLElement | VaporComponentInstance;
|
|
317
344
|
export declare function createPlainElement(comp: string, rawProps?: LooseRawProps | null, rawSlots?: LooseRawSlots | null, isSingleRoot?: boolean, once?: boolean): HTMLElement;
|
|
318
|
-
|
|
345
|
+
//#endregion
|
|
346
|
+
//#region temp/packages/runtime-vapor/src/apiCreateApp.d.ts
|
|
319
347
|
export declare const createVaporApp: CreateAppFunction<ParentNode, VaporComponent>;
|
|
320
348
|
export declare const createVaporSSRApp: CreateAppFunction<ParentNode, VaporComponent>;
|
|
321
|
-
|
|
349
|
+
//#endregion
|
|
350
|
+
//#region temp/packages/runtime-vapor/src/apiDefineAsyncComponent.d.ts
|
|
322
351
|
export declare function defineVaporAsyncComponent<T extends VaporComponent>(source: AsyncComponentLoader<T> | AsyncComponentOptions<T>): T;
|
|
323
|
-
|
|
352
|
+
//#endregion
|
|
353
|
+
//#region temp/packages/runtime-vapor/src/directives/custom.d.ts
|
|
324
354
|
export type VaporDirective = (node: Element | VaporComponentInstance, value?: () => any, argument?: string, modifiers?: DirectiveModifiers) => (() => void) | void;
|
|
325
|
-
type VaporDirectiveArguments = Array<[VaporDirective | undefined] | [VaporDirective | undefined, () => any] | [VaporDirective | undefined, (() => any) | undefined, argument: string] | [
|
|
326
|
-
VaporDirective | undefined,
|
|
327
|
-
value: (() => any) | undefined,
|
|
328
|
-
argument: string | undefined,
|
|
329
|
-
modifiers: DirectiveModifiers
|
|
330
|
-
]>;
|
|
355
|
+
type VaporDirectiveArguments = Array<[VaporDirective | undefined] | [VaporDirective | undefined, () => any] | [VaporDirective | undefined, (() => any) | undefined, argument: string] | [VaporDirective | undefined, value: (() => any) | undefined, argument: string | undefined, modifiers: DirectiveModifiers]>;
|
|
331
356
|
export declare function withVaporDirectives(node: Element | VaporComponentInstance, dirs: VaporDirectiveArguments): void;
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
357
|
+
//#endregion
|
|
358
|
+
//#region temp/packages/runtime-vapor/src/apiDefineCustomElement.d.ts
|
|
335
359
|
export type VaporElementConstructor<P = {}> = {
|
|
336
|
-
|
|
360
|
+
new (initialProps?: Record<string, any>): VaporElement & P;
|
|
337
361
|
};
|
|
338
362
|
export declare function defineVaporCustomElement<Props, RawBindings = object>(setup: (props: Props, ctx: {
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
}) => RawBindings | VaporRenderResult, options?: Pick<
|
|
344
|
-
|
|
363
|
+
attrs: Record<string, any>;
|
|
364
|
+
slots: StaticSlots;
|
|
365
|
+
emit: EmitFn;
|
|
366
|
+
expose: (exposed: Record<string, any>) => void;
|
|
367
|
+
}) => RawBindings | VaporRenderResult, options?: Pick<VaporComponentOptions, "name" | "inheritAttrs" | "emits"> & CustomElementOptions & {
|
|
368
|
+
props?: (keyof Props)[];
|
|
345
369
|
}): VaporElementConstructor<Props>;
|
|
346
370
|
export declare function defineVaporCustomElement<Props, RawBindings = object>(setup: (props: Props, ctx: {
|
|
371
|
+
attrs: Record<string, any>;
|
|
372
|
+
slots: StaticSlots;
|
|
373
|
+
emit: EmitFn;
|
|
374
|
+
expose: (exposed: Record<string, any>) => void;
|
|
375
|
+
}) => RawBindings | VaporRenderResult, options?: Pick<VaporComponentOptions, "name" | "inheritAttrs" | "emits"> & CustomElementOptions & {
|
|
376
|
+
props?: ComponentObjectPropsOptions<Props>;
|
|
377
|
+
}): VaporElementConstructor<Props>;
|
|
378
|
+
export declare function defineVaporCustomElement<RuntimePropsOptions extends ComponentObjectPropsOptions = ComponentObjectPropsOptions, RuntimePropsKeys extends string = string, RuntimeEmitsOptions extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Slots extends StaticSlots = StaticSlots, InferredProps = (string extends RuntimePropsKeys ? ComponentObjectPropsOptions extends RuntimePropsOptions ? {} : ExtractPropTypes<RuntimePropsOptions> : { [key in RuntimePropsKeys]?: any }), ResolvedProps = InferredProps & EmitsToProps<RuntimeEmitsOptions>>(options: CustomElementOptions & {
|
|
379
|
+
props?: (RuntimePropsOptions & ThisType<void>) | RuntimePropsKeys[];
|
|
380
|
+
emits?: RuntimeEmitsOptions | RuntimeEmitsKeys[];
|
|
381
|
+
slots?: Slots;
|
|
382
|
+
setup?: (props: Readonly<InferredProps>, ctx: {
|
|
347
383
|
attrs: Record<string, any>;
|
|
348
|
-
slots:
|
|
349
|
-
emit: EmitFn
|
|
384
|
+
slots: Slots;
|
|
385
|
+
emit: EmitFn<RuntimeEmitsOptions>;
|
|
350
386
|
expose: (exposed: Record<string, any>) => void;
|
|
351
|
-
}) =>
|
|
352
|
-
props?: ComponentObjectPropsOptions<Props>;
|
|
353
|
-
}): VaporElementConstructor<Props>;
|
|
354
|
-
export declare function defineVaporCustomElement<RuntimePropsOptions extends ComponentObjectPropsOptions = ComponentObjectPropsOptions, RuntimePropsKeys extends string = string, RuntimeEmitsOptions extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Slots extends StaticSlots = StaticSlots, InferredProps = string extends RuntimePropsKeys ? ComponentObjectPropsOptions extends RuntimePropsOptions ? {} : ExtractPropTypes<RuntimePropsOptions> : {
|
|
355
|
-
[key in RuntimePropsKeys]?: any;
|
|
356
|
-
}, ResolvedProps = InferredProps & EmitsToProps<RuntimeEmitsOptions>>(options: CustomElementOptions & {
|
|
357
|
-
props?: (RuntimePropsOptions & ThisType<void>) | RuntimePropsKeys[];
|
|
358
|
-
emits?: RuntimeEmitsOptions | RuntimeEmitsKeys[];
|
|
359
|
-
slots?: Slots;
|
|
360
|
-
setup?: (props: Readonly<InferredProps>, ctx: {
|
|
361
|
-
attrs: Record<string, any>;
|
|
362
|
-
slots: Slots;
|
|
363
|
-
emit: EmitFn<RuntimeEmitsOptions>;
|
|
364
|
-
expose: (exposed: Record<string, any>) => void;
|
|
365
|
-
}) => any;
|
|
387
|
+
}) => any;
|
|
366
388
|
} & ThisType<void>, extraOptions?: CustomElementOptions): VaporElementConstructor<ResolvedProps>;
|
|
367
389
|
export declare function defineVaporCustomElement<T extends DefineVaporComponent<any, any, any, any, any, any, any, any, any, any> | DefineVaporSetupFnComponent<any, any, any, any, any>>(options: T, extraOptions?: CustomElementOptions): VaporElementConstructor<T extends DefineVaporComponent<infer RuntimePropsOptions, any, any, any, any, any, any, any, any, any> ? ComponentObjectPropsOptions extends RuntimePropsOptions ? {} : ExtractPropTypes<RuntimePropsOptions> : T extends DefineVaporSetupFnComponent<infer P extends Record<string, any>, any, any, any, any> ? P : unknown>;
|
|
368
390
|
export declare const defineVaporSSRCustomElement: typeof defineVaporCustomElement;
|
|
369
391
|
type VaporInnerComponentDef = VaporComponent & CustomElementOptions;
|
|
370
392
|
export declare class VaporElement extends VueElementBase<ParentNode, VaporComponent, VaporInnerComponentDef> {
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
393
|
+
constructor(def: VaporInnerComponentDef, props?: Record<string, any> | undefined, createAppFn?: CreateAppFunction<ParentNode, VaporComponent>);
|
|
394
|
+
protected _needsHydration(): boolean;
|
|
395
|
+
protected _mount(def: VaporInnerComponentDef): void;
|
|
396
|
+
protected _update(): void;
|
|
397
|
+
protected _unmount(): void;
|
|
398
|
+
/**
|
|
399
|
+
* Only called when shadowRoot is false
|
|
400
|
+
*/
|
|
401
|
+
protected _updateSlotNodes(replacements: Map<Node, Node[]>): void;
|
|
402
|
+
private _createComponent;
|
|
381
403
|
}
|
|
382
|
-
|
|
404
|
+
//#endregion
|
|
405
|
+
//#region temp/packages/runtime-vapor/src/insertionState.d.ts
|
|
383
406
|
type InsertionParent = ParentNode & {
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
$lpn?: Node | null;
|
|
387
|
-
$lan?: Node | null;
|
|
388
|
-
$curIdx?: number;
|
|
407
|
+
$fc?: Node | null;
|
|
408
|
+
$llc?: Node | null;
|
|
389
409
|
};
|
|
390
410
|
/**
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
411
|
+
* This function is called before a block type that requires insertion
|
|
412
|
+
* (component, slot outlet, if, for) is created. The state is used for actual
|
|
413
|
+
* insertion on client-side render, and used for node adoption during hydration.
|
|
414
|
+
*/
|
|
395
415
|
export declare function setInsertionState(parent: ParentNode & {
|
|
396
|
-
|
|
397
|
-
}, anchor?: Node | 0 | null
|
|
398
|
-
|
|
399
|
-
|
|
416
|
+
$fc?: Node | null;
|
|
417
|
+
}, anchor?: Node | 0 | null, logicalIndex?: number, last?: boolean): void;
|
|
418
|
+
//#endregion
|
|
419
|
+
//#region temp/packages/runtime-vapor/src/dom/template.d.ts
|
|
400
420
|
export declare function template(html: string, root?: boolean, ns?: Namespace): () => Node & {
|
|
401
|
-
|
|
421
|
+
$root?: true;
|
|
402
422
|
};
|
|
403
|
-
|
|
423
|
+
//#endregion
|
|
424
|
+
//#region temp/packages/runtime-vapor/src/dom/node.d.ts
|
|
404
425
|
export declare function createTextNode(value?: string): Text;
|
|
405
|
-
declare
|
|
406
|
-
declare function
|
|
407
|
-
declare function
|
|
408
|
-
declare function
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
};
|
|
412
|
-
export declare const txt: DelegatedFunction<typeof _txt>;
|
|
413
|
-
export declare const child: DelegatedFunction<typeof _child>;
|
|
414
|
-
export declare const next: DelegatedFunction<typeof _next>;
|
|
415
|
-
export declare const nthChild: DelegatedFunction<typeof _nthChild>;
|
|
416
|
-
|
|
426
|
+
export declare function txt(node: ParentNode): Node;
|
|
427
|
+
export declare function child(node: InsertionParent, logicalIndex?: number): Node;
|
|
428
|
+
export declare function nthChild(node: InsertionParent, i: number): Node;
|
|
429
|
+
export declare function next(node: Node, logicalIndex?: number): Node;
|
|
430
|
+
//#endregion
|
|
431
|
+
//#region temp/packages/runtime-vapor/src/dom/prop.d.ts
|
|
417
432
|
type TargetElement = Element & {
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
433
|
+
$root?: true;
|
|
434
|
+
$html?: string;
|
|
435
|
+
$cls?: string;
|
|
436
|
+
$sty?: NormalizedStyle | string | undefined;
|
|
437
|
+
value?: string;
|
|
438
|
+
_value?: any;
|
|
424
439
|
};
|
|
425
440
|
export declare function setProp(el: any, key: string, value: any): void;
|
|
426
441
|
export declare function setAttr(el: any, key: string, value: any, isSVG?: boolean): void;
|
|
@@ -429,75 +444,90 @@ export declare function setClass(el: TargetElement, value: any, isSVG?: boolean)
|
|
|
429
444
|
export declare function setStyle(el: TargetElement, value: any): void;
|
|
430
445
|
export declare function setValue(el: TargetElement, value: any, forceHydrate?: boolean): void;
|
|
431
446
|
/**
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
447
|
+
* Only called on text nodes!
|
|
448
|
+
* Compiler should also ensure value passed here is already converted by
|
|
449
|
+
* `toDisplayString`
|
|
450
|
+
*/
|
|
436
451
|
export declare function setText(el: Text & {
|
|
437
|
-
|
|
452
|
+
$txt?: string;
|
|
438
453
|
}, value: string): void;
|
|
439
454
|
/**
|
|
440
|
-
|
|
441
|
-
|
|
455
|
+
* Used by setDynamicProps only, so need to guard with `toDisplayString`
|
|
456
|
+
*/
|
|
442
457
|
export declare function setElementText(el: Node & {
|
|
443
|
-
|
|
458
|
+
$txt?: string;
|
|
444
459
|
}, value: unknown): void;
|
|
445
460
|
export declare function setBlockText(block: Block & {
|
|
446
|
-
|
|
461
|
+
$txt?: string;
|
|
447
462
|
}, value: unknown): void;
|
|
448
463
|
export declare function setHtml(el: TargetElement, value: any): void;
|
|
449
464
|
export declare function setBlockHtml(block: Block & {
|
|
450
|
-
|
|
465
|
+
$html?: string;
|
|
451
466
|
}, value: any): void;
|
|
452
467
|
export declare function setDynamicProps(el: any, args: any[], isSVG?: boolean): void;
|
|
453
|
-
|
|
468
|
+
//#endregion
|
|
469
|
+
//#region temp/packages/runtime-vapor/src/dom/event.d.ts
|
|
454
470
|
export declare function on(el: Element, event: string, handler: (e: Event) => any | ((e: Event) => any)[], options?: AddEventListenerOptions & {
|
|
455
|
-
|
|
471
|
+
effect?: boolean;
|
|
456
472
|
}): void;
|
|
457
473
|
export declare function delegate(el: any, event: string, handler: (e: Event) => any): void;
|
|
458
474
|
export declare const delegateEvents: (...names: string[]) => void;
|
|
459
475
|
export declare function setDynamicEvents(el: HTMLElement, events: Record<string, (...args: any[]) => any>): void;
|
|
460
476
|
export declare function createInvoker(handler: (...args: any[]) => any): (...args: any[]) => any;
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
477
|
+
//#endregion
|
|
478
|
+
//#region temp/packages/runtime-vapor/src/apiCreateIf.d.ts
|
|
479
|
+
export declare function createIf(condition: () => any, b1: BlockFn, b2?: BlockFn, blockShape?: number, once?: boolean, index?: number): Block;
|
|
480
|
+
//#endregion
|
|
481
|
+
//#region temp/packages/runtime-vapor/src/apiCreateFragment.d.ts
|
|
464
482
|
/**
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
483
|
+
* Create a dynamic fragment keyed by a reactive value for Vapor transitions.
|
|
484
|
+
* The fragment is re-rendered when the key changes to trigger enter/leave
|
|
485
|
+
* animations.
|
|
486
|
+
*
|
|
487
|
+
* Example:
|
|
488
|
+
* <VaporTransition>
|
|
489
|
+
* <h1 :key="count">{{ count }}</h1>
|
|
490
|
+
* </VaporTransition>
|
|
491
|
+
*/
|
|
474
492
|
export declare function createKeyedFragment(key: () => any, render: BlockFn): Block;
|
|
475
|
-
|
|
493
|
+
//#endregion
|
|
494
|
+
//#region temp/packages/runtime-vapor/src/apiCreateFor.d.ts
|
|
476
495
|
type Source = any[] | Record<any, any> | number | Set<any> | Map<any, any>;
|
|
477
496
|
export declare const createFor: (src: () => Source, renderItem: (item: ShallowRef<any>, key: ShallowRef<any>, index: ShallowRef<number | undefined>) => Block, getKey?: (item: any, key: any, index?: number) => any, flags?: number, setup?: (_: {
|
|
478
|
-
|
|
497
|
+
createSelector: (source: () => any) => (cb: () => void) => void;
|
|
479
498
|
}) => void) => ForFragment;
|
|
480
499
|
export declare function createForSlots(rawSource: Source, getSlot: (item: any, key: any, index?: number) => DynamicSlot): DynamicSlot[];
|
|
481
500
|
export declare function getRestElement(val: any, keys: string[]): any;
|
|
482
501
|
export declare function getDefaultValue(val: any, defaultVal: any): any;
|
|
483
|
-
|
|
502
|
+
//#endregion
|
|
503
|
+
//#region temp/packages/runtime-vapor/src/helpers/useCssVars.d.ts
|
|
484
504
|
export declare function useVaporCssVars(getter: () => Record<string, string>): void;
|
|
485
|
-
|
|
505
|
+
//#endregion
|
|
506
|
+
//#region temp/packages/runtime-vapor/src/helpers/setKey.d.ts
|
|
507
|
+
export declare function setBlockKey(block: (Block & {
|
|
508
|
+
$key?: any;
|
|
509
|
+
}) | null | undefined, key: any): void;
|
|
510
|
+
//#endregion
|
|
511
|
+
//#region temp/packages/runtime-vapor/src/apiCreateDynamicComponent.d.ts
|
|
486
512
|
export declare function createDynamicComponent(getter: () => any, rawProps?: RawProps | null, rawSlots?: RawSlots | null, isSingleRoot?: boolean, once?: boolean): VaporFragment;
|
|
487
|
-
|
|
513
|
+
//#endregion
|
|
514
|
+
//#region temp/packages/runtime-vapor/src/apiSetupHelpers.d.ts
|
|
515
|
+
export declare function withAsyncContext(getAwaitable: () => any): [any, () => void];
|
|
516
|
+
//#endregion
|
|
517
|
+
//#region temp/packages/runtime-vapor/src/directives/vShow.d.ts
|
|
488
518
|
export declare function applyVShow(target: Block, source: () => any): void;
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
export declare const applyTextModel: VaporModelDirective<HTMLInputElement | HTMLTextAreaElement, 'trim' | 'number' | 'lazy'>;
|
|
519
|
+
//#endregion
|
|
520
|
+
//#region temp/packages/runtime-vapor/src/directives/vModel.d.ts
|
|
521
|
+
type VaporModelDirective<T extends HTMLElement = HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement, Modifiers extends string = string> = (el: T, get: () => any, set: (v: any) => void, modifiers?: { [key in Modifiers]?: true }) => void;
|
|
522
|
+
export declare const applyTextModel: VaporModelDirective<HTMLInputElement | HTMLTextAreaElement, "trim" | "number" | "lazy">;
|
|
494
523
|
export declare const applyCheckboxModel: VaporModelDirective<HTMLInputElement>;
|
|
495
524
|
export declare const applyRadioModel: VaporModelDirective<HTMLInputElement>;
|
|
496
|
-
export declare const applySelectModel: VaporModelDirective<HTMLSelectElement,
|
|
525
|
+
export declare const applySelectModel: VaporModelDirective<HTMLSelectElement, "number">;
|
|
497
526
|
export declare const applyDynamicModel: VaporModelDirective;
|
|
498
|
-
|
|
527
|
+
//#endregion
|
|
528
|
+
//#region temp/packages/runtime-vapor/src/components/Transition.d.ts
|
|
499
529
|
export declare const VaporTransition: FunctionalVaporComponent<TransitionProps>;
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
530
|
+
//#endregion
|
|
531
|
+
//#region temp/packages/runtime-vapor/src/components/TransitionGroup.d.ts
|
|
532
|
+
export declare const VaporTransitionGroup: DefineVaporComponent<{}, string, TransitionGroupProps>;
|
|
533
|
+
//#endregion
|