1 | import { computed as computed$1, Ref, OnCleanup, WatchStopHandle, ShallowUnwrapRef, UnwrapNestedRefs, DebuggerEvent, ComputedGetter, WritableComputedOptions, WatchCallback, ReactiveEffect, DebuggerOptions, WatchEffect, WatchHandle, WatchSource, ReactiveMarker, ShallowRef, WatchErrorCodes, reactive } from '@vue/reactivity';
|
---|
2 | export { ComputedGetter, ComputedRef, ComputedSetter, CustomRefFactory, DebuggerEvent, DebuggerEventExtraInfo, DebuggerOptions, DeepReadonly, EffectScheduler, EffectScope, MaybeRef, MaybeRefOrGetter, Raw, Reactive, ReactiveEffect, ReactiveEffectOptions, ReactiveEffectRunner, ReactiveFlags, Ref, ShallowReactive, ShallowRef, ShallowUnwrapRef, ToRef, ToRefs, TrackOpTypes, TriggerOpTypes, UnwrapNestedRefs, UnwrapRef, WatchCallback, WatchEffect, WatchHandle, WatchSource, WatchStopHandle, WritableComputedOptions, WritableComputedRef, customRef, effect, effectScope, getCurrentScope, getCurrentWatcher, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, onScopeDispose, onWatcherCleanup, proxyRefs, reactive, readonly, ref, shallowReactive, shallowReadonly, shallowRef, stop, toRaw, toRef, toRefs, toValue, triggerRef, unref } from '@vue/reactivity';
|
---|
3 | import { IfAny, Prettify, LooseRequired, UnionToIntersection, OverloadParameters, IsKeyValues } from '@vue/shared';
|
---|
4 | export { camelize, capitalize, normalizeClass, normalizeProps, normalizeStyle, toDisplayString, toHandlerKey } from '@vue/shared';
|
---|
5 |
|
---|
6 | export declare const computed: typeof computed$1;
|
---|
7 |
|
---|
8 | export type Slot<T extends any = any> = (...args: IfAny<T, any[], [T] | (T extends undefined ? [] : never)>) => VNode[];
|
---|
9 | type InternalSlots = {
|
---|
10 | [name: string]: Slot | undefined;
|
---|
11 | };
|
---|
12 | export type Slots = Readonly<InternalSlots>;
|
---|
13 | declare const SlotSymbol: unique symbol;
|
---|
14 | export type SlotsType<T extends Record<string, any> = Record<string, any>> = {
|
---|
15 | [SlotSymbol]?: T;
|
---|
16 | };
|
---|
17 | type StrictUnwrapSlotsType<S extends SlotsType, T = NonNullable<S[typeof SlotSymbol]>> = [keyof S] extends [never] ? Slots : Readonly<T> & T;
|
---|
18 | type UnwrapSlotsType<S extends SlotsType, T = NonNullable<S[typeof SlotSymbol]>> = [keyof S] extends [never] ? Slots : Readonly<Prettify<{
|
---|
19 | [K in keyof T]: NonNullable<T[K]> extends (...args: any[]) => any ? T[K] : Slot<T[K]>;
|
---|
20 | }>>;
|
---|
21 | type RawSlots = {
|
---|
22 | [name: string]: unknown;
|
---|
23 | $stable?: boolean;
|
---|
24 | };
|
---|
25 |
|
---|
26 | declare enum SchedulerJobFlags {
|
---|
27 | QUEUED = 1,
|
---|
28 | PRE = 2,
|
---|
29 | /**
|
---|
30 | * Indicates whether the effect is allowed to recursively trigger itself
|
---|
31 | * when managed by the scheduler.
|
---|
32 | *
|
---|
33 | * By default, a job cannot trigger itself because some built-in method calls,
|
---|
34 | * e.g. Array.prototype.push actually performs reads as well (#1740) which
|
---|
35 | * can lead to confusing infinite loops.
|
---|
36 | * The allowed cases are component update functions and watch callbacks.
|
---|
37 | * Component update functions may update child component props, which in turn
|
---|
38 | * trigger flush: "pre" watch callbacks that mutates state that the parent
|
---|
39 | * relies on (#1801). Watch callbacks doesn't track its dependencies so if it
|
---|
40 | * triggers itself again, it's likely intentional and it is the user's
|
---|
41 | * responsibility to perform recursive state mutation that eventually
|
---|
42 | * stabilizes (#1727).
|
---|
43 | */
|
---|
44 | ALLOW_RECURSE = 4,
|
---|
45 | DISPOSED = 8
|
---|
46 | }
|
---|
47 | interface SchedulerJob extends Function {
|
---|
48 | id?: number;
|
---|
49 | /**
|
---|
50 | * flags can technically be undefined, but it can still be used in bitwise
|
---|
51 | * operations just like 0.
|
---|
52 | */
|
---|
53 | flags?: SchedulerJobFlags;
|
---|
54 | /**
|
---|
55 | * Attached by renderer.ts when setting up a component's render effect
|
---|
56 | * Used to obtain component information when reporting max recursive updates.
|
---|
57 | */
|
---|
58 | i?: ComponentInternalInstance;
|
---|
59 | }
|
---|
60 | type SchedulerJobs = SchedulerJob | SchedulerJob[];
|
---|
61 | export declare function nextTick<T = void, R = void>(this: T, fn?: (this: T) => R): Promise<Awaited<R>>;
|
---|
62 | export declare function queuePostFlushCb(cb: SchedulerJobs): void;
|
---|
63 |
|
---|
64 | export type ComponentPropsOptions<P = Data> = ComponentObjectPropsOptions<P> | string[];
|
---|
65 | export type ComponentObjectPropsOptions<P = Data> = {
|
---|
66 | [K in keyof P]: Prop<P[K]> | null;
|
---|
67 | };
|
---|
68 | export type Prop<T, D = T> = PropOptions<T, D> | PropType<T>;
|
---|
69 | type DefaultFactory<T> = (props: Data) => T | null | undefined;
|
---|
70 | interface PropOptions<T = any, D = T> {
|
---|
71 | type?: PropType<T> | true | null;
|
---|
72 | required?: boolean;
|
---|
73 | default?: D | DefaultFactory<D> | null | undefined | object;
|
---|
74 | validator?(value: unknown, props: Data): boolean;
|
---|
75 | }
|
---|
76 | export type PropType<T> = PropConstructor<T> | (PropConstructor<T> | null)[];
|
---|
77 | type PropConstructor<T = any> = {
|
---|
78 | new (...args: any[]): T & {};
|
---|
79 | } | {
|
---|
80 | (): T;
|
---|
81 | } | PropMethod<T>;
|
---|
82 | type PropMethod<T, TConstructor = any> = [T] extends [
|
---|
83 | ((...args: any) => any) | undefined
|
---|
84 | ] ? {
|
---|
85 | new (): TConstructor;
|
---|
86 | (): T;
|
---|
87 | readonly prototype: TConstructor;
|
---|
88 | } : never;
|
---|
89 | type RequiredKeys<T> = {
|
---|
90 | [K in keyof T]: T[K] extends {
|
---|
91 | required: true;
|
---|
92 | } | {
|
---|
93 | default: any;
|
---|
94 | } | BooleanConstructor | {
|
---|
95 | type: BooleanConstructor;
|
---|
96 | } ? T[K] extends {
|
---|
97 | default: undefined | (() => undefined);
|
---|
98 | } ? never : K : never;
|
---|
99 | }[keyof T];
|
---|
100 | type OptionalKeys<T> = Exclude<keyof T, RequiredKeys<T>>;
|
---|
101 | type DefaultKeys<T> = {
|
---|
102 | [K in keyof T]: T[K] extends {
|
---|
103 | default: any;
|
---|
104 | } | BooleanConstructor | {
|
---|
105 | type: BooleanConstructor;
|
---|
106 | } ? T[K] extends {
|
---|
107 | type: BooleanConstructor;
|
---|
108 | required: true;
|
---|
109 | } ? never : K : never;
|
---|
110 | }[keyof T];
|
---|
111 | type InferPropType<T, NullAsAny = true> = [T] extends [null] ? NullAsAny extends true ? any : null : [T] extends [{
|
---|
112 | type: null | true;
|
---|
113 | }] ? any : [T] extends [ObjectConstructor | {
|
---|
114 | type: ObjectConstructor;
|
---|
115 | }] ? Record<string, any> : [T] extends [BooleanConstructor | {
|
---|
116 | type: BooleanConstructor;
|
---|
117 | }] ? boolean : [T] extends [DateConstructor | {
|
---|
118 | type: DateConstructor;
|
---|
119 | }] ? Date : [T] extends [(infer U)[] | {
|
---|
120 | type: (infer U)[];
|
---|
121 | }] ? U extends DateConstructor ? Date | InferPropType<U, false> : InferPropType<U, false> : [T] extends [Prop<infer V, infer D>] ? unknown extends V ? keyof V extends never ? IfAny<V, V, D> : V : V : T;
|
---|
122 | /**
|
---|
123 | * Extract prop types from a runtime props options object.
|
---|
124 | * The extracted types are **internal** - i.e. the resolved props received by
|
---|
125 | * the component.
|
---|
126 | * - Boolean props are always present
|
---|
127 | * - Props with default values are always present
|
---|
128 | *
|
---|
129 | * To extract accepted props from the parent, use {@link ExtractPublicPropTypes}.
|
---|
130 | */
|
---|
131 | export type ExtractPropTypes<O> = {
|
---|
132 | [K in keyof Pick<O, RequiredKeys<O>>]: InferPropType<O[K]>;
|
---|
133 | } & {
|
---|
134 | [K in keyof Pick<O, OptionalKeys<O>>]?: InferPropType<O[K]>;
|
---|
135 | };
|
---|
136 | type PublicRequiredKeys<T> = {
|
---|
137 | [K in keyof T]: T[K] extends {
|
---|
138 | required: true;
|
---|
139 | } ? K : never;
|
---|
140 | }[keyof T];
|
---|
141 | type PublicOptionalKeys<T> = Exclude<keyof T, PublicRequiredKeys<T>>;
|
---|
142 | /**
|
---|
143 | * Extract prop types from a runtime props options object.
|
---|
144 | * The extracted types are **public** - i.e. the expected props that can be
|
---|
145 | * passed to component.
|
---|
146 | */
|
---|
147 | export type ExtractPublicPropTypes<O> = {
|
---|
148 | [K in keyof Pick<O, PublicRequiredKeys<O>>]: InferPropType<O[K]>;
|
---|
149 | } & {
|
---|
150 | [K in keyof Pick<O, PublicOptionalKeys<O>>]?: InferPropType<O[K]>;
|
---|
151 | };
|
---|
152 | export type ExtractDefaultPropTypes<O> = O extends object ? {
|
---|
153 | [K in keyof Pick<O, DefaultKeys<O>>]: InferPropType<O[K]>;
|
---|
154 | } : {};
|
---|
155 |
|
---|
156 | /**
|
---|
157 | * Vue `<script setup>` compiler macro for declaring component props. The
|
---|
158 | * expected argument is the same as the component `props` option.
|
---|
159 | *
|
---|
160 | * Example runtime declaration:
|
---|
161 | * ```js
|
---|
162 | * // using Array syntax
|
---|
163 | * const props = defineProps(['foo', 'bar'])
|
---|
164 | * // using Object syntax
|
---|
165 | * const props = defineProps({
|
---|
166 | * foo: String,
|
---|
167 | * bar: {
|
---|
168 | * type: Number,
|
---|
169 | * required: true
|
---|
170 | * }
|
---|
171 | * })
|
---|
172 | * ```
|
---|
173 | *
|
---|
174 | * Equivalent type-based declaration:
|
---|
175 | * ```ts
|
---|
176 | * // will be compiled into equivalent runtime declarations
|
---|
177 | * const props = defineProps<{
|
---|
178 | * foo?: string
|
---|
179 | * bar: number
|
---|
180 | * }>()
|
---|
181 | * ```
|
---|
182 | *
|
---|
183 | * @see {@link https://vuejs.org/api/sfc-script-setup.html#defineprops-defineemits}
|
---|
184 | *
|
---|
185 | * This is only usable inside `<script setup>`, is compiled away in the
|
---|
186 | * output and should **not** be actually called at runtime.
|
---|
187 | */
|
---|
188 | export declare function defineProps<PropNames extends string = string>(props: PropNames[]): Prettify<Readonly<{
|
---|
189 | [key in PropNames]?: any;
|
---|
190 | }>>;
|
---|
191 | export declare function defineProps<PP extends ComponentObjectPropsOptions = ComponentObjectPropsOptions>(props: PP): Prettify<Readonly<ExtractPropTypes<PP>>>;
|
---|
192 | export declare function defineProps<TypeProps>(): DefineProps<LooseRequired<TypeProps>, BooleanKey<TypeProps>>;
|
---|
193 | export type DefineProps<T, BKeys extends keyof T> = Readonly<T> & {
|
---|
194 | readonly [K in BKeys]-?: boolean;
|
---|
195 | };
|
---|
196 | type BooleanKey<T, K extends keyof T = keyof T> = K extends any ? [T[K]] extends [boolean | undefined] ? K : never : never;
|
---|
197 | /**
|
---|
198 | * Vue `<script setup>` compiler macro for declaring a component's emitted
|
---|
199 | * events. The expected argument is the same as the component `emits` option.
|
---|
200 | *
|
---|
201 | * Example runtime declaration:
|
---|
202 | * ```js
|
---|
203 | * const emit = defineEmits(['change', 'update'])
|
---|
204 | * ```
|
---|
205 | *
|
---|
206 | * Example type-based declaration:
|
---|
207 | * ```ts
|
---|
208 | * const emit = defineEmits<{
|
---|
209 | * // <eventName>: <expected arguments>
|
---|
210 | * change: []
|
---|
211 | * update: [value: number] // named tuple syntax
|
---|
212 | * }>()
|
---|
213 | *
|
---|
214 | * emit('change')
|
---|
215 | * emit('update', 1)
|
---|
216 | * ```
|
---|
217 | *
|
---|
218 | * This is only usable inside `<script setup>`, is compiled away in the
|
---|
219 | * output and should **not** be actually called at runtime.
|
---|
220 | *
|
---|
221 | * @see {@link https://vuejs.org/api/sfc-script-setup.html#defineprops-defineemits}
|
---|
222 | */
|
---|
223 | export declare function defineEmits<EE extends string = string>(emitOptions: EE[]): EmitFn<EE[]>;
|
---|
224 | export declare function defineEmits<E extends EmitsOptions = EmitsOptions>(emitOptions: E): EmitFn<E>;
|
---|
225 | export declare function defineEmits<T extends ComponentTypeEmits>(): T extends (...args: any[]) => any ? T : ShortEmits<T>;
|
---|
226 | export type ComponentTypeEmits = ((...args: any[]) => any) | Record<string, any>;
|
---|
227 | type RecordToUnion<T extends Record<string, any>> = T[keyof T];
|
---|
228 | type ShortEmits<T extends Record<string, any>> = UnionToIntersection<RecordToUnion<{
|
---|
229 | [K in keyof T]: (evt: K, ...args: T[K]) => void;
|
---|
230 | }>>;
|
---|
231 | /**
|
---|
232 | * Vue `<script setup>` compiler macro for declaring a component's exposed
|
---|
233 | * instance properties when it is accessed by a parent component via template
|
---|
234 | * refs.
|
---|
235 | *
|
---|
236 | * `<script setup>` components are closed by default - i.e. variables inside
|
---|
237 | * the `<script setup>` scope is not exposed to parent unless explicitly exposed
|
---|
238 | * via `defineExpose`.
|
---|
239 | *
|
---|
240 | * This is only usable inside `<script setup>`, is compiled away in the
|
---|
241 | * output and should **not** be actually called at runtime.
|
---|
242 | *
|
---|
243 | * @see {@link https://vuejs.org/api/sfc-script-setup.html#defineexpose}
|
---|
244 | */
|
---|
245 | export declare function defineExpose<Exposed extends Record<string, any> = Record<string, any>>(exposed?: Exposed): void;
|
---|
246 | /**
|
---|
247 | * Vue `<script setup>` compiler macro for declaring a component's additional
|
---|
248 | * options. This should be used only for options that cannot be expressed via
|
---|
249 | * Composition API - e.g. `inheritAttrs`.
|
---|
250 | *
|
---|
251 | * @see {@link https://vuejs.org/api/sfc-script-setup.html#defineoptions}
|
---|
252 | */
|
---|
253 | export declare function defineOptions<RawBindings = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin>(options?: ComponentOptionsBase<{}, RawBindings, D, C, M, Mixin, Extends, {}> & {
|
---|
254 | /**
|
---|
255 | * props should be defined via defineProps().
|
---|
256 | */
|
---|
257 | props?: never;
|
---|
258 | /**
|
---|
259 | * emits should be defined via defineEmits().
|
---|
260 | */
|
---|
261 | emits?: never;
|
---|
262 | /**
|
---|
263 | * expose should be defined via defineExpose().
|
---|
264 | */
|
---|
265 | expose?: never;
|
---|
266 | /**
|
---|
267 | * slots should be defined via defineSlots().
|
---|
268 | */
|
---|
269 | slots?: never;
|
---|
270 | }): void;
|
---|
271 | export declare function defineSlots<S extends Record<string, any> = Record<string, any>>(): StrictUnwrapSlotsType<SlotsType<S>>;
|
---|
272 | export type ModelRef<T, M extends PropertyKey = string, G = T, S = T> = Ref<G, S> & [
|
---|
273 | ModelRef<T, M, G, S>,
|
---|
274 | Record<M, true | undefined>
|
---|
275 | ];
|
---|
276 | type DefineModelOptions<T = any, G = T, S = T> = {
|
---|
277 | get?: (v: T) => G;
|
---|
278 | set?: (v: S) => any;
|
---|
279 | };
|
---|
280 | /**
|
---|
281 | * Vue `<script setup>` compiler macro for declaring a
|
---|
282 | * two-way binding prop that can be consumed via `v-model` from the parent
|
---|
283 | * component. This will declare a prop with the same name and a corresponding
|
---|
284 | * `update:propName` event.
|
---|
285 | *
|
---|
286 | * If the first argument is a string, it will be used as the prop name;
|
---|
287 | * Otherwise the prop name will default to "modelValue". In both cases, you
|
---|
288 | * can also pass an additional object which will be used as the prop's options.
|
---|
289 | *
|
---|
290 | * The returned ref behaves differently depending on whether the parent
|
---|
291 | * provided the corresponding v-model props or not:
|
---|
292 | * - If yes, the returned ref's value will always be in sync with the parent
|
---|
293 | * prop.
|
---|
294 | * - If not, the returned ref will behave like a normal local ref.
|
---|
295 | *
|
---|
296 | * @example
|
---|
297 | * ```ts
|
---|
298 | * // default model (consumed via `v-model`)
|
---|
299 | * const modelValue = defineModel<string>()
|
---|
300 | * modelValue.value = "hello"
|
---|
301 | *
|
---|
302 | * // default model with options
|
---|
303 | * const modelValue = defineModel<string>({ required: true })
|
---|
304 | *
|
---|
305 | * // with specified name (consumed via `v-model:count`)
|
---|
306 | * const count = defineModel<number>('count')
|
---|
307 | * count.value++
|
---|
308 | *
|
---|
309 | * // with specified name and default value
|
---|
310 | * const count = defineModel<number>('count', { default: 0 })
|
---|
311 | * ```
|
---|
312 | */
|
---|
313 | export declare function defineModel<T, M extends PropertyKey = string, G = T, S = T>(options: ({
|
---|
314 | default: any;
|
---|
315 | } | {
|
---|
316 | required: true;
|
---|
317 | }) & PropOptions<T> & DefineModelOptions<T, G, S>): ModelRef<T, M, G, S>;
|
---|
318 | export declare function defineModel<T, M extends PropertyKey = string, G = T, S = T>(options?: PropOptions<T> & DefineModelOptions<T, G, S>): ModelRef<T | undefined, M, G | undefined, S | undefined>;
|
---|
319 | export declare function defineModel<T, M extends PropertyKey = string, G = T, S = T>(name: string, options: ({
|
---|
320 | default: any;
|
---|
321 | } | {
|
---|
322 | required: true;
|
---|
323 | }) & PropOptions<T> & DefineModelOptions<T, G, S>): ModelRef<T, M, G, S>;
|
---|
324 | export declare function defineModel<T, M extends PropertyKey = string, G = T, S = T>(name: string, options?: PropOptions<T> & DefineModelOptions<T, G, S>): ModelRef<T | undefined, M, G | undefined, S | undefined>;
|
---|
325 | type NotUndefined<T> = T extends undefined ? never : T;
|
---|
326 | type MappedOmit<T, K extends keyof any> = {
|
---|
327 | [P in keyof T as P extends K ? never : P]: T[P];
|
---|
328 | };
|
---|
329 | type InferDefaults<T> = {
|
---|
330 | [K in keyof T]?: InferDefault<T, T[K]>;
|
---|
331 | };
|
---|
332 | type NativeType = null | number | string | boolean | symbol | Function;
|
---|
333 | type InferDefault<P, T> = ((props: P) => T & {}) | (T extends NativeType ? T : never);
|
---|
334 | type PropsWithDefaults<T, Defaults extends InferDefaults<T>, BKeys extends keyof T> = T extends unknown ? Readonly<MappedOmit<T, keyof Defaults>> & {
|
---|
335 | readonly [K in keyof Defaults as K extends keyof T ? K : never]-?: K extends keyof T ? Defaults[K] extends undefined ? IfAny<Defaults[K], NotUndefined<T[K]>, T[K]> : NotUndefined<T[K]> : never;
|
---|
336 | } & {
|
---|
337 | readonly [K in BKeys]-?: K extends keyof Defaults ? Defaults[K] extends undefined ? boolean | undefined : boolean : boolean;
|
---|
338 | } : never;
|
---|
339 | /**
|
---|
340 | * Vue `<script setup>` compiler macro for providing props default values when
|
---|
341 | * using type-based `defineProps` declaration.
|
---|
342 | *
|
---|
343 | * Example usage:
|
---|
344 | * ```ts
|
---|
345 | * withDefaults(defineProps<{
|
---|
346 | * size?: number
|
---|
347 | * labels?: string[]
|
---|
348 | * }>(), {
|
---|
349 | * size: 3,
|
---|
350 | * labels: () => ['default label']
|
---|
351 | * })
|
---|
352 | * ```
|
---|
353 | *
|
---|
354 | * This is only usable inside `<script setup>`, is compiled away in the output
|
---|
355 | * and should **not** be actually called at runtime.
|
---|
356 | *
|
---|
357 | * @see {@link https://vuejs.org/guide/typescript/composition-api.html#typing-component-props}
|
---|
358 | */
|
---|
359 | export declare function withDefaults<T, BKeys extends keyof T, Defaults extends InferDefaults<T>>(props: DefineProps<T, BKeys>, defaults: Defaults): PropsWithDefaults<T, Defaults, BKeys>;
|
---|
360 | export declare function useSlots(): SetupContext['slots'];
|
---|
361 | export declare function useAttrs(): SetupContext['attrs'];
|
---|
362 |
|
---|
363 | export type ObjectEmitsOptions = Record<string, ((...args: any[]) => any) | null>;
|
---|
364 | export type EmitsOptions = ObjectEmitsOptions | string[];
|
---|
365 | export type EmitsToProps<T extends EmitsOptions | ComponentTypeEmits> = T extends string[] ? {
|
---|
366 | [K in `on${Capitalize<T[number]>}`]?: (...args: any[]) => any;
|
---|
367 | } : T extends ObjectEmitsOptions ? {
|
---|
368 | [K in string & keyof T as `on${Capitalize<K>}`]?: (...args: T[K] extends (...args: infer P) => any ? P : T[K] extends null ? any[] : never) => any;
|
---|
369 | } : {};
|
---|
370 | type TypeEmitsToOptions<T extends ComponentTypeEmits> = {
|
---|
371 | [K in keyof T & string]: T[K] extends [...args: infer Args] ? (...args: Args) => any : () => any;
|
---|
372 | } & (T extends (...args: any[]) => any ? ParametersToFns<OverloadParameters<T>> : {});
|
---|
373 | type ParametersToFns<T extends any[]> = {
|
---|
374 | [K in T[0]]: IsStringLiteral<K> extends true ? (...args: T extends [e: infer E, ...args: infer P] ? K extends E ? P : never : never) => any : never;
|
---|
375 | };
|
---|
376 | type IsStringLiteral<T> = T extends string ? string extends T ? false : true : false;
|
---|
377 | export type ShortEmitsToObject<E> = E extends Record<string, any[]> ? {
|
---|
378 | [K in keyof E]: (...args: E[K]) => any;
|
---|
379 | } : E;
|
---|
380 | export type EmitFn<Options = ObjectEmitsOptions, Event extends keyof Options = keyof Options> = Options extends Array<infer V> ? (event: V, ...args: any[]) => void : {} extends Options ? (event: string, ...args: any[]) => void : UnionToIntersection<{
|
---|
381 | [key in Event]: Options[key] extends (...args: infer Args) => any ? (event: key, ...args: Args) => void : Options[key] extends any[] ? (event: key, ...args: Options[key]) => void : (event: key, ...args: any[]) => void;
|
---|
382 | }[Event]>;
|
---|
383 |
|
---|
384 | /**
|
---|
385 | Runtime helper for applying directives to a vnode. Example usage:
|
---|
386 |
|
---|
387 | const comp = resolveComponent('comp')
|
---|
388 | const foo = resolveDirective('foo')
|
---|
389 | const bar = resolveDirective('bar')
|
---|
390 |
|
---|
391 | return withDirectives(h(comp), [
|
---|
392 | [foo, this.x],
|
---|
393 | [bar, this.y]
|
---|
394 | ])
|
---|
395 | */
|
---|
396 |
|
---|
397 | export interface DirectiveBinding<Value = any, Modifiers extends string = string, Arg extends string = string> {
|
---|
398 | instance: ComponentPublicInstance | Record<string, any> | null;
|
---|
399 | value: Value;
|
---|
400 | oldValue: Value | null;
|
---|
401 | arg?: Arg;
|
---|
402 | modifiers: DirectiveModifiers<Modifiers>;
|
---|
403 | dir: ObjectDirective<any, Value>;
|
---|
404 | }
|
---|
405 | export type DirectiveHook<HostElement = any, Prev = VNode<any, HostElement> | null, Value = any, Modifiers extends string = string, Arg extends string = string> = (el: HostElement, binding: DirectiveBinding<Value, Modifiers, Arg>, vnode: VNode<any, HostElement>, prevVNode: Prev) => void;
|
---|
406 | type SSRDirectiveHook<Value = any, Modifiers extends string = string, Arg extends string = string> = (binding: DirectiveBinding<Value, Modifiers, Arg>, vnode: VNode) => Data | undefined;
|
---|
407 | export interface ObjectDirective<HostElement = any, Value = any, Modifiers extends string = string, Arg extends string = string> {
|
---|
408 | created?: DirectiveHook<HostElement, null, Value, Modifiers, Arg>;
|
---|
409 | beforeMount?: DirectiveHook<HostElement, null, Value, Modifiers, Arg>;
|
---|
410 | mounted?: DirectiveHook<HostElement, null, Value, Modifiers, Arg>;
|
---|
411 | beforeUpdate?: DirectiveHook<HostElement, VNode<any, HostElement>, Value, Modifiers, Arg>;
|
---|
412 | updated?: DirectiveHook<HostElement, VNode<any, HostElement>, Value, Modifiers, Arg>;
|
---|
413 | beforeUnmount?: DirectiveHook<HostElement, null, Value, Modifiers, Arg>;
|
---|
414 | unmounted?: DirectiveHook<HostElement, null, Value, Modifiers, Arg>;
|
---|
415 | getSSRProps?: SSRDirectiveHook<Value, Modifiers, Arg>;
|
---|
416 | deep?: boolean;
|
---|
417 | }
|
---|
418 | export type FunctionDirective<HostElement = any, V = any, Modifiers extends string = string, Arg extends string = string> = DirectiveHook<HostElement, any, V, Modifiers, Arg>;
|
---|
419 | export type Directive<HostElement = any, Value = any, Modifiers extends string = string, Arg extends string = string> = ObjectDirective<HostElement, Value, Modifiers, Arg> | FunctionDirective<HostElement, Value, Modifiers, Arg>;
|
---|
420 | type DirectiveModifiers<K extends string = string> = Record<K, boolean>;
|
---|
421 | export type DirectiveArguments = Array<[Directive | undefined] | [Directive | undefined, any] | [Directive | undefined, any, string] | [Directive | undefined, any, string | undefined, DirectiveModifiers]>;
|
---|
422 | /**
|
---|
423 | * Adds directives to a VNode.
|
---|
424 | */
|
---|
425 | export declare function withDirectives<T extends VNode>(vnode: T, directives: DirectiveArguments): T;
|
---|
426 |
|
---|
427 | /**
|
---|
428 | * Custom properties added to component instances in any way and can be accessed through `this`
|
---|
429 | *
|
---|
430 | * @example
|
---|
431 | * Here is an example of adding a property `$router` to every component instance:
|
---|
432 | * ```ts
|
---|
433 | * import { createApp } from 'vue'
|
---|
434 | * import { Router, createRouter } from 'vue-router'
|
---|
435 | *
|
---|
436 | * declare module 'vue' {
|
---|
437 | * interface ComponentCustomProperties {
|
---|
438 | * $router: Router
|
---|
439 | * }
|
---|
440 | * }
|
---|
441 | *
|
---|
442 | * // effectively adding the router to every component instance
|
---|
443 | * const app = createApp({})
|
---|
444 | * const router = createRouter()
|
---|
445 | * app.config.globalProperties.$router = router
|
---|
446 | *
|
---|
447 | * const vm = app.mount('#app')
|
---|
448 | * // we can access the router from the instance
|
---|
449 | * vm.$router.push('/')
|
---|
450 | * ```
|
---|
451 | */
|
---|
452 | export interface ComponentCustomProperties {
|
---|
453 | }
|
---|
454 | type IsDefaultMixinComponent<T> = T extends ComponentOptionsMixin ? ComponentOptionsMixin extends T ? true : false : false;
|
---|
455 | type MixinToOptionTypes<T> = T extends ComponentOptionsBase<infer P, infer B, infer D, infer C, infer M, infer Mixin, infer Extends, any, any, infer Defaults, any, any, any, any, any, any, any> ? OptionTypesType<P & {}, B & {}, D & {}, C & {}, M & {}, Defaults & {}> & IntersectionMixin<Mixin> & IntersectionMixin<Extends> : never;
|
---|
456 | type ExtractMixin<T> = {
|
---|
457 | Mixin: MixinToOptionTypes<T>;
|
---|
458 | }[T extends ComponentOptionsMixin ? 'Mixin' : never];
|
---|
459 | type IntersectionMixin<T> = IsDefaultMixinComponent<T> extends true ? OptionTypesType : UnionToIntersection<ExtractMixin<T>>;
|
---|
460 | type UnwrapMixinsType<T, Type extends OptionTypesKeys> = T extends OptionTypesType ? T[Type] : never;
|
---|
461 | type EnsureNonVoid<T> = T extends void ? {} : T;
|
---|
462 | type ComponentPublicInstanceConstructor<T extends ComponentPublicInstance<Props, RawBindings, D, C, M> = ComponentPublicInstance<any>, Props = any, RawBindings = any, D = any, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions> = {
|
---|
463 | __isFragment?: never;
|
---|
464 | __isTeleport?: never;
|
---|
465 | __isSuspense?: never;
|
---|
466 | new (...args: any[]): T;
|
---|
467 | };
|
---|
468 | /**
|
---|
469 | * @deprecated This is no longer used internally, but exported and relied on by
|
---|
470 | * existing library types generated by vue-tsc.
|
---|
471 | */
|
---|
472 | export type CreateComponentPublicInstance<P = {}, B = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, PublicProps = P, Defaults = {}, MakeDefaultsOptional extends boolean = false, I extends ComponentInjectOptions = {}, S extends SlotsType = {}, PublicMixin = IntersectionMixin<Mixin> & IntersectionMixin<Extends>, PublicP = UnwrapMixinsType<PublicMixin, 'P'> & EnsureNonVoid<P>, PublicB = UnwrapMixinsType<PublicMixin, 'B'> & EnsureNonVoid<B>, PublicD = UnwrapMixinsType<PublicMixin, 'D'> & EnsureNonVoid<D>, PublicC extends ComputedOptions = UnwrapMixinsType<PublicMixin, 'C'> & EnsureNonVoid<C>, PublicM extends MethodOptions = UnwrapMixinsType<PublicMixin, 'M'> & EnsureNonVoid<M>, PublicDefaults = UnwrapMixinsType<PublicMixin, 'Defaults'> & EnsureNonVoid<Defaults>> = ComponentPublicInstance<PublicP, PublicB, PublicD, PublicC, PublicM, E, PublicProps, PublicDefaults, MakeDefaultsOptional, ComponentOptionsBase<P, B, D, C, M, Mixin, Extends, E, string, Defaults, {}, string, S>, I, S>;
|
---|
473 | /**
|
---|
474 | * This is the same as `CreateComponentPublicInstance` but adds local components,
|
---|
475 | * global directives, exposed, and provide inference.
|
---|
476 | * It changes the arguments order so that we don't need to repeat mixin
|
---|
477 | * inference everywhere internally, but it has to be a new type to avoid
|
---|
478 | * breaking types that relies on previous arguments order (#10842)
|
---|
479 | */
|
---|
480 | export type CreateComponentPublicInstanceWithMixins<P = {}, B = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, PublicProps = P, Defaults = {}, MakeDefaultsOptional extends boolean = false, I extends ComponentInjectOptions = {}, S extends SlotsType = {}, LC extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, TypeRefs extends Data = {}, TypeEl extends Element = any, Provide extends ComponentProvideOptions = ComponentProvideOptions, PublicMixin = IntersectionMixin<Mixin> & IntersectionMixin<Extends>, PublicP = UnwrapMixinsType<PublicMixin, 'P'> & EnsureNonVoid<P>, PublicB = UnwrapMixinsType<PublicMixin, 'B'> & EnsureNonVoid<B>, PublicD = UnwrapMixinsType<PublicMixin, 'D'> & EnsureNonVoid<D>, PublicC extends ComputedOptions = UnwrapMixinsType<PublicMixin, 'C'> & EnsureNonVoid<C>, PublicM extends MethodOptions = UnwrapMixinsType<PublicMixin, 'M'> & EnsureNonVoid<M>, PublicDefaults = UnwrapMixinsType<PublicMixin, 'Defaults'> & EnsureNonVoid<Defaults>> = ComponentPublicInstance<PublicP, PublicB, PublicD, PublicC, PublicM, E, PublicProps, PublicDefaults, MakeDefaultsOptional, ComponentOptionsBase<P, B, D, C, M, Mixin, Extends, E, string, Defaults, {}, string, S, LC, Directives, Exposed, Provide>, I, S, Exposed, TypeRefs, TypeEl>;
|
---|
481 | type ExposedKeys<T, Exposed extends string & keyof T> = '' extends Exposed ? T : Pick<T, Exposed>;
|
---|
482 | export type ComponentPublicInstance<P = {}, // props type extracted from props option
|
---|
483 | B = {}, // raw bindings returned from setup()
|
---|
484 | D = {}, // return from data()
|
---|
485 | C extends ComputedOptions = {}, M extends MethodOptions = {}, E extends EmitsOptions = {}, PublicProps = {}, Defaults = {}, MakeDefaultsOptional extends boolean = false, Options = ComponentOptionsBase<any, any, any, any, any, any, any, any, any>, I extends ComponentInjectOptions = {}, S extends SlotsType = {}, Exposed extends string = '', TypeRefs extends Data = {}, TypeEl extends Element = any> = {
|
---|
486 | $: ComponentInternalInstance;
|
---|
487 | $data: D;
|
---|
488 | $props: MakeDefaultsOptional extends true ? Partial<Defaults> & Omit<Prettify<P> & PublicProps, keyof Defaults> : Prettify<P> & PublicProps;
|
---|
489 | $attrs: Data;
|
---|
490 | $refs: Data & TypeRefs;
|
---|
491 | $slots: UnwrapSlotsType<S>;
|
---|
492 | $root: ComponentPublicInstance | null;
|
---|
493 | $parent: ComponentPublicInstance | null;
|
---|
494 | $host: Element | null;
|
---|
495 | $emit: EmitFn<E>;
|
---|
496 | $el: TypeEl;
|
---|
497 | $options: Options & MergedComponentOptionsOverride;
|
---|
498 | $forceUpdate: () => void;
|
---|
499 | $nextTick: typeof nextTick;
|
---|
500 | $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, OnCleanup]) => any : (...args: [any, any, OnCleanup]) => any, options?: WatchOptions): WatchStopHandle;
|
---|
501 | } & ExposedKeys<IfAny<P, P, Readonly<Defaults> & Omit<P, keyof ShallowUnwrapRef<B> | keyof Defaults>> & ShallowUnwrapRef<B> & UnwrapNestedRefs<D> & ExtractComputedReturns<C> & M & ComponentCustomProperties & InjectToObject<I>, Exposed>;
|
---|
502 |
|
---|
503 | declare enum LifecycleHooks {
|
---|
504 | BEFORE_CREATE = "bc",
|
---|
505 | CREATED = "c",
|
---|
506 | BEFORE_MOUNT = "bm",
|
---|
507 | MOUNTED = "m",
|
---|
508 | BEFORE_UPDATE = "bu",
|
---|
509 | UPDATED = "u",
|
---|
510 | BEFORE_UNMOUNT = "bum",
|
---|
511 | UNMOUNTED = "um",
|
---|
512 | DEACTIVATED = "da",
|
---|
513 | ACTIVATED = "a",
|
---|
514 | RENDER_TRIGGERED = "rtg",
|
---|
515 | RENDER_TRACKED = "rtc",
|
---|
516 | ERROR_CAPTURED = "ec",
|
---|
517 | SERVER_PREFETCH = "sp"
|
---|
518 | }
|
---|
519 |
|
---|
520 | export interface SuspenseProps {
|
---|
521 | onResolve?: () => void;
|
---|
522 | onPending?: () => void;
|
---|
523 | onFallback?: () => void;
|
---|
524 | timeout?: string | number;
|
---|
525 | /**
|
---|
526 | * Allow suspense to be captured by parent suspense
|
---|
527 | *
|
---|
528 | * @default false
|
---|
529 | */
|
---|
530 | suspensible?: boolean;
|
---|
531 | }
|
---|
532 | declare const SuspenseImpl: {
|
---|
533 | name: string;
|
---|
534 | __isSuspense: boolean;
|
---|
535 | process(n1: VNode | null, n2: VNode, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, namespace: ElementNamespace, slotScopeIds: string[] | null, optimized: boolean, rendererInternals: RendererInternals): void;
|
---|
536 | hydrate: typeof hydrateSuspense;
|
---|
537 | normalize: typeof normalizeSuspenseChildren;
|
---|
538 | };
|
---|
539 | export declare const Suspense: {
|
---|
540 | __isSuspense: true;
|
---|
541 | new (): {
|
---|
542 | $props: VNodeProps & SuspenseProps;
|
---|
543 | $slots: {
|
---|
544 | default(): VNode[];
|
---|
545 | fallback(): VNode[];
|
---|
546 | };
|
---|
547 | };
|
---|
548 | };
|
---|
549 | export interface SuspenseBoundary {
|
---|
550 | vnode: VNode<RendererNode, RendererElement, SuspenseProps>;
|
---|
551 | parent: SuspenseBoundary | null;
|
---|
552 | parentComponent: ComponentInternalInstance | null;
|
---|
553 | namespace: ElementNamespace;
|
---|
554 | container: RendererElement;
|
---|
555 | hiddenContainer: RendererElement;
|
---|
556 | activeBranch: VNode | null;
|
---|
557 | pendingBranch: VNode | null;
|
---|
558 | deps: number;
|
---|
559 | pendingId: number;
|
---|
560 | timeout: number;
|
---|
561 | isInFallback: boolean;
|
---|
562 | isHydrating: boolean;
|
---|
563 | isUnmounted: boolean;
|
---|
564 | effects: Function[];
|
---|
565 | resolve(force?: boolean, sync?: boolean): void;
|
---|
566 | fallback(fallbackVNode: VNode): void;
|
---|
567 | move(container: RendererElement, anchor: RendererNode | null, type: MoveType): void;
|
---|
568 | next(): RendererNode | null;
|
---|
569 | registerDep(instance: ComponentInternalInstance, setupRenderEffect: SetupRenderEffectFn, optimized: boolean): void;
|
---|
570 | unmount(parentSuspense: SuspenseBoundary | null, doRemove?: boolean): void;
|
---|
571 | }
|
---|
572 | declare function hydrateSuspense(node: Node, vnode: VNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, namespace: ElementNamespace, slotScopeIds: string[] | null, optimized: boolean, rendererInternals: RendererInternals, hydrateNode: (node: Node, vnode: VNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, slotScopeIds: string[] | null, optimized: boolean) => Node | null): Node | null;
|
---|
573 | declare function normalizeSuspenseChildren(vnode: VNode): void;
|
---|
574 |
|
---|
575 | export type RootHydrateFunction = (vnode: VNode<Node, Element>, container: (Element | ShadowRoot) & {
|
---|
576 | _vnode?: VNode;
|
---|
577 | }) => void;
|
---|
578 |
|
---|
579 | type Hook<T = () => void> = T | T[];
|
---|
580 | export interface BaseTransitionProps<HostElement = RendererElement> {
|
---|
581 | mode?: 'in-out' | 'out-in' | 'default';
|
---|
582 | appear?: boolean;
|
---|
583 | persisted?: boolean;
|
---|
584 | onBeforeEnter?: Hook<(el: HostElement) => void>;
|
---|
585 | onEnter?: Hook<(el: HostElement, done: () => void) => void>;
|
---|
586 | onAfterEnter?: Hook<(el: HostElement) => void>;
|
---|
587 | onEnterCancelled?: Hook<(el: HostElement) => void>;
|
---|
588 | onBeforeLeave?: Hook<(el: HostElement) => void>;
|
---|
589 | onLeave?: Hook<(el: HostElement, done: () => void) => void>;
|
---|
590 | onAfterLeave?: Hook<(el: HostElement) => void>;
|
---|
591 | onLeaveCancelled?: Hook<(el: HostElement) => void>;
|
---|
592 | onBeforeAppear?: Hook<(el: HostElement) => void>;
|
---|
593 | onAppear?: Hook<(el: HostElement, done: () => void) => void>;
|
---|
594 | onAfterAppear?: Hook<(el: HostElement) => void>;
|
---|
595 | onAppearCancelled?: Hook<(el: HostElement) => void>;
|
---|
596 | }
|
---|
597 | export interface TransitionHooks<HostElement = RendererElement> {
|
---|
598 | mode: BaseTransitionProps['mode'];
|
---|
599 | persisted: boolean;
|
---|
600 | beforeEnter(el: HostElement): void;
|
---|
601 | enter(el: HostElement): void;
|
---|
602 | leave(el: HostElement, remove: () => void): void;
|
---|
603 | clone(vnode: VNode): TransitionHooks<HostElement>;
|
---|
604 | afterLeave?(): void;
|
---|
605 | delayLeave?(el: HostElement, earlyRemove: () => void, delayedLeave: () => void): void;
|
---|
606 | delayedLeave?(): void;
|
---|
607 | }
|
---|
608 | export interface TransitionState {
|
---|
609 | isMounted: boolean;
|
---|
610 | isLeaving: boolean;
|
---|
611 | isUnmounting: boolean;
|
---|
612 | leavingVNodes: Map<any, Record<string, VNode>>;
|
---|
613 | }
|
---|
614 | export declare function useTransitionState(): TransitionState;
|
---|
615 | export declare const BaseTransitionPropsValidators: Record<string, any>;
|
---|
616 | export declare const BaseTransition: {
|
---|
617 | new (): {
|
---|
618 | $props: BaseTransitionProps<any>;
|
---|
619 | $slots: {
|
---|
620 | default(): VNode[];
|
---|
621 | };
|
---|
622 | };
|
---|
623 | };
|
---|
624 | export declare function resolveTransitionHooks(vnode: VNode, props: BaseTransitionProps<any>, state: TransitionState, instance: ComponentInternalInstance, postClone?: (hooks: TransitionHooks) => void): TransitionHooks;
|
---|
625 | export declare function setTransitionHooks(vnode: VNode, hooks: TransitionHooks): void;
|
---|
626 | export declare function getTransitionRawChildren(children: VNode[], keepComment?: boolean, parentKey?: VNode['key']): VNode[];
|
---|
627 |
|
---|
628 | export interface Renderer<HostElement = RendererElement> {
|
---|
629 | render: RootRenderFunction<HostElement>;
|
---|
630 | createApp: CreateAppFunction<HostElement>;
|
---|
631 | }
|
---|
632 | export interface HydrationRenderer extends Renderer<Element | ShadowRoot> {
|
---|
633 | hydrate: RootHydrateFunction;
|
---|
634 | }
|
---|
635 | export type ElementNamespace = 'svg' | 'mathml' | undefined;
|
---|
636 | export type RootRenderFunction<HostElement = RendererElement> = (vnode: VNode | null, container: HostElement, namespace?: ElementNamespace) => void;
|
---|
637 | export interface RendererOptions<HostNode = RendererNode, HostElement = RendererElement> {
|
---|
638 | patchProp(el: HostElement, key: string, prevValue: any, nextValue: any, namespace?: ElementNamespace, parentComponent?: ComponentInternalInstance | null): void;
|
---|
639 | insert(el: HostNode, parent: HostElement, anchor?: HostNode | null): void;
|
---|
640 | remove(el: HostNode): void;
|
---|
641 | createElement(type: string, namespace?: ElementNamespace, isCustomizedBuiltIn?: string, vnodeProps?: (VNodeProps & {
|
---|
642 | [key: string]: any;
|
---|
643 | }) | null): HostElement;
|
---|
644 | createText(text: string): HostNode;
|
---|
645 | createComment(text: string): HostNode;
|
---|
646 | setText(node: HostNode, text: string): void;
|
---|
647 | setElementText(node: HostElement, text: string): void;
|
---|
648 | parentNode(node: HostNode): HostElement | null;
|
---|
649 | nextSibling(node: HostNode): HostNode | null;
|
---|
650 | querySelector?(selector: string): HostElement | null;
|
---|
651 | setScopeId?(el: HostElement, id: string): void;
|
---|
652 | cloneNode?(node: HostNode): HostNode;
|
---|
653 | insertStaticContent?(content: string, parent: HostElement, anchor: HostNode | null, namespace: ElementNamespace, start?: HostNode | null, end?: HostNode | null): [HostNode, HostNode];
|
---|
654 | }
|
---|
655 | export interface RendererNode {
|
---|
656 | [key: string | symbol]: any;
|
---|
657 | }
|
---|
658 | export interface RendererElement extends RendererNode {
|
---|
659 | }
|
---|
660 | interface RendererInternals<HostNode = RendererNode, HostElement = RendererElement> {
|
---|
661 | p: PatchFn;
|
---|
662 | um: UnmountFn;
|
---|
663 | r: RemoveFn;
|
---|
664 | m: MoveFn;
|
---|
665 | mt: MountComponentFn;
|
---|
666 | mc: MountChildrenFn;
|
---|
667 | pc: PatchChildrenFn;
|
---|
668 | pbc: PatchBlockChildrenFn;
|
---|
669 | n: NextFn;
|
---|
670 | o: RendererOptions<HostNode, HostElement>;
|
---|
671 | }
|
---|
672 | type PatchFn = (n1: VNode | null, // null means this is a mount
|
---|
673 | n2: VNode, container: RendererElement, anchor?: RendererNode | null, parentComponent?: ComponentInternalInstance | null, parentSuspense?: SuspenseBoundary | null, namespace?: ElementNamespace, slotScopeIds?: string[] | null, optimized?: boolean) => void;
|
---|
674 | type MountChildrenFn = (children: VNodeArrayChildren, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, namespace: ElementNamespace, slotScopeIds: string[] | null, optimized: boolean, start?: number) => void;
|
---|
675 | type PatchChildrenFn = (n1: VNode | null, n2: VNode, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, namespace: ElementNamespace, slotScopeIds: string[] | null, optimized: boolean) => void;
|
---|
676 | type PatchBlockChildrenFn = (oldChildren: VNode[], newChildren: VNode[], fallbackContainer: RendererElement, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, namespace: ElementNamespace, slotScopeIds: string[] | null) => void;
|
---|
677 | type MoveFn = (vnode: VNode, container: RendererElement, anchor: RendererNode | null, type: MoveType, parentSuspense?: SuspenseBoundary | null) => void;
|
---|
678 | type NextFn = (vnode: VNode) => RendererNode | null;
|
---|
679 | type UnmountFn = (vnode: VNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, doRemove?: boolean, optimized?: boolean) => void;
|
---|
680 | type RemoveFn = (vnode: VNode) => void;
|
---|
681 | type MountComponentFn = (initialVNode: VNode, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, namespace: ElementNamespace, optimized: boolean) => void;
|
---|
682 | type SetupRenderEffectFn = (instance: ComponentInternalInstance, initialVNode: VNode, container: RendererElement, anchor: RendererNode | null, parentSuspense: SuspenseBoundary | null, namespace: ElementNamespace, optimized: boolean) => void;
|
---|
683 | declare enum MoveType {
|
---|
684 | ENTER = 0,
|
---|
685 | LEAVE = 1,
|
---|
686 | REORDER = 2
|
---|
687 | }
|
---|
688 | /**
|
---|
689 | * The createRenderer function accepts two generic arguments:
|
---|
690 | * HostNode and HostElement, corresponding to Node and Element types in the
|
---|
691 | * host environment. For example, for runtime-dom, HostNode would be the DOM
|
---|
692 | * `Node` interface and HostElement would be the DOM `Element` interface.
|
---|
693 | *
|
---|
694 | * Custom renderers can pass in the platform specific types like this:
|
---|
695 | *
|
---|
696 | * ``` js
|
---|
697 | * const { render, createApp } = createRenderer<Node, Element>({
|
---|
698 | * patchProp,
|
---|
699 | * ...nodeOps
|
---|
700 | * })
|
---|
701 | * ```
|
---|
702 | */
|
---|
703 | export declare function createRenderer<HostNode = RendererNode, HostElement = RendererElement>(options: RendererOptions<HostNode, HostElement>): Renderer<HostElement>;
|
---|
704 | export declare function createHydrationRenderer(options: RendererOptions<Node, Element>): HydrationRenderer;
|
---|
705 |
|
---|
706 | type MatchPattern = string | RegExp | (string | RegExp)[];
|
---|
707 | export interface KeepAliveProps {
|
---|
708 | include?: MatchPattern;
|
---|
709 | exclude?: MatchPattern;
|
---|
710 | max?: number | string;
|
---|
711 | }
|
---|
712 | export declare const KeepAlive: {
|
---|
713 | __isKeepAlive: true;
|
---|
714 | new (): {
|
---|
715 | $props: VNodeProps & KeepAliveProps;
|
---|
716 | $slots: {
|
---|
717 | default(): VNode[];
|
---|
718 | };
|
---|
719 | };
|
---|
720 | };
|
---|
721 | export declare function onActivated(hook: Function, target?: ComponentInternalInstance | null): void;
|
---|
722 | export declare function onDeactivated(hook: Function, target?: ComponentInternalInstance | null): void;
|
---|
723 |
|
---|
724 | type CreateHook<T = any> = (hook: T, target?: ComponentInternalInstance | null) => void;
|
---|
725 | export declare const onBeforeMount: CreateHook;
|
---|
726 | export declare const onMounted: CreateHook;
|
---|
727 | export declare const onBeforeUpdate: CreateHook;
|
---|
728 | export declare const onUpdated: CreateHook;
|
---|
729 | export declare const onBeforeUnmount: CreateHook;
|
---|
730 | export declare const onUnmounted: CreateHook;
|
---|
731 | export declare const onServerPrefetch: CreateHook;
|
---|
732 | type DebuggerHook = (e: DebuggerEvent) => void;
|
---|
733 | export declare const onRenderTriggered: CreateHook<DebuggerHook>;
|
---|
734 | export declare const onRenderTracked: CreateHook<DebuggerHook>;
|
---|
735 | type ErrorCapturedHook<TError = unknown> = (err: TError, instance: ComponentPublicInstance | null, info: string) => boolean | void;
|
---|
736 | export declare function onErrorCaptured<TError = Error>(hook: ErrorCapturedHook<TError>, target?: ComponentInternalInstance | null): void;
|
---|
737 |
|
---|
738 | declare enum DeprecationTypes$1 {
|
---|
739 | GLOBAL_MOUNT = "GLOBAL_MOUNT",
|
---|
740 | GLOBAL_MOUNT_CONTAINER = "GLOBAL_MOUNT_CONTAINER",
|
---|
741 | GLOBAL_EXTEND = "GLOBAL_EXTEND",
|
---|
742 | GLOBAL_PROTOTYPE = "GLOBAL_PROTOTYPE",
|
---|
743 | GLOBAL_SET = "GLOBAL_SET",
|
---|
744 | GLOBAL_DELETE = "GLOBAL_DELETE",
|
---|
745 | GLOBAL_OBSERVABLE = "GLOBAL_OBSERVABLE",
|
---|
746 | GLOBAL_PRIVATE_UTIL = "GLOBAL_PRIVATE_UTIL",
|
---|
747 | CONFIG_SILENT = "CONFIG_SILENT",
|
---|
748 | CONFIG_DEVTOOLS = "CONFIG_DEVTOOLS",
|
---|
749 | CONFIG_KEY_CODES = "CONFIG_KEY_CODES",
|
---|
750 | CONFIG_PRODUCTION_TIP = "CONFIG_PRODUCTION_TIP",
|
---|
751 | CONFIG_IGNORED_ELEMENTS = "CONFIG_IGNORED_ELEMENTS",
|
---|
752 | CONFIG_WHITESPACE = "CONFIG_WHITESPACE",
|
---|
753 | CONFIG_OPTION_MERGE_STRATS = "CONFIG_OPTION_MERGE_STRATS",
|
---|
754 | INSTANCE_SET = "INSTANCE_SET",
|
---|
755 | INSTANCE_DELETE = "INSTANCE_DELETE",
|
---|
756 | INSTANCE_DESTROY = "INSTANCE_DESTROY",
|
---|
757 | INSTANCE_EVENT_EMITTER = "INSTANCE_EVENT_EMITTER",
|
---|
758 | INSTANCE_EVENT_HOOKS = "INSTANCE_EVENT_HOOKS",
|
---|
759 | INSTANCE_CHILDREN = "INSTANCE_CHILDREN",
|
---|
760 | INSTANCE_LISTENERS = "INSTANCE_LISTENERS",
|
---|
761 | INSTANCE_SCOPED_SLOTS = "INSTANCE_SCOPED_SLOTS",
|
---|
762 | INSTANCE_ATTRS_CLASS_STYLE = "INSTANCE_ATTRS_CLASS_STYLE",
|
---|
763 | OPTIONS_DATA_FN = "OPTIONS_DATA_FN",
|
---|
764 | OPTIONS_DATA_MERGE = "OPTIONS_DATA_MERGE",
|
---|
765 | OPTIONS_BEFORE_DESTROY = "OPTIONS_BEFORE_DESTROY",
|
---|
766 | OPTIONS_DESTROYED = "OPTIONS_DESTROYED",
|
---|
767 | WATCH_ARRAY = "WATCH_ARRAY",
|
---|
768 | PROPS_DEFAULT_THIS = "PROPS_DEFAULT_THIS",
|
---|
769 | V_ON_KEYCODE_MODIFIER = "V_ON_KEYCODE_MODIFIER",
|
---|
770 | CUSTOM_DIR = "CUSTOM_DIR",
|
---|
771 | ATTR_FALSE_VALUE = "ATTR_FALSE_VALUE",
|
---|
772 | ATTR_ENUMERATED_COERCION = "ATTR_ENUMERATED_COERCION",
|
---|
773 | TRANSITION_CLASSES = "TRANSITION_CLASSES",
|
---|
774 | TRANSITION_GROUP_ROOT = "TRANSITION_GROUP_ROOT",
|
---|
775 | COMPONENT_ASYNC = "COMPONENT_ASYNC",
|
---|
776 | COMPONENT_FUNCTIONAL = "COMPONENT_FUNCTIONAL",
|
---|
777 | COMPONENT_V_MODEL = "COMPONENT_V_MODEL",
|
---|
778 | RENDER_FUNCTION = "RENDER_FUNCTION",
|
---|
779 | FILTERS = "FILTERS",
|
---|
780 | PRIVATE_APIS = "PRIVATE_APIS"
|
---|
781 | }
|
---|
782 | type CompatConfig = Partial<Record<DeprecationTypes$1, boolean | 'suppress-warning'>> & {
|
---|
783 | MODE?: 2 | 3 | ((comp: Component | null) => 2 | 3);
|
---|
784 | };
|
---|
785 | declare function configureCompat(config: CompatConfig): void;
|
---|
786 |
|
---|
787 | /**
|
---|
788 | * Interface for declaring custom options.
|
---|
789 | *
|
---|
790 | * @example
|
---|
791 | * ```ts
|
---|
792 | * declare module 'vue' {
|
---|
793 | * interface ComponentCustomOptions {
|
---|
794 | * beforeRouteUpdate?(
|
---|
795 | * to: Route,
|
---|
796 | * from: Route,
|
---|
797 | * next: () => void
|
---|
798 | * ): void
|
---|
799 | * }
|
---|
800 | * }
|
---|
801 | * ```
|
---|
802 | */
|
---|
803 | export interface ComponentCustomOptions {
|
---|
804 | }
|
---|
805 | export type RenderFunction = () => VNodeChild;
|
---|
806 | export interface ComponentOptionsBase<Props, RawBindings, D, C extends ComputedOptions, M extends MethodOptions, Mixin extends ComponentOptionsMixin, Extends extends ComponentOptionsMixin, E extends EmitsOptions, EE extends string = string, Defaults = {}, I extends ComponentInjectOptions = {}, II extends string = string, S extends SlotsType = {}, LC extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions> extends LegacyOptions<Props, D, C, M, Mixin, Extends, I, II, Provide>, ComponentInternalOptions, ComponentCustomOptions {
|
---|
807 | setup?: (this: void, props: LooseRequired<Props & Prettify<UnwrapMixinsType<IntersectionMixin<Mixin> & IntersectionMixin<Extends>, 'P'>>>, ctx: SetupContext<E, S>) => Promise<RawBindings> | RawBindings | RenderFunction | void;
|
---|
808 | name?: string;
|
---|
809 | template?: string | object;
|
---|
810 | render?: Function;
|
---|
811 | components?: LC & Record<string, Component>;
|
---|
812 | directives?: Directives & Record<string, Directive>;
|
---|
813 | inheritAttrs?: boolean;
|
---|
814 | emits?: (E | EE[]) & ThisType<void>;
|
---|
815 | slots?: S;
|
---|
816 | expose?: Exposed[];
|
---|
817 | serverPrefetch?(): void | Promise<any>;
|
---|
818 | compilerOptions?: RuntimeCompilerOptions;
|
---|
819 | call?: (this: unknown, ...args: unknown[]) => never;
|
---|
820 | __isFragment?: never;
|
---|
821 | __isTeleport?: never;
|
---|
822 | __isSuspense?: never;
|
---|
823 | __defaults?: Defaults;
|
---|
824 | }
|
---|
825 | /**
|
---|
826 | * Subset of compiler options that makes sense for the runtime.
|
---|
827 | */
|
---|
828 | export interface RuntimeCompilerOptions {
|
---|
829 | isCustomElement?: (tag: string) => boolean;
|
---|
830 | whitespace?: 'preserve' | 'condense';
|
---|
831 | comments?: boolean;
|
---|
832 | delimiters?: [string, string];
|
---|
833 | }
|
---|
834 | export type ComponentOptions<Props = {}, RawBindings = any, D = any, C extends ComputedOptions = any, M extends MethodOptions = any, Mixin extends ComponentOptionsMixin = any, Extends extends ComponentOptionsMixin = any, E extends EmitsOptions = any, EE extends string = string, Defaults = {}, I extends ComponentInjectOptions = {}, II extends string = string, S extends SlotsType = {}, LC extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions> = ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, Defaults, I, II, S, LC, Directives, Exposed, Provide> & ThisType<CreateComponentPublicInstanceWithMixins<{}, RawBindings, D, C, M, Mixin, Extends, E, Readonly<Props>, Defaults, false, I, S, LC, Directives>>;
|
---|
835 | export type ComponentOptionsMixin = ComponentOptionsBase<any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any>;
|
---|
836 | export type ComputedOptions = Record<string, ComputedGetter<any> | WritableComputedOptions<any>>;
|
---|
837 | export interface MethodOptions {
|
---|
838 | [key: string]: Function;
|
---|
839 | }
|
---|
840 | type ExtractComputedReturns<T extends any> = {
|
---|
841 | [key in keyof T]: T[key] extends {
|
---|
842 | get: (...args: any[]) => infer TReturn;
|
---|
843 | } ? TReturn : T[key] extends (...args: any[]) => infer TReturn ? TReturn : never;
|
---|
844 | };
|
---|
845 | type ObjectWatchOptionItem = {
|
---|
846 | handler: WatchCallback | string;
|
---|
847 | } & WatchOptions;
|
---|
848 | type WatchOptionItem = string | WatchCallback | ObjectWatchOptionItem;
|
---|
849 | type ComponentWatchOptionItem = WatchOptionItem | WatchOptionItem[];
|
---|
850 | type ComponentWatchOptions = Record<string, ComponentWatchOptionItem>;
|
---|
851 | export type ComponentProvideOptions = ObjectProvideOptions | Function;
|
---|
852 | type ObjectProvideOptions = Record<string | symbol, unknown>;
|
---|
853 | export type ComponentInjectOptions = string[] | ObjectInjectOptions;
|
---|
854 | type ObjectInjectOptions = Record<string | symbol, string | symbol | {
|
---|
855 | from?: string | symbol;
|
---|
856 | default?: unknown;
|
---|
857 | }>;
|
---|
858 | type InjectToObject<T extends ComponentInjectOptions> = T extends string[] ? {
|
---|
859 | [K in T[number]]?: unknown;
|
---|
860 | } : T extends ObjectInjectOptions ? {
|
---|
861 | [K in keyof T]?: unknown;
|
---|
862 | } : never;
|
---|
863 | interface LegacyOptions<Props, D, C extends ComputedOptions, M extends MethodOptions, Mixin extends ComponentOptionsMixin, Extends extends ComponentOptionsMixin, I extends ComponentInjectOptions, II extends string, Provide extends ComponentProvideOptions = ComponentProvideOptions> {
|
---|
864 | compatConfig?: CompatConfig;
|
---|
865 | [key: string]: any;
|
---|
866 | data?: (this: CreateComponentPublicInstanceWithMixins<Props, {}, {}, {}, MethodOptions, Mixin, Extends>, vm: CreateComponentPublicInstanceWithMixins<Props, {}, {}, {}, MethodOptions, Mixin, Extends>) => D;
|
---|
867 | computed?: C;
|
---|
868 | methods?: M;
|
---|
869 | watch?: ComponentWatchOptions;
|
---|
870 | provide?: Provide;
|
---|
871 | inject?: I | II[];
|
---|
872 | filters?: Record<string, Function>;
|
---|
873 | mixins?: Mixin[];
|
---|
874 | extends?: Extends;
|
---|
875 | beforeCreate?(): void;
|
---|
876 | created?(): void;
|
---|
877 | beforeMount?(): void;
|
---|
878 | mounted?(): void;
|
---|
879 | beforeUpdate?(): void;
|
---|
880 | updated?(): void;
|
---|
881 | activated?(): void;
|
---|
882 | deactivated?(): void;
|
---|
883 | /** @deprecated use `beforeUnmount` instead */
|
---|
884 | beforeDestroy?(): void;
|
---|
885 | beforeUnmount?(): void;
|
---|
886 | /** @deprecated use `unmounted` instead */
|
---|
887 | destroyed?(): void;
|
---|
888 | unmounted?(): void;
|
---|
889 | renderTracked?: DebuggerHook;
|
---|
890 | renderTriggered?: DebuggerHook;
|
---|
891 | errorCaptured?: ErrorCapturedHook;
|
---|
892 | /**
|
---|
893 | * runtime compile only
|
---|
894 | * @deprecated use `compilerOptions.delimiters` instead.
|
---|
895 | */
|
---|
896 | delimiters?: [string, string];
|
---|
897 | /**
|
---|
898 | * #3468
|
---|
899 | *
|
---|
900 | * type-only, used to assist Mixin's type inference,
|
---|
901 | * typescript will try to simplify the inferred `Mixin` type,
|
---|
902 | * with the `__differentiator`, typescript won't be able to combine different mixins,
|
---|
903 | * because the `__differentiator` will be different
|
---|
904 | */
|
---|
905 | __differentiator?: keyof D | keyof C | keyof M;
|
---|
906 | }
|
---|
907 | type MergedHook<T = () => void> = T | T[];
|
---|
908 | type MergedComponentOptionsOverride = {
|
---|
909 | beforeCreate?: MergedHook;
|
---|
910 | created?: MergedHook;
|
---|
911 | beforeMount?: MergedHook;
|
---|
912 | mounted?: MergedHook;
|
---|
913 | beforeUpdate?: MergedHook;
|
---|
914 | updated?: MergedHook;
|
---|
915 | activated?: MergedHook;
|
---|
916 | deactivated?: MergedHook;
|
---|
917 | /** @deprecated use `beforeUnmount` instead */
|
---|
918 | beforeDestroy?: MergedHook;
|
---|
919 | beforeUnmount?: MergedHook;
|
---|
920 | /** @deprecated use `unmounted` instead */
|
---|
921 | destroyed?: MergedHook;
|
---|
922 | unmounted?: MergedHook;
|
---|
923 | renderTracked?: MergedHook<DebuggerHook>;
|
---|
924 | renderTriggered?: MergedHook<DebuggerHook>;
|
---|
925 | errorCaptured?: MergedHook<ErrorCapturedHook>;
|
---|
926 | };
|
---|
927 | type OptionTypesKeys = 'P' | 'B' | 'D' | 'C' | 'M' | 'Defaults';
|
---|
928 | type OptionTypesType<P = {}, B = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Defaults = {}> = {
|
---|
929 | P: P;
|
---|
930 | B: B;
|
---|
931 | D: D;
|
---|
932 | C: C;
|
---|
933 | M: M;
|
---|
934 | Defaults: Defaults;
|
---|
935 | };
|
---|
936 | /**
|
---|
937 | * @deprecated
|
---|
938 | */
|
---|
939 | export type ComponentOptionsWithoutProps<Props = {}, RawBindings = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, EE extends string = string, I extends ComponentInjectOptions = {}, II extends string = string, S extends SlotsType = {}, LC extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions, TE extends ComponentTypeEmits = {}, ResolvedEmits extends EmitsOptions = {} extends E ? TypeEmitsToOptions<TE> : E, PE = Props & EmitsToProps<ResolvedEmits>> = ComponentOptionsBase<PE, RawBindings, D, C, M, Mixin, Extends, E, EE, {}, I, II, S, LC, Directives, Exposed, Provide> & {
|
---|
940 | props?: never;
|
---|
941 | /**
|
---|
942 | * @private for language-tools use only
|
---|
943 | */
|
---|
944 | __typeProps?: Props;
|
---|
945 | /**
|
---|
946 | * @private for language-tools use only
|
---|
947 | */
|
---|
948 | __typeEmits?: TE;
|
---|
949 | } & ThisType<CreateComponentPublicInstanceWithMixins<PE, RawBindings, D, C, M, Mixin, Extends, ResolvedEmits, EE, {}, false, I, S, LC, Directives, Exposed>>;
|
---|
950 | /**
|
---|
951 | * @deprecated
|
---|
952 | */
|
---|
953 | export type ComponentOptionsWithArrayProps<PropNames extends string = string, RawBindings = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = EmitsOptions, EE extends string = string, I extends ComponentInjectOptions = {}, II extends string = string, S extends SlotsType = {}, LC extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions, Props = Prettify<Readonly<{
|
---|
954 | [key in PropNames]?: any;
|
---|
955 | } & EmitsToProps<E>>>> = ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, {}, I, II, S, LC, Directives, Exposed, Provide> & {
|
---|
956 | props: PropNames[];
|
---|
957 | } & ThisType<CreateComponentPublicInstanceWithMixins<Props, RawBindings, D, C, M, Mixin, Extends, E, Props, {}, false, I, S, LC, Directives, Exposed>>;
|
---|
958 | /**
|
---|
959 | * @deprecated
|
---|
960 | */
|
---|
961 | export type ComponentOptionsWithObjectProps<PropsOptions = ComponentObjectPropsOptions, RawBindings = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = EmitsOptions, EE extends string = string, I extends ComponentInjectOptions = {}, II extends string = string, S extends SlotsType = {}, LC extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions, Props = Prettify<Readonly<ExtractPropTypes<PropsOptions>> & Readonly<EmitsToProps<E>>>, Defaults = ExtractDefaultPropTypes<PropsOptions>> = ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, Defaults, I, II, S, LC, Directives, Exposed, Provide> & {
|
---|
962 | props: PropsOptions & ThisType<void>;
|
---|
963 | } & ThisType<CreateComponentPublicInstanceWithMixins<Props, RawBindings, D, C, M, Mixin, Extends, E, Props, Defaults, false, I, S, LC, Directives>>;
|
---|
964 |
|
---|
965 | interface InjectionConstraint<T> {
|
---|
966 | }
|
---|
967 | export type InjectionKey<T> = symbol & InjectionConstraint<T>;
|
---|
968 | export declare function provide<T, K = InjectionKey<T> | string | number>(key: K, value: K extends InjectionKey<infer V> ? V : T): void;
|
---|
969 | export declare function inject<T>(key: InjectionKey<T> | string): T | undefined;
|
---|
970 | export declare function inject<T>(key: InjectionKey<T> | string, defaultValue: T, treatDefaultAsFactory?: false): T;
|
---|
971 | export declare function inject<T>(key: InjectionKey<T> | string, defaultValue: T | (() => T), treatDefaultAsFactory: true): T;
|
---|
972 | /**
|
---|
973 | * Returns true if `inject()` can be used without warning about being called in the wrong place (e.g. outside of
|
---|
974 | * setup()). This is used by libraries that want to use `inject()` internally without triggering a warning to the end
|
---|
975 | * user. One example is `useRoute()` in `vue-router`.
|
---|
976 | */
|
---|
977 | export declare function hasInjectionContext(): boolean;
|
---|
978 |
|
---|
979 | export type PublicProps = VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
---|
980 | type ResolveProps<PropsOrPropOptions, E extends EmitsOptions> = Readonly<PropsOrPropOptions extends ComponentPropsOptions ? ExtractPropTypes<PropsOrPropOptions> : PropsOrPropOptions> & ({} extends E ? {} : EmitsToProps<E>);
|
---|
981 | export type DefineComponent<PropsOrPropOptions = {}, RawBindings = {}, D = {}, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, EE extends string = string, PP = PublicProps, Props = ResolveProps<PropsOrPropOptions, E>, Defaults = ExtractDefaultPropTypes<PropsOrPropOptions>, S extends SlotsType = {}, LC extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions, MakeDefaultsOptional extends boolean = true, TypeRefs extends Record<string, unknown> = {}, TypeEl extends Element = any> = ComponentPublicInstanceConstructor<CreateComponentPublicInstanceWithMixins<Props, RawBindings, D, C, M, Mixin, Extends, E, PP, Defaults, MakeDefaultsOptional, {}, S, LC & GlobalComponents, Directives & GlobalDirectives, Exposed, TypeRefs, TypeEl>> & ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, Defaults, {}, string, S, LC & GlobalComponents, Directives & GlobalDirectives, Exposed, Provide> & PP;
|
---|
982 | export type DefineSetupFnComponent<P extends Record<string, any>, E extends EmitsOptions = {}, S extends SlotsType = SlotsType, Props = P & EmitsToProps<E>, PP = PublicProps> = new (props: Props & PP) => CreateComponentPublicInstanceWithMixins<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, E, PP, {}, false, {}, S>;
|
---|
983 | type ToResolvedProps<Props, Emits extends EmitsOptions> = Readonly<Props> & Readonly<EmitsToProps<Emits>>;
|
---|
984 | export declare function defineComponent<Props extends Record<string, any>, E extends EmitsOptions = {}, EE extends string = string, S extends SlotsType = {}>(setup: (props: Props, ctx: SetupContext<E, S>) => RenderFunction | Promise<RenderFunction>, options?: Pick<ComponentOptions, 'name' | 'inheritAttrs'> & {
|
---|
985 | props?: (keyof Props)[];
|
---|
986 | emits?: E | EE[];
|
---|
987 | slots?: S;
|
---|
988 | }): DefineSetupFnComponent<Props, E, S>;
|
---|
989 | export declare function defineComponent<Props extends Record<string, any>, E extends EmitsOptions = {}, EE extends string = string, S extends SlotsType = {}>(setup: (props: Props, ctx: SetupContext<E, S>) => RenderFunction | Promise<RenderFunction>, options?: Pick<ComponentOptions, 'name' | 'inheritAttrs'> & {
|
---|
990 | props?: ComponentObjectPropsOptions<Props>;
|
---|
991 | emits?: E | EE[];
|
---|
992 | slots?: S;
|
---|
993 | }): DefineSetupFnComponent<Props, E, S>;
|
---|
994 | export declare function defineComponent<TypeProps, RuntimePropsOptions extends ComponentObjectPropsOptions = ComponentObjectPropsOptions, RuntimePropsKeys extends string = string, TypeEmits extends ComponentTypeEmits = {}, RuntimeEmitsOptions extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Data = {}, SetupBindings = {}, Computed extends ComputedOptions = {}, Methods extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, InjectOptions extends ComponentInjectOptions = {}, InjectKeys extends string = string, Slots extends SlotsType = {}, LocalComponents extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions, ResolvedEmits extends EmitsOptions = {} extends RuntimeEmitsOptions ? TypeEmitsToOptions<TypeEmits> : RuntimeEmitsOptions, InferredProps = IsKeyValues<TypeProps> extends true ? TypeProps : string extends RuntimePropsKeys ? ComponentObjectPropsOptions extends RuntimePropsOptions ? {} : ExtractPropTypes<RuntimePropsOptions> : {
|
---|
995 | [key in RuntimePropsKeys]?: any;
|
---|
996 | }, TypeRefs extends Record<string, unknown> = {}, TypeEl extends Element = any>(options: {
|
---|
997 | props?: (RuntimePropsOptions & ThisType<void>) | RuntimePropsKeys[];
|
---|
998 | /**
|
---|
999 | * @private for language-tools use only
|
---|
1000 | */
|
---|
1001 | __typeProps?: TypeProps;
|
---|
1002 | /**
|
---|
1003 | * @private for language-tools use only
|
---|
1004 | */
|
---|
1005 | __typeEmits?: TypeEmits;
|
---|
1006 | /**
|
---|
1007 | * @private for language-tools use only
|
---|
1008 | */
|
---|
1009 | __typeRefs?: TypeRefs;
|
---|
1010 | /**
|
---|
1011 | * @private for language-tools use only
|
---|
1012 | */
|
---|
1013 | __typeEl?: TypeEl;
|
---|
1014 | } & ComponentOptionsBase<ToResolvedProps<InferredProps, ResolvedEmits>, SetupBindings, Data, Computed, Methods, Mixin, Extends, RuntimeEmitsOptions, RuntimeEmitsKeys, {}, // Defaults
|
---|
1015 | InjectOptions, InjectKeys, Slots, LocalComponents, Directives, Exposed, Provide> & ThisType<CreateComponentPublicInstanceWithMixins<ToResolvedProps<InferredProps, ResolvedEmits>, SetupBindings, Data, Computed, Methods, Mixin, Extends, ResolvedEmits, {}, {}, false, InjectOptions, Slots, LocalComponents, Directives, Exposed>>): DefineComponent<InferredProps, SetupBindings, Data, Computed, Methods, Mixin, Extends, ResolvedEmits, RuntimeEmitsKeys, PublicProps, ToResolvedProps<InferredProps, ResolvedEmits>, ExtractDefaultPropTypes<RuntimePropsOptions>, Slots, LocalComponents, Directives, Exposed, Provide, unknown extends TypeProps ? true : false, TypeRefs, TypeEl>;
|
---|
1016 |
|
---|
1017 | export interface App<HostElement = any> {
|
---|
1018 | version: string;
|
---|
1019 | config: AppConfig;
|
---|
1020 | use<Options extends unknown[]>(plugin: Plugin<Options>, ...options: Options): this;
|
---|
1021 | use<Options>(plugin: Plugin<Options>, options: Options): this;
|
---|
1022 | mixin(mixin: ComponentOptions): this;
|
---|
1023 | component(name: string): Component | undefined;
|
---|
1024 | component<T extends Component | DefineComponent>(name: string, component: T): this;
|
---|
1025 | directive<HostElement = any, Value = any, Modifiers extends string = string, Arg extends string = string>(name: string): Directive<HostElement, Value, Modifiers, Arg> | undefined;
|
---|
1026 | directive<HostElement = any, Value = any, Modifiers extends string = string, Arg extends string = string>(name: string, directive: Directive<HostElement, Value, Modifiers, Arg>): this;
|
---|
1027 | mount(rootContainer: HostElement | string,
|
---|
1028 | /**
|
---|
1029 | * @internal
|
---|
1030 | */
|
---|
1031 | isHydrate?: boolean,
|
---|
1032 | /**
|
---|
1033 | * @internal
|
---|
1034 | */
|
---|
1035 | namespace?: boolean | ElementNamespace,
|
---|
1036 | /**
|
---|
1037 | * @internal
|
---|
1038 | */
|
---|
1039 | vnode?: VNode): ComponentPublicInstance;
|
---|
1040 | unmount(): void;
|
---|
1041 | onUnmount(cb: () => void): void;
|
---|
1042 | provide<T, K = InjectionKey<T> | string | number>(key: K, value: K extends InjectionKey<infer V> ? V : T): this;
|
---|
1043 | /**
|
---|
1044 | * Runs a function with the app as active instance. This allows using of `inject()` within the function to get access
|
---|
1045 | * to variables provided via `app.provide()`.
|
---|
1046 | *
|
---|
1047 | * @param fn - function to run with the app as active instance
|
---|
1048 | */
|
---|
1049 | runWithContext<T>(fn: () => T): T;
|
---|
1050 | _uid: number;
|
---|
1051 | _component: ConcreteComponent;
|
---|
1052 | _props: Data | null;
|
---|
1053 | _container: HostElement | null;
|
---|
1054 | _context: AppContext;
|
---|
1055 | _instance: ComponentInternalInstance | null;
|
---|
1056 | /**
|
---|
1057 | * v2 compat only
|
---|
1058 | */
|
---|
1059 | filter?(name: string): Function | undefined;
|
---|
1060 | filter?(name: string, filter: Function): this;
|
---|
1061 | }
|
---|
1062 | export type OptionMergeFunction = (to: unknown, from: unknown) => any;
|
---|
1063 | export interface AppConfig {
|
---|
1064 | readonly isNativeTag: (tag: string) => boolean;
|
---|
1065 | performance: boolean;
|
---|
1066 | optionMergeStrategies: Record<string, OptionMergeFunction>;
|
---|
1067 | globalProperties: ComponentCustomProperties & Record<string, any>;
|
---|
1068 | errorHandler?: (err: unknown, instance: ComponentPublicInstance | null, info: string) => void;
|
---|
1069 | warnHandler?: (msg: string, instance: ComponentPublicInstance | null, trace: string) => void;
|
---|
1070 | /**
|
---|
1071 | * Options to pass to `@vue/compiler-dom`.
|
---|
1072 | * Only supported in runtime compiler build.
|
---|
1073 | */
|
---|
1074 | compilerOptions: RuntimeCompilerOptions;
|
---|
1075 | /**
|
---|
1076 | * @deprecated use config.compilerOptions.isCustomElement
|
---|
1077 | */
|
---|
1078 | isCustomElement?: (tag: string) => boolean;
|
---|
1079 | /**
|
---|
1080 | * TODO document for 3.5
|
---|
1081 | * Enable warnings for computed getters that recursively trigger itself.
|
---|
1082 | */
|
---|
1083 | warnRecursiveComputed?: boolean;
|
---|
1084 | /**
|
---|
1085 | * Whether to throw unhandled errors in production.
|
---|
1086 | * Default is `false` to avoid crashing on any error (and only logs it)
|
---|
1087 | * But in some cases, e.g. SSR, throwing might be more desirable.
|
---|
1088 | */
|
---|
1089 | throwUnhandledErrorInProduction?: boolean;
|
---|
1090 | /**
|
---|
1091 | * Prefix for all useId() calls within this app
|
---|
1092 | */
|
---|
1093 | idPrefix?: string;
|
---|
1094 | }
|
---|
1095 | export interface AppContext {
|
---|
1096 | app: App;
|
---|
1097 | config: AppConfig;
|
---|
1098 | mixins: ComponentOptions[];
|
---|
1099 | components: Record<string, Component>;
|
---|
1100 | directives: Record<string, Directive>;
|
---|
1101 | provides: Record<string | symbol, any>;
|
---|
1102 | }
|
---|
1103 | type PluginInstallFunction<Options = any[]> = Options extends unknown[] ? (app: App, ...options: Options) => any : (app: App, options: Options) => any;
|
---|
1104 | export type ObjectPlugin<Options = any[]> = {
|
---|
1105 | install: PluginInstallFunction<Options>;
|
---|
1106 | };
|
---|
1107 | export type FunctionPlugin<Options = any[]> = PluginInstallFunction<Options> & Partial<ObjectPlugin<Options>>;
|
---|
1108 | export type Plugin<Options = any[]> = FunctionPlugin<Options> | ObjectPlugin<Options>;
|
---|
1109 | export type CreateAppFunction<HostElement> = (rootComponent: Component, rootProps?: Data | null) => App<HostElement>;
|
---|
1110 |
|
---|
1111 | type TeleportVNode = VNode<RendererNode, RendererElement, TeleportProps>;
|
---|
1112 | export interface TeleportProps {
|
---|
1113 | to: string | RendererElement | null | undefined;
|
---|
1114 | disabled?: boolean;
|
---|
1115 | defer?: boolean;
|
---|
1116 | }
|
---|
1117 | declare const TeleportImpl: {
|
---|
1118 | name: string;
|
---|
1119 | __isTeleport: boolean;
|
---|
1120 | process(n1: TeleportVNode | null, n2: TeleportVNode, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, namespace: ElementNamespace, slotScopeIds: string[] | null, optimized: boolean, internals: RendererInternals): void;
|
---|
1121 | remove(vnode: VNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, { um: unmount, o: { remove: hostRemove } }: RendererInternals, doRemove: boolean): void;
|
---|
1122 | move: typeof moveTeleport;
|
---|
1123 | hydrate: typeof hydrateTeleport;
|
---|
1124 | };
|
---|
1125 | declare enum TeleportMoveTypes {
|
---|
1126 | TARGET_CHANGE = 0,
|
---|
1127 | TOGGLE = 1,// enable / disable
|
---|
1128 | REORDER = 2
|
---|
1129 | }
|
---|
1130 | declare function moveTeleport(vnode: VNode, container: RendererElement, parentAnchor: RendererNode | null, { o: { insert }, m: move }: RendererInternals, moveType?: TeleportMoveTypes): void;
|
---|
1131 | declare function hydrateTeleport(node: Node, vnode: TeleportVNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, slotScopeIds: string[] | null, optimized: boolean, { o: { nextSibling, parentNode, querySelector, insert, createText }, }: RendererInternals<Node, Element>, hydrateChildren: (node: Node | null, vnode: VNode, container: Element, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, slotScopeIds: string[] | null, optimized: boolean) => Node | null): Node | null;
|
---|
1132 | export declare const Teleport: {
|
---|
1133 | __isTeleport: true;
|
---|
1134 | new (): {
|
---|
1135 | $props: VNodeProps & TeleportProps;
|
---|
1136 | $slots: {
|
---|
1137 | default(): VNode[];
|
---|
1138 | };
|
---|
1139 | };
|
---|
1140 | };
|
---|
1141 |
|
---|
1142 | /**
|
---|
1143 | * @private
|
---|
1144 | */
|
---|
1145 | export declare function resolveComponent(name: string, maybeSelfReference?: boolean): ConcreteComponent | string;
|
---|
1146 | declare const NULL_DYNAMIC_COMPONENT: unique symbol;
|
---|
1147 | /**
|
---|
1148 | * @private
|
---|
1149 | */
|
---|
1150 | export declare function resolveDynamicComponent(component: unknown): VNodeTypes;
|
---|
1151 | /**
|
---|
1152 | * @private
|
---|
1153 | */
|
---|
1154 | export declare function resolveDirective(name: string): Directive | undefined;
|
---|
1155 |
|
---|
1156 | export declare const Fragment: {
|
---|
1157 | __isFragment: true;
|
---|
1158 | new (): {
|
---|
1159 | $props: VNodeProps;
|
---|
1160 | };
|
---|
1161 | };
|
---|
1162 | export declare const Text: unique symbol;
|
---|
1163 | export declare const Comment: unique symbol;
|
---|
1164 | export declare const Static: unique symbol;
|
---|
1165 | export type VNodeTypes = string | VNode | Component | typeof Text | typeof Static | typeof Comment | typeof Fragment | typeof Teleport | typeof TeleportImpl | typeof Suspense | typeof SuspenseImpl;
|
---|
1166 | export type VNodeRef = string | Ref | ((ref: Element | ComponentPublicInstance | null, refs: Record<string, any>) => void);
|
---|
1167 | type VNodeNormalizedRefAtom = {
|
---|
1168 | /**
|
---|
1169 | * component instance
|
---|
1170 | */
|
---|
1171 | i: ComponentInternalInstance;
|
---|
1172 | /**
|
---|
1173 | * Actual ref
|
---|
1174 | */
|
---|
1175 | r: VNodeRef;
|
---|
1176 | /**
|
---|
1177 | * setup ref key
|
---|
1178 | */
|
---|
1179 | k?: string;
|
---|
1180 | /**
|
---|
1181 | * refInFor marker
|
---|
1182 | */
|
---|
1183 | f?: boolean;
|
---|
1184 | };
|
---|
1185 | type VNodeNormalizedRef = VNodeNormalizedRefAtom | VNodeNormalizedRefAtom[];
|
---|
1186 | type VNodeMountHook = (vnode: VNode) => void;
|
---|
1187 | type VNodeUpdateHook = (vnode: VNode, oldVNode: VNode) => void;
|
---|
1188 | export type VNodeProps = {
|
---|
1189 | key?: PropertyKey;
|
---|
1190 | ref?: VNodeRef;
|
---|
1191 | ref_for?: boolean;
|
---|
1192 | ref_key?: string;
|
---|
1193 | onVnodeBeforeMount?: VNodeMountHook | VNodeMountHook[];
|
---|
1194 | onVnodeMounted?: VNodeMountHook | VNodeMountHook[];
|
---|
1195 | onVnodeBeforeUpdate?: VNodeUpdateHook | VNodeUpdateHook[];
|
---|
1196 | onVnodeUpdated?: VNodeUpdateHook | VNodeUpdateHook[];
|
---|
1197 | onVnodeBeforeUnmount?: VNodeMountHook | VNodeMountHook[];
|
---|
1198 | onVnodeUnmounted?: VNodeMountHook | VNodeMountHook[];
|
---|
1199 | };
|
---|
1200 | type VNodeChildAtom = VNode | string | number | boolean | null | undefined | void;
|
---|
1201 | export type VNodeArrayChildren = Array<VNodeArrayChildren | VNodeChildAtom>;
|
---|
1202 | export type VNodeChild = VNodeChildAtom | VNodeArrayChildren;
|
---|
1203 | export type VNodeNormalizedChildren = string | VNodeArrayChildren | RawSlots | null;
|
---|
1204 | export interface VNode<HostNode = RendererNode, HostElement = RendererElement, ExtraProps = {
|
---|
1205 | [key: string]: any;
|
---|
1206 | }> {
|
---|
1207 | type: VNodeTypes;
|
---|
1208 | props: (VNodeProps & ExtraProps) | null;
|
---|
1209 | key: PropertyKey | null;
|
---|
1210 | ref: VNodeNormalizedRef | null;
|
---|
1211 | /**
|
---|
1212 | * SFC only. This is assigned on vnode creation using currentScopeId
|
---|
1213 | * which is set alongside currentRenderingInstance.
|
---|
1214 | */
|
---|
1215 | scopeId: string | null;
|
---|
1216 | children: VNodeNormalizedChildren;
|
---|
1217 | component: ComponentInternalInstance | null;
|
---|
1218 | dirs: DirectiveBinding[] | null;
|
---|
1219 | transition: TransitionHooks<HostElement> | null;
|
---|
1220 | el: HostNode | null;
|
---|
1221 | anchor: HostNode | null;
|
---|
1222 | target: HostElement | null;
|
---|
1223 | targetStart: HostNode | null;
|
---|
1224 | targetAnchor: HostNode | null;
|
---|
1225 | suspense: SuspenseBoundary | null;
|
---|
1226 | shapeFlag: number;
|
---|
1227 | patchFlag: number;
|
---|
1228 | appContext: AppContext | null;
|
---|
1229 | }
|
---|
1230 | /**
|
---|
1231 | * Open a block.
|
---|
1232 | * This must be called before `createBlock`. It cannot be part of `createBlock`
|
---|
1233 | * because the children of the block are evaluated before `createBlock` itself
|
---|
1234 | * is called. The generated code typically looks like this:
|
---|
1235 | *
|
---|
1236 | * ```js
|
---|
1237 | * function render() {
|
---|
1238 | * return (openBlock(),createBlock('div', null, [...]))
|
---|
1239 | * }
|
---|
1240 | * ```
|
---|
1241 | * disableTracking is true when creating a v-for fragment block, since a v-for
|
---|
1242 | * fragment always diffs its children.
|
---|
1243 | *
|
---|
1244 | * @private
|
---|
1245 | */
|
---|
1246 | export declare function openBlock(disableTracking?: boolean): void;
|
---|
1247 | /**
|
---|
1248 | * Block tracking sometimes needs to be disabled, for example during the
|
---|
1249 | * creation of a tree that needs to be cached by v-once. The compiler generates
|
---|
1250 | * code like this:
|
---|
1251 | *
|
---|
1252 | * ``` js
|
---|
1253 | * _cache[1] || (
|
---|
1254 | * setBlockTracking(-1, true),
|
---|
1255 | * _cache[1] = createVNode(...),
|
---|
1256 | * setBlockTracking(1),
|
---|
1257 | * _cache[1]
|
---|
1258 | * )
|
---|
1259 | * ```
|
---|
1260 | *
|
---|
1261 | * @private
|
---|
1262 | */
|
---|
1263 | export declare function setBlockTracking(value: number, inVOnce?: boolean): void;
|
---|
1264 | /**
|
---|
1265 | * @private
|
---|
1266 | */
|
---|
1267 | export declare function createElementBlock(type: string | typeof Fragment, props?: Record<string, any> | null, children?: any, patchFlag?: number, dynamicProps?: string[], shapeFlag?: number): VNode;
|
---|
1268 | /**
|
---|
1269 | * Create a block root vnode. Takes the same exact arguments as `createVNode`.
|
---|
1270 | * A block root keeps track of dynamic nodes within the block in the
|
---|
1271 | * `dynamicChildren` array.
|
---|
1272 | *
|
---|
1273 | * @private
|
---|
1274 | */
|
---|
1275 | export declare function createBlock(type: VNodeTypes | ClassComponent, props?: Record<string, any> | null, children?: any, patchFlag?: number, dynamicProps?: string[]): VNode;
|
---|
1276 | export declare function isVNode(value: any): value is VNode;
|
---|
1277 | declare let vnodeArgsTransformer: ((args: Parameters<typeof _createVNode>, instance: ComponentInternalInstance | null) => Parameters<typeof _createVNode>) | undefined;
|
---|
1278 | /**
|
---|
1279 | * Internal API for registering an arguments transform for createVNode
|
---|
1280 | * used for creating stubs in the test-utils
|
---|
1281 | * It is *internal* but needs to be exposed for test-utils to pick up proper
|
---|
1282 | * typings
|
---|
1283 | */
|
---|
1284 | export declare function transformVNodeArgs(transformer?: typeof vnodeArgsTransformer): void;
|
---|
1285 | export declare function createBaseVNode(type: VNodeTypes | ClassComponent | typeof NULL_DYNAMIC_COMPONENT, props?: (Data & VNodeProps) | null, children?: unknown, patchFlag?: number, dynamicProps?: string[] | null, shapeFlag?: number, isBlockNode?: boolean, needFullChildrenNormalization?: boolean): VNode;
|
---|
1286 |
|
---|
1287 | export declare const createVNode: typeof _createVNode;
|
---|
1288 | declare function _createVNode(type: VNodeTypes | ClassComponent | typeof NULL_DYNAMIC_COMPONENT, props?: (Data & VNodeProps) | null, children?: unknown, patchFlag?: number, dynamicProps?: string[] | null, isBlockNode?: boolean): VNode;
|
---|
1289 | export declare function guardReactiveProps(props: (Data & VNodeProps) | null): (Data & VNodeProps) | null;
|
---|
1290 | export declare function cloneVNode<T, U>(vnode: VNode<T, U>, extraProps?: (Data & VNodeProps) | null, mergeRef?: boolean, cloneTransition?: boolean): VNode<T, U>;
|
---|
1291 | /**
|
---|
1292 | * @private
|
---|
1293 | */
|
---|
1294 | export declare function createTextVNode(text?: string, flag?: number): VNode;
|
---|
1295 | /**
|
---|
1296 | * @private
|
---|
1297 | */
|
---|
1298 | export declare function createStaticVNode(content: string, numberOfNodes: number): VNode;
|
---|
1299 | /**
|
---|
1300 | * @private
|
---|
1301 | */
|
---|
1302 | export declare function createCommentVNode(text?: string, asBlock?: boolean): VNode;
|
---|
1303 | export declare function mergeProps(...args: (Data & VNodeProps)[]): Data;
|
---|
1304 |
|
---|
1305 | type Data = Record<string, unknown>;
|
---|
1306 | /**
|
---|
1307 | * Public utility type for extracting the instance type of a component.
|
---|
1308 | * Works with all valid component definition types. This is intended to replace
|
---|
1309 | * the usage of `InstanceType<typeof Comp>` which only works for
|
---|
1310 | * constructor-based component definition types.
|
---|
1311 | *
|
---|
1312 | * @example
|
---|
1313 | * ```ts
|
---|
1314 | * const MyComp = { ... }
|
---|
1315 | * declare const instance: ComponentInstance<typeof MyComp>
|
---|
1316 | * ```
|
---|
1317 | */
|
---|
1318 | export type ComponentInstance<T> = T extends {
|
---|
1319 | new (): ComponentPublicInstance;
|
---|
1320 | } ? InstanceType<T> : T extends FunctionalComponent<infer Props, infer Emits> ? ComponentPublicInstance<Props, {}, {}, {}, {}, ShortEmitsToObject<Emits>> : T extends Component<infer Props, infer RawBindings, infer D, infer C, infer M> ? ComponentPublicInstance<unknown extends Props ? {} : Props, unknown extends RawBindings ? {} : RawBindings, unknown extends D ? {} : D, C, M> : never;
|
---|
1321 | /**
|
---|
1322 | * For extending allowed non-declared props on components in TSX
|
---|
1323 | */
|
---|
1324 | export interface ComponentCustomProps {
|
---|
1325 | }
|
---|
1326 | /**
|
---|
1327 | * For globally defined Directives
|
---|
1328 | * Here is an example of adding a directive `VTooltip` as global directive:
|
---|
1329 | *
|
---|
1330 | * @example
|
---|
1331 | * ```ts
|
---|
1332 | * import VTooltip from 'v-tooltip'
|
---|
1333 | *
|
---|
1334 | * declare module '@vue/runtime-core' {
|
---|
1335 | * interface GlobalDirectives {
|
---|
1336 | * VTooltip
|
---|
1337 | * }
|
---|
1338 | * }
|
---|
1339 | * ```
|
---|
1340 | */
|
---|
1341 | export interface GlobalDirectives {
|
---|
1342 | }
|
---|
1343 | /**
|
---|
1344 | * For globally defined Components
|
---|
1345 | * Here is an example of adding a component `RouterView` as global component:
|
---|
1346 | *
|
---|
1347 | * @example
|
---|
1348 | * ```ts
|
---|
1349 | * import { RouterView } from 'vue-router'
|
---|
1350 | *
|
---|
1351 | * declare module '@vue/runtime-core' {
|
---|
1352 | * interface GlobalComponents {
|
---|
1353 | * RouterView
|
---|
1354 | * }
|
---|
1355 | * }
|
---|
1356 | * ```
|
---|
1357 | */
|
---|
1358 | export interface GlobalComponents {
|
---|
1359 | Teleport: DefineComponent<TeleportProps>;
|
---|
1360 | Suspense: DefineComponent<SuspenseProps>;
|
---|
1361 | KeepAlive: DefineComponent<KeepAliveProps>;
|
---|
1362 | BaseTransition: DefineComponent<BaseTransitionProps>;
|
---|
1363 | }
|
---|
1364 | /**
|
---|
1365 | * Default allowed non-declared props on component in TSX
|
---|
1366 | */
|
---|
1367 | export interface AllowedComponentProps {
|
---|
1368 | class?: unknown;
|
---|
1369 | style?: unknown;
|
---|
1370 | }
|
---|
1371 | interface ComponentInternalOptions {
|
---|
1372 | /**
|
---|
1373 | * Compat build only, for bailing out of certain compatibility behavior
|
---|
1374 | */
|
---|
1375 | __isBuiltIn?: boolean;
|
---|
1376 | /**
|
---|
1377 | * This one should be exposed so that devtools can make use of it
|
---|
1378 | */
|
---|
1379 | __file?: string;
|
---|
1380 | /**
|
---|
1381 | * name inferred from filename
|
---|
1382 | */
|
---|
1383 | __name?: string;
|
---|
1384 | }
|
---|
1385 | export interface FunctionalComponent<P = {}, E extends EmitsOptions | Record<string, any[]> = {}, S extends Record<string, any> = any, EE extends EmitsOptions = ShortEmitsToObject<E>> extends ComponentInternalOptions {
|
---|
1386 | (props: P & EmitsToProps<EE>, ctx: Omit<SetupContext<EE, IfAny<S, {}, SlotsType<S>>>, 'expose'>): any;
|
---|
1387 | props?: ComponentPropsOptions<P>;
|
---|
1388 | emits?: EE | (keyof EE)[];
|
---|
1389 | slots?: IfAny<S, Slots, SlotsType<S>>;
|
---|
1390 | inheritAttrs?: boolean;
|
---|
1391 | displayName?: string;
|
---|
1392 | compatConfig?: CompatConfig;
|
---|
1393 | }
|
---|
1394 | interface ClassComponent {
|
---|
1395 | new (...args: any[]): ComponentPublicInstance<any, any, any, any, any>;
|
---|
1396 | __vccOpts: ComponentOptions;
|
---|
1397 | }
|
---|
1398 | /**
|
---|
1399 | * Concrete component type matches its actual value: it's either an options
|
---|
1400 | * object, or a function. Use this where the code expects to work with actual
|
---|
1401 | * values, e.g. checking if its a function or not. This is mostly for internal
|
---|
1402 | * implementation code.
|
---|
1403 | */
|
---|
1404 | export type ConcreteComponent<Props = {}, RawBindings = any, D = any, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions, E extends EmitsOptions | Record<string, any[]> = {}, S extends Record<string, any> = any> = ComponentOptions<Props, RawBindings, D, C, M> | FunctionalComponent<Props, E, S>;
|
---|
1405 | /**
|
---|
1406 | * A type used in public APIs where a component type is expected.
|
---|
1407 | * The constructor type is an artificial type returned by defineComponent().
|
---|
1408 | */
|
---|
1409 | export type Component<Props = any, RawBindings = any, D = any, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions, E extends EmitsOptions | Record<string, any[]> = {}, S extends Record<string, any> = any> = ConcreteComponent<Props, RawBindings, D, C, M, E, S> | ComponentPublicInstanceConstructor<Props>;
|
---|
1410 |
|
---|
1411 | export type SetupContext<E = EmitsOptions, S extends SlotsType = {}> = E extends any ? {
|
---|
1412 | attrs: Data;
|
---|
1413 | slots: UnwrapSlotsType<S>;
|
---|
1414 | emit: EmitFn<E>;
|
---|
1415 | expose: <Exposed extends Record<string, any> = Record<string, any>>(exposed?: Exposed) => void;
|
---|
1416 | } : never;
|
---|
1417 | /**
|
---|
1418 | * We expose a subset of properties on the internal instance as they are
|
---|
1419 | * useful for advanced external libraries and tools.
|
---|
1420 | */
|
---|
1421 | export interface ComponentInternalInstance {
|
---|
1422 | uid: number;
|
---|
1423 | type: ConcreteComponent;
|
---|
1424 | parent: ComponentInternalInstance | null;
|
---|
1425 | root: ComponentInternalInstance;
|
---|
1426 | appContext: AppContext;
|
---|
1427 | /**
|
---|
1428 | * Vnode representing this component in its parent's vdom tree
|
---|
1429 | */
|
---|
1430 | vnode: VNode;
|
---|
1431 | /**
|
---|
1432 | * Root vnode of this component's own vdom tree
|
---|
1433 | */
|
---|
1434 | subTree: VNode;
|
---|
1435 | /**
|
---|
1436 | * Render effect instance
|
---|
1437 | */
|
---|
1438 | effect: ReactiveEffect;
|
---|
1439 | /**
|
---|
1440 | * Force update render effect
|
---|
1441 | */
|
---|
1442 | update: () => void;
|
---|
1443 | /**
|
---|
1444 | * Render effect job to be passed to scheduler (checks if dirty)
|
---|
1445 | */
|
---|
1446 | job: SchedulerJob;
|
---|
1447 | proxy: ComponentPublicInstance | null;
|
---|
1448 | exposed: Record<string, any> | null;
|
---|
1449 | exposeProxy: Record<string, any> | null;
|
---|
1450 | data: Data;
|
---|
1451 | props: Data;
|
---|
1452 | attrs: Data;
|
---|
1453 | slots: InternalSlots;
|
---|
1454 | refs: Data;
|
---|
1455 | emit: EmitFn;
|
---|
1456 | isMounted: boolean;
|
---|
1457 | isUnmounted: boolean;
|
---|
1458 | isDeactivated: boolean;
|
---|
1459 | }
|
---|
1460 | export declare const getCurrentInstance: () => ComponentInternalInstance | null;
|
---|
1461 | /**
|
---|
1462 | * For runtime-dom to register the compiler.
|
---|
1463 | * Note the exported method uses any to avoid d.ts relying on the compiler types.
|
---|
1464 | */
|
---|
1465 | export declare function registerRuntimeCompiler(_compile: any): void;
|
---|
1466 | export declare const isRuntimeOnly: () => boolean;
|
---|
1467 | export interface ComponentCustomElementInterface {
|
---|
1468 | }
|
---|
1469 |
|
---|
1470 | type MaybeUndefined<T, I> = I extends true ? T | undefined : T;
|
---|
1471 | type MapSources<T, Immediate> = {
|
---|
1472 | [K in keyof T]: T[K] extends WatchSource<infer V> ? MaybeUndefined<V, Immediate> : T[K] extends object ? MaybeUndefined<T[K], Immediate> : never;
|
---|
1473 | };
|
---|
1474 | export interface WatchEffectOptions extends DebuggerOptions {
|
---|
1475 | flush?: 'pre' | 'post' | 'sync';
|
---|
1476 | }
|
---|
1477 | export interface WatchOptions<Immediate = boolean> extends WatchEffectOptions {
|
---|
1478 | immediate?: Immediate;
|
---|
1479 | deep?: boolean | number;
|
---|
1480 | once?: boolean;
|
---|
1481 | }
|
---|
1482 | export declare function watchEffect(effect: WatchEffect, options?: WatchEffectOptions): WatchHandle;
|
---|
1483 | export declare function watchPostEffect(effect: WatchEffect, options?: DebuggerOptions): WatchHandle;
|
---|
1484 | export declare function watchSyncEffect(effect: WatchEffect, options?: DebuggerOptions): WatchHandle;
|
---|
1485 | export type MultiWatchSources = (WatchSource<unknown> | object)[];
|
---|
1486 | export declare function watch<T, Immediate extends Readonly<boolean> = false>(source: WatchSource<T>, cb: WatchCallback<T, MaybeUndefined<T, Immediate>>, options?: WatchOptions<Immediate>): WatchHandle;
|
---|
1487 | export declare function watch<T extends Readonly<MultiWatchSources>, Immediate extends Readonly<boolean> = false>(sources: readonly [...T] | T, cb: [T] extends [ReactiveMarker] ? WatchCallback<T, MaybeUndefined<T, Immediate>> : WatchCallback<MapSources<T, false>, MapSources<T, Immediate>>, options?: WatchOptions<Immediate>): WatchHandle;
|
---|
1488 | export declare function watch<T extends MultiWatchSources, Immediate extends Readonly<boolean> = false>(sources: [...T], cb: WatchCallback<MapSources<T, false>, MapSources<T, Immediate>>, options?: WatchOptions<Immediate>): WatchHandle;
|
---|
1489 | export declare function watch<T extends object, Immediate extends Readonly<boolean> = false>(source: T, cb: WatchCallback<T, MaybeUndefined<T, Immediate>>, options?: WatchOptions<Immediate>): WatchHandle;
|
---|
1490 |
|
---|
1491 | /**
|
---|
1492 | * A lazy hydration strategy for async components.
|
---|
1493 | * @param hydrate - call this to perform the actual hydration.
|
---|
1494 | * @param forEachElement - iterate through the root elements of the component's
|
---|
1495 | * non-hydrated DOM, accounting for possible fragments.
|
---|
1496 | * @returns a teardown function to be called if the async component is unmounted
|
---|
1497 | * before it is hydrated. This can be used to e.g. remove DOM event
|
---|
1498 | * listeners.
|
---|
1499 | */
|
---|
1500 | export type HydrationStrategy = (hydrate: () => void, forEachElement: (cb: (el: Element) => any) => void) => (() => void) | void;
|
---|
1501 | export type HydrationStrategyFactory<Options> = (options?: Options) => HydrationStrategy;
|
---|
1502 | export declare const hydrateOnIdle: HydrationStrategyFactory<number>;
|
---|
1503 | export declare const hydrateOnVisible: HydrationStrategyFactory<IntersectionObserverInit>;
|
---|
1504 | export declare const hydrateOnMediaQuery: HydrationStrategyFactory<string>;
|
---|
1505 | export declare const hydrateOnInteraction: HydrationStrategyFactory<keyof HTMLElementEventMap | Array<keyof HTMLElementEventMap>>;
|
---|
1506 |
|
---|
1507 | type AsyncComponentResolveResult<T = Component> = T | {
|
---|
1508 | default: T;
|
---|
1509 | };
|
---|
1510 | export type AsyncComponentLoader<T = any> = () => Promise<AsyncComponentResolveResult<T>>;
|
---|
1511 | export interface AsyncComponentOptions<T = any> {
|
---|
1512 | loader: AsyncComponentLoader<T>;
|
---|
1513 | loadingComponent?: Component;
|
---|
1514 | errorComponent?: Component;
|
---|
1515 | delay?: number;
|
---|
1516 | timeout?: number;
|
---|
1517 | suspensible?: boolean;
|
---|
1518 | hydrate?: HydrationStrategy;
|
---|
1519 | onError?: (error: Error, retry: () => void, fail: () => void, attempts: number) => any;
|
---|
1520 | }
|
---|
1521 | /*! #__NO_SIDE_EFFECTS__ */
|
---|
1522 | export declare function defineAsyncComponent<T extends Component = {
|
---|
1523 | new (): ComponentPublicInstance;
|
---|
1524 | }>(source: AsyncComponentLoader<T> | AsyncComponentOptions<T>): T;
|
---|
1525 |
|
---|
1526 | export declare function useModel<M extends PropertyKey, T extends Record<string, any>, K extends keyof T, G = T[K], S = T[K]>(props: T, name: K, options?: DefineModelOptions<T[K], G, S>): ModelRef<T[K], M, G, S>;
|
---|
1527 |
|
---|
1528 | export declare function useTemplateRef<T = unknown, Keys extends string = string>(key: Keys): Readonly<ShallowRef<T | null>>;
|
---|
1529 |
|
---|
1530 | export declare function useId(): string;
|
---|
1531 |
|
---|
1532 | type RawProps = VNodeProps & {
|
---|
1533 | __v_isVNode?: never;
|
---|
1534 | [Symbol.iterator]?: never;
|
---|
1535 | } & Record<string, any>;
|
---|
1536 | type RawChildren = string | number | boolean | VNode | VNodeArrayChildren | (() => any);
|
---|
1537 | interface Constructor<P = any> {
|
---|
1538 | __isFragment?: never;
|
---|
1539 | __isTeleport?: never;
|
---|
1540 | __isSuspense?: never;
|
---|
1541 | new (...args: any[]): {
|
---|
1542 | $props: P;
|
---|
1543 | };
|
---|
1544 | }
|
---|
1545 | type HTMLElementEventHandler = {
|
---|
1546 | [K in keyof HTMLElementEventMap as `on${Capitalize<K>}`]?: (ev: HTMLElementEventMap[K]) => any;
|
---|
1547 | };
|
---|
1548 | export declare function h<K extends keyof HTMLElementTagNameMap>(type: K, children?: RawChildren): VNode;
|
---|
1549 | export declare function h<K extends keyof HTMLElementTagNameMap>(type: K, props?: (RawProps & HTMLElementEventHandler) | null, children?: RawChildren | RawSlots): VNode;
|
---|
1550 | export declare function h(type: string, children?: RawChildren): VNode;
|
---|
1551 | export declare function h(type: string, props?: RawProps | null, children?: RawChildren | RawSlots): VNode;
|
---|
1552 | export declare function h(type: typeof Text | typeof Comment, children?: string | number | boolean): VNode;
|
---|
1553 | export declare function h(type: typeof Text | typeof Comment, props?: null, children?: string | number | boolean): VNode;
|
---|
1554 | export declare function h(type: typeof Fragment, children?: VNodeArrayChildren): VNode;
|
---|
1555 | export declare function h(type: typeof Fragment, props?: RawProps | null, children?: VNodeArrayChildren): VNode;
|
---|
1556 | export declare function h(type: typeof Teleport, props: RawProps & TeleportProps, children: RawChildren | RawSlots): VNode;
|
---|
1557 | export declare function h(type: typeof Suspense, children?: RawChildren): VNode;
|
---|
1558 | export declare function h(type: typeof Suspense, props?: (RawProps & SuspenseProps) | null, children?: RawChildren | RawSlots): VNode;
|
---|
1559 | export declare function h<P, E extends EmitsOptions = {}, S extends Record<string, any> = any>(type: FunctionalComponent<P, any, S, any>, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren | IfAny<S, RawSlots, S>): VNode;
|
---|
1560 | export declare function h(type: Component, children?: RawChildren): VNode;
|
---|
1561 | export declare function h<P>(type: ConcreteComponent | string, children?: RawChildren): VNode;
|
---|
1562 | export declare function h<P>(type: ConcreteComponent<P> | string, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren): VNode;
|
---|
1563 | export declare function h<P>(type: Component<P>, props?: (RawProps & P) | null, children?: RawChildren | RawSlots): VNode;
|
---|
1564 | export declare function h<P>(type: ComponentOptions<P>, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren | RawSlots): VNode;
|
---|
1565 | export declare function h(type: Constructor, children?: RawChildren): VNode;
|
---|
1566 | export declare function h<P>(type: Constructor<P>, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren | RawSlots): VNode;
|
---|
1567 | export declare function h(type: DefineComponent, children?: RawChildren): VNode;
|
---|
1568 | export declare function h<P>(type: DefineComponent<P>, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren | RawSlots): VNode;
|
---|
1569 | export declare function h(type: string | Component, children?: RawChildren): VNode;
|
---|
1570 | export declare function h<P>(type: string | Component<P>, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren | RawSlots): VNode;
|
---|
1571 |
|
---|
1572 | export declare const ssrContextKey: unique symbol;
|
---|
1573 | export declare const useSSRContext: <T = Record<string, any>>() => T | undefined;
|
---|
1574 |
|
---|
1575 | declare function warn$1(msg: string, ...args: any[]): void;
|
---|
1576 |
|
---|
1577 | export declare enum ErrorCodes {
|
---|
1578 | SETUP_FUNCTION = 0,
|
---|
1579 | RENDER_FUNCTION = 1,
|
---|
1580 | NATIVE_EVENT_HANDLER = 5,
|
---|
1581 | COMPONENT_EVENT_HANDLER = 6,
|
---|
1582 | VNODE_HOOK = 7,
|
---|
1583 | DIRECTIVE_HOOK = 8,
|
---|
1584 | TRANSITION_HOOK = 9,
|
---|
1585 | APP_ERROR_HANDLER = 10,
|
---|
1586 | APP_WARN_HANDLER = 11,
|
---|
1587 | FUNCTION_REF = 12,
|
---|
1588 | ASYNC_COMPONENT_LOADER = 13,
|
---|
1589 | SCHEDULER = 14,
|
---|
1590 | COMPONENT_UPDATE = 15,
|
---|
1591 | APP_UNMOUNT_CLEANUP = 16
|
---|
1592 | }
|
---|
1593 | type ErrorTypes = LifecycleHooks | ErrorCodes | WatchErrorCodes;
|
---|
1594 | export declare function callWithErrorHandling(fn: Function, instance: ComponentInternalInstance | null | undefined, type: ErrorTypes, args?: unknown[]): any;
|
---|
1595 | export declare function callWithAsyncErrorHandling(fn: Function | Function[], instance: ComponentInternalInstance | null, type: ErrorTypes, args?: unknown[]): any;
|
---|
1596 | export declare function handleError(err: unknown, instance: ComponentInternalInstance | null | undefined, type: ErrorTypes, throwInDev?: boolean): void;
|
---|
1597 |
|
---|
1598 | export declare function initCustomFormatter(): void;
|
---|
1599 |
|
---|
1600 | interface AppRecord {
|
---|
1601 | id: number;
|
---|
1602 | app: App;
|
---|
1603 | version: string;
|
---|
1604 | types: Record<string, string | Symbol>;
|
---|
1605 | }
|
---|
1606 | interface DevtoolsHook {
|
---|
1607 | enabled?: boolean;
|
---|
1608 | emit: (event: string, ...payload: any[]) => void;
|
---|
1609 | on: (event: string, handler: Function) => void;
|
---|
1610 | once: (event: string, handler: Function) => void;
|
---|
1611 | off: (event: string, handler: Function) => void;
|
---|
1612 | appRecords: AppRecord[];
|
---|
1613 | /**
|
---|
1614 | * Added at https://github.com/vuejs/devtools/commit/f2ad51eea789006ab66942e5a27c0f0986a257f9
|
---|
1615 | * Returns whether the arg was buffered or not
|
---|
1616 | */
|
---|
1617 | cleanupBuffer?: (matchArg: unknown) => boolean;
|
---|
1618 | }
|
---|
1619 | declare function setDevtoolsHook$1(hook: DevtoolsHook, target: any): void;
|
---|
1620 |
|
---|
1621 | type HMRComponent = ComponentOptions | ClassComponent;
|
---|
1622 | export interface HMRRuntime {
|
---|
1623 | createRecord: typeof createRecord;
|
---|
1624 | rerender: typeof rerender;
|
---|
1625 | reload: typeof reload;
|
---|
1626 | }
|
---|
1627 | declare function createRecord(id: string, initialDef: HMRComponent): boolean;
|
---|
1628 | declare function rerender(id: string, newRender?: Function): void;
|
---|
1629 | declare function reload(id: string, newComp: HMRComponent): void;
|
---|
1630 |
|
---|
1631 | /**
|
---|
1632 | * Set scope id when creating hoisted vnodes.
|
---|
1633 | * @private compiler helper
|
---|
1634 | */
|
---|
1635 | export declare function pushScopeId(id: string | null): void;
|
---|
1636 | /**
|
---|
1637 | * Technically we no longer need this after 3.0.8 but we need to keep the same
|
---|
1638 | * API for backwards compat w/ code generated by compilers.
|
---|
1639 | * @private
|
---|
1640 | */
|
---|
1641 | export declare function popScopeId(): void;
|
---|
1642 | /**
|
---|
1643 | * Only for backwards compat
|
---|
1644 | * @private
|
---|
1645 | */
|
---|
1646 | export declare const withScopeId: (_id: string) => typeof withCtx;
|
---|
1647 | /**
|
---|
1648 | * Wrap a slot function to memoize current rendering instance
|
---|
1649 | * @private compiler helper
|
---|
1650 | */
|
---|
1651 | export declare function withCtx(fn: Function, ctx?: ComponentInternalInstance | null, isNonScopedSlot?: boolean): Function;
|
---|
1652 |
|
---|
1653 | /**
|
---|
1654 | * v-for string
|
---|
1655 | * @private
|
---|
1656 | */
|
---|
1657 | export declare function renderList(source: string, renderItem: (value: string, index: number) => VNodeChild): VNodeChild[];
|
---|
1658 | /**
|
---|
1659 | * v-for number
|
---|
1660 | */
|
---|
1661 | export declare function renderList(source: number, renderItem: (value: number, index: number) => VNodeChild): VNodeChild[];
|
---|
1662 | /**
|
---|
1663 | * v-for array
|
---|
1664 | */
|
---|
1665 | export declare function renderList<T>(source: T[], renderItem: (value: T, index: number) => VNodeChild): VNodeChild[];
|
---|
1666 | /**
|
---|
1667 | * v-for iterable
|
---|
1668 | */
|
---|
1669 | export declare function renderList<T>(source: Iterable<T>, renderItem: (value: T, index: number) => VNodeChild): VNodeChild[];
|
---|
1670 | /**
|
---|
1671 | * v-for object
|
---|
1672 | */
|
---|
1673 | export declare function renderList<T>(source: T, renderItem: <K extends keyof T>(value: T[K], key: string, index: number) => VNodeChild): VNodeChild[];
|
---|
1674 |
|
---|
1675 | /**
|
---|
1676 | * For prefixing keys in v-on="obj" with "on"
|
---|
1677 | * @private
|
---|
1678 | */
|
---|
1679 | export declare function toHandlers(obj: Record<string, any>, preserveCaseIfNecessary?: boolean): Record<string, any>;
|
---|
1680 |
|
---|
1681 | /**
|
---|
1682 | * Compiler runtime helper for rendering `<slot/>`
|
---|
1683 | * @private
|
---|
1684 | */
|
---|
1685 | export declare function renderSlot(slots: Slots, name: string, props?: Data, fallback?: () => VNodeArrayChildren, noSlotted?: boolean): VNode;
|
---|
1686 |
|
---|
1687 | type SSRSlot = (...args: any[]) => VNode[] | undefined;
|
---|
1688 | interface CompiledSlotDescriptor {
|
---|
1689 | name: string;
|
---|
1690 | fn: SSRSlot;
|
---|
1691 | key?: string;
|
---|
1692 | }
|
---|
1693 | /**
|
---|
1694 | * Compiler runtime helper for creating dynamic slots object
|
---|
1695 | * @private
|
---|
1696 | */
|
---|
1697 | export declare function createSlots(slots: Record<string, SSRSlot>, dynamicSlots: (CompiledSlotDescriptor | CompiledSlotDescriptor[] | undefined)[]): Record<string, SSRSlot>;
|
---|
1698 |
|
---|
1699 | export declare function withMemo(memo: any[], render: () => VNode<any, any>, cache: any[], index: number): VNode<any, any>;
|
---|
1700 | export declare function isMemoSame(cached: VNode, memo: any[]): boolean;
|
---|
1701 |
|
---|
1702 | export type LegacyConfig = {
|
---|
1703 | /**
|
---|
1704 | * @deprecated `config.silent` option has been removed
|
---|
1705 | */
|
---|
1706 | silent?: boolean;
|
---|
1707 | /**
|
---|
1708 | * @deprecated use __VUE_PROD_DEVTOOLS__ compile-time feature flag instead
|
---|
1709 | * https://github.com/vuejs/core/tree/main/packages/vue#bundler-build-feature-flags
|
---|
1710 | */
|
---|
1711 | devtools?: boolean;
|
---|
1712 | /**
|
---|
1713 | * @deprecated use `config.isCustomElement` instead
|
---|
1714 | * https://v3-migration.vuejs.org/breaking-changes/global-api.html#config-ignoredelements-is-now-config-iscustomelement
|
---|
1715 | */
|
---|
1716 | ignoredElements?: (string | RegExp)[];
|
---|
1717 | /**
|
---|
1718 | * @deprecated
|
---|
1719 | * https://v3-migration.vuejs.org/breaking-changes/keycode-modifiers.html
|
---|
1720 | */
|
---|
1721 | keyCodes?: Record<string, number | number[]>;
|
---|
1722 | /**
|
---|
1723 | * @deprecated
|
---|
1724 | * https://v3-migration.vuejs.org/breaking-changes/global-api.html#config-productiontip-removed
|
---|
1725 | */
|
---|
1726 | productionTip?: boolean;
|
---|
1727 | };
|
---|
1728 |
|
---|
1729 | type LegacyPublicInstance = ComponentPublicInstance & LegacyPublicProperties;
|
---|
1730 | interface LegacyPublicProperties {
|
---|
1731 | $set<T extends Record<keyof any, any>, K extends keyof T>(target: T, key: K, value: T[K]): void;
|
---|
1732 | $delete<T extends Record<keyof any, any>, K extends keyof T>(target: T, key: K): void;
|
---|
1733 | $mount(el?: string | Element): this;
|
---|
1734 | $destroy(): void;
|
---|
1735 | $scopedSlots: Slots;
|
---|
1736 | $on(event: string | string[], fn: Function): this;
|
---|
1737 | $once(event: string, fn: Function): this;
|
---|
1738 | $off(event?: string | string[], fn?: Function): this;
|
---|
1739 | $children: LegacyPublicProperties[];
|
---|
1740 | $listeners: Record<string, Function | Function[]>;
|
---|
1741 | }
|
---|
1742 |
|
---|
1743 | /**
|
---|
1744 | * @deprecated the default `Vue` export has been removed in Vue 3. The type for
|
---|
1745 | * the default export is provided only for migration purposes. Please use
|
---|
1746 | * named imports instead - e.g. `import { createApp } from 'vue'`.
|
---|
1747 | */
|
---|
1748 | export type CompatVue = Pick<App, 'version' | 'component' | 'directive'> & {
|
---|
1749 | configureCompat: typeof configureCompat;
|
---|
1750 | new (options?: ComponentOptions): LegacyPublicInstance;
|
---|
1751 | version: string;
|
---|
1752 | config: AppConfig & LegacyConfig;
|
---|
1753 | nextTick: typeof nextTick;
|
---|
1754 | use<Options extends unknown[]>(plugin: Plugin<Options>, ...options: Options): CompatVue;
|
---|
1755 | use<Options>(plugin: Plugin<Options>, options: Options): CompatVue;
|
---|
1756 | mixin(mixin: ComponentOptions): CompatVue;
|
---|
1757 | component(name: string): Component | undefined;
|
---|
1758 | component(name: string, component: Component): CompatVue;
|
---|
1759 | directive<T = any, V = any>(name: string): Directive<T, V> | undefined;
|
---|
1760 | directive<T = any, V = any>(name: string, directive: Directive<T, V>): CompatVue;
|
---|
1761 | compile(template: string): RenderFunction;
|
---|
1762 | /**
|
---|
1763 | * @deprecated Vue 3 no longer supports extending constructors.
|
---|
1764 | */
|
---|
1765 | extend: (options?: ComponentOptions) => CompatVue;
|
---|
1766 | /**
|
---|
1767 | * @deprecated Vue 3 no longer needs set() for adding new properties.
|
---|
1768 | */
|
---|
1769 | set(target: any, key: PropertyKey, value: any): void;
|
---|
1770 | /**
|
---|
1771 | * @deprecated Vue 3 no longer needs delete() for property deletions.
|
---|
1772 | */
|
---|
1773 | delete(target: any, key: PropertyKey): void;
|
---|
1774 | /**
|
---|
1775 | * @deprecated use `reactive` instead.
|
---|
1776 | */
|
---|
1777 | observable: typeof reactive;
|
---|
1778 | /**
|
---|
1779 | * @deprecated filters have been removed from Vue 3.
|
---|
1780 | */
|
---|
1781 | filter(name: string, arg?: any): null;
|
---|
1782 | };
|
---|
1783 |
|
---|
1784 | export declare const version: string;
|
---|
1785 |
|
---|
1786 | export declare const warn: typeof warn$1;
|
---|
1787 |
|
---|
1788 | export declare const devtools: DevtoolsHook;
|
---|
1789 | export declare const setDevtoolsHook: typeof setDevtoolsHook$1;
|
---|
1790 |
|
---|
1791 | declare module '@vue/reactivity' {
|
---|
1792 | interface RefUnwrapBailTypes {
|
---|
1793 | runtimeCoreBailTypes: VNode | {
|
---|
1794 | $: ComponentInternalInstance;
|
---|
1795 | };
|
---|
1796 | }
|
---|
1797 | }
|
---|
1798 |
|
---|
1799 | export declare const DeprecationTypes: typeof DeprecationTypes$1;
|
---|
1800 |
|
---|
1801 | export { type WatchEffectOptions as WatchOptionsBase, createBaseVNode as createElementVNode, };
|
---|
1802 | // Note: this file is auto concatenated to the end of the bundled d.ts during
|
---|
1803 | // build.
|
---|
1804 |
|
---|
1805 | declare module '@vue/runtime-core' {
|
---|
1806 | export interface GlobalComponents {
|
---|
1807 | Teleport: DefineComponent<TeleportProps>
|
---|
1808 | Suspense: DefineComponent<SuspenseProps>
|
---|
1809 | KeepAlive: DefineComponent<KeepAliveProps>
|
---|
1810 | BaseTransition: DefineComponent<BaseTransitionProps>
|
---|
1811 | }
|
---|
1812 | }
|
---|
1813 |
|
---|
1814 | // Note: this file is auto concatenated to the end of the bundled d.ts during
|
---|
1815 | // build.
|
---|
1816 | type _defineProps = typeof defineProps
|
---|
1817 | type _defineEmits = typeof defineEmits
|
---|
1818 | type _defineExpose = typeof defineExpose
|
---|
1819 | type _defineOptions = typeof defineOptions
|
---|
1820 | type _defineSlots = typeof defineSlots
|
---|
1821 | type _defineModel = typeof defineModel
|
---|
1822 | type _withDefaults = typeof withDefaults
|
---|
1823 |
|
---|
1824 | declare global {
|
---|
1825 | const defineProps: _defineProps
|
---|
1826 | const defineEmits: _defineEmits
|
---|
1827 | const defineExpose: _defineExpose
|
---|
1828 | const defineOptions: _defineOptions
|
---|
1829 | const defineSlots: _defineSlots
|
---|
1830 | const defineModel: _defineModel
|
---|
1831 | const withDefaults: _withDefaults
|
---|
1832 | }
|
---|