@vitejs/devtools 0.0.0-alpha.3 → 0.0.0-alpha.30

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.
@@ -1,39 +1,1481 @@
1
+ import { SharedState } from "@vitejs/devtools-kit/utils/shared-state";
1
2
  import { DevToolsDockEntry } from "@vitejs/devtools-kit";
2
- import { VueElementConstructor } from "vue";
3
+ import { DevToolsRpcClient, DockEntryState, DockPanelStorage, DocksContext } from "@vitejs/devtools-kit/client";
3
4
 
4
- //#region src/client/webcomponents/components/DockProps.d.ts
5
- interface DevToolsDockState {
6
- width: number;
7
- height: number;
8
- top: number;
9
- left: number;
10
- position: 'left' | 'right' | 'bottom' | 'top';
11
- open: boolean;
12
- minimizePanelInactive: number;
13
- dockEntry?: DevToolsDockEntry;
14
- }
15
- interface DockProps {
16
- state: DevToolsDockState;
17
- docks: DevToolsDockEntry[];
5
+ //#region ../../node_modules/.pnpm/@vue+shared@3.5.27/node_modules/@vue/shared/dist/shared.d.ts
6
+ type Prettify<T> = { [K in keyof T]: T[K] } & {};
7
+ type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;
8
+ type LooseRequired<T> = { [P in keyof (T & Required<T>)]: T[P] };
9
+ type IfAny<T, Y, N> = 0 extends 1 & T ? Y : N;
10
+ //#endregion
11
+ //#region ../../node_modules/.pnpm/@vue+reactivity@3.5.27/node_modules/@vue/reactivity/dist/reactivity.d.ts
12
+ declare enum TrackOpTypes {
13
+ GET = "get",
14
+ HAS = "has",
15
+ ITERATE = "iterate"
16
+ }
17
+ declare enum TriggerOpTypes {
18
+ SET = "set",
19
+ ADD = "add",
20
+ DELETE = "delete",
21
+ CLEAR = "clear"
22
+ }
23
+ type UnwrapNestedRefs<T> = T extends Ref ? T : UnwrapRefSimple<T>;
24
+ declare const ShallowReactiveMarker: unique symbol;
25
+ type Primitive = string | number | boolean | bigint | symbol | undefined | null;
26
+ type Builtin = Primitive | Function | Date | Error | RegExp;
27
+ type EffectScheduler = (...args: any[]) => any;
28
+ type DebuggerEvent = {
29
+ effect: Subscriber;
30
+ } & DebuggerEventExtraInfo;
31
+ type DebuggerEventExtraInfo = {
32
+ target: object;
33
+ type: TrackOpTypes | TriggerOpTypes;
34
+ key: any;
35
+ newValue?: any;
36
+ oldValue?: any;
37
+ oldTarget?: Map<any, any> | Set<any>;
38
+ };
39
+ interface DebuggerOptions {
40
+ onTrack?: (event: DebuggerEvent) => void;
41
+ onTrigger?: (event: DebuggerEvent) => void;
42
+ }
43
+ interface ReactiveEffectOptions extends DebuggerOptions {
44
+ scheduler?: EffectScheduler;
45
+ allowRecurse?: boolean;
46
+ onStop?: () => void;
47
+ }
48
+ /**
49
+ * Subscriber is a type that tracks (or subscribes to) a list of deps.
50
+ */
51
+ interface Subscriber extends DebuggerOptions {}
52
+ declare class ReactiveEffect<T = any> implements Subscriber, ReactiveEffectOptions {
53
+ fn: () => T;
54
+ scheduler?: EffectScheduler;
55
+ onStop?: () => void;
56
+ onTrack?: (event: DebuggerEvent) => void;
57
+ onTrigger?: (event: DebuggerEvent) => void;
58
+ constructor(fn: () => T);
59
+ pause(): void;
60
+ resume(): void;
61
+ run(): T;
62
+ stop(): void;
63
+ trigger(): void;
64
+ get dirty(): boolean;
65
+ }
66
+ type ComputedGetter<T> = (oldValue?: T) => T;
67
+ type ComputedSetter<T> = (newValue: T) => void;
68
+ interface WritableComputedOptions<T, S = T> {
69
+ get: ComputedGetter<T>;
70
+ set: ComputedSetter<S>;
71
+ }
72
+ declare const RefSymbol: unique symbol;
73
+ declare const RawSymbol: unique symbol;
74
+ interface Ref<T = any, S = T> {
75
+ get value(): T;
76
+ set value(_: S);
77
+ /**
78
+ * Type differentiator only.
79
+ * We need this to be in public d.ts but don't want it to show up in IDE
80
+ * autocomplete, so we use a private Symbol instead.
81
+ */
82
+ [RefSymbol]: true;
83
+ }
84
+ declare const ShallowRefMarker: unique symbol;
85
+ type ShallowRef<T = any, S = T> = Ref<T, S> & {
86
+ [ShallowRefMarker]?: true;
87
+ };
88
+ /**
89
+ * This is a special exported interface for other packages to declare
90
+ * additional types that should bail out for ref unwrapping. For example
91
+ * \@vue/runtime-dom can declare it like so in its d.ts:
92
+ *
93
+ * ``` ts
94
+ * declare module '@vue/reactivity' {
95
+ * export interface RefUnwrapBailTypes {
96
+ * runtimeDOMBailTypes: Node | Window
97
+ * }
98
+ * }
99
+ * ```
100
+ */
101
+ interface RefUnwrapBailTypes {}
102
+ type ShallowUnwrapRef<T> = { [K in keyof T]: DistributeRef<T[K]> };
103
+ type DistributeRef<T> = T extends Ref<infer V, unknown> ? V : T;
104
+ type UnwrapRef<T> = T extends ShallowRef<infer V, unknown> ? V : T extends Ref<infer V, unknown> ? UnwrapRefSimple<V> : UnwrapRefSimple<T>;
105
+ type UnwrapRefSimple<T> = T extends Builtin | Ref | RefUnwrapBailTypes[keyof RefUnwrapBailTypes] | {
106
+ [RawSymbol]?: true;
107
+ } ? T : T extends Map<infer K, infer V> ? Map<K, UnwrapRefSimple<V>> & UnwrapRef<Omit<T, keyof Map<any, any>>> : T extends WeakMap<infer K, infer V> ? WeakMap<K, UnwrapRefSimple<V>> & UnwrapRef<Omit<T, keyof WeakMap<any, any>>> : T extends Set<infer V> ? Set<UnwrapRefSimple<V>> & UnwrapRef<Omit<T, keyof Set<any>>> : T extends WeakSet<infer V> ? WeakSet<UnwrapRefSimple<V>> & UnwrapRef<Omit<T, keyof WeakSet<any>>> : T extends ReadonlyArray<any> ? { [K in keyof T]: UnwrapRefSimple<T[K]> } : T extends object & {
108
+ [ShallowReactiveMarker]?: never;
109
+ } ? { [P in keyof T]: P extends symbol ? T[P] : UnwrapRef<T[P]> } : T;
110
+ type WatchCallback<V = any, OV = any> = (value: V, oldValue: OV, onCleanup: OnCleanup) => any;
111
+ type OnCleanup = (cleanupFn: () => void) => void;
112
+ type WatchStopHandle = () => void;
113
+ //#endregion
114
+ //#region ../../node_modules/.pnpm/@vue+runtime-core@3.5.27/node_modules/@vue/runtime-core/dist/runtime-core.d.ts
115
+ type Slot<T extends any = any> = (...args: IfAny<T, any[], [T] | (T extends undefined ? [] : never)>) => VNode[];
116
+ type InternalSlots = {
117
+ [name: string]: Slot | undefined;
118
+ };
119
+ type Slots = Readonly<InternalSlots>;
120
+ declare const SlotSymbol: unique symbol;
121
+ type SlotsType<T extends Record<string, any> = Record<string, any>> = {
122
+ [SlotSymbol]?: T;
123
+ };
124
+ type StrictUnwrapSlotsType<S extends SlotsType, T = NonNullable<S[typeof SlotSymbol]>> = [keyof S] extends [never] ? Slots : Readonly<T> & T;
125
+ type UnwrapSlotsType<S extends SlotsType, T = NonNullable<S[typeof SlotSymbol]>> = [keyof S] extends [never] ? Slots : Readonly<Prettify<{ [K in keyof T]: NonNullable<T[K]> extends ((...args: any[]) => any) ? T[K] : Slot<T[K]> }>>;
126
+ type RawSlots = {
127
+ [name: string]: unknown;
128
+ $stable?: boolean;
129
+ };
130
+ declare enum SchedulerJobFlags {
131
+ QUEUED = 1,
132
+ PRE = 2,
133
+ /**
134
+ * Indicates whether the effect is allowed to recursively trigger itself
135
+ * when managed by the scheduler.
136
+ *
137
+ * By default, a job cannot trigger itself because some built-in method calls,
138
+ * e.g. Array.prototype.push actually performs reads as well (#1740) which
139
+ * can lead to confusing infinite loops.
140
+ * The allowed cases are component update functions and watch callbacks.
141
+ * Component update functions may update child component props, which in turn
142
+ * trigger flush: "pre" watch callbacks that mutates state that the parent
143
+ * relies on (#1801). Watch callbacks doesn't track its dependencies so if it
144
+ * triggers itself again, it's likely intentional and it is the user's
145
+ * responsibility to perform recursive state mutation that eventually
146
+ * stabilizes (#1727).
147
+ */
148
+ ALLOW_RECURSE = 4,
149
+ DISPOSED = 8
150
+ }
151
+ interface SchedulerJob extends Function {
152
+ id?: number;
153
+ /**
154
+ * flags can technically be undefined, but it can still be used in bitwise
155
+ * operations just like 0.
156
+ */
157
+ flags?: SchedulerJobFlags;
158
+ /**
159
+ * Attached by renderer.ts when setting up a component's render effect
160
+ * Used to obtain component information when reporting max recursive updates.
161
+ */
162
+ i?: ComponentInternalInstance;
163
+ }
164
+ declare function nextTick(): Promise<void>;
165
+ declare function nextTick<T, R>(this: T, fn: (this: T) => R | Promise<R>): Promise<R>;
166
+ type ComponentPropsOptions<P = Data> = ComponentObjectPropsOptions<P> | string[];
167
+ type ComponentObjectPropsOptions<P = Data> = { [K in keyof P]: Prop<P[K]> | null };
168
+ type Prop<T, D = T> = PropOptions<T, D> | PropType<T>;
169
+ type DefaultFactory<T> = (props: Data) => T | null | undefined;
170
+ interface PropOptions<T = any, D = T> {
171
+ type?: PropType<T> | true | null;
172
+ required?: boolean;
173
+ default?: D | DefaultFactory<D> | null | undefined | object;
174
+ validator?(value: unknown, props: Data): boolean;
175
+ }
176
+ type PropType<T> = PropConstructor<T> | (PropConstructor<T> | null)[];
177
+ type PropConstructor<T = any> = {
178
+ new (...args: any[]): T & {};
179
+ } | {
180
+ (): T;
181
+ } | PropMethod<T>;
182
+ type PropMethod<T, TConstructor = any> = [T] extends [((...args: any) => any) | undefined] ? {
183
+ new (): TConstructor;
184
+ (): T;
185
+ readonly prototype: TConstructor;
186
+ } : never;
187
+ type RequiredKeys<T> = { [K in keyof T]: T[K] extends {
188
+ required: true;
189
+ } | {
190
+ default: any;
191
+ } | BooleanConstructor | {
192
+ type: BooleanConstructor;
193
+ } ? T[K] extends {
194
+ default: undefined | (() => undefined);
195
+ } ? never : K : never }[keyof T];
196
+ type OptionalKeys<T> = Exclude<keyof T, RequiredKeys<T>>;
197
+ type DefaultKeys<T> = { [K in keyof T]: T[K] extends {
198
+ default: any;
199
+ } | BooleanConstructor | {
200
+ type: BooleanConstructor;
201
+ } ? T[K] extends {
202
+ type: BooleanConstructor;
203
+ required: true;
204
+ } ? never : K : never }[keyof T];
205
+ type InferPropType<T, NullAsAny = true> = [T] extends [null] ? NullAsAny extends true ? any : null : [T] extends [{
206
+ type: null | true;
207
+ }] ? any : [T] extends [ObjectConstructor | {
208
+ type: ObjectConstructor;
209
+ }] ? Record<string, any> : [T] extends [BooleanConstructor | {
210
+ type: BooleanConstructor;
211
+ }] ? boolean : [T] extends [DateConstructor | {
212
+ type: DateConstructor;
213
+ }] ? Date : [T] extends [(infer U)[] | {
214
+ type: (infer U)[];
215
+ }] ? 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;
216
+ /**
217
+ * Extract prop types from a runtime props options object.
218
+ * The extracted types are **internal** - i.e. the resolved props received by
219
+ * the component.
220
+ * - Boolean props are always present
221
+ * - Props with default values are always present
222
+ *
223
+ * To extract accepted props from the parent, use {@link ExtractPublicPropTypes}.
224
+ */
225
+ type ExtractPropTypes<O> = { [K in keyof Pick<O, RequiredKeys<O>>]: O[K] extends {
226
+ default: any;
227
+ } ? Exclude<InferPropType<O[K]>, undefined> : InferPropType<O[K]> } & { [K in keyof Pick<O, OptionalKeys<O>>]?: InferPropType<O[K]> };
228
+ type ExtractDefaultPropTypes<O> = O extends object ? { [K in keyof Pick<O, DefaultKeys<O>>]: InferPropType<O[K]> } : {};
229
+ /**
230
+ * Vue `<script setup>` compiler macro for declaring component props. The
231
+ * expected argument is the same as the component `props` option.
232
+ *
233
+ * Example runtime declaration:
234
+ * ```js
235
+ * // using Array syntax
236
+ * const props = defineProps(['foo', 'bar'])
237
+ * // using Object syntax
238
+ * const props = defineProps({
239
+ * foo: String,
240
+ * bar: {
241
+ * type: Number,
242
+ * required: true
243
+ * }
244
+ * })
245
+ * ```
246
+ *
247
+ * Equivalent type-based declaration:
248
+ * ```ts
249
+ * // will be compiled into equivalent runtime declarations
250
+ * const props = defineProps<{
251
+ * foo?: string
252
+ * bar: number
253
+ * }>()
254
+ * ```
255
+ *
256
+ * @see {@link https://vuejs.org/api/sfc-script-setup.html#defineprops-defineemits}
257
+ *
258
+ * This is only usable inside `<script setup>`, is compiled away in the
259
+ * output and should **not** be actually called at runtime.
260
+ */
261
+ declare function defineProps<PropNames extends string = string>(props: PropNames[]): Prettify<Readonly<{ [key in PropNames]?: any }>>;
262
+ declare function defineProps<PP extends ComponentObjectPropsOptions = ComponentObjectPropsOptions>(props: PP): Prettify<Readonly<ExtractPropTypes<PP>>>;
263
+ declare function defineProps<TypeProps>(): DefineProps<LooseRequired<TypeProps>, BooleanKey<TypeProps>>;
264
+ type DefineProps<T, BKeys extends keyof T> = Readonly<T> & { readonly [K in BKeys]-?: boolean };
265
+ type BooleanKey<T, K extends keyof T = keyof T> = K extends any ? T[K] extends boolean | undefined ? T[K] extends never | undefined ? never : K : never : never;
266
+ /**
267
+ * Vue `<script setup>` compiler macro for declaring a component's emitted
268
+ * events. The expected argument is the same as the component `emits` option.
269
+ *
270
+ * Example runtime declaration:
271
+ * ```js
272
+ * const emit = defineEmits(['change', 'update'])
273
+ * ```
274
+ *
275
+ * Example type-based declaration:
276
+ * ```ts
277
+ * const emit = defineEmits<{
278
+ * // <eventName>: <expected arguments>
279
+ * change: []
280
+ * update: [value: number] // named tuple syntax
281
+ * }>()
282
+ *
283
+ * emit('change')
284
+ * emit('update', 1)
285
+ * ```
286
+ *
287
+ * This is only usable inside `<script setup>`, is compiled away in the
288
+ * output and should **not** be actually called at runtime.
289
+ *
290
+ * @see {@link https://vuejs.org/api/sfc-script-setup.html#defineprops-defineemits}
291
+ */
292
+ declare function defineEmits<EE extends string = string>(emitOptions: EE[]): EmitFn<EE[]>;
293
+ declare function defineEmits<E extends EmitsOptions = EmitsOptions>(emitOptions: E): EmitFn<E>;
294
+ declare function defineEmits<T extends ComponentTypeEmits>(): T extends ((...args: any[]) => any) ? T : ShortEmits<T>;
295
+ type ComponentTypeEmits = ((...args: any[]) => any) | Record<string, any>;
296
+ type RecordToUnion<T extends Record<string, any>> = T[keyof T];
297
+ type ShortEmits<T extends Record<string, any>> = UnionToIntersection<RecordToUnion<{ [K in keyof T]: (evt: K, ...args: T[K]) => void }>>;
298
+ /**
299
+ * Vue `<script setup>` compiler macro for declaring a component's exposed
300
+ * instance properties when it is accessed by a parent component via template
301
+ * refs.
302
+ *
303
+ * `<script setup>` components are closed by default - i.e. variables inside
304
+ * the `<script setup>` scope is not exposed to parent unless explicitly exposed
305
+ * via `defineExpose`.
306
+ *
307
+ * This is only usable inside `<script setup>`, is compiled away in the
308
+ * output and should **not** be actually called at runtime.
309
+ *
310
+ * @see {@link https://vuejs.org/api/sfc-script-setup.html#defineexpose}
311
+ */
312
+ declare function defineExpose<Exposed extends Record<string, any> = Record<string, any>>(exposed?: Exposed): void;
313
+ /**
314
+ * Vue `<script setup>` compiler macro for declaring a component's additional
315
+ * options. This should be used only for options that cannot be expressed via
316
+ * Composition API - e.g. `inheritAttrs`.
317
+ *
318
+ * @see {@link https://vuejs.org/api/sfc-script-setup.html#defineoptions}
319
+ */
320
+ 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, {}> & {
321
+ /**
322
+ * props should be defined via defineProps().
323
+ */
324
+ props?: never;
325
+ /**
326
+ * emits should be defined via defineEmits().
327
+ */
328
+ emits?: never;
329
+ /**
330
+ * expose should be defined via defineExpose().
331
+ */
332
+ expose?: never;
333
+ /**
334
+ * slots should be defined via defineSlots().
335
+ */
336
+ slots?: never;
337
+ }): void;
338
+ declare function defineSlots<S extends Record<string, any> = Record<string, any>>(): StrictUnwrapSlotsType<SlotsType<S>>;
339
+ type ModelRef<T, M extends PropertyKey = string, G = T, S = T> = Ref<G, S> & [ModelRef<T, M, G, S>, Record<M, true | undefined>];
340
+ type DefineModelOptions<T = any, G = T, S = T> = {
341
+ get?: (v: T) => G;
342
+ set?: (v: S) => any;
343
+ };
344
+ /**
345
+ * Vue `<script setup>` compiler macro for declaring a
346
+ * two-way binding prop that can be consumed via `v-model` from the parent
347
+ * component. This will declare a prop with the same name and a corresponding
348
+ * `update:propName` event.
349
+ *
350
+ * If the first argument is a string, it will be used as the prop name;
351
+ * Otherwise the prop name will default to "modelValue". In both cases, you
352
+ * can also pass an additional object which will be used as the prop's options.
353
+ *
354
+ * The returned ref behaves differently depending on whether the parent
355
+ * provided the corresponding v-model props or not:
356
+ * - If yes, the returned ref's value will always be in sync with the parent
357
+ * prop.
358
+ * - If not, the returned ref will behave like a normal local ref.
359
+ *
360
+ * @example
361
+ * ```ts
362
+ * // default model (consumed via `v-model`)
363
+ * const modelValue = defineModel<string>()
364
+ * modelValue.value = "hello"
365
+ *
366
+ * // default model with options
367
+ * const modelValue = defineModel<string>({ required: true })
368
+ *
369
+ * // with specified name (consumed via `v-model:count`)
370
+ * const count = defineModel<number>('count')
371
+ * count.value++
372
+ *
373
+ * // with specified name and default value
374
+ * const count = defineModel<number>('count', { default: 0 })
375
+ * ```
376
+ */
377
+ declare function defineModel<T, M extends PropertyKey = string, G = T, S = T>(options: ({
378
+ default: any;
379
+ } | {
380
+ required: true;
381
+ }) & PropOptions<T> & DefineModelOptions<T, G, S>): ModelRef<T, M, G, S>;
382
+ 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>;
383
+ declare function defineModel<T, M extends PropertyKey = string, G = T, S = T>(name: string, options: ({
384
+ default: any;
385
+ } | {
386
+ required: true;
387
+ }) & PropOptions<T> & DefineModelOptions<T, G, S>): ModelRef<T, M, G, S>;
388
+ 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>;
389
+ type NotUndefined<T> = T extends undefined ? never : T;
390
+ type MappedOmit<T, K extends keyof any> = { [P in keyof T as P extends K ? never : P]: T[P] };
391
+ type InferDefaults<T> = { [K in keyof T]?: InferDefault<T, T[K]> };
392
+ type NativeType = null | undefined | number | string | boolean | symbol | Function;
393
+ type InferDefault<P, T> = ((props: P) => T & {}) | (T extends NativeType ? T : never);
394
+ type PropsWithDefaults<T, Defaults extends InferDefaults<T>, BKeys extends keyof T> = T extends unknown ? Readonly<MappedOmit<T, keyof Defaults>> & { 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 } & { readonly [K in BKeys]-?: K extends keyof Defaults ? Defaults[K] extends undefined ? boolean | undefined : boolean : boolean } : never;
395
+ /**
396
+ * Vue `<script setup>` compiler macro for providing props default values when
397
+ * using type-based `defineProps` declaration.
398
+ *
399
+ * Example usage:
400
+ * ```ts
401
+ * withDefaults(defineProps<{
402
+ * size?: number
403
+ * labels?: string[]
404
+ * }>(), {
405
+ * size: 3,
406
+ * labels: () => ['default label']
407
+ * })
408
+ * ```
409
+ *
410
+ * This is only usable inside `<script setup>`, is compiled away in the output
411
+ * and should **not** be actually called at runtime.
412
+ *
413
+ * @see {@link https://vuejs.org/guide/typescript/composition-api.html#typing-component-props}
414
+ */
415
+ declare function withDefaults<T, BKeys extends keyof T, Defaults extends InferDefaults<T>>(props: DefineProps<T, BKeys>, defaults: Defaults): PropsWithDefaults<T, Defaults, BKeys>;
416
+ type ObjectEmitsOptions = Record<string, ((...args: any[]) => any) | null>;
417
+ type EmitsOptions = ObjectEmitsOptions | string[];
418
+ type EmitsToProps<T extends EmitsOptions | ComponentTypeEmits> = T extends string[] ? { [K in `on${Capitalize<T[number]>}`]?: (...args: any[]) => any } : T extends ObjectEmitsOptions ? { [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 } : {};
419
+ type ShortEmitsToObject<E> = E extends Record<string, any[]> ? { [K in keyof E]: (...args: E[K]) => any } : E;
420
+ 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<{ [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 }[Event]>;
421
+ /**
422
+ Runtime helper for applying directives to a vnode. Example usage:
423
+
424
+ const comp = resolveComponent('comp')
425
+ const foo = resolveDirective('foo')
426
+ const bar = resolveDirective('bar')
427
+
428
+ return withDirectives(h(comp), [
429
+ [foo, this.x],
430
+ [bar, this.y]
431
+ ])
432
+ */
433
+ interface DirectiveBinding<Value = any, Modifiers extends string = string, Arg = any> {
434
+ instance: ComponentPublicInstance | Record<string, any> | null;
435
+ value: Value;
436
+ oldValue: Value | null;
437
+ arg?: Arg;
438
+ modifiers: DirectiveModifiers<Modifiers>;
439
+ dir: ObjectDirective<any, Value, Modifiers, Arg>;
440
+ }
441
+ type DirectiveHook<HostElement = any, Prev = VNode<any, HostElement> | null, Value = any, Modifiers extends string = string, Arg = any> = (el: HostElement, binding: DirectiveBinding<Value, Modifiers, Arg>, vnode: VNode<any, HostElement>, prevVNode: Prev) => void;
442
+ type SSRDirectiveHook<Value = any, Modifiers extends string = string, Arg = any> = (binding: DirectiveBinding<Value, Modifiers, Arg>, vnode: VNode) => Data | undefined;
443
+ interface ObjectDirective<HostElement = any, Value = any, Modifiers extends string = string, Arg = any> {
444
+ created?: DirectiveHook<HostElement, null, Value, Modifiers, Arg>;
445
+ beforeMount?: DirectiveHook<HostElement, null, Value, Modifiers, Arg>;
446
+ mounted?: DirectiveHook<HostElement, null, Value, Modifiers, Arg>;
447
+ beforeUpdate?: DirectiveHook<HostElement, VNode<any, HostElement>, Value, Modifiers, Arg>;
448
+ updated?: DirectiveHook<HostElement, VNode<any, HostElement>, Value, Modifiers, Arg>;
449
+ beforeUnmount?: DirectiveHook<HostElement, null, Value, Modifiers, Arg>;
450
+ unmounted?: DirectiveHook<HostElement, null, Value, Modifiers, Arg>;
451
+ getSSRProps?: SSRDirectiveHook<Value, Modifiers, Arg>;
452
+ deep?: boolean;
453
+ }
454
+ type FunctionDirective<HostElement = any, V = any, Modifiers extends string = string, Arg = any> = DirectiveHook<HostElement, any, V, Modifiers, Arg>;
455
+ type Directive<HostElement = any, Value = any, Modifiers extends string = string, Arg = any> = ObjectDirective<HostElement, Value, Modifiers, Arg> | FunctionDirective<HostElement, Value, Modifiers, Arg>;
456
+ type DirectiveModifiers<K extends string = string> = Partial<Record<K, boolean>>;
457
+ /**
458
+ * Custom properties added to component instances in any way and can be accessed through `this`
459
+ *
460
+ * @example
461
+ * Here is an example of adding a property `$router` to every component instance:
462
+ * ```ts
463
+ * import { createApp } from 'vue'
464
+ * import { Router, createRouter } from 'vue-router'
465
+ *
466
+ * declare module 'vue' {
467
+ * interface ComponentCustomProperties {
468
+ * $router: Router
469
+ * }
470
+ * }
471
+ *
472
+ * // effectively adding the router to every component instance
473
+ * const app = createApp({})
474
+ * const router = createRouter()
475
+ * app.config.globalProperties.$router = router
476
+ *
477
+ * const vm = app.mount('#app')
478
+ * // we can access the router from the instance
479
+ * vm.$router.push('/')
480
+ * ```
481
+ */
482
+ interface ComponentCustomProperties {}
483
+ type IsDefaultMixinComponent<T> = T extends ComponentOptionsMixin ? ComponentOptionsMixin extends T ? true : false : false;
484
+ 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;
485
+ type ExtractMixin<T> = {
486
+ Mixin: MixinToOptionTypes<T>;
487
+ }[T extends ComponentOptionsMixin ? 'Mixin' : never];
488
+ type IntersectionMixin<T> = IsDefaultMixinComponent<T> extends true ? OptionTypesType : UnionToIntersection<ExtractMixin<T>>;
489
+ type UnwrapMixinsType<T, Type extends OptionTypesKeys> = T extends OptionTypesType ? T[Type] : never;
490
+ type EnsureNonVoid<T> = T extends void ? {} : T;
491
+ 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> = {
492
+ __isFragment?: never;
493
+ __isTeleport?: never;
494
+ __isSuspense?: never;
495
+ new (...args: any[]): T;
496
+ };
497
+ /**
498
+ * @deprecated This is no longer used internally, but exported and relied on by
499
+ * existing library types generated by vue-tsc.
500
+ */
501
+ /**
502
+ * This is the same as `CreateComponentPublicInstance` but adds local components,
503
+ * global directives, exposed, and provide inference.
504
+ * It changes the arguments order so that we don't need to repeat mixin
505
+ * inference everywhere internally, but it has to be a new type to avoid
506
+ * breaking types that relies on previous arguments order (#10842)
507
+ */
508
+ 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>;
509
+ type ExposedKeys<T, Exposed extends string & keyof T> = '' extends Exposed ? T : Pick<T, Exposed>;
510
+ type ComponentPublicInstance<P = {}, // props type extracted from props option
511
+ B = {}, // raw bindings returned from setup()
512
+ D = {}, // return from data()
513
+ 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> = {
514
+ $: ComponentInternalInstance;
515
+ $data: D;
516
+ $props: MakeDefaultsOptional extends true ? Partial<Defaults> & Omit<Prettify<P> & PublicProps, keyof Defaults> : Prettify<P> & PublicProps;
517
+ $attrs: Data;
518
+ $refs: Data & TypeRefs;
519
+ $slots: UnwrapSlotsType<S>;
520
+ $root: ComponentPublicInstance | null;
521
+ $parent: ComponentPublicInstance | null;
522
+ $host: Element | null;
523
+ $emit: EmitFn<E>;
524
+ $el: TypeEl;
525
+ $options: Options & MergedComponentOptionsOverride;
526
+ $forceUpdate: () => void;
527
+ $nextTick: typeof nextTick;
528
+ $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;
529
+ } & ExposedKeys<IfAny<P, P, Readonly<Defaults> & Omit<P, keyof ShallowUnwrapRef<B> | keyof Defaults>> & ShallowUnwrapRef<B> & UnwrapNestedRefs<D> & ExtractComputedReturns<C> & M & ComponentCustomProperties & InjectToObject<I>, Exposed>;
530
+ interface SuspenseProps {
531
+ onResolve?: () => void;
532
+ onPending?: () => void;
533
+ onFallback?: () => void;
534
+ timeout?: string | number;
535
+ /**
536
+ * Allow suspense to be captured by parent suspense
537
+ *
538
+ * @default false
539
+ */
540
+ suspensible?: boolean;
541
+ }
542
+ declare const SuspenseImpl: {
543
+ name: string;
544
+ __isSuspense: boolean;
545
+ 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;
546
+ hydrate: typeof hydrateSuspense;
547
+ normalize: typeof normalizeSuspenseChildren;
548
+ };
549
+ declare const Suspense: {
550
+ __isSuspense: true;
551
+ new (): {
552
+ $props: VNodeProps & SuspenseProps;
553
+ $slots: {
554
+ default(): VNode[];
555
+ fallback(): VNode[];
556
+ };
557
+ };
558
+ };
559
+ interface SuspenseBoundary {
560
+ vnode: VNode<RendererNode, RendererElement, SuspenseProps>;
561
+ parent: SuspenseBoundary | null;
562
+ parentComponent: ComponentInternalInstance | null;
563
+ namespace: ElementNamespace;
564
+ container: RendererElement;
565
+ hiddenContainer: RendererElement;
566
+ activeBranch: VNode | null;
567
+ pendingBranch: VNode | null;
568
+ deps: number;
569
+ pendingId: number;
570
+ timeout: number;
571
+ isInFallback: boolean;
572
+ isHydrating: boolean;
573
+ isUnmounted: boolean;
574
+ effects: Function[];
575
+ resolve(force?: boolean, sync?: boolean): void;
576
+ fallback(fallbackVNode: VNode): void;
577
+ move(container: RendererElement, anchor: RendererNode | null, type: MoveType): void;
578
+ next(): RendererNode | null;
579
+ registerDep(instance: ComponentInternalInstance, setupRenderEffect: SetupRenderEffectFn, optimized: boolean): void;
580
+ unmount(parentSuspense: SuspenseBoundary | null, doRemove?: boolean): void;
581
+ }
582
+ 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;
583
+ declare function normalizeSuspenseChildren(vnode: VNode): void;
584
+ type Hook<T = () => void> = T | T[];
585
+ interface BaseTransitionProps<HostElement = RendererElement> {
586
+ mode?: 'in-out' | 'out-in' | 'default';
587
+ appear?: boolean;
588
+ persisted?: boolean;
589
+ onBeforeEnter?: Hook<(el: HostElement) => void>;
590
+ onEnter?: Hook<(el: HostElement, done: () => void) => void>;
591
+ onAfterEnter?: Hook<(el: HostElement) => void>;
592
+ onEnterCancelled?: Hook<(el: HostElement) => void>;
593
+ onBeforeLeave?: Hook<(el: HostElement) => void>;
594
+ onLeave?: Hook<(el: HostElement, done: () => void) => void>;
595
+ onAfterLeave?: Hook<(el: HostElement) => void>;
596
+ onLeaveCancelled?: Hook<(el: HostElement) => void>;
597
+ onBeforeAppear?: Hook<(el: HostElement) => void>;
598
+ onAppear?: Hook<(el: HostElement, done: () => void) => void>;
599
+ onAfterAppear?: Hook<(el: HostElement) => void>;
600
+ onAppearCancelled?: Hook<(el: HostElement) => void>;
601
+ }
602
+ interface TransitionHooks<HostElement = RendererElement> {
603
+ mode: BaseTransitionProps['mode'];
604
+ persisted: boolean;
605
+ beforeEnter(el: HostElement): void;
606
+ enter(el: HostElement): void;
607
+ leave(el: HostElement, remove: () => void): void;
608
+ clone(vnode: VNode): TransitionHooks<HostElement>;
609
+ afterLeave?(): void;
610
+ delayLeave?(el: HostElement, earlyRemove: () => void, delayedLeave: () => void): void;
611
+ delayedLeave?(): void;
612
+ }
613
+ type ElementNamespace = 'svg' | 'mathml' | undefined;
614
+ interface RendererOptions<HostNode = RendererNode, HostElement = RendererElement> {
615
+ patchProp(el: HostElement, key: string, prevValue: any, nextValue: any, namespace?: ElementNamespace, parentComponent?: ComponentInternalInstance | null): void;
616
+ insert(el: HostNode, parent: HostElement, anchor?: HostNode | null): void;
617
+ remove(el: HostNode): void;
618
+ createElement(type: string, namespace?: ElementNamespace, isCustomizedBuiltIn?: string, vnodeProps?: (VNodeProps & {
619
+ [key: string]: any;
620
+ }) | null): HostElement;
621
+ createText(text: string): HostNode;
622
+ createComment(text: string): HostNode;
623
+ setText(node: HostNode, text: string): void;
624
+ setElementText(node: HostElement, text: string): void;
625
+ parentNode(node: HostNode): HostElement | null;
626
+ nextSibling(node: HostNode): HostNode | null;
627
+ querySelector?(selector: string): HostElement | null;
628
+ setScopeId?(el: HostElement, id: string): void;
629
+ cloneNode?(node: HostNode): HostNode;
630
+ insertStaticContent?(content: string, parent: HostElement, anchor: HostNode | null, namespace: ElementNamespace, start?: HostNode | null, end?: HostNode | null): [HostNode, HostNode];
631
+ }
632
+ interface RendererNode {
633
+ [key: string | symbol]: any;
634
+ }
635
+ interface RendererElement extends RendererNode {}
636
+ interface RendererInternals<HostNode = RendererNode, HostElement = RendererElement> {
637
+ p: PatchFn;
638
+ um: UnmountFn;
639
+ r: RemoveFn;
640
+ m: MoveFn;
641
+ mt: MountComponentFn;
642
+ mc: MountChildrenFn;
643
+ pc: PatchChildrenFn;
644
+ pbc: PatchBlockChildrenFn;
645
+ n: NextFn;
646
+ o: RendererOptions<HostNode, HostElement>;
647
+ }
648
+ type PatchFn = (n1: VNode | null, // null means this is a mount
649
+ n2: VNode, container: RendererElement, anchor?: RendererNode | null, parentComponent?: ComponentInternalInstance | null, parentSuspense?: SuspenseBoundary | null, namespace?: ElementNamespace, slotScopeIds?: string[] | null, optimized?: boolean) => void;
650
+ 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;
651
+ 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;
652
+ type PatchBlockChildrenFn = (oldChildren: VNode[], newChildren: VNode[], fallbackContainer: RendererElement, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, namespace: ElementNamespace, slotScopeIds: string[] | null) => void;
653
+ type MoveFn = (vnode: VNode, container: RendererElement, anchor: RendererNode | null, type: MoveType, parentSuspense?: SuspenseBoundary | null) => void;
654
+ type NextFn = (vnode: VNode) => RendererNode | null;
655
+ type UnmountFn = (vnode: VNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, doRemove?: boolean, optimized?: boolean) => void;
656
+ type RemoveFn = (vnode: VNode) => void;
657
+ type MountComponentFn = (initialVNode: VNode, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, namespace: ElementNamespace, optimized: boolean) => void;
658
+ type SetupRenderEffectFn = (instance: ComponentInternalInstance, initialVNode: VNode, container: RendererElement, anchor: RendererNode | null, parentSuspense: SuspenseBoundary | null, namespace: ElementNamespace, optimized: boolean) => void;
659
+ declare enum MoveType {
660
+ ENTER = 0,
661
+ LEAVE = 1,
662
+ REORDER = 2
663
+ }
664
+ /**
665
+ * The createRenderer function accepts two generic arguments:
666
+ * HostNode and HostElement, corresponding to Node and Element types in the
667
+ * host environment. For example, for runtime-dom, HostNode would be the DOM
668
+ * `Node` interface and HostElement would be the DOM `Element` interface.
669
+ *
670
+ * Custom renderers can pass in the platform specific types like this:
671
+ *
672
+ * ``` js
673
+ * const { render, createApp } = createRenderer<Node, Element>({
674
+ * patchProp,
675
+ * ...nodeOps
676
+ * })
677
+ * ```
678
+ */
679
+ type MatchPattern = string | RegExp | (string | RegExp)[];
680
+ interface KeepAliveProps {
681
+ include?: MatchPattern;
682
+ exclude?: MatchPattern;
683
+ max?: number | string;
684
+ }
685
+ type DebuggerHook = (e: DebuggerEvent) => void;
686
+ type ErrorCapturedHook<TError = unknown> = (err: TError, instance: ComponentPublicInstance | null, info: string) => boolean | void;
687
+ declare enum DeprecationTypes$1 {
688
+ GLOBAL_MOUNT = "GLOBAL_MOUNT",
689
+ GLOBAL_MOUNT_CONTAINER = "GLOBAL_MOUNT_CONTAINER",
690
+ GLOBAL_EXTEND = "GLOBAL_EXTEND",
691
+ GLOBAL_PROTOTYPE = "GLOBAL_PROTOTYPE",
692
+ GLOBAL_SET = "GLOBAL_SET",
693
+ GLOBAL_DELETE = "GLOBAL_DELETE",
694
+ GLOBAL_OBSERVABLE = "GLOBAL_OBSERVABLE",
695
+ GLOBAL_PRIVATE_UTIL = "GLOBAL_PRIVATE_UTIL",
696
+ CONFIG_SILENT = "CONFIG_SILENT",
697
+ CONFIG_DEVTOOLS = "CONFIG_DEVTOOLS",
698
+ CONFIG_KEY_CODES = "CONFIG_KEY_CODES",
699
+ CONFIG_PRODUCTION_TIP = "CONFIG_PRODUCTION_TIP",
700
+ CONFIG_IGNORED_ELEMENTS = "CONFIG_IGNORED_ELEMENTS",
701
+ CONFIG_WHITESPACE = "CONFIG_WHITESPACE",
702
+ CONFIG_OPTION_MERGE_STRATS = "CONFIG_OPTION_MERGE_STRATS",
703
+ INSTANCE_SET = "INSTANCE_SET",
704
+ INSTANCE_DELETE = "INSTANCE_DELETE",
705
+ INSTANCE_DESTROY = "INSTANCE_DESTROY",
706
+ INSTANCE_EVENT_EMITTER = "INSTANCE_EVENT_EMITTER",
707
+ INSTANCE_EVENT_HOOKS = "INSTANCE_EVENT_HOOKS",
708
+ INSTANCE_CHILDREN = "INSTANCE_CHILDREN",
709
+ INSTANCE_LISTENERS = "INSTANCE_LISTENERS",
710
+ INSTANCE_SCOPED_SLOTS = "INSTANCE_SCOPED_SLOTS",
711
+ INSTANCE_ATTRS_CLASS_STYLE = "INSTANCE_ATTRS_CLASS_STYLE",
712
+ OPTIONS_DATA_FN = "OPTIONS_DATA_FN",
713
+ OPTIONS_DATA_MERGE = "OPTIONS_DATA_MERGE",
714
+ OPTIONS_BEFORE_DESTROY = "OPTIONS_BEFORE_DESTROY",
715
+ OPTIONS_DESTROYED = "OPTIONS_DESTROYED",
716
+ WATCH_ARRAY = "WATCH_ARRAY",
717
+ PROPS_DEFAULT_THIS = "PROPS_DEFAULT_THIS",
718
+ V_ON_KEYCODE_MODIFIER = "V_ON_KEYCODE_MODIFIER",
719
+ CUSTOM_DIR = "CUSTOM_DIR",
720
+ ATTR_FALSE_VALUE = "ATTR_FALSE_VALUE",
721
+ ATTR_ENUMERATED_COERCION = "ATTR_ENUMERATED_COERCION",
722
+ TRANSITION_CLASSES = "TRANSITION_CLASSES",
723
+ TRANSITION_GROUP_ROOT = "TRANSITION_GROUP_ROOT",
724
+ COMPONENT_ASYNC = "COMPONENT_ASYNC",
725
+ COMPONENT_FUNCTIONAL = "COMPONENT_FUNCTIONAL",
726
+ COMPONENT_V_MODEL = "COMPONENT_V_MODEL",
727
+ RENDER_FUNCTION = "RENDER_FUNCTION",
728
+ FILTERS = "FILTERS",
729
+ PRIVATE_APIS = "PRIVATE_APIS"
730
+ }
731
+ type CompatConfig = Partial<Record<DeprecationTypes$1, boolean | 'suppress-warning'>> & {
732
+ MODE?: 2 | 3 | ((comp: Component | null) => 2 | 3);
733
+ };
734
+ /**
735
+ * Interface for declaring custom options.
736
+ *
737
+ * @example
738
+ * ```ts
739
+ * declare module 'vue' {
740
+ * interface ComponentCustomOptions {
741
+ * beforeRouteUpdate?(
742
+ * to: Route,
743
+ * from: Route,
744
+ * next: () => void
745
+ * ): void
746
+ * }
747
+ * }
748
+ * ```
749
+ */
750
+ interface ComponentCustomOptions {}
751
+ type RenderFunction = () => VNodeChild;
752
+ 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 {
753
+ setup?: (this: void, props: LooseRequired<Props & Prettify<UnwrapMixinsType<IntersectionMixin<Mixin> & IntersectionMixin<Extends>, 'P'>>>, ctx: SetupContext<E, S>) => Promise<RawBindings> | RawBindings | RenderFunction | void;
754
+ name?: string;
755
+ template?: string | object;
756
+ render?: Function;
757
+ components?: LC & Record<string, Component>;
758
+ directives?: Directives & Record<string, Directive>;
759
+ inheritAttrs?: boolean;
760
+ emits?: (E | EE[]) & ThisType<void>;
761
+ slots?: S;
762
+ expose?: Exposed[];
763
+ serverPrefetch?(): void | Promise<any>;
764
+ compilerOptions?: RuntimeCompilerOptions;
765
+ call?: (this: unknown, ...args: unknown[]) => never;
766
+ __isFragment?: never;
767
+ __isTeleport?: never;
768
+ __isSuspense?: never;
769
+ __defaults?: Defaults;
770
+ }
771
+ /**
772
+ * Subset of compiler options that makes sense for the runtime.
773
+ */
774
+ interface RuntimeCompilerOptions {
775
+ isCustomElement?: (tag: string) => boolean;
776
+ whitespace?: 'preserve' | 'condense';
777
+ comments?: boolean;
778
+ delimiters?: [string, string];
779
+ }
780
+ 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>>;
781
+ type ComponentOptionsMixin = ComponentOptionsBase<any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any>;
782
+ type ComputedOptions = Record<string, ComputedGetter<any> | WritableComputedOptions<any>>;
783
+ interface MethodOptions {
784
+ [key: string]: Function;
785
+ }
786
+ type ExtractComputedReturns<T extends any> = { [key in keyof T]: T[key] extends {
787
+ get: (...args: any[]) => infer TReturn;
788
+ } ? TReturn : T[key] extends ((...args: any[]) => infer TReturn) ? TReturn : never };
789
+ type ObjectWatchOptionItem = {
790
+ handler: WatchCallback | string;
791
+ } & WatchOptions;
792
+ type WatchOptionItem = string | WatchCallback | ObjectWatchOptionItem;
793
+ type ComponentWatchOptionItem = WatchOptionItem | WatchOptionItem[];
794
+ type ComponentWatchOptions = Record<string, ComponentWatchOptionItem>;
795
+ type ComponentProvideOptions = ObjectProvideOptions | Function;
796
+ type ObjectProvideOptions = Record<string | symbol, unknown>;
797
+ type ComponentInjectOptions = string[] | ObjectInjectOptions;
798
+ type ObjectInjectOptions = Record<string | symbol, string | symbol | {
799
+ from?: string | symbol;
800
+ default?: unknown;
801
+ }>;
802
+ type InjectToObject<T extends ComponentInjectOptions> = T extends string[] ? { [K in T[number]]?: unknown } : T extends ObjectInjectOptions ? { [K in keyof T]?: unknown } : never;
803
+ 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> {
804
+ compatConfig?: CompatConfig;
805
+ [key: string]: any;
806
+ data?: (this: CreateComponentPublicInstanceWithMixins<Props, {}, {}, {}, MethodOptions, Mixin, Extends>, vm: CreateComponentPublicInstanceWithMixins<Props, {}, {}, {}, MethodOptions, Mixin, Extends>) => D;
807
+ computed?: C;
808
+ methods?: M;
809
+ watch?: ComponentWatchOptions;
810
+ provide?: Provide;
811
+ inject?: I | II[];
812
+ filters?: Record<string, Function>;
813
+ mixins?: Mixin[];
814
+ extends?: Extends;
815
+ beforeCreate?(): any;
816
+ created?(): any;
817
+ beforeMount?(): any;
818
+ mounted?(): any;
819
+ beforeUpdate?(): any;
820
+ updated?(): any;
821
+ activated?(): any;
822
+ deactivated?(): any;
823
+ /** @deprecated use `beforeUnmount` instead */
824
+ beforeDestroy?(): any;
825
+ beforeUnmount?(): any;
826
+ /** @deprecated use `unmounted` instead */
827
+ destroyed?(): any;
828
+ unmounted?(): any;
829
+ renderTracked?: DebuggerHook;
830
+ renderTriggered?: DebuggerHook;
831
+ errorCaptured?: ErrorCapturedHook;
832
+ /**
833
+ * runtime compile only
834
+ * @deprecated use `compilerOptions.delimiters` instead.
835
+ */
836
+ delimiters?: [string, string];
837
+ /**
838
+ * #3468
839
+ *
840
+ * type-only, used to assist Mixin's type inference,
841
+ * TypeScript will try to simplify the inferred `Mixin` type,
842
+ * with the `__differentiator`, TypeScript won't be able to combine different mixins,
843
+ * because the `__differentiator` will be different
844
+ */
845
+ __differentiator?: keyof D | keyof C | keyof M;
846
+ }
847
+ type MergedHook<T = () => void> = T | T[];
848
+ type MergedComponentOptionsOverride = {
849
+ beforeCreate?: MergedHook;
850
+ created?: MergedHook;
851
+ beforeMount?: MergedHook;
852
+ mounted?: MergedHook;
853
+ beforeUpdate?: MergedHook;
854
+ updated?: MergedHook;
855
+ activated?: MergedHook;
856
+ deactivated?: MergedHook; /** @deprecated use `beforeUnmount` instead */
857
+ beforeDestroy?: MergedHook;
858
+ beforeUnmount?: MergedHook; /** @deprecated use `unmounted` instead */
859
+ destroyed?: MergedHook;
860
+ unmounted?: MergedHook;
861
+ renderTracked?: MergedHook<DebuggerHook>;
862
+ renderTriggered?: MergedHook<DebuggerHook>;
863
+ errorCaptured?: MergedHook<ErrorCapturedHook>;
864
+ };
865
+ type OptionTypesKeys = 'P' | 'B' | 'D' | 'C' | 'M' | 'Defaults';
866
+ type OptionTypesType<P = {}, B = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Defaults = {}> = {
867
+ P: P;
868
+ B: B;
869
+ D: D;
870
+ C: C;
871
+ M: M;
872
+ Defaults: Defaults;
873
+ };
874
+ /**
875
+ * @deprecated
876
+ */
877
+ interface InjectionConstraint<T> {}
878
+ type InjectionKey<T> = symbol & InjectionConstraint<T>;
879
+ type PublicProps = VNodeProps & AllowedComponentProps & ComponentCustomProps;
880
+ type ResolveProps<PropsOrPropOptions, E extends EmitsOptions> = Readonly<PropsOrPropOptions extends ComponentPropsOptions ? ExtractPropTypes<PropsOrPropOptions> : PropsOrPropOptions> & ({} extends E ? {} : EmitsToProps<E>);
881
+ 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;
882
+ interface App<HostElement = any> {
883
+ version: string;
884
+ config: AppConfig;
885
+ use<Options extends unknown[]>(plugin: Plugin<Options>, ...options: NoInfer<Options>): this;
886
+ use<Options>(plugin: Plugin<Options>, options: NoInfer<Options>): this;
887
+ mixin(mixin: ComponentOptions): this;
888
+ component(name: string): Component | undefined;
889
+ component<T extends Component | DefineComponent>(name: string, component: T): this;
890
+ directive<HostElement = any, Value = any, Modifiers extends string = string, Arg = any>(name: string): Directive<HostElement, Value, Modifiers, Arg> | undefined;
891
+ directive<HostElement = any, Value = any, Modifiers extends string = string, Arg = any>(name: string, directive: Directive<HostElement, Value, Modifiers, Arg>): this;
892
+ mount(rootContainer: HostElement | string,
893
+ /**
894
+ * @internal
895
+ */
896
+
897
+ isHydrate?: boolean,
898
+ /**
899
+ * @internal
900
+ */
901
+
902
+ namespace?: boolean | ElementNamespace,
903
+ /**
904
+ * @internal
905
+ */
906
+
907
+ vnode?: VNode): ComponentPublicInstance;
908
+ unmount(): void;
909
+ onUnmount(cb: () => void): void;
910
+ provide<T, K = InjectionKey<T> | string | number>(key: K, value: K extends InjectionKey<infer V> ? V : T): this;
911
+ /**
912
+ * Runs a function with the app as active instance. This allows using of `inject()` within the function to get access
913
+ * to variables provided via `app.provide()`.
914
+ *
915
+ * @param fn - function to run with the app as active instance
916
+ */
917
+ runWithContext<T>(fn: () => T): T;
918
+ _uid: number;
919
+ _component: ConcreteComponent;
920
+ _props: Data | null;
921
+ _container: HostElement | null;
922
+ _context: AppContext;
923
+ _instance: ComponentInternalInstance | null;
924
+ /**
925
+ * v2 compat only
926
+ */
927
+ filter?(name: string): Function | undefined;
928
+ filter?(name: string, filter: Function): this;
929
+ }
930
+ type OptionMergeFunction = (to: unknown, from: unknown) => any;
931
+ interface AppConfig {
932
+ readonly isNativeTag: (tag: string) => boolean;
933
+ performance: boolean;
934
+ optionMergeStrategies: Record<string, OptionMergeFunction>;
935
+ globalProperties: ComponentCustomProperties & Record<string, any>;
936
+ errorHandler?: (err: unknown, instance: ComponentPublicInstance | null, info: string) => void;
937
+ warnHandler?: (msg: string, instance: ComponentPublicInstance | null, trace: string) => void;
938
+ /**
939
+ * Options to pass to `@vue/compiler-dom`.
940
+ * Only supported in runtime compiler build.
941
+ */
942
+ compilerOptions: RuntimeCompilerOptions;
943
+ /**
944
+ * @deprecated use config.compilerOptions.isCustomElement
945
+ */
946
+ isCustomElement?: (tag: string) => boolean;
947
+ /**
948
+ * TODO document for 3.5
949
+ * Enable warnings for computed getters that recursively trigger itself.
950
+ */
951
+ warnRecursiveComputed?: boolean;
952
+ /**
953
+ * Whether to throw unhandled errors in production.
954
+ * Default is `false` to avoid crashing on any error (and only logs it)
955
+ * But in some cases, e.g. SSR, throwing might be more desirable.
956
+ */
957
+ throwUnhandledErrorInProduction?: boolean;
958
+ /**
959
+ * Prefix for all useId() calls within this app
960
+ */
961
+ idPrefix?: string;
962
+ }
963
+ interface AppContext {
964
+ app: App;
965
+ config: AppConfig;
966
+ mixins: ComponentOptions[];
967
+ components: Record<string, Component>;
968
+ directives: Record<string, Directive>;
969
+ provides: Record<string | symbol, any>;
970
+ }
971
+ type PluginInstallFunction<Options = any[]> = Options extends unknown[] ? (app: App, ...options: Options) => any : (app: App, options: Options) => any;
972
+ type ObjectPlugin<Options = any[]> = {
973
+ install: PluginInstallFunction<Options>;
974
+ };
975
+ type FunctionPlugin<Options = any[]> = PluginInstallFunction<Options> & Partial<ObjectPlugin<Options>>;
976
+ type Plugin<Options = any[], P extends unknown[] = (Options extends unknown[] ? Options : [Options])> = FunctionPlugin<P> | ObjectPlugin<P>;
977
+ type CreateAppFunction<HostElement> = (rootComponent: Component, rootProps?: Data | null) => App<HostElement>;
978
+ type TeleportVNode = VNode<RendererNode, RendererElement, TeleportProps>;
979
+ interface TeleportProps {
980
+ to: string | RendererElement | null | undefined;
981
+ disabled?: boolean;
982
+ defer?: boolean;
983
+ }
984
+ declare const TeleportImpl: {
985
+ name: string;
986
+ __isTeleport: boolean;
987
+ 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;
988
+ remove(vnode: VNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, {
989
+ um: unmount,
990
+ o: {
991
+ remove: hostRemove
992
+ }
993
+ }: RendererInternals, doRemove: boolean): void;
994
+ move: typeof moveTeleport;
995
+ hydrate: typeof hydrateTeleport;
996
+ };
997
+ declare enum TeleportMoveTypes {
998
+ TARGET_CHANGE = 0,
999
+ TOGGLE = 1,
1000
+ // enable / disable
1001
+ REORDER = 2
1002
+ }
1003
+ declare function moveTeleport(vnode: VNode, container: RendererElement, parentAnchor: RendererNode | null, {
1004
+ o: {
1005
+ insert
1006
+ },
1007
+ m: move
1008
+ }: RendererInternals, moveType?: TeleportMoveTypes): void;
1009
+ declare function hydrateTeleport(node: Node, vnode: TeleportVNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, slotScopeIds: string[] | null, optimized: boolean, {
1010
+ o: {
1011
+ nextSibling,
1012
+ parentNode,
1013
+ querySelector,
1014
+ insert,
1015
+ createText
1016
+ }
1017
+ }: 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;
1018
+ declare const Teleport: {
1019
+ __isTeleport: true;
1020
+ new (): {
1021
+ $props: VNodeProps & TeleportProps;
1022
+ $slots: {
1023
+ default(): VNode[];
1024
+ };
1025
+ };
1026
+ };
1027
+ declare const Fragment: {
1028
+ __isFragment: true;
1029
+ new (): {
1030
+ $props: VNodeProps;
1031
+ };
1032
+ };
1033
+ declare const Text: unique symbol;
1034
+ declare const Comment: unique symbol;
1035
+ declare const Static: unique symbol;
1036
+ type VNodeTypes = string | VNode | Component | typeof Text | typeof Static | typeof Comment | typeof Fragment | typeof Teleport | typeof TeleportImpl | typeof Suspense | typeof SuspenseImpl;
1037
+ type VNodeRef = string | Ref | ((ref: Element | ComponentPublicInstance | null, refs: Record<string, any>) => void);
1038
+ type VNodeNormalizedRefAtom = {
1039
+ /**
1040
+ * component instance
1041
+ */
1042
+ i: ComponentInternalInstance;
1043
+ /**
1044
+ * Actual ref
1045
+ */
1046
+ r: VNodeRef;
1047
+ /**
1048
+ * setup ref key
1049
+ */
1050
+ k?: string;
1051
+ /**
1052
+ * refInFor marker
1053
+ */
1054
+ f?: boolean;
1055
+ };
1056
+ type VNodeNormalizedRef = VNodeNormalizedRefAtom | VNodeNormalizedRefAtom[];
1057
+ type VNodeMountHook = (vnode: VNode) => void;
1058
+ type VNodeUpdateHook = (vnode: VNode, oldVNode: VNode) => void;
1059
+ type VNodeProps = {
1060
+ key?: PropertyKey;
1061
+ ref?: VNodeRef;
1062
+ ref_for?: boolean;
1063
+ ref_key?: string;
1064
+ onVnodeBeforeMount?: VNodeMountHook | VNodeMountHook[];
1065
+ onVnodeMounted?: VNodeMountHook | VNodeMountHook[];
1066
+ onVnodeBeforeUpdate?: VNodeUpdateHook | VNodeUpdateHook[];
1067
+ onVnodeUpdated?: VNodeUpdateHook | VNodeUpdateHook[];
1068
+ onVnodeBeforeUnmount?: VNodeMountHook | VNodeMountHook[];
1069
+ onVnodeUnmounted?: VNodeMountHook | VNodeMountHook[];
1070
+ };
1071
+ type VNodeChildAtom = VNode | string | number | boolean | null | undefined | void;
1072
+ type VNodeArrayChildren = Array<VNodeArrayChildren | VNodeChildAtom>;
1073
+ type VNodeChild = VNodeChildAtom | VNodeArrayChildren;
1074
+ type VNodeNormalizedChildren = string | VNodeArrayChildren | RawSlots | null;
1075
+ interface VNode<HostNode = RendererNode, HostElement = RendererElement, ExtraProps = {
1076
+ [key: string]: any;
1077
+ }> {
1078
+ type: VNodeTypes;
1079
+ props: (VNodeProps & ExtraProps) | null;
1080
+ key: PropertyKey | null;
1081
+ ref: VNodeNormalizedRef | null;
1082
+ /**
1083
+ * SFC only. This is assigned on vnode creation using currentScopeId
1084
+ * which is set alongside currentRenderingInstance.
1085
+ */
1086
+ scopeId: string | null;
1087
+ children: VNodeNormalizedChildren;
1088
+ component: ComponentInternalInstance | null;
1089
+ dirs: DirectiveBinding[] | null;
1090
+ transition: TransitionHooks<HostElement> | null;
1091
+ el: HostNode | null;
1092
+ placeholder: HostNode | null;
1093
+ anchor: HostNode | null;
1094
+ target: HostElement | null;
1095
+ targetStart: HostNode | null;
1096
+ targetAnchor: HostNode | null;
1097
+ suspense: SuspenseBoundary | null;
1098
+ shapeFlag: number;
1099
+ patchFlag: number;
1100
+ appContext: AppContext | null;
1101
+ }
1102
+ type Data = Record<string, unknown>;
1103
+ /**
1104
+ * Public utility type for extracting the instance type of a component.
1105
+ * Works with all valid component definition types. This is intended to replace
1106
+ * the usage of `InstanceType<typeof Comp>` which only works for
1107
+ * constructor-based component definition types.
1108
+ *
1109
+ * @example
1110
+ * ```ts
1111
+ * const MyComp = { ... }
1112
+ * declare const instance: ComponentInstance<typeof MyComp>
1113
+ * ```
1114
+ */
1115
+ /**
1116
+ * For extending allowed non-declared props on components in TSX
1117
+ */
1118
+ interface ComponentCustomProps {}
1119
+ /**
1120
+ * For globally defined Directives
1121
+ * Here is an example of adding a directive `VTooltip` as global directive:
1122
+ *
1123
+ * @example
1124
+ * ```ts
1125
+ * import VTooltip from 'v-tooltip'
1126
+ *
1127
+ * declare module '@vue/runtime-core' {
1128
+ * interface GlobalDirectives {
1129
+ * VTooltip
1130
+ * }
1131
+ * }
1132
+ * ```
1133
+ */
1134
+ interface GlobalDirectives {}
1135
+ /**
1136
+ * For globally defined Components
1137
+ * Here is an example of adding a component `RouterView` as global component:
1138
+ *
1139
+ * @example
1140
+ * ```ts
1141
+ * import { RouterView } from 'vue-router'
1142
+ *
1143
+ * declare module '@vue/runtime-core' {
1144
+ * interface GlobalComponents {
1145
+ * RouterView
1146
+ * }
1147
+ * }
1148
+ * ```
1149
+ */
1150
+ interface GlobalComponents {
1151
+ Teleport: DefineComponent<TeleportProps>;
1152
+ Suspense: DefineComponent<SuspenseProps>;
1153
+ KeepAlive: DefineComponent<KeepAliveProps>;
1154
+ BaseTransition: DefineComponent<BaseTransitionProps>;
1155
+ }
1156
+ /**
1157
+ * Default allowed non-declared props on component in TSX
1158
+ */
1159
+ interface AllowedComponentProps {
1160
+ class?: unknown;
1161
+ style?: unknown;
1162
+ }
1163
+ interface ComponentInternalOptions {
1164
+ /**
1165
+ * Compat build only, for bailing out of certain compatibility behavior
1166
+ */
1167
+ __isBuiltIn?: boolean;
1168
+ /**
1169
+ * This one should be exposed so that devtools can make use of it
1170
+ */
1171
+ __file?: string;
1172
+ /**
1173
+ * name inferred from filename
1174
+ */
1175
+ __name?: string;
1176
+ }
1177
+ interface FunctionalComponent<P = {}, E extends EmitsOptions | Record<string, any[]> = {}, S extends Record<string, any> = any, EE extends EmitsOptions = ShortEmitsToObject<E>> extends ComponentInternalOptions {
1178
+ (props: P & EmitsToProps<EE>, ctx: Omit<SetupContext<EE, IfAny<S, {}, SlotsType<S>>>, 'expose'>): any;
1179
+ props?: ComponentPropsOptions<P>;
1180
+ emits?: EE | (keyof EE)[];
1181
+ slots?: IfAny<S, Slots, SlotsType<S>>;
1182
+ inheritAttrs?: boolean;
1183
+ displayName?: string;
1184
+ compatConfig?: CompatConfig;
1185
+ }
1186
+ /**
1187
+ * Concrete component type matches its actual value: it's either an options
1188
+ * object, or a function. Use this where the code expects to work with actual
1189
+ * values, e.g. checking if its a function or not. This is mostly for internal
1190
+ * implementation code.
1191
+ */
1192
+ 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>;
1193
+ /**
1194
+ * A type used in public APIs where a component type is expected.
1195
+ * The constructor type is an artificial type returned by defineComponent().
1196
+ */
1197
+ 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>;
1198
+ type SetupContext<E = EmitsOptions, S extends SlotsType = {}> = E extends any ? {
1199
+ attrs: Data;
1200
+ slots: UnwrapSlotsType<S>;
1201
+ emit: EmitFn<E>;
1202
+ expose: <Exposed extends Record<string, any> = Record<string, any>>(exposed?: Exposed) => void;
1203
+ } : never;
1204
+ /**
1205
+ * We expose a subset of properties on the internal instance as they are
1206
+ * useful for advanced external libraries and tools.
1207
+ */
1208
+ interface ComponentInternalInstance {
1209
+ uid: number;
1210
+ type: ConcreteComponent;
1211
+ parent: ComponentInternalInstance | null;
1212
+ root: ComponentInternalInstance;
1213
+ appContext: AppContext;
1214
+ /**
1215
+ * Vnode representing this component in its parent's vdom tree
1216
+ */
1217
+ vnode: VNode;
1218
+ /**
1219
+ * Root vnode of this component's own vdom tree
1220
+ */
1221
+ subTree: VNode;
1222
+ /**
1223
+ * Render effect instance
1224
+ */
1225
+ effect: ReactiveEffect;
1226
+ /**
1227
+ * Force update render effect
1228
+ */
1229
+ update: () => void;
1230
+ /**
1231
+ * Render effect job to be passed to scheduler (checks if dirty)
1232
+ */
1233
+ job: SchedulerJob;
1234
+ proxy: ComponentPublicInstance | null;
1235
+ exposed: Record<string, any> | null;
1236
+ exposeProxy: Record<string, any> | null;
1237
+ data: Data;
1238
+ props: Data;
1239
+ attrs: Data;
1240
+ slots: InternalSlots;
1241
+ refs: Data;
1242
+ emit: EmitFn;
1243
+ isMounted: boolean;
1244
+ isUnmounted: boolean;
1245
+ isDeactivated: boolean;
1246
+ }
1247
+ interface ComponentCustomElementInterface {}
1248
+ interface WatchEffectOptions extends DebuggerOptions {
1249
+ flush?: 'pre' | 'post' | 'sync';
1250
+ }
1251
+ interface WatchOptions<Immediate = boolean> extends WatchEffectOptions {
1252
+ immediate?: Immediate;
1253
+ deep?: boolean | number;
1254
+ once?: boolean;
1255
+ }
1256
+ declare module '@vue/reactivity' {
1257
+ interface RefUnwrapBailTypes {
1258
+ runtimeCoreBailTypes: VNode | {
1259
+ $: ComponentInternalInstance;
1260
+ };
1261
+ }
1262
+ }
1263
+ // Note: this file is auto concatenated to the end of the bundled d.ts during
1264
+ // build.
1265
+ declare module '@vue/runtime-core' {
1266
+ export interface GlobalComponents {
1267
+ Teleport: DefineComponent<TeleportProps>;
1268
+ Suspense: DefineComponent<SuspenseProps>;
1269
+ KeepAlive: DefineComponent<KeepAliveProps>;
1270
+ BaseTransition: DefineComponent<BaseTransitionProps>;
1271
+ }
1272
+ } // Note: this file is auto concatenated to the end of the bundled d.ts during
1273
+ // build.
1274
+ type _defineProps = typeof defineProps;
1275
+ type _defineEmits = typeof defineEmits;
1276
+ type _defineExpose = typeof defineExpose;
1277
+ type _defineOptions = typeof defineOptions;
1278
+ type _defineSlots = typeof defineSlots;
1279
+ type _defineModel = typeof defineModel;
1280
+ type _withDefaults = typeof withDefaults;
1281
+ declare global {
1282
+ const defineProps: _defineProps;
1283
+ const defineEmits: _defineEmits;
1284
+ const defineExpose: _defineExpose;
1285
+ const defineOptions: _defineOptions;
1286
+ const defineSlots: _defineSlots;
1287
+ const defineModel: _defineModel;
1288
+ const withDefaults: _withDefaults;
1289
+ }
1290
+ //#endregion
1291
+ //#region ../../node_modules/.pnpm/@vue+runtime-dom@3.5.27/node_modules/@vue/runtime-dom/dist/runtime-dom.d.ts
1292
+ declare const TRANSITION = "transition";
1293
+ declare const ANIMATION = "animation";
1294
+ type AnimationTypes = typeof TRANSITION | typeof ANIMATION;
1295
+ interface TransitionProps extends BaseTransitionProps<Element> {
1296
+ name?: string;
1297
+ type?: AnimationTypes;
1298
+ css?: boolean;
1299
+ duration?: number | {
1300
+ enter: number;
1301
+ leave: number;
1302
+ };
1303
+ enterFromClass?: string;
1304
+ enterActiveClass?: string;
1305
+ enterToClass?: string;
1306
+ appearFromClass?: string;
1307
+ appearActiveClass?: string;
1308
+ appearToClass?: string;
1309
+ leaveFromClass?: string;
1310
+ leaveActiveClass?: string;
1311
+ leaveToClass?: string;
1312
+ }
1313
+ type TransitionGroupProps = Omit<TransitionProps, 'mode'> & {
1314
+ tag?: string;
1315
+ moveClass?: string;
1316
+ };
1317
+ declare const vShowOriginalDisplay: unique symbol;
1318
+ declare const vShowHidden: unique symbol;
1319
+ interface VShowElement extends HTMLElement {
1320
+ [vShowOriginalDisplay]: string;
1321
+ [vShowHidden]: boolean;
1322
+ }
1323
+ declare const vShow: ObjectDirective<VShowElement> & {
1324
+ name: 'show';
1325
+ };
1326
+ declare const systemModifiers: readonly ["ctrl", "shift", "alt", "meta"];
1327
+ type SystemModifiers = (typeof systemModifiers)[number];
1328
+ type CompatModifiers = keyof typeof keyNames;
1329
+ type VOnModifiers = SystemModifiers | ModifierGuards | CompatModifiers;
1330
+ type ModifierGuards = 'shift' | 'ctrl' | 'alt' | 'meta' | 'left' | 'right' | 'stop' | 'prevent' | 'self' | 'middle' | 'exact';
1331
+ /**
1332
+ * @private
1333
+ */
1334
+ declare const keyNames: Record<'esc' | 'space' | 'up' | 'left' | 'right' | 'down' | 'delete', string>;
1335
+ /**
1336
+ * @private
1337
+ */
1338
+ type VOnDirective = Directive<any, any, VOnModifiers>;
1339
+ type AssignerFn = (value: any) => void;
1340
+ declare const assignKey: unique symbol;
1341
+ type ModelDirective<T, Modifiers extends string = string> = ObjectDirective<T & {
1342
+ [assignKey]: AssignerFn;
1343
+ _assigning?: boolean;
1344
+ }, any, Modifiers>;
1345
+ declare const vModelText: ModelDirective<HTMLInputElement | HTMLTextAreaElement, 'trim' | 'number' | 'lazy'>;
1346
+ declare const vModelCheckbox: ModelDirective<HTMLInputElement>;
1347
+ declare const vModelRadio: ModelDirective<HTMLInputElement>;
1348
+ declare const vModelSelect: ModelDirective<HTMLSelectElement, 'number'>;
1349
+ declare const vModelDynamic: ObjectDirective<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>;
1350
+ type VModelDirective = typeof vModelText | typeof vModelCheckbox | typeof vModelSelect | typeof vModelRadio | typeof vModelDynamic;
1351
+ type VueElementConstructor<P = {}> = {
1352
+ new (initialProps?: Record<string, any>): VueElement & P;
1353
+ };
1354
+ interface CustomElementOptions {
1355
+ styles?: string[];
1356
+ shadowRoot?: boolean;
1357
+ shadowRootOptions?: Omit<ShadowRootInit, 'mode'>;
1358
+ nonce?: string;
1359
+ configureApp?: (app: App) => void;
1360
+ }
1361
+ declare const BaseClass: typeof HTMLElement;
1362
+ type InnerComponentDef = ConcreteComponent & CustomElementOptions;
1363
+ declare class VueElement extends BaseClass implements ComponentCustomElementInterface {
1364
+ /**
1365
+ * Component def - note this may be an AsyncWrapper, and this._def will
1366
+ * be overwritten by the inner component when resolved.
1367
+ */
1368
+ private _def;
1369
+ private _props;
1370
+ private _createApp;
1371
+ _isVueCE: boolean;
1372
+ private _connected;
1373
+ private _resolved;
1374
+ private _patching;
1375
+ private _dirty;
1376
+ private _numberProps;
1377
+ private _styleChildren;
1378
+ private _pendingResolve;
1379
+ private _parent;
1380
+ /**
1381
+ * dev only
1382
+ */
1383
+ private _styles?;
1384
+ /**
1385
+ * dev only
1386
+ */
1387
+ private _childStyles?;
1388
+ private _ob?;
1389
+ private _slots?;
1390
+ constructor(
1391
+ /**
1392
+ * Component def - note this may be an AsyncWrapper, and this._def will
1393
+ * be overwritten by the inner component when resolved.
1394
+ */
1395
+
1396
+ _def: InnerComponentDef, _props?: Record<string, any>, _createApp?: CreateAppFunction<Element>);
1397
+ connectedCallback(): void;
1398
+ private _setParent;
1399
+ private _inheritParentContext;
1400
+ disconnectedCallback(): void;
1401
+ private _processMutations;
1402
+ /**
1403
+ * resolve inner component definition (handle possible async component)
1404
+ */
1405
+ private _resolveDef;
1406
+ private _mount;
1407
+ private _resolveProps;
1408
+ protected _setAttr(key: string): void;
1409
+ private _update;
1410
+ private _createVNode;
1411
+ private _applyStyles;
1412
+ /**
1413
+ * Only called when shadowRoot is false
1414
+ */
1415
+ private _parseSlots;
1416
+ /**
1417
+ * Only called when shadowRoot is false
1418
+ */
1419
+ private _renderSlots;
1420
+ }
1421
+ /**
1422
+ * This is a stub implementation to prevent the need to use dom types.
1423
+ *
1424
+ * To enable proper types, add `"dom"` to `"lib"` in your `tsconfig.json`.
1425
+ */
1426
+ type DomType<T> = typeof globalThis extends {
1427
+ window: unknown;
1428
+ } ? T : never;
1429
+ declare module '@vue/reactivity' {
1430
+ interface RefUnwrapBailTypes {
1431
+ runtimeDOMBailTypes: DomType<Node | Window>;
1432
+ }
1433
+ }
1434
+ declare module '@vue/runtime-core' {
1435
+ interface GlobalComponents {
1436
+ Transition: DefineComponent<TransitionProps>;
1437
+ TransitionGroup: DefineComponent<TransitionGroupProps>;
1438
+ }
1439
+ interface GlobalDirectives {
1440
+ vShow: typeof vShow;
1441
+ vOn: VOnDirective;
1442
+ vBind: VModelDirective;
1443
+ vIf: Directive<any, boolean>;
1444
+ vOnce: Directive;
1445
+ vSlot: Directive;
1446
+ }
18
1447
  }
19
1448
  //#endregion
20
1449
  //#region src/client/webcomponents/components/DockEmbedded.d.ts
21
- declare const DockEmbedded: VueElementConstructor<DockProps>;
1450
+ declare const DockEmbedded: VueElementConstructor<{
1451
+ context: DocksContext;
1452
+ }>;
22
1453
  //#endregion
23
- //#region src/client/webcomponents/components/IframeManager.d.ts
24
- declare class IframeManager {
25
- readonly iframes: Record<string, IframeHolder>;
26
- container: Element;
27
- constructor();
28
- setContainer(container: Element): void;
29
- getIframeHolder(id: string): IframeHolder;
30
- }
31
- declare class IframeHolder {
32
- readonly iframe: HTMLIFrameElement;
1454
+ //#region src/client/webcomponents/state/docks.d.ts
1455
+ declare function DEFAULT_DOCK_PANEL_STORE(): DockPanelStorage;
1456
+ declare function createDockEntryState(entry: DevToolsDockEntry, selected: Ref<DevToolsDockEntry | null>): DockEntryState;
1457
+ declare function sharedStateToRef<T>(sharedState: SharedState<T>): ShallowRef<T>;
1458
+ declare function useDocksEntries(rpc: DevToolsRpcClient): Promise<Ref<DevToolsDockEntry[]>>;
1459
+ //#endregion
1460
+ //#region src/client/webcomponents/utils/PersistedDomViewsManager.d.ts
1461
+ interface TagNameToElementMap {
1462
+ iframe: HTMLIFrameElement;
1463
+ div: HTMLDivElement;
1464
+ }
1465
+ declare class PersistedDomViewsManager {
1466
+ container: Readonly<ShallowRef<HTMLElement | undefined | null>>;
1467
+ readonly holders: Record<string, PersistedDomHolder<HTMLElement>>;
1468
+ constructor(container: Readonly<ShallowRef<HTMLElement | undefined | null>>);
1469
+ getHolder<T extends keyof TagNameToElementMap>(id: string, _type: T): PersistedDomHolder<TagNameToElementMap[T]> | undefined;
1470
+ getOrCreateHolder<T extends keyof TagNameToElementMap>(id: string, type: T): PersistedDomHolder<TagNameToElementMap[T]>;
1471
+ removeHolder(id: string): boolean;
1472
+ }
1473
+ declare class PersistedDomHolder<ElementType extends HTMLElement> {
1474
+ readonly element: ElementType;
33
1475
  readonly id: string;
34
- parent?: Element;
1476
+ anchor?: Element;
35
1477
  _cleanups: (() => void)[];
36
- constructor(id: string, iframe: HTMLIFrameElement);
1478
+ constructor(id: string, iframe: ElementType);
37
1479
  cleanup(): void;
38
1480
  mount(parent: Element): void;
39
1481
  hide(): void;
@@ -42,4 +1484,4 @@ declare class IframeHolder {
42
1484
  unmount(): void;
43
1485
  }
44
1486
  //#endregion
45
- export { DevToolsDockState, DockEmbedded, DockProps, IframeHolder, IframeManager };
1487
+ export { DEFAULT_DOCK_PANEL_STORE, DockEmbedded, PersistedDomHolder, PersistedDomViewsManager, TagNameToElementMap, createDockEntryState, sharedStateToRef, useDocksEntries };