@mc-markets/ui 1.0.37 → 1.0.38

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