@vue/runtime-vapor 3.6.0-alpha.5 → 3.6.0-alpha.7
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 +144 -49
- package/dist/runtime-vapor.esm-bundler.js +1602 -1462
- package/package.json +4 -4
package/dist/runtime-vapor.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { VNode, TransitionHooks, TransitionState, TransitionProps, Plugin, SchedulerJob,
|
|
2
|
-
import { Ref, EffectScope, ReactiveEffect, ShallowRef } from '@vue/reactivity';
|
|
3
|
-
import { Namespace, NormalizedStyle } from '@vue/shared';
|
|
1
|
+
import { VNode, GenericComponentInstance, TransitionHooks, TransitionState, TransitionProps, Plugin, SchedulerJob, EmitsOptions, ComponentObjectPropsOptions, ExtractPropTypes, ReservedProps, AllowedComponentProps, ComponentCustomProps, EmitsToProps, ExtractDefaultPropTypes, EmitFn, ComponentTypeEmits, TypeEmitsToOptions, GenericAppContext, EffectScope as EffectScope$1, ShallowUnwrapRef, SuspenseBoundary, LifecycleHook, NormalizedPropsOptions, ObjectEmitsOptions, ComponentInternalOptions, AsyncComponentInternalOptions, ComponentPropsOptions, CreateAppFunction, AsyncComponentLoader, AsyncComponentOptions, DirectiveModifiers, CustomElementOptions, VueElementBase } from '@vue/runtime-dom';
|
|
2
|
+
import { Ref, EffectScope, ReactiveEffect, ComputedRef, ShallowRef } from '@vue/reactivity';
|
|
3
|
+
import { Prettify, IsKeyValues, Namespace, NormalizedStyle } from '@vue/shared';
|
|
4
4
|
|
|
5
5
|
type NodeRef = string | Ref | ((ref: Element | VaporComponentInstance, refs: Record<string, any>) => void);
|
|
6
6
|
type RefEl = Element | VaporComponentInstance;
|
|
@@ -13,12 +13,13 @@ export declare class VaporFragment<T extends Block = Block> implements Transitio
|
|
|
13
13
|
nodes: T;
|
|
14
14
|
vnode?: VNode | null;
|
|
15
15
|
anchor?: Node;
|
|
16
|
+
parentComponent?: GenericComponentInstance | null;
|
|
16
17
|
fallback?: BlockFn;
|
|
17
18
|
insert?: (parent: ParentNode, anchor: Node | null, transitionHooks?: TransitionHooks) => void;
|
|
18
19
|
remove?: (parent?: ParentNode, transitionHooks?: TransitionHooks) => void;
|
|
19
20
|
hydrate?: (...args: any[]) => void;
|
|
20
21
|
setRef?: (instance: VaporComponentInstance, ref: NodeRef, refFor: boolean, refKey: string | undefined) => void;
|
|
21
|
-
|
|
22
|
+
onUpdated?: ((nodes?: Block) => void)[];
|
|
22
23
|
constructor(nodes: T);
|
|
23
24
|
}
|
|
24
25
|
declare class ForFragment extends VaporFragment<Block[]> {
|
|
@@ -30,28 +31,30 @@ declare class DynamicFragment extends VaporFragment {
|
|
|
30
31
|
current?: BlockFn;
|
|
31
32
|
fallback?: BlockFn;
|
|
32
33
|
anchorLabel?: string;
|
|
34
|
+
attrs?: Record<string, any>;
|
|
35
|
+
setAsyncRef?: (instance: VaporComponentInstance) => void;
|
|
33
36
|
getScope?: (key: any) => EffectScope | undefined;
|
|
34
|
-
|
|
35
|
-
|
|
37
|
+
onBeforeTeardown?: ((oldKey: any, nodes: Block, scope: EffectScope) => boolean)[];
|
|
38
|
+
onBeforeMount?: ((newKey: any, nodes: Block, scope: EffectScope) => void)[];
|
|
39
|
+
slotOwner: VaporComponentInstance | null;
|
|
36
40
|
constructor(anchorLabel?: string);
|
|
37
41
|
update(render?: BlockFn, key?: any): void;
|
|
38
|
-
|
|
42
|
+
renderBranch(render: BlockFn | undefined, transition: VaporTransitionHooks | undefined, parent: ParentNode | null, instance: GenericComponentInstance | null): void;
|
|
39
43
|
hydrate: (isEmpty?: boolean) => void;
|
|
40
44
|
}
|
|
41
45
|
export declare function isFragment(val: NonNullable<unknown>): val is VaporFragment;
|
|
42
46
|
|
|
43
|
-
interface VaporTransitionHooks extends TransitionHooks {
|
|
47
|
+
export interface VaporTransitionHooks extends TransitionHooks {
|
|
44
48
|
state: TransitionState;
|
|
45
49
|
props: TransitionProps;
|
|
46
50
|
instance: VaporComponentInstance;
|
|
47
51
|
disabled?: boolean;
|
|
48
|
-
group?: boolean;
|
|
49
52
|
}
|
|
50
53
|
interface TransitionOptions {
|
|
51
54
|
$key?: any;
|
|
52
55
|
$transition?: VaporTransitionHooks;
|
|
53
56
|
}
|
|
54
|
-
type Block = Node | VaporFragment | DynamicFragment | VaporComponentInstance | Block[];
|
|
57
|
+
export type Block = Node | VaporFragment | DynamicFragment | VaporComponentInstance | Block[];
|
|
55
58
|
type BlockFn = (...args: any[]) => Block;
|
|
56
59
|
export declare function insert(block: Block, parent: ParentNode & {
|
|
57
60
|
$fc?: Node | null;
|
|
@@ -85,20 +88,24 @@ type RawSlots = Record<string, VaporSlot> & {
|
|
|
85
88
|
$?: DynamicSlotSource[];
|
|
86
89
|
};
|
|
87
90
|
type StaticSlots = Record<string, VaporSlot>;
|
|
88
|
-
type VaporSlot = BlockFn;
|
|
91
|
+
export type VaporSlot = BlockFn;
|
|
89
92
|
type DynamicSlot = {
|
|
90
93
|
name: string;
|
|
91
94
|
fn: VaporSlot;
|
|
92
95
|
};
|
|
93
|
-
type DynamicSlotFn = () => DynamicSlot | DynamicSlot[]
|
|
96
|
+
type DynamicSlotFn = (() => DynamicSlot | DynamicSlot[]) & {
|
|
97
|
+
_cache?: ComputedRef<DynamicSlot | DynamicSlot[]>;
|
|
98
|
+
};
|
|
94
99
|
type DynamicSlotSource = StaticSlots | DynamicSlotFn;
|
|
95
100
|
/**
|
|
96
|
-
* Wrap a slot function to
|
|
97
|
-
*
|
|
98
|
-
*
|
|
101
|
+
* Wrap a slot function to track the slot owner.
|
|
102
|
+
*
|
|
103
|
+
* This ensures:
|
|
104
|
+
* 1. createSlot gets rawSlots from the correct component (slot owner)
|
|
105
|
+
* 2. Elements inherit the slot owner's scopeId
|
|
99
106
|
*/
|
|
100
107
|
export declare function withVaporCtx(fn: Function): BlockFn;
|
|
101
|
-
export declare function createSlot(name: string | (() => string), rawProps?: LooseRawProps | null, fallback?: VaporSlot, noSlotted?: boolean): Block;
|
|
108
|
+
export declare function createSlot(name: string | (() => string), rawProps?: LooseRawProps | null, fallback?: VaporSlot, noSlotted?: boolean, once?: boolean): Block;
|
|
102
109
|
|
|
103
110
|
export declare const VaporTeleportImpl: {
|
|
104
111
|
name: string;
|
|
@@ -118,32 +125,89 @@ declare class TeleportFragment extends VaporFragment {
|
|
|
118
125
|
placeholder?: Node;
|
|
119
126
|
mountContainer?: ParentNode | null;
|
|
120
127
|
mountAnchor?: Node | null;
|
|
121
|
-
parentComponent: GenericComponentInstance;
|
|
122
128
|
constructor(props: LooseRawProps, slots: LooseRawSlots);
|
|
123
129
|
get parent(): ParentNode | null;
|
|
124
130
|
private initChildren;
|
|
125
131
|
private handleChildrenUpdate;
|
|
132
|
+
private mount;
|
|
133
|
+
private mountToTarget;
|
|
126
134
|
private handlePropsUpdate;
|
|
127
135
|
insert: (container: ParentNode, anchor: Node | null) => void;
|
|
128
136
|
remove: (parent?: ParentNode | undefined) => void;
|
|
129
137
|
private hydrateDisabledTeleport;
|
|
130
|
-
private
|
|
138
|
+
private mountChildren;
|
|
131
139
|
hydrate: () => void;
|
|
132
140
|
}
|
|
133
141
|
|
|
134
|
-
type
|
|
135
|
-
type
|
|
136
|
-
type
|
|
142
|
+
export type VaporPublicProps = ReservedProps & AllowedComponentProps & ComponentCustomProps;
|
|
143
|
+
export type VaporRenderResult<T = Block> = VNode | T | VaporRenderResult<T>[];
|
|
144
|
+
type VaporComponentInstanceConstructor<T extends VaporComponentInstance> = {
|
|
145
|
+
__isFragment?: never;
|
|
146
|
+
__isTeleport?: never;
|
|
147
|
+
__isSuspense?: never;
|
|
148
|
+
new (props?: T['props']): T;
|
|
149
|
+
};
|
|
150
|
+
export type DefineVaporComponent<RuntimePropsOptions = {}, RuntimePropsKeys extends string = string, 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, InferredProps = string extends RuntimePropsKeys ? ComponentObjectPropsOptions extends RuntimePropsOptions ? {} : ExtractPropTypes<RuntimePropsOptions> : {
|
|
151
|
+
[key in RuntimePropsKeys]?: any;
|
|
152
|
+
}, 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>> & ObjectVaporComponent<RuntimePropsOptions | RuntimePropsKeys[], Emits, RuntimeEmitsKeys, Slots, Exposed>;
|
|
153
|
+
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 (props?: ResolvedProps) => VaporComponentInstance<ResolvedProps, Emits, Slots, Exposed, TypeBlock>;
|
|
154
|
+
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: {
|
|
155
|
+
emit: EmitFn<Emits>;
|
|
156
|
+
slots: Slots;
|
|
157
|
+
attrs: Record<string, any>;
|
|
158
|
+
expose: (exposed: Exposed) => void;
|
|
159
|
+
}) => VaporRenderResult<TypeBlock> | void, extraOptions?: ObjectVaporComponent<(keyof Props)[], Emits, RuntimeEmitsKeys, Slots, Exposed> & ThisType<void>): DefineVaporSetupFnComponent<Props, Emits, Slots, Exposed, TypeBlock>;
|
|
160
|
+
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: {
|
|
161
|
+
emit: EmitFn<Emits>;
|
|
162
|
+
slots: Slots;
|
|
163
|
+
attrs: Record<string, any>;
|
|
164
|
+
expose: (exposed: Exposed) => void;
|
|
165
|
+
}) => VaporRenderResult<TypeBlock> | void, extraOptions?: ObjectVaporComponent<ComponentObjectPropsOptions<Props>, Emits, RuntimeEmitsKeys, Slots, Exposed> & ThisType<void>): DefineVaporSetupFnComponent<Props, Emits, Slots, Exposed, TypeBlock>;
|
|
166
|
+
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> : {
|
|
167
|
+
[key in RuntimePropsKeys]?: any;
|
|
168
|
+
}, TypeRefs extends Record<string, unknown> = {}, TypeBlock extends Block = Block>(options: ObjectVaporComponent<RuntimePropsOptions | RuntimePropsKeys[], ResolvedEmits, RuntimeEmitsKeys, Slots, Exposed, TypeBlock, InferredProps> & {
|
|
169
|
+
/**
|
|
170
|
+
* @private for language-tools use only
|
|
171
|
+
*/
|
|
172
|
+
__typeProps?: TypeProps;
|
|
173
|
+
/**
|
|
174
|
+
* @private for language-tools use only
|
|
175
|
+
*/
|
|
176
|
+
__typeEmits?: TypeEmits;
|
|
177
|
+
/**
|
|
178
|
+
* @private for language-tools use only
|
|
179
|
+
*/
|
|
180
|
+
__typeRefs?: TypeRefs;
|
|
181
|
+
/**
|
|
182
|
+
* @private for language-tools use only
|
|
183
|
+
*/
|
|
184
|
+
__typeEl?: TypeBlock;
|
|
185
|
+
} & ThisType<void>): DefineVaporComponent<RuntimePropsOptions, RuntimePropsKeys, ResolvedEmits, RuntimeEmitsKeys, Slots, Exposed extends Block ? Record<string, any> : Exposed, TypeBlock, TypeRefs, unknown extends TypeProps ? true : false, InferredProps>;
|
|
186
|
+
|
|
187
|
+
export type VaporComponent = FunctionalVaporComponent | ObjectVaporComponent | DefineVaporComponent;
|
|
188
|
+
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: {
|
|
189
|
+
emit: EmitFn<Emits>;
|
|
190
|
+
slots: Slots;
|
|
191
|
+
attrs: Record<string, any>;
|
|
192
|
+
expose: <T extends Record<string, any> = Exposed>(exposed: T) => void;
|
|
193
|
+
}) => VaporRenderResult) & Omit<ObjectVaporComponent<ComponentPropsOptions<Props>, Emits, string, Slots>, 'setup'> & {
|
|
137
194
|
displayName?: string;
|
|
138
195
|
} & SharedInternalOptions;
|
|
139
|
-
interface ObjectVaporComponent extends ComponentInternalOptions, AsyncComponentInternalOptions<ObjectVaporComponent, VaporComponentInstance>, SharedInternalOptions {
|
|
140
|
-
setup?: VaporSetupFn;
|
|
196
|
+
interface ObjectVaporComponent<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<ObjectVaporComponent, VaporComponentInstance>, SharedInternalOptions {
|
|
141
197
|
inheritAttrs?: boolean;
|
|
142
|
-
props?:
|
|
143
|
-
emits?:
|
|
144
|
-
|
|
198
|
+
props?: Props;
|
|
199
|
+
emits?: Emits | RuntimeEmitsKeys[];
|
|
200
|
+
slots?: Slots;
|
|
201
|
+
setup?: (props: Readonly<InferredProps>, ctx: {
|
|
202
|
+
emit: EmitFn<Emits>;
|
|
203
|
+
slots: Slots;
|
|
204
|
+
attrs: Record<string, any>;
|
|
205
|
+
expose: <T extends Record<string, any> = Exposed>(exposed: T) => void;
|
|
206
|
+
}) => TypeBlock | Exposed | Promise<Exposed> | void;
|
|
207
|
+
render?(ctx: Exposed extends Block ? undefined : ShallowUnwrapRef<Exposed>, props: Readonly<InferredProps>, emit: EmitFn<Emits>, attrs: any, slots: Slots): VaporRenderResult<TypeBlock> | void;
|
|
145
208
|
name?: string;
|
|
146
209
|
vapor?: boolean;
|
|
210
|
+
components?: Record<string, VaporComponent>;
|
|
147
211
|
}
|
|
148
212
|
interface SharedInternalOptions {
|
|
149
213
|
/**
|
|
@@ -168,33 +232,36 @@ type LooseRawSlots = Record<string, VaporSlot | DynamicSlotSource[]> & {
|
|
|
168
232
|
$?: DynamicSlotSource[];
|
|
169
233
|
};
|
|
170
234
|
export declare function createComponent(component: VaporComponent, rawProps?: LooseRawProps | null, rawSlots?: LooseRawSlots | null, isSingleRoot?: boolean, once?: boolean, appContext?: GenericAppContext): VaporComponentInstance;
|
|
171
|
-
declare class VaporComponentInstance implements GenericComponentInstance {
|
|
235
|
+
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 {
|
|
172
236
|
vapor: true;
|
|
173
237
|
uid: number;
|
|
174
238
|
type: VaporComponent;
|
|
175
239
|
root: GenericComponentInstance | null;
|
|
176
240
|
parent: GenericComponentInstance | null;
|
|
177
241
|
appContext: GenericAppContext;
|
|
178
|
-
block:
|
|
242
|
+
block: TypeBlock;
|
|
179
243
|
scope: EffectScope$1;
|
|
180
244
|
rawProps: RawProps;
|
|
181
245
|
rawSlots: RawSlots;
|
|
182
|
-
props:
|
|
246
|
+
props: Readonly<Props>;
|
|
183
247
|
attrs: Record<string, any>;
|
|
184
248
|
propsDefaults: Record<string, any> | null;
|
|
185
|
-
slots:
|
|
249
|
+
slots: Slots;
|
|
186
250
|
scopeId?: string | null;
|
|
187
251
|
rawPropsRef?: ShallowRef<any>;
|
|
188
252
|
rawSlotsRef?: ShallowRef<any>;
|
|
189
|
-
emit: EmitFn
|
|
253
|
+
emit: EmitFn<Emits>;
|
|
190
254
|
emitted: Record<string, boolean> | null;
|
|
191
|
-
expose: (
|
|
192
|
-
exposed:
|
|
193
|
-
exposeProxy:
|
|
194
|
-
refs:
|
|
255
|
+
expose: (<T extends Record<string, any> = Exposed>(exposed: T) => void) & string[];
|
|
256
|
+
exposed: Exposed | null;
|
|
257
|
+
exposeProxy: Prettify<ShallowUnwrapRef<Exposed>> | null;
|
|
258
|
+
refs: TypeRefs;
|
|
195
259
|
provides: Record<string, any>;
|
|
196
260
|
ids: [string, number, number];
|
|
197
261
|
suspense: SuspenseBoundary | null;
|
|
262
|
+
suspenseId: number;
|
|
263
|
+
asyncDep: Promise<any> | null;
|
|
264
|
+
asyncResolved: boolean;
|
|
198
265
|
renderEffects?: RenderEffect[];
|
|
199
266
|
hasFallthrough: boolean;
|
|
200
267
|
shapeFlag?: number;
|
|
@@ -216,7 +283,7 @@ declare class VaporComponentInstance implements GenericComponentInstance {
|
|
|
216
283
|
rtc?: LifecycleHook;
|
|
217
284
|
ec?: LifecycleHook;
|
|
218
285
|
sp?: LifecycleHook<() => Promise<unknown>>;
|
|
219
|
-
setupState?:
|
|
286
|
+
setupState?: Exposed extends Block ? undefined : ShallowUnwrapRef<Exposed>;
|
|
220
287
|
devtoolsRawSetupState?: any;
|
|
221
288
|
hmrRerender?: () => void;
|
|
222
289
|
hmrReload?: (newComp: VaporComponent) => void;
|
|
@@ -224,7 +291,13 @@ declare class VaporComponentInstance implements GenericComponentInstance {
|
|
|
224
291
|
propsOptions?: NormalizedPropsOptions;
|
|
225
292
|
emitsOptions?: ObjectEmitsOptions | null;
|
|
226
293
|
isSingleRoot?: boolean;
|
|
227
|
-
|
|
294
|
+
/**
|
|
295
|
+
* dev only flag to track whether $attrs was used during render.
|
|
296
|
+
* If $attrs was used during render then the warning for failed attrs
|
|
297
|
+
* fallthrough can be suppressed.
|
|
298
|
+
*/
|
|
299
|
+
accessedAttrs: boolean;
|
|
300
|
+
constructor(comp: VaporComponent, rawProps?: RawProps | null, rawSlots?: RawSlots | null, appContext?: GenericAppContext, once?: boolean);
|
|
228
301
|
/**
|
|
229
302
|
* Expose `getKeysFromRawProps` on the instance so it can be used in code
|
|
230
303
|
* paths where it's needed, e.g. `useModel`
|
|
@@ -243,9 +316,6 @@ export declare function createPlainElement(comp: string, rawProps?: LooseRawProp
|
|
|
243
316
|
export declare const createVaporApp: CreateAppFunction<ParentNode, VaporComponent>;
|
|
244
317
|
export declare const createVaporSSRApp: CreateAppFunction<ParentNode, VaporComponent>;
|
|
245
318
|
|
|
246
|
-
/*! #__NO_SIDE_EFFECTS__ */
|
|
247
|
-
export declare function defineVaporComponent(comp: VaporComponent, extraOptions?: Omit<ObjectVaporComponent, 'setup'>): VaporComponent;
|
|
248
|
-
|
|
249
319
|
export declare function defineVaporAsyncComponent<T extends VaporComponent>(source: AsyncComponentLoader<T> | AsyncComponentOptions<T>): T;
|
|
250
320
|
|
|
251
321
|
export type VaporDirective = (node: Element | VaporComponentInstance, value?: () => any, argument?: string, modifiers?: DirectiveModifiers) => (() => void) | void;
|
|
@@ -259,17 +329,42 @@ export declare function withVaporDirectives(node: Element | VaporComponentInstan
|
|
|
259
329
|
|
|
260
330
|
export declare const VaporKeepAliveImpl: ObjectVaporComponent;
|
|
261
331
|
|
|
262
|
-
type VaporElementConstructor<P = {}> = {
|
|
332
|
+
export type VaporElementConstructor<P = {}> = {
|
|
263
333
|
new (initialProps?: Record<string, any>): VaporElement & P;
|
|
264
334
|
};
|
|
265
|
-
export declare function defineVaporCustomElement(
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
335
|
+
export declare function defineVaporCustomElement<Props, RawBindings = object>(setup: (props: Props, ctx: {
|
|
336
|
+
attrs: Record<string, any>;
|
|
337
|
+
slots: StaticSlots;
|
|
338
|
+
emit: EmitFn;
|
|
339
|
+
expose: (exposed: Record<string, any>) => void;
|
|
340
|
+
}) => RawBindings | VaporRenderResult, options?: Pick<ObjectVaporComponent, 'name' | 'inheritAttrs' | 'emits'> & CustomElementOptions & {
|
|
341
|
+
props?: (keyof Props)[];
|
|
342
|
+
}): VaporElementConstructor<Props>;
|
|
343
|
+
export declare function defineVaporCustomElement<Props, RawBindings = object>(setup: (props: Props, ctx: {
|
|
344
|
+
attrs: Record<string, any>;
|
|
345
|
+
slots: StaticSlots;
|
|
346
|
+
emit: EmitFn;
|
|
347
|
+
expose: (exposed: Record<string, any>) => void;
|
|
348
|
+
}) => RawBindings | VaporRenderResult, options?: Pick<ObjectVaporComponent, 'name' | 'inheritAttrs' | 'emits'> & CustomElementOptions & {
|
|
349
|
+
props?: ComponentObjectPropsOptions<Props>;
|
|
350
|
+
}): VaporElementConstructor<Props>;
|
|
351
|
+
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> : {
|
|
352
|
+
[key in RuntimePropsKeys]?: any;
|
|
353
|
+
}, ResolvedProps = InferredProps & EmitsToProps<RuntimeEmitsOptions>>(options: CustomElementOptions & {
|
|
354
|
+
props?: (RuntimePropsOptions & ThisType<void>) | RuntimePropsKeys[];
|
|
355
|
+
emits?: RuntimeEmitsOptions | RuntimeEmitsKeys[];
|
|
356
|
+
slots?: Slots;
|
|
357
|
+
setup?: (props: Readonly<InferredProps>, ctx: {
|
|
358
|
+
attrs: Record<string, any>;
|
|
359
|
+
slots: Slots;
|
|
360
|
+
emit: EmitFn<RuntimeEmitsOptions>;
|
|
361
|
+
expose: (exposed: Record<string, any>) => void;
|
|
362
|
+
}) => any;
|
|
363
|
+
} & ThisType<void>, extraOptions?: CustomElementOptions): VaporElementConstructor<ResolvedProps>;
|
|
364
|
+
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>;
|
|
270
365
|
export declare const defineVaporSSRCustomElement: typeof defineVaporCustomElement;
|
|
271
366
|
type VaporInnerComponentDef = VaporComponent & CustomElementOptions;
|
|
272
|
-
declare class VaporElement extends VueElementBase<ParentNode, VaporComponent, VaporInnerComponentDef> {
|
|
367
|
+
export declare class VaporElement extends VueElementBase<ParentNode, VaporComponent, VaporInnerComponentDef> {
|
|
273
368
|
constructor(def: VaporInnerComponentDef, props?: Record<string, any> | undefined, createAppFn?: CreateAppFunction<ParentNode, VaporComponent>);
|
|
274
369
|
protected _needsHydration(): boolean;
|
|
275
370
|
protected _mount(def: VaporInnerComponentDef): void;
|
|
@@ -353,7 +448,7 @@ export declare function setBlockHtml(block: Block & {
|
|
|
353
448
|
}, value: any): void;
|
|
354
449
|
export declare function setDynamicProps(el: any, args: any[], isSVG?: boolean): void;
|
|
355
450
|
|
|
356
|
-
export declare function on(el: Element, event: string, handler: (e: Event) => any, options?: AddEventListenerOptions & {
|
|
451
|
+
export declare function on(el: Element, event: string, handler: (e: Event) => any | ((e: Event) => any)[], options?: AddEventListenerOptions & {
|
|
357
452
|
effect?: boolean;
|
|
358
453
|
}): void;
|
|
359
454
|
export declare function delegate(el: any, event: string, handler: (e: Event) => any): void;
|
|
@@ -388,7 +483,7 @@ export declare const applyRadioModel: VaporModelDirective<HTMLInputElement>;
|
|
|
388
483
|
export declare const applySelectModel: VaporModelDirective<HTMLSelectElement, 'number'>;
|
|
389
484
|
export declare const applyDynamicModel: VaporModelDirective;
|
|
390
485
|
|
|
391
|
-
export declare const VaporTransition: FunctionalVaporComponent
|
|
486
|
+
export declare const VaporTransition: FunctionalVaporComponent<TransitionProps>;
|
|
392
487
|
|
|
393
488
|
export declare const VaporTransitionGroup: ObjectVaporComponent;
|
|
394
489
|
|