@vitejs/devtools-kit 0.0.0-alpha.26 → 0.0.0-alpha.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client-script-BOHKZVPh.d.mts +1864 -0
- package/dist/client.d.mts +1 -2
- package/dist/client.mjs +22 -22
- package/dist/constants.d.mts +1 -2
- package/dist/index.d.mts +2 -3
- package/dist/index.mjs +1 -1
- package/dist/utils/events.d.mts +1 -2
- package/dist/utils/events.mjs +39 -1
- package/dist/utils/nanoid.mjs +9 -1
- package/dist/utils/shared-state.d.mts +53 -2
- package/dist/utils/shared-state.mjs +36 -1
- package/package.json +4 -5
- package/dist/events-Cjs2Ve7T.mjs +0 -41
- package/dist/index-DAkd9-02.d.mts +0 -507
- package/dist/nanoid-CVty-meb.mjs +0 -11
- package/dist/shared-state-BjG-wgCU.d.mts +0 -53
- package/dist/shared-state-Du0QViU9.mjs +0 -38
- /package/dist/{events-C3OiqHBC.d.mts → events-57bKw4ct.d.mts} +0 -0
|
@@ -0,0 +1,1864 @@
|
|
|
1
|
+
import { t as EventEmitter } from "./events-57bKw4ct.mjs";
|
|
2
|
+
import { SharedState } from "./utils/shared-state.mjs";
|
|
3
|
+
import * as _vitejs_devtools_rpc0 from "@vitejs/devtools-rpc";
|
|
4
|
+
import { RpcDefinitionsFilter, RpcDefinitionsToFunctions, RpcFunctionsCollector, RpcFunctionsCollectorBase } from "@vitejs/devtools-rpc";
|
|
5
|
+
import { WebSocketRpcClientOptions } from "@vitejs/devtools-rpc/presets/ws/client";
|
|
6
|
+
import { DevToolsNodeRpcSessionMeta } from "@vitejs/devtools-rpc/presets/ws/server";
|
|
7
|
+
import { BirpcOptions, BirpcReturn } from "birpc";
|
|
8
|
+
import { Plugin, ResolvedConfig, ViteDevServer } from "vite";
|
|
9
|
+
import { ChildProcess } from "node:child_process";
|
|
10
|
+
|
|
11
|
+
//#region ../../node_modules/.pnpm/@vue+shared@3.5.27/node_modules/@vue/shared/dist/shared.d.ts
|
|
12
|
+
type Prettify<T> = { [K in keyof T]: T[K] } & {};
|
|
13
|
+
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;
|
|
14
|
+
type LooseRequired<T> = { [P in keyof (T & Required<T>)]: T[P] };
|
|
15
|
+
type IfAny<T, Y, N> = 0 extends 1 & T ? Y : N;
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region ../../node_modules/.pnpm/@vue+reactivity@3.5.27/node_modules/@vue/reactivity/dist/reactivity.d.ts
|
|
18
|
+
declare enum TrackOpTypes {
|
|
19
|
+
GET = "get",
|
|
20
|
+
HAS = "has",
|
|
21
|
+
ITERATE = "iterate"
|
|
22
|
+
}
|
|
23
|
+
declare enum TriggerOpTypes {
|
|
24
|
+
SET = "set",
|
|
25
|
+
ADD = "add",
|
|
26
|
+
DELETE = "delete",
|
|
27
|
+
CLEAR = "clear"
|
|
28
|
+
}
|
|
29
|
+
type UnwrapNestedRefs<T> = T extends Ref ? T : UnwrapRefSimple<T>;
|
|
30
|
+
declare const ShallowReactiveMarker: unique symbol;
|
|
31
|
+
type Primitive = string | number | boolean | bigint | symbol | undefined | null;
|
|
32
|
+
type Builtin = Primitive | Function | Date | Error | RegExp;
|
|
33
|
+
type Raw<T> = T & {
|
|
34
|
+
[RawSymbol]?: true;
|
|
35
|
+
};
|
|
36
|
+
type EffectScheduler = (...args: any[]) => any;
|
|
37
|
+
type DebuggerEvent = {
|
|
38
|
+
effect: Subscriber;
|
|
39
|
+
} & DebuggerEventExtraInfo;
|
|
40
|
+
type DebuggerEventExtraInfo = {
|
|
41
|
+
target: object;
|
|
42
|
+
type: TrackOpTypes | TriggerOpTypes;
|
|
43
|
+
key: any;
|
|
44
|
+
newValue?: any;
|
|
45
|
+
oldValue?: any;
|
|
46
|
+
oldTarget?: Map<any, any> | Set<any>;
|
|
47
|
+
};
|
|
48
|
+
interface DebuggerOptions {
|
|
49
|
+
onTrack?: (event: DebuggerEvent) => void;
|
|
50
|
+
onTrigger?: (event: DebuggerEvent) => void;
|
|
51
|
+
}
|
|
52
|
+
interface ReactiveEffectOptions extends DebuggerOptions {
|
|
53
|
+
scheduler?: EffectScheduler;
|
|
54
|
+
allowRecurse?: boolean;
|
|
55
|
+
onStop?: () => void;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Subscriber is a type that tracks (or subscribes to) a list of deps.
|
|
59
|
+
*/
|
|
60
|
+
interface Subscriber extends DebuggerOptions {}
|
|
61
|
+
declare class ReactiveEffect<T = any> implements Subscriber, ReactiveEffectOptions {
|
|
62
|
+
fn: () => T;
|
|
63
|
+
scheduler?: EffectScheduler;
|
|
64
|
+
onStop?: () => void;
|
|
65
|
+
onTrack?: (event: DebuggerEvent) => void;
|
|
66
|
+
onTrigger?: (event: DebuggerEvent) => void;
|
|
67
|
+
constructor(fn: () => T);
|
|
68
|
+
pause(): void;
|
|
69
|
+
resume(): void;
|
|
70
|
+
run(): T;
|
|
71
|
+
stop(): void;
|
|
72
|
+
trigger(): void;
|
|
73
|
+
get dirty(): boolean;
|
|
74
|
+
}
|
|
75
|
+
type ComputedGetter<T> = (oldValue?: T) => T;
|
|
76
|
+
type ComputedSetter<T> = (newValue: T) => void;
|
|
77
|
+
interface WritableComputedOptions<T, S = T> {
|
|
78
|
+
get: ComputedGetter<T>;
|
|
79
|
+
set: ComputedSetter<S>;
|
|
80
|
+
}
|
|
81
|
+
declare const RefSymbol: unique symbol;
|
|
82
|
+
declare const RawSymbol: unique symbol;
|
|
83
|
+
interface Ref<T = any, S = T> {
|
|
84
|
+
get value(): T;
|
|
85
|
+
set value(_: S);
|
|
86
|
+
/**
|
|
87
|
+
* Type differentiator only.
|
|
88
|
+
* We need this to be in public d.ts but don't want it to show up in IDE
|
|
89
|
+
* autocomplete, so we use a private Symbol instead.
|
|
90
|
+
*/
|
|
91
|
+
[RefSymbol]: true;
|
|
92
|
+
}
|
|
93
|
+
declare const ShallowRefMarker: unique symbol;
|
|
94
|
+
type ShallowRef<T = any, S = T> = Ref<T, S> & {
|
|
95
|
+
[ShallowRefMarker]?: true;
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* This is a special exported interface for other packages to declare
|
|
99
|
+
* additional types that should bail out for ref unwrapping. For example
|
|
100
|
+
* \@vue/runtime-dom can declare it like so in its d.ts:
|
|
101
|
+
*
|
|
102
|
+
* ``` ts
|
|
103
|
+
* declare module '@vue/reactivity' {
|
|
104
|
+
* export interface RefUnwrapBailTypes {
|
|
105
|
+
* runtimeDOMBailTypes: Node | Window
|
|
106
|
+
* }
|
|
107
|
+
* }
|
|
108
|
+
* ```
|
|
109
|
+
*/
|
|
110
|
+
interface RefUnwrapBailTypes {}
|
|
111
|
+
type ShallowUnwrapRef<T> = { [K in keyof T]: DistributeRef<T[K]> };
|
|
112
|
+
type DistributeRef<T> = T extends Ref<infer V, unknown> ? V : T;
|
|
113
|
+
type UnwrapRef<T> = T extends ShallowRef<infer V, unknown> ? V : T extends Ref<infer V, unknown> ? UnwrapRefSimple<V> : UnwrapRefSimple<T>;
|
|
114
|
+
type UnwrapRefSimple<T> = T extends Builtin | Ref | RefUnwrapBailTypes[keyof RefUnwrapBailTypes] | {
|
|
115
|
+
[RawSymbol]?: true;
|
|
116
|
+
} ? 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 & {
|
|
117
|
+
[ShallowReactiveMarker]?: never;
|
|
118
|
+
} ? { [P in keyof T]: P extends symbol ? T[P] : UnwrapRef<T[P]> } : T;
|
|
119
|
+
type WatchCallback<V = any, OV = any> = (value: V, oldValue: OV, onCleanup: OnCleanup) => any;
|
|
120
|
+
type OnCleanup = (cleanupFn: () => void) => void;
|
|
121
|
+
type WatchStopHandle = () => void;
|
|
122
|
+
//#endregion
|
|
123
|
+
//#region ../../node_modules/.pnpm/@vue+runtime-core@3.5.27/node_modules/@vue/runtime-core/dist/runtime-core.d.ts
|
|
124
|
+
type Slot<T extends any = any> = (...args: IfAny<T, any[], [T] | (T extends undefined ? [] : never)>) => VNode[];
|
|
125
|
+
type InternalSlots = {
|
|
126
|
+
[name: string]: Slot | undefined;
|
|
127
|
+
};
|
|
128
|
+
type Slots = Readonly<InternalSlots>;
|
|
129
|
+
declare const SlotSymbol: unique symbol;
|
|
130
|
+
type SlotsType<T extends Record<string, any> = Record<string, any>> = {
|
|
131
|
+
[SlotSymbol]?: T;
|
|
132
|
+
};
|
|
133
|
+
type StrictUnwrapSlotsType<S extends SlotsType, T = NonNullable<S[typeof SlotSymbol]>> = [keyof S] extends [never] ? Slots : Readonly<T> & T;
|
|
134
|
+
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]> }>>;
|
|
135
|
+
type RawSlots = {
|
|
136
|
+
[name: string]: unknown;
|
|
137
|
+
$stable?: boolean;
|
|
138
|
+
};
|
|
139
|
+
declare enum SchedulerJobFlags {
|
|
140
|
+
QUEUED = 1,
|
|
141
|
+
PRE = 2,
|
|
142
|
+
/**
|
|
143
|
+
* Indicates whether the effect is allowed to recursively trigger itself
|
|
144
|
+
* when managed by the scheduler.
|
|
145
|
+
*
|
|
146
|
+
* By default, a job cannot trigger itself because some built-in method calls,
|
|
147
|
+
* e.g. Array.prototype.push actually performs reads as well (#1740) which
|
|
148
|
+
* can lead to confusing infinite loops.
|
|
149
|
+
* The allowed cases are component update functions and watch callbacks.
|
|
150
|
+
* Component update functions may update child component props, which in turn
|
|
151
|
+
* trigger flush: "pre" watch callbacks that mutates state that the parent
|
|
152
|
+
* relies on (#1801). Watch callbacks doesn't track its dependencies so if it
|
|
153
|
+
* triggers itself again, it's likely intentional and it is the user's
|
|
154
|
+
* responsibility to perform recursive state mutation that eventually
|
|
155
|
+
* stabilizes (#1727).
|
|
156
|
+
*/
|
|
157
|
+
ALLOW_RECURSE = 4,
|
|
158
|
+
DISPOSED = 8
|
|
159
|
+
}
|
|
160
|
+
interface SchedulerJob extends Function {
|
|
161
|
+
id?: number;
|
|
162
|
+
/**
|
|
163
|
+
* flags can technically be undefined, but it can still be used in bitwise
|
|
164
|
+
* operations just like 0.
|
|
165
|
+
*/
|
|
166
|
+
flags?: SchedulerJobFlags;
|
|
167
|
+
/**
|
|
168
|
+
* Attached by renderer.ts when setting up a component's render effect
|
|
169
|
+
* Used to obtain component information when reporting max recursive updates.
|
|
170
|
+
*/
|
|
171
|
+
i?: ComponentInternalInstance;
|
|
172
|
+
}
|
|
173
|
+
declare function nextTick(): Promise<void>;
|
|
174
|
+
declare function nextTick<T, R>(this: T, fn: (this: T) => R | Promise<R>): Promise<R>;
|
|
175
|
+
type ComponentPropsOptions<P = Data> = ComponentObjectPropsOptions<P> | string[];
|
|
176
|
+
type ComponentObjectPropsOptions<P = Data> = { [K in keyof P]: Prop<P[K]> | null };
|
|
177
|
+
type Prop<T, D = T> = PropOptions<T, D> | PropType<T>;
|
|
178
|
+
type DefaultFactory<T> = (props: Data) => T | null | undefined;
|
|
179
|
+
interface PropOptions<T = any, D = T> {
|
|
180
|
+
type?: PropType<T> | true | null;
|
|
181
|
+
required?: boolean;
|
|
182
|
+
default?: D | DefaultFactory<D> | null | undefined | object;
|
|
183
|
+
validator?(value: unknown, props: Data): boolean;
|
|
184
|
+
}
|
|
185
|
+
type PropType<T> = PropConstructor<T> | (PropConstructor<T> | null)[];
|
|
186
|
+
type PropConstructor<T = any> = {
|
|
187
|
+
new (...args: any[]): T & {};
|
|
188
|
+
} | {
|
|
189
|
+
(): T;
|
|
190
|
+
} | PropMethod<T>;
|
|
191
|
+
type PropMethod<T, TConstructor = any> = [T] extends [((...args: any) => any) | undefined] ? {
|
|
192
|
+
new (): TConstructor;
|
|
193
|
+
(): T;
|
|
194
|
+
readonly prototype: TConstructor;
|
|
195
|
+
} : never;
|
|
196
|
+
type RequiredKeys<T> = { [K in keyof T]: T[K] extends {
|
|
197
|
+
required: true;
|
|
198
|
+
} | {
|
|
199
|
+
default: any;
|
|
200
|
+
} | BooleanConstructor | {
|
|
201
|
+
type: BooleanConstructor;
|
|
202
|
+
} ? T[K] extends {
|
|
203
|
+
default: undefined | (() => undefined);
|
|
204
|
+
} ? never : K : never }[keyof T];
|
|
205
|
+
type OptionalKeys<T> = Exclude<keyof T, RequiredKeys<T>>;
|
|
206
|
+
type DefaultKeys<T> = { [K in keyof T]: T[K] extends {
|
|
207
|
+
default: any;
|
|
208
|
+
} | BooleanConstructor | {
|
|
209
|
+
type: BooleanConstructor;
|
|
210
|
+
} ? T[K] extends {
|
|
211
|
+
type: BooleanConstructor;
|
|
212
|
+
required: true;
|
|
213
|
+
} ? never : K : never }[keyof T];
|
|
214
|
+
type InferPropType<T, NullAsAny = true> = [T] extends [null] ? NullAsAny extends true ? any : null : [T] extends [{
|
|
215
|
+
type: null | true;
|
|
216
|
+
}] ? any : [T] extends [ObjectConstructor | {
|
|
217
|
+
type: ObjectConstructor;
|
|
218
|
+
}] ? Record<string, any> : [T] extends [BooleanConstructor | {
|
|
219
|
+
type: BooleanConstructor;
|
|
220
|
+
}] ? boolean : [T] extends [DateConstructor | {
|
|
221
|
+
type: DateConstructor;
|
|
222
|
+
}] ? Date : [T] extends [(infer U)[] | {
|
|
223
|
+
type: (infer U)[];
|
|
224
|
+
}] ? 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;
|
|
225
|
+
/**
|
|
226
|
+
* Extract prop types from a runtime props options object.
|
|
227
|
+
* The extracted types are **internal** - i.e. the resolved props received by
|
|
228
|
+
* the component.
|
|
229
|
+
* - Boolean props are always present
|
|
230
|
+
* - Props with default values are always present
|
|
231
|
+
*
|
|
232
|
+
* To extract accepted props from the parent, use {@link ExtractPublicPropTypes}.
|
|
233
|
+
*/
|
|
234
|
+
type ExtractPropTypes<O> = { [K in keyof Pick<O, RequiredKeys<O>>]: O[K] extends {
|
|
235
|
+
default: any;
|
|
236
|
+
} ? Exclude<InferPropType<O[K]>, undefined> : InferPropType<O[K]> } & { [K in keyof Pick<O, OptionalKeys<O>>]?: InferPropType<O[K]> };
|
|
237
|
+
type ExtractDefaultPropTypes<O> = O extends object ? { [K in keyof Pick<O, DefaultKeys<O>>]: InferPropType<O[K]> } : {};
|
|
238
|
+
/**
|
|
239
|
+
* Vue `<script setup>` compiler macro for declaring component props. The
|
|
240
|
+
* expected argument is the same as the component `props` option.
|
|
241
|
+
*
|
|
242
|
+
* Example runtime declaration:
|
|
243
|
+
* ```js
|
|
244
|
+
* // using Array syntax
|
|
245
|
+
* const props = defineProps(['foo', 'bar'])
|
|
246
|
+
* // using Object syntax
|
|
247
|
+
* const props = defineProps({
|
|
248
|
+
* foo: String,
|
|
249
|
+
* bar: {
|
|
250
|
+
* type: Number,
|
|
251
|
+
* required: true
|
|
252
|
+
* }
|
|
253
|
+
* })
|
|
254
|
+
* ```
|
|
255
|
+
*
|
|
256
|
+
* Equivalent type-based declaration:
|
|
257
|
+
* ```ts
|
|
258
|
+
* // will be compiled into equivalent runtime declarations
|
|
259
|
+
* const props = defineProps<{
|
|
260
|
+
* foo?: string
|
|
261
|
+
* bar: number
|
|
262
|
+
* }>()
|
|
263
|
+
* ```
|
|
264
|
+
*
|
|
265
|
+
* @see {@link https://vuejs.org/api/sfc-script-setup.html#defineprops-defineemits}
|
|
266
|
+
*
|
|
267
|
+
* This is only usable inside `<script setup>`, is compiled away in the
|
|
268
|
+
* output and should **not** be actually called at runtime.
|
|
269
|
+
*/
|
|
270
|
+
declare function defineProps<PropNames extends string = string>(props: PropNames[]): Prettify<Readonly<{ [key in PropNames]?: any }>>;
|
|
271
|
+
declare function defineProps<PP extends ComponentObjectPropsOptions = ComponentObjectPropsOptions>(props: PP): Prettify<Readonly<ExtractPropTypes<PP>>>;
|
|
272
|
+
declare function defineProps<TypeProps>(): DefineProps<LooseRequired<TypeProps>, BooleanKey<TypeProps>>;
|
|
273
|
+
type DefineProps<T, BKeys extends keyof T> = Readonly<T> & { readonly [K in BKeys]-?: boolean };
|
|
274
|
+
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;
|
|
275
|
+
/**
|
|
276
|
+
* Vue `<script setup>` compiler macro for declaring a component's emitted
|
|
277
|
+
* events. The expected argument is the same as the component `emits` option.
|
|
278
|
+
*
|
|
279
|
+
* Example runtime declaration:
|
|
280
|
+
* ```js
|
|
281
|
+
* const emit = defineEmits(['change', 'update'])
|
|
282
|
+
* ```
|
|
283
|
+
*
|
|
284
|
+
* Example type-based declaration:
|
|
285
|
+
* ```ts
|
|
286
|
+
* const emit = defineEmits<{
|
|
287
|
+
* // <eventName>: <expected arguments>
|
|
288
|
+
* change: []
|
|
289
|
+
* update: [value: number] // named tuple syntax
|
|
290
|
+
* }>()
|
|
291
|
+
*
|
|
292
|
+
* emit('change')
|
|
293
|
+
* emit('update', 1)
|
|
294
|
+
* ```
|
|
295
|
+
*
|
|
296
|
+
* This is only usable inside `<script setup>`, is compiled away in the
|
|
297
|
+
* output and should **not** be actually called at runtime.
|
|
298
|
+
*
|
|
299
|
+
* @see {@link https://vuejs.org/api/sfc-script-setup.html#defineprops-defineemits}
|
|
300
|
+
*/
|
|
301
|
+
declare function defineEmits<EE extends string = string>(emitOptions: EE[]): EmitFn<EE[]>;
|
|
302
|
+
declare function defineEmits<E extends EmitsOptions = EmitsOptions>(emitOptions: E): EmitFn<E>;
|
|
303
|
+
declare function defineEmits<T extends ComponentTypeEmits>(): T extends ((...args: any[]) => any) ? T : ShortEmits<T>;
|
|
304
|
+
type ComponentTypeEmits = ((...args: any[]) => any) | Record<string, any>;
|
|
305
|
+
type RecordToUnion<T extends Record<string, any>> = T[keyof T];
|
|
306
|
+
type ShortEmits<T extends Record<string, any>> = UnionToIntersection<RecordToUnion<{ [K in keyof T]: (evt: K, ...args: T[K]) => void }>>;
|
|
307
|
+
/**
|
|
308
|
+
* Vue `<script setup>` compiler macro for declaring a component's exposed
|
|
309
|
+
* instance properties when it is accessed by a parent component via template
|
|
310
|
+
* refs.
|
|
311
|
+
*
|
|
312
|
+
* `<script setup>` components are closed by default - i.e. variables inside
|
|
313
|
+
* the `<script setup>` scope is not exposed to parent unless explicitly exposed
|
|
314
|
+
* via `defineExpose`.
|
|
315
|
+
*
|
|
316
|
+
* This is only usable inside `<script setup>`, is compiled away in the
|
|
317
|
+
* output and should **not** be actually called at runtime.
|
|
318
|
+
*
|
|
319
|
+
* @see {@link https://vuejs.org/api/sfc-script-setup.html#defineexpose}
|
|
320
|
+
*/
|
|
321
|
+
declare function defineExpose<Exposed extends Record<string, any> = Record<string, any>>(exposed?: Exposed): void;
|
|
322
|
+
/**
|
|
323
|
+
* Vue `<script setup>` compiler macro for declaring a component's additional
|
|
324
|
+
* options. This should be used only for options that cannot be expressed via
|
|
325
|
+
* Composition API - e.g. `inheritAttrs`.
|
|
326
|
+
*
|
|
327
|
+
* @see {@link https://vuejs.org/api/sfc-script-setup.html#defineoptions}
|
|
328
|
+
*/
|
|
329
|
+
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, {}> & {
|
|
330
|
+
/**
|
|
331
|
+
* props should be defined via defineProps().
|
|
332
|
+
*/
|
|
333
|
+
props?: never;
|
|
334
|
+
/**
|
|
335
|
+
* emits should be defined via defineEmits().
|
|
336
|
+
*/
|
|
337
|
+
emits?: never;
|
|
338
|
+
/**
|
|
339
|
+
* expose should be defined via defineExpose().
|
|
340
|
+
*/
|
|
341
|
+
expose?: never;
|
|
342
|
+
/**
|
|
343
|
+
* slots should be defined via defineSlots().
|
|
344
|
+
*/
|
|
345
|
+
slots?: never;
|
|
346
|
+
}): void;
|
|
347
|
+
declare function defineSlots<S extends Record<string, any> = Record<string, any>>(): StrictUnwrapSlotsType<SlotsType<S>>;
|
|
348
|
+
type ModelRef<T, M extends PropertyKey = string, G = T, S = T> = Ref<G, S> & [ModelRef<T, M, G, S>, Record<M, true | undefined>];
|
|
349
|
+
type DefineModelOptions<T = any, G = T, S = T> = {
|
|
350
|
+
get?: (v: T) => G;
|
|
351
|
+
set?: (v: S) => any;
|
|
352
|
+
};
|
|
353
|
+
/**
|
|
354
|
+
* Vue `<script setup>` compiler macro for declaring a
|
|
355
|
+
* two-way binding prop that can be consumed via `v-model` from the parent
|
|
356
|
+
* component. This will declare a prop with the same name and a corresponding
|
|
357
|
+
* `update:propName` event.
|
|
358
|
+
*
|
|
359
|
+
* If the first argument is a string, it will be used as the prop name;
|
|
360
|
+
* Otherwise the prop name will default to "modelValue". In both cases, you
|
|
361
|
+
* can also pass an additional object which will be used as the prop's options.
|
|
362
|
+
*
|
|
363
|
+
* The returned ref behaves differently depending on whether the parent
|
|
364
|
+
* provided the corresponding v-model props or not:
|
|
365
|
+
* - If yes, the returned ref's value will always be in sync with the parent
|
|
366
|
+
* prop.
|
|
367
|
+
* - If not, the returned ref will behave like a normal local ref.
|
|
368
|
+
*
|
|
369
|
+
* @example
|
|
370
|
+
* ```ts
|
|
371
|
+
* // default model (consumed via `v-model`)
|
|
372
|
+
* const modelValue = defineModel<string>()
|
|
373
|
+
* modelValue.value = "hello"
|
|
374
|
+
*
|
|
375
|
+
* // default model with options
|
|
376
|
+
* const modelValue = defineModel<string>({ required: true })
|
|
377
|
+
*
|
|
378
|
+
* // with specified name (consumed via `v-model:count`)
|
|
379
|
+
* const count = defineModel<number>('count')
|
|
380
|
+
* count.value++
|
|
381
|
+
*
|
|
382
|
+
* // with specified name and default value
|
|
383
|
+
* const count = defineModel<number>('count', { default: 0 })
|
|
384
|
+
* ```
|
|
385
|
+
*/
|
|
386
|
+
declare function defineModel<T, M extends PropertyKey = string, G = T, S = T>(options: ({
|
|
387
|
+
default: any;
|
|
388
|
+
} | {
|
|
389
|
+
required: true;
|
|
390
|
+
}) & PropOptions<T> & DefineModelOptions<T, G, S>): ModelRef<T, M, G, S>;
|
|
391
|
+
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>;
|
|
392
|
+
declare function defineModel<T, M extends PropertyKey = string, G = T, S = T>(name: string, options: ({
|
|
393
|
+
default: any;
|
|
394
|
+
} | {
|
|
395
|
+
required: true;
|
|
396
|
+
}) & PropOptions<T> & DefineModelOptions<T, G, S>): ModelRef<T, M, G, S>;
|
|
397
|
+
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>;
|
|
398
|
+
type NotUndefined<T> = T extends undefined ? never : T;
|
|
399
|
+
type MappedOmit<T, K extends keyof any> = { [P in keyof T as P extends K ? never : P]: T[P] };
|
|
400
|
+
type InferDefaults<T> = { [K in keyof T]?: InferDefault<T, T[K]> };
|
|
401
|
+
type NativeType = null | undefined | number | string | boolean | symbol | Function;
|
|
402
|
+
type InferDefault<P, T> = ((props: P) => T & {}) | (T extends NativeType ? T : never);
|
|
403
|
+
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;
|
|
404
|
+
/**
|
|
405
|
+
* Vue `<script setup>` compiler macro for providing props default values when
|
|
406
|
+
* using type-based `defineProps` declaration.
|
|
407
|
+
*
|
|
408
|
+
* Example usage:
|
|
409
|
+
* ```ts
|
|
410
|
+
* withDefaults(defineProps<{
|
|
411
|
+
* size?: number
|
|
412
|
+
* labels?: string[]
|
|
413
|
+
* }>(), {
|
|
414
|
+
* size: 3,
|
|
415
|
+
* labels: () => ['default label']
|
|
416
|
+
* })
|
|
417
|
+
* ```
|
|
418
|
+
*
|
|
419
|
+
* This is only usable inside `<script setup>`, is compiled away in the output
|
|
420
|
+
* and should **not** be actually called at runtime.
|
|
421
|
+
*
|
|
422
|
+
* @see {@link https://vuejs.org/guide/typescript/composition-api.html#typing-component-props}
|
|
423
|
+
*/
|
|
424
|
+
declare function withDefaults<T, BKeys extends keyof T, Defaults extends InferDefaults<T>>(props: DefineProps<T, BKeys>, defaults: Defaults): PropsWithDefaults<T, Defaults, BKeys>;
|
|
425
|
+
type ObjectEmitsOptions = Record<string, ((...args: any[]) => any) | null>;
|
|
426
|
+
type EmitsOptions = ObjectEmitsOptions | string[];
|
|
427
|
+
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 } : {};
|
|
428
|
+
type ShortEmitsToObject<E> = E extends Record<string, any[]> ? { [K in keyof E]: (...args: E[K]) => any } : E;
|
|
429
|
+
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]>;
|
|
430
|
+
/**
|
|
431
|
+
Runtime helper for applying directives to a vnode. Example usage:
|
|
432
|
+
|
|
433
|
+
const comp = resolveComponent('comp')
|
|
434
|
+
const foo = resolveDirective('foo')
|
|
435
|
+
const bar = resolveDirective('bar')
|
|
436
|
+
|
|
437
|
+
return withDirectives(h(comp), [
|
|
438
|
+
[foo, this.x],
|
|
439
|
+
[bar, this.y]
|
|
440
|
+
])
|
|
441
|
+
*/
|
|
442
|
+
interface DirectiveBinding<Value = any, Modifiers extends string = string, Arg = any> {
|
|
443
|
+
instance: ComponentPublicInstance | Record<string, any> | null;
|
|
444
|
+
value: Value;
|
|
445
|
+
oldValue: Value | null;
|
|
446
|
+
arg?: Arg;
|
|
447
|
+
modifiers: DirectiveModifiers<Modifiers>;
|
|
448
|
+
dir: ObjectDirective<any, Value, Modifiers, Arg>;
|
|
449
|
+
}
|
|
450
|
+
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;
|
|
451
|
+
type SSRDirectiveHook<Value = any, Modifiers extends string = string, Arg = any> = (binding: DirectiveBinding<Value, Modifiers, Arg>, vnode: VNode) => Data | undefined;
|
|
452
|
+
interface ObjectDirective<HostElement = any, Value = any, Modifiers extends string = string, Arg = any> {
|
|
453
|
+
created?: DirectiveHook<HostElement, null, Value, Modifiers, Arg>;
|
|
454
|
+
beforeMount?: DirectiveHook<HostElement, null, Value, Modifiers, Arg>;
|
|
455
|
+
mounted?: DirectiveHook<HostElement, null, Value, Modifiers, Arg>;
|
|
456
|
+
beforeUpdate?: DirectiveHook<HostElement, VNode<any, HostElement>, Value, Modifiers, Arg>;
|
|
457
|
+
updated?: DirectiveHook<HostElement, VNode<any, HostElement>, Value, Modifiers, Arg>;
|
|
458
|
+
beforeUnmount?: DirectiveHook<HostElement, null, Value, Modifiers, Arg>;
|
|
459
|
+
unmounted?: DirectiveHook<HostElement, null, Value, Modifiers, Arg>;
|
|
460
|
+
getSSRProps?: SSRDirectiveHook<Value, Modifiers, Arg>;
|
|
461
|
+
deep?: boolean;
|
|
462
|
+
}
|
|
463
|
+
type FunctionDirective<HostElement = any, V = any, Modifiers extends string = string, Arg = any> = DirectiveHook<HostElement, any, V, Modifiers, Arg>;
|
|
464
|
+
type Directive<HostElement = any, Value = any, Modifiers extends string = string, Arg = any> = ObjectDirective<HostElement, Value, Modifiers, Arg> | FunctionDirective<HostElement, Value, Modifiers, Arg>;
|
|
465
|
+
type DirectiveModifiers<K extends string = string> = Partial<Record<K, boolean>>;
|
|
466
|
+
/**
|
|
467
|
+
* Custom properties added to component instances in any way and can be accessed through `this`
|
|
468
|
+
*
|
|
469
|
+
* @example
|
|
470
|
+
* Here is an example of adding a property `$router` to every component instance:
|
|
471
|
+
* ```ts
|
|
472
|
+
* import { createApp } from 'vue'
|
|
473
|
+
* import { Router, createRouter } from 'vue-router'
|
|
474
|
+
*
|
|
475
|
+
* declare module 'vue' {
|
|
476
|
+
* interface ComponentCustomProperties {
|
|
477
|
+
* $router: Router
|
|
478
|
+
* }
|
|
479
|
+
* }
|
|
480
|
+
*
|
|
481
|
+
* // effectively adding the router to every component instance
|
|
482
|
+
* const app = createApp({})
|
|
483
|
+
* const router = createRouter()
|
|
484
|
+
* app.config.globalProperties.$router = router
|
|
485
|
+
*
|
|
486
|
+
* const vm = app.mount('#app')
|
|
487
|
+
* // we can access the router from the instance
|
|
488
|
+
* vm.$router.push('/')
|
|
489
|
+
* ```
|
|
490
|
+
*/
|
|
491
|
+
interface ComponentCustomProperties {}
|
|
492
|
+
type IsDefaultMixinComponent<T> = T extends ComponentOptionsMixin ? ComponentOptionsMixin extends T ? true : false : false;
|
|
493
|
+
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;
|
|
494
|
+
type ExtractMixin<T> = {
|
|
495
|
+
Mixin: MixinToOptionTypes<T>;
|
|
496
|
+
}[T extends ComponentOptionsMixin ? 'Mixin' : never];
|
|
497
|
+
type IntersectionMixin<T> = IsDefaultMixinComponent<T> extends true ? OptionTypesType : UnionToIntersection<ExtractMixin<T>>;
|
|
498
|
+
type UnwrapMixinsType<T, Type extends OptionTypesKeys> = T extends OptionTypesType ? T[Type] : never;
|
|
499
|
+
type EnsureNonVoid<T> = T extends void ? {} : T;
|
|
500
|
+
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> = {
|
|
501
|
+
__isFragment?: never;
|
|
502
|
+
__isTeleport?: never;
|
|
503
|
+
__isSuspense?: never;
|
|
504
|
+
new (...args: any[]): T;
|
|
505
|
+
};
|
|
506
|
+
/**
|
|
507
|
+
* @deprecated This is no longer used internally, but exported and relied on by
|
|
508
|
+
* existing library types generated by vue-tsc.
|
|
509
|
+
*/
|
|
510
|
+
/**
|
|
511
|
+
* This is the same as `CreateComponentPublicInstance` but adds local components,
|
|
512
|
+
* global directives, exposed, and provide inference.
|
|
513
|
+
* It changes the arguments order so that we don't need to repeat mixin
|
|
514
|
+
* inference everywhere internally, but it has to be a new type to avoid
|
|
515
|
+
* breaking types that relies on previous arguments order (#10842)
|
|
516
|
+
*/
|
|
517
|
+
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>;
|
|
518
|
+
type ExposedKeys<T, Exposed extends string & keyof T> = '' extends Exposed ? T : Pick<T, Exposed>;
|
|
519
|
+
type ComponentPublicInstance<P = {}, // props type extracted from props option
|
|
520
|
+
B = {}, // raw bindings returned from setup()
|
|
521
|
+
D = {}, // return from data()
|
|
522
|
+
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> = {
|
|
523
|
+
$: ComponentInternalInstance;
|
|
524
|
+
$data: D;
|
|
525
|
+
$props: MakeDefaultsOptional extends true ? Partial<Defaults> & Omit<Prettify<P> & PublicProps, keyof Defaults> : Prettify<P> & PublicProps;
|
|
526
|
+
$attrs: Data;
|
|
527
|
+
$refs: Data & TypeRefs;
|
|
528
|
+
$slots: UnwrapSlotsType<S>;
|
|
529
|
+
$root: ComponentPublicInstance | null;
|
|
530
|
+
$parent: ComponentPublicInstance | null;
|
|
531
|
+
$host: Element | null;
|
|
532
|
+
$emit: EmitFn<E>;
|
|
533
|
+
$el: TypeEl;
|
|
534
|
+
$options: Options & MergedComponentOptionsOverride;
|
|
535
|
+
$forceUpdate: () => void;
|
|
536
|
+
$nextTick: typeof nextTick;
|
|
537
|
+
$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;
|
|
538
|
+
} & ExposedKeys<IfAny<P, P, Readonly<Defaults> & Omit<P, keyof ShallowUnwrapRef<B> | keyof Defaults>> & ShallowUnwrapRef<B> & UnwrapNestedRefs<D> & ExtractComputedReturns<C> & M & ComponentCustomProperties & InjectToObject<I>, Exposed>;
|
|
539
|
+
interface SuspenseProps {
|
|
540
|
+
onResolve?: () => void;
|
|
541
|
+
onPending?: () => void;
|
|
542
|
+
onFallback?: () => void;
|
|
543
|
+
timeout?: string | number;
|
|
544
|
+
/**
|
|
545
|
+
* Allow suspense to be captured by parent suspense
|
|
546
|
+
*
|
|
547
|
+
* @default false
|
|
548
|
+
*/
|
|
549
|
+
suspensible?: boolean;
|
|
550
|
+
}
|
|
551
|
+
declare const SuspenseImpl: {
|
|
552
|
+
name: string;
|
|
553
|
+
__isSuspense: boolean;
|
|
554
|
+
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;
|
|
555
|
+
hydrate: typeof hydrateSuspense;
|
|
556
|
+
normalize: typeof normalizeSuspenseChildren;
|
|
557
|
+
};
|
|
558
|
+
declare const Suspense: {
|
|
559
|
+
__isSuspense: true;
|
|
560
|
+
new (): {
|
|
561
|
+
$props: VNodeProps & SuspenseProps;
|
|
562
|
+
$slots: {
|
|
563
|
+
default(): VNode[];
|
|
564
|
+
fallback(): VNode[];
|
|
565
|
+
};
|
|
566
|
+
};
|
|
567
|
+
};
|
|
568
|
+
interface SuspenseBoundary {
|
|
569
|
+
vnode: VNode<RendererNode, RendererElement, SuspenseProps>;
|
|
570
|
+
parent: SuspenseBoundary | null;
|
|
571
|
+
parentComponent: ComponentInternalInstance | null;
|
|
572
|
+
namespace: ElementNamespace;
|
|
573
|
+
container: RendererElement;
|
|
574
|
+
hiddenContainer: RendererElement;
|
|
575
|
+
activeBranch: VNode | null;
|
|
576
|
+
pendingBranch: VNode | null;
|
|
577
|
+
deps: number;
|
|
578
|
+
pendingId: number;
|
|
579
|
+
timeout: number;
|
|
580
|
+
isInFallback: boolean;
|
|
581
|
+
isHydrating: boolean;
|
|
582
|
+
isUnmounted: boolean;
|
|
583
|
+
effects: Function[];
|
|
584
|
+
resolve(force?: boolean, sync?: boolean): void;
|
|
585
|
+
fallback(fallbackVNode: VNode): void;
|
|
586
|
+
move(container: RendererElement, anchor: RendererNode | null, type: MoveType): void;
|
|
587
|
+
next(): RendererNode | null;
|
|
588
|
+
registerDep(instance: ComponentInternalInstance, setupRenderEffect: SetupRenderEffectFn, optimized: boolean): void;
|
|
589
|
+
unmount(parentSuspense: SuspenseBoundary | null, doRemove?: boolean): void;
|
|
590
|
+
}
|
|
591
|
+
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;
|
|
592
|
+
declare function normalizeSuspenseChildren(vnode: VNode): void;
|
|
593
|
+
type Hook<T = () => void> = T | T[];
|
|
594
|
+
interface BaseTransitionProps<HostElement = RendererElement> {
|
|
595
|
+
mode?: 'in-out' | 'out-in' | 'default';
|
|
596
|
+
appear?: boolean;
|
|
597
|
+
persisted?: boolean;
|
|
598
|
+
onBeforeEnter?: Hook<(el: HostElement) => void>;
|
|
599
|
+
onEnter?: Hook<(el: HostElement, done: () => void) => void>;
|
|
600
|
+
onAfterEnter?: Hook<(el: HostElement) => void>;
|
|
601
|
+
onEnterCancelled?: Hook<(el: HostElement) => void>;
|
|
602
|
+
onBeforeLeave?: Hook<(el: HostElement) => void>;
|
|
603
|
+
onLeave?: Hook<(el: HostElement, done: () => void) => void>;
|
|
604
|
+
onAfterLeave?: Hook<(el: HostElement) => void>;
|
|
605
|
+
onLeaveCancelled?: Hook<(el: HostElement) => void>;
|
|
606
|
+
onBeforeAppear?: Hook<(el: HostElement) => void>;
|
|
607
|
+
onAppear?: Hook<(el: HostElement, done: () => void) => void>;
|
|
608
|
+
onAfterAppear?: Hook<(el: HostElement) => void>;
|
|
609
|
+
onAppearCancelled?: Hook<(el: HostElement) => void>;
|
|
610
|
+
}
|
|
611
|
+
interface TransitionHooks<HostElement = RendererElement> {
|
|
612
|
+
mode: BaseTransitionProps['mode'];
|
|
613
|
+
persisted: boolean;
|
|
614
|
+
beforeEnter(el: HostElement): void;
|
|
615
|
+
enter(el: HostElement): void;
|
|
616
|
+
leave(el: HostElement, remove: () => void): void;
|
|
617
|
+
clone(vnode: VNode): TransitionHooks<HostElement>;
|
|
618
|
+
afterLeave?(): void;
|
|
619
|
+
delayLeave?(el: HostElement, earlyRemove: () => void, delayedLeave: () => void): void;
|
|
620
|
+
delayedLeave?(): void;
|
|
621
|
+
}
|
|
622
|
+
type ElementNamespace = 'svg' | 'mathml' | undefined;
|
|
623
|
+
interface RendererOptions<HostNode = RendererNode, HostElement = RendererElement> {
|
|
624
|
+
patchProp(el: HostElement, key: string, prevValue: any, nextValue: any, namespace?: ElementNamespace, parentComponent?: ComponentInternalInstance | null): void;
|
|
625
|
+
insert(el: HostNode, parent: HostElement, anchor?: HostNode | null): void;
|
|
626
|
+
remove(el: HostNode): void;
|
|
627
|
+
createElement(type: string, namespace?: ElementNamespace, isCustomizedBuiltIn?: string, vnodeProps?: (VNodeProps & {
|
|
628
|
+
[key: string]: any;
|
|
629
|
+
}) | null): HostElement;
|
|
630
|
+
createText(text: string): HostNode;
|
|
631
|
+
createComment(text: string): HostNode;
|
|
632
|
+
setText(node: HostNode, text: string): void;
|
|
633
|
+
setElementText(node: HostElement, text: string): void;
|
|
634
|
+
parentNode(node: HostNode): HostElement | null;
|
|
635
|
+
nextSibling(node: HostNode): HostNode | null;
|
|
636
|
+
querySelector?(selector: string): HostElement | null;
|
|
637
|
+
setScopeId?(el: HostElement, id: string): void;
|
|
638
|
+
cloneNode?(node: HostNode): HostNode;
|
|
639
|
+
insertStaticContent?(content: string, parent: HostElement, anchor: HostNode | null, namespace: ElementNamespace, start?: HostNode | null, end?: HostNode | null): [HostNode, HostNode];
|
|
640
|
+
}
|
|
641
|
+
interface RendererNode {
|
|
642
|
+
[key: string | symbol]: any;
|
|
643
|
+
}
|
|
644
|
+
interface RendererElement extends RendererNode {}
|
|
645
|
+
interface RendererInternals<HostNode = RendererNode, HostElement = RendererElement> {
|
|
646
|
+
p: PatchFn;
|
|
647
|
+
um: UnmountFn;
|
|
648
|
+
r: RemoveFn;
|
|
649
|
+
m: MoveFn;
|
|
650
|
+
mt: MountComponentFn;
|
|
651
|
+
mc: MountChildrenFn;
|
|
652
|
+
pc: PatchChildrenFn;
|
|
653
|
+
pbc: PatchBlockChildrenFn;
|
|
654
|
+
n: NextFn;
|
|
655
|
+
o: RendererOptions<HostNode, HostElement>;
|
|
656
|
+
}
|
|
657
|
+
type PatchFn = (n1: VNode | null, // null means this is a mount
|
|
658
|
+
n2: VNode, container: RendererElement, anchor?: RendererNode | null, parentComponent?: ComponentInternalInstance | null, parentSuspense?: SuspenseBoundary | null, namespace?: ElementNamespace, slotScopeIds?: string[] | null, optimized?: boolean) => void;
|
|
659
|
+
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;
|
|
660
|
+
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;
|
|
661
|
+
type PatchBlockChildrenFn = (oldChildren: VNode[], newChildren: VNode[], fallbackContainer: RendererElement, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, namespace: ElementNamespace, slotScopeIds: string[] | null) => void;
|
|
662
|
+
type MoveFn = (vnode: VNode, container: RendererElement, anchor: RendererNode | null, type: MoveType, parentSuspense?: SuspenseBoundary | null) => void;
|
|
663
|
+
type NextFn = (vnode: VNode) => RendererNode | null;
|
|
664
|
+
type UnmountFn = (vnode: VNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, doRemove?: boolean, optimized?: boolean) => void;
|
|
665
|
+
type RemoveFn = (vnode: VNode) => void;
|
|
666
|
+
type MountComponentFn = (initialVNode: VNode, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, namespace: ElementNamespace, optimized: boolean) => void;
|
|
667
|
+
type SetupRenderEffectFn = (instance: ComponentInternalInstance, initialVNode: VNode, container: RendererElement, anchor: RendererNode | null, parentSuspense: SuspenseBoundary | null, namespace: ElementNamespace, optimized: boolean) => void;
|
|
668
|
+
declare enum MoveType {
|
|
669
|
+
ENTER = 0,
|
|
670
|
+
LEAVE = 1,
|
|
671
|
+
REORDER = 2
|
|
672
|
+
}
|
|
673
|
+
/**
|
|
674
|
+
* The createRenderer function accepts two generic arguments:
|
|
675
|
+
* HostNode and HostElement, corresponding to Node and Element types in the
|
|
676
|
+
* host environment. For example, for runtime-dom, HostNode would be the DOM
|
|
677
|
+
* `Node` interface and HostElement would be the DOM `Element` interface.
|
|
678
|
+
*
|
|
679
|
+
* Custom renderers can pass in the platform specific types like this:
|
|
680
|
+
*
|
|
681
|
+
* ``` js
|
|
682
|
+
* const { render, createApp } = createRenderer<Node, Element>({
|
|
683
|
+
* patchProp,
|
|
684
|
+
* ...nodeOps
|
|
685
|
+
* })
|
|
686
|
+
* ```
|
|
687
|
+
*/
|
|
688
|
+
type MatchPattern = string | RegExp | (string | RegExp)[];
|
|
689
|
+
interface KeepAliveProps {
|
|
690
|
+
include?: MatchPattern;
|
|
691
|
+
exclude?: MatchPattern;
|
|
692
|
+
max?: number | string;
|
|
693
|
+
}
|
|
694
|
+
type DebuggerHook = (e: DebuggerEvent) => void;
|
|
695
|
+
type ErrorCapturedHook<TError = unknown> = (err: TError, instance: ComponentPublicInstance | null, info: string) => boolean | void;
|
|
696
|
+
declare enum DeprecationTypes$1 {
|
|
697
|
+
GLOBAL_MOUNT = "GLOBAL_MOUNT",
|
|
698
|
+
GLOBAL_MOUNT_CONTAINER = "GLOBAL_MOUNT_CONTAINER",
|
|
699
|
+
GLOBAL_EXTEND = "GLOBAL_EXTEND",
|
|
700
|
+
GLOBAL_PROTOTYPE = "GLOBAL_PROTOTYPE",
|
|
701
|
+
GLOBAL_SET = "GLOBAL_SET",
|
|
702
|
+
GLOBAL_DELETE = "GLOBAL_DELETE",
|
|
703
|
+
GLOBAL_OBSERVABLE = "GLOBAL_OBSERVABLE",
|
|
704
|
+
GLOBAL_PRIVATE_UTIL = "GLOBAL_PRIVATE_UTIL",
|
|
705
|
+
CONFIG_SILENT = "CONFIG_SILENT",
|
|
706
|
+
CONFIG_DEVTOOLS = "CONFIG_DEVTOOLS",
|
|
707
|
+
CONFIG_KEY_CODES = "CONFIG_KEY_CODES",
|
|
708
|
+
CONFIG_PRODUCTION_TIP = "CONFIG_PRODUCTION_TIP",
|
|
709
|
+
CONFIG_IGNORED_ELEMENTS = "CONFIG_IGNORED_ELEMENTS",
|
|
710
|
+
CONFIG_WHITESPACE = "CONFIG_WHITESPACE",
|
|
711
|
+
CONFIG_OPTION_MERGE_STRATS = "CONFIG_OPTION_MERGE_STRATS",
|
|
712
|
+
INSTANCE_SET = "INSTANCE_SET",
|
|
713
|
+
INSTANCE_DELETE = "INSTANCE_DELETE",
|
|
714
|
+
INSTANCE_DESTROY = "INSTANCE_DESTROY",
|
|
715
|
+
INSTANCE_EVENT_EMITTER = "INSTANCE_EVENT_EMITTER",
|
|
716
|
+
INSTANCE_EVENT_HOOKS = "INSTANCE_EVENT_HOOKS",
|
|
717
|
+
INSTANCE_CHILDREN = "INSTANCE_CHILDREN",
|
|
718
|
+
INSTANCE_LISTENERS = "INSTANCE_LISTENERS",
|
|
719
|
+
INSTANCE_SCOPED_SLOTS = "INSTANCE_SCOPED_SLOTS",
|
|
720
|
+
INSTANCE_ATTRS_CLASS_STYLE = "INSTANCE_ATTRS_CLASS_STYLE",
|
|
721
|
+
OPTIONS_DATA_FN = "OPTIONS_DATA_FN",
|
|
722
|
+
OPTIONS_DATA_MERGE = "OPTIONS_DATA_MERGE",
|
|
723
|
+
OPTIONS_BEFORE_DESTROY = "OPTIONS_BEFORE_DESTROY",
|
|
724
|
+
OPTIONS_DESTROYED = "OPTIONS_DESTROYED",
|
|
725
|
+
WATCH_ARRAY = "WATCH_ARRAY",
|
|
726
|
+
PROPS_DEFAULT_THIS = "PROPS_DEFAULT_THIS",
|
|
727
|
+
V_ON_KEYCODE_MODIFIER = "V_ON_KEYCODE_MODIFIER",
|
|
728
|
+
CUSTOM_DIR = "CUSTOM_DIR",
|
|
729
|
+
ATTR_FALSE_VALUE = "ATTR_FALSE_VALUE",
|
|
730
|
+
ATTR_ENUMERATED_COERCION = "ATTR_ENUMERATED_COERCION",
|
|
731
|
+
TRANSITION_CLASSES = "TRANSITION_CLASSES",
|
|
732
|
+
TRANSITION_GROUP_ROOT = "TRANSITION_GROUP_ROOT",
|
|
733
|
+
COMPONENT_ASYNC = "COMPONENT_ASYNC",
|
|
734
|
+
COMPONENT_FUNCTIONAL = "COMPONENT_FUNCTIONAL",
|
|
735
|
+
COMPONENT_V_MODEL = "COMPONENT_V_MODEL",
|
|
736
|
+
RENDER_FUNCTION = "RENDER_FUNCTION",
|
|
737
|
+
FILTERS = "FILTERS",
|
|
738
|
+
PRIVATE_APIS = "PRIVATE_APIS"
|
|
739
|
+
}
|
|
740
|
+
type CompatConfig = Partial<Record<DeprecationTypes$1, boolean | 'suppress-warning'>> & {
|
|
741
|
+
MODE?: 2 | 3 | ((comp: Component | null) => 2 | 3);
|
|
742
|
+
};
|
|
743
|
+
/**
|
|
744
|
+
* Interface for declaring custom options.
|
|
745
|
+
*
|
|
746
|
+
* @example
|
|
747
|
+
* ```ts
|
|
748
|
+
* declare module 'vue' {
|
|
749
|
+
* interface ComponentCustomOptions {
|
|
750
|
+
* beforeRouteUpdate?(
|
|
751
|
+
* to: Route,
|
|
752
|
+
* from: Route,
|
|
753
|
+
* next: () => void
|
|
754
|
+
* ): void
|
|
755
|
+
* }
|
|
756
|
+
* }
|
|
757
|
+
* ```
|
|
758
|
+
*/
|
|
759
|
+
interface ComponentCustomOptions {}
|
|
760
|
+
type RenderFunction = () => VNodeChild;
|
|
761
|
+
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 {
|
|
762
|
+
setup?: (this: void, props: LooseRequired<Props & Prettify<UnwrapMixinsType<IntersectionMixin<Mixin> & IntersectionMixin<Extends>, 'P'>>>, ctx: SetupContext<E, S>) => Promise<RawBindings> | RawBindings | RenderFunction | void;
|
|
763
|
+
name?: string;
|
|
764
|
+
template?: string | object;
|
|
765
|
+
render?: Function;
|
|
766
|
+
components?: LC & Record<string, Component>;
|
|
767
|
+
directives?: Directives & Record<string, Directive>;
|
|
768
|
+
inheritAttrs?: boolean;
|
|
769
|
+
emits?: (E | EE[]) & ThisType<void>;
|
|
770
|
+
slots?: S;
|
|
771
|
+
expose?: Exposed[];
|
|
772
|
+
serverPrefetch?(): void | Promise<any>;
|
|
773
|
+
compilerOptions?: RuntimeCompilerOptions;
|
|
774
|
+
call?: (this: unknown, ...args: unknown[]) => never;
|
|
775
|
+
__isFragment?: never;
|
|
776
|
+
__isTeleport?: never;
|
|
777
|
+
__isSuspense?: never;
|
|
778
|
+
__defaults?: Defaults;
|
|
779
|
+
}
|
|
780
|
+
/**
|
|
781
|
+
* Subset of compiler options that makes sense for the runtime.
|
|
782
|
+
*/
|
|
783
|
+
interface RuntimeCompilerOptions {
|
|
784
|
+
isCustomElement?: (tag: string) => boolean;
|
|
785
|
+
whitespace?: 'preserve' | 'condense';
|
|
786
|
+
comments?: boolean;
|
|
787
|
+
delimiters?: [string, string];
|
|
788
|
+
}
|
|
789
|
+
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>>;
|
|
790
|
+
type ComponentOptionsMixin = ComponentOptionsBase<any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any>;
|
|
791
|
+
type ComputedOptions = Record<string, ComputedGetter<any> | WritableComputedOptions<any>>;
|
|
792
|
+
interface MethodOptions {
|
|
793
|
+
[key: string]: Function;
|
|
794
|
+
}
|
|
795
|
+
type ExtractComputedReturns<T extends any> = { [key in keyof T]: T[key] extends {
|
|
796
|
+
get: (...args: any[]) => infer TReturn;
|
|
797
|
+
} ? TReturn : T[key] extends ((...args: any[]) => infer TReturn) ? TReturn : never };
|
|
798
|
+
type ObjectWatchOptionItem = {
|
|
799
|
+
handler: WatchCallback | string;
|
|
800
|
+
} & WatchOptions;
|
|
801
|
+
type WatchOptionItem = string | WatchCallback | ObjectWatchOptionItem;
|
|
802
|
+
type ComponentWatchOptionItem = WatchOptionItem | WatchOptionItem[];
|
|
803
|
+
type ComponentWatchOptions = Record<string, ComponentWatchOptionItem>;
|
|
804
|
+
type ComponentProvideOptions = ObjectProvideOptions | Function;
|
|
805
|
+
type ObjectProvideOptions = Record<string | symbol, unknown>;
|
|
806
|
+
type ComponentInjectOptions = string[] | ObjectInjectOptions;
|
|
807
|
+
type ObjectInjectOptions = Record<string | symbol, string | symbol | {
|
|
808
|
+
from?: string | symbol;
|
|
809
|
+
default?: unknown;
|
|
810
|
+
}>;
|
|
811
|
+
type InjectToObject<T extends ComponentInjectOptions> = T extends string[] ? { [K in T[number]]?: unknown } : T extends ObjectInjectOptions ? { [K in keyof T]?: unknown } : never;
|
|
812
|
+
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> {
|
|
813
|
+
compatConfig?: CompatConfig;
|
|
814
|
+
[key: string]: any;
|
|
815
|
+
data?: (this: CreateComponentPublicInstanceWithMixins<Props, {}, {}, {}, MethodOptions, Mixin, Extends>, vm: CreateComponentPublicInstanceWithMixins<Props, {}, {}, {}, MethodOptions, Mixin, Extends>) => D;
|
|
816
|
+
computed?: C;
|
|
817
|
+
methods?: M;
|
|
818
|
+
watch?: ComponentWatchOptions;
|
|
819
|
+
provide?: Provide;
|
|
820
|
+
inject?: I | II[];
|
|
821
|
+
filters?: Record<string, Function>;
|
|
822
|
+
mixins?: Mixin[];
|
|
823
|
+
extends?: Extends;
|
|
824
|
+
beforeCreate?(): any;
|
|
825
|
+
created?(): any;
|
|
826
|
+
beforeMount?(): any;
|
|
827
|
+
mounted?(): any;
|
|
828
|
+
beforeUpdate?(): any;
|
|
829
|
+
updated?(): any;
|
|
830
|
+
activated?(): any;
|
|
831
|
+
deactivated?(): any;
|
|
832
|
+
/** @deprecated use `beforeUnmount` instead */
|
|
833
|
+
beforeDestroy?(): any;
|
|
834
|
+
beforeUnmount?(): any;
|
|
835
|
+
/** @deprecated use `unmounted` instead */
|
|
836
|
+
destroyed?(): any;
|
|
837
|
+
unmounted?(): any;
|
|
838
|
+
renderTracked?: DebuggerHook;
|
|
839
|
+
renderTriggered?: DebuggerHook;
|
|
840
|
+
errorCaptured?: ErrorCapturedHook;
|
|
841
|
+
/**
|
|
842
|
+
* runtime compile only
|
|
843
|
+
* @deprecated use `compilerOptions.delimiters` instead.
|
|
844
|
+
*/
|
|
845
|
+
delimiters?: [string, string];
|
|
846
|
+
/**
|
|
847
|
+
* #3468
|
|
848
|
+
*
|
|
849
|
+
* type-only, used to assist Mixin's type inference,
|
|
850
|
+
* TypeScript will try to simplify the inferred `Mixin` type,
|
|
851
|
+
* with the `__differentiator`, TypeScript won't be able to combine different mixins,
|
|
852
|
+
* because the `__differentiator` will be different
|
|
853
|
+
*/
|
|
854
|
+
__differentiator?: keyof D | keyof C | keyof M;
|
|
855
|
+
}
|
|
856
|
+
type MergedHook<T = () => void> = T | T[];
|
|
857
|
+
type MergedComponentOptionsOverride = {
|
|
858
|
+
beforeCreate?: MergedHook;
|
|
859
|
+
created?: MergedHook;
|
|
860
|
+
beforeMount?: MergedHook;
|
|
861
|
+
mounted?: MergedHook;
|
|
862
|
+
beforeUpdate?: MergedHook;
|
|
863
|
+
updated?: MergedHook;
|
|
864
|
+
activated?: MergedHook;
|
|
865
|
+
deactivated?: MergedHook; /** @deprecated use `beforeUnmount` instead */
|
|
866
|
+
beforeDestroy?: MergedHook;
|
|
867
|
+
beforeUnmount?: MergedHook; /** @deprecated use `unmounted` instead */
|
|
868
|
+
destroyed?: MergedHook;
|
|
869
|
+
unmounted?: MergedHook;
|
|
870
|
+
renderTracked?: MergedHook<DebuggerHook>;
|
|
871
|
+
renderTriggered?: MergedHook<DebuggerHook>;
|
|
872
|
+
errorCaptured?: MergedHook<ErrorCapturedHook>;
|
|
873
|
+
};
|
|
874
|
+
type OptionTypesKeys = 'P' | 'B' | 'D' | 'C' | 'M' | 'Defaults';
|
|
875
|
+
type OptionTypesType<P = {}, B = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Defaults = {}> = {
|
|
876
|
+
P: P;
|
|
877
|
+
B: B;
|
|
878
|
+
D: D;
|
|
879
|
+
C: C;
|
|
880
|
+
M: M;
|
|
881
|
+
Defaults: Defaults;
|
|
882
|
+
};
|
|
883
|
+
/**
|
|
884
|
+
* @deprecated
|
|
885
|
+
*/
|
|
886
|
+
interface InjectionConstraint<T> {}
|
|
887
|
+
type InjectionKey<T> = symbol & InjectionConstraint<T>;
|
|
888
|
+
type PublicProps = VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
889
|
+
type ResolveProps<PropsOrPropOptions, E extends EmitsOptions> = Readonly<PropsOrPropOptions extends ComponentPropsOptions ? ExtractPropTypes<PropsOrPropOptions> : PropsOrPropOptions> & ({} extends E ? {} : EmitsToProps<E>);
|
|
890
|
+
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;
|
|
891
|
+
interface App<HostElement = any> {
|
|
892
|
+
version: string;
|
|
893
|
+
config: AppConfig;
|
|
894
|
+
use<Options extends unknown[]>(plugin: Plugin$1<Options>, ...options: NoInfer<Options>): this;
|
|
895
|
+
use<Options>(plugin: Plugin$1<Options>, options: NoInfer<Options>): this;
|
|
896
|
+
mixin(mixin: ComponentOptions): this;
|
|
897
|
+
component(name: string): Component | undefined;
|
|
898
|
+
component<T extends Component | DefineComponent>(name: string, component: T): this;
|
|
899
|
+
directive<HostElement = any, Value = any, Modifiers extends string = string, Arg = any>(name: string): Directive<HostElement, Value, Modifiers, Arg> | undefined;
|
|
900
|
+
directive<HostElement = any, Value = any, Modifiers extends string = string, Arg = any>(name: string, directive: Directive<HostElement, Value, Modifiers, Arg>): this;
|
|
901
|
+
mount(rootContainer: HostElement | string,
|
|
902
|
+
/**
|
|
903
|
+
* @internal
|
|
904
|
+
*/
|
|
905
|
+
|
|
906
|
+
isHydrate?: boolean,
|
|
907
|
+
/**
|
|
908
|
+
* @internal
|
|
909
|
+
*/
|
|
910
|
+
|
|
911
|
+
namespace?: boolean | ElementNamespace,
|
|
912
|
+
/**
|
|
913
|
+
* @internal
|
|
914
|
+
*/
|
|
915
|
+
|
|
916
|
+
vnode?: VNode): ComponentPublicInstance;
|
|
917
|
+
unmount(): void;
|
|
918
|
+
onUnmount(cb: () => void): void;
|
|
919
|
+
provide<T, K = InjectionKey<T> | string | number>(key: K, value: K extends InjectionKey<infer V> ? V : T): this;
|
|
920
|
+
/**
|
|
921
|
+
* Runs a function with the app as active instance. This allows using of `inject()` within the function to get access
|
|
922
|
+
* to variables provided via `app.provide()`.
|
|
923
|
+
*
|
|
924
|
+
* @param fn - function to run with the app as active instance
|
|
925
|
+
*/
|
|
926
|
+
runWithContext<T>(fn: () => T): T;
|
|
927
|
+
_uid: number;
|
|
928
|
+
_component: ConcreteComponent;
|
|
929
|
+
_props: Data | null;
|
|
930
|
+
_container: HostElement | null;
|
|
931
|
+
_context: AppContext;
|
|
932
|
+
_instance: ComponentInternalInstance | null;
|
|
933
|
+
/**
|
|
934
|
+
* v2 compat only
|
|
935
|
+
*/
|
|
936
|
+
filter?(name: string): Function | undefined;
|
|
937
|
+
filter?(name: string, filter: Function): this;
|
|
938
|
+
}
|
|
939
|
+
type OptionMergeFunction = (to: unknown, from: unknown) => any;
|
|
940
|
+
interface AppConfig {
|
|
941
|
+
readonly isNativeTag: (tag: string) => boolean;
|
|
942
|
+
performance: boolean;
|
|
943
|
+
optionMergeStrategies: Record<string, OptionMergeFunction>;
|
|
944
|
+
globalProperties: ComponentCustomProperties & Record<string, any>;
|
|
945
|
+
errorHandler?: (err: unknown, instance: ComponentPublicInstance | null, info: string) => void;
|
|
946
|
+
warnHandler?: (msg: string, instance: ComponentPublicInstance | null, trace: string) => void;
|
|
947
|
+
/**
|
|
948
|
+
* Options to pass to `@vue/compiler-dom`.
|
|
949
|
+
* Only supported in runtime compiler build.
|
|
950
|
+
*/
|
|
951
|
+
compilerOptions: RuntimeCompilerOptions;
|
|
952
|
+
/**
|
|
953
|
+
* @deprecated use config.compilerOptions.isCustomElement
|
|
954
|
+
*/
|
|
955
|
+
isCustomElement?: (tag: string) => boolean;
|
|
956
|
+
/**
|
|
957
|
+
* TODO document for 3.5
|
|
958
|
+
* Enable warnings for computed getters that recursively trigger itself.
|
|
959
|
+
*/
|
|
960
|
+
warnRecursiveComputed?: boolean;
|
|
961
|
+
/**
|
|
962
|
+
* Whether to throw unhandled errors in production.
|
|
963
|
+
* Default is `false` to avoid crashing on any error (and only logs it)
|
|
964
|
+
* But in some cases, e.g. SSR, throwing might be more desirable.
|
|
965
|
+
*/
|
|
966
|
+
throwUnhandledErrorInProduction?: boolean;
|
|
967
|
+
/**
|
|
968
|
+
* Prefix for all useId() calls within this app
|
|
969
|
+
*/
|
|
970
|
+
idPrefix?: string;
|
|
971
|
+
}
|
|
972
|
+
interface AppContext {
|
|
973
|
+
app: App;
|
|
974
|
+
config: AppConfig;
|
|
975
|
+
mixins: ComponentOptions[];
|
|
976
|
+
components: Record<string, Component>;
|
|
977
|
+
directives: Record<string, Directive>;
|
|
978
|
+
provides: Record<string | symbol, any>;
|
|
979
|
+
}
|
|
980
|
+
type PluginInstallFunction<Options = any[]> = Options extends unknown[] ? (app: App, ...options: Options) => any : (app: App, options: Options) => any;
|
|
981
|
+
type ObjectPlugin<Options = any[]> = {
|
|
982
|
+
install: PluginInstallFunction<Options>;
|
|
983
|
+
};
|
|
984
|
+
type FunctionPlugin<Options = any[]> = PluginInstallFunction<Options> & Partial<ObjectPlugin<Options>>;
|
|
985
|
+
type Plugin$1<Options = any[], P extends unknown[] = (Options extends unknown[] ? Options : [Options])> = FunctionPlugin<P> | ObjectPlugin<P>;
|
|
986
|
+
type TeleportVNode = VNode<RendererNode, RendererElement, TeleportProps>;
|
|
987
|
+
interface TeleportProps {
|
|
988
|
+
to: string | RendererElement | null | undefined;
|
|
989
|
+
disabled?: boolean;
|
|
990
|
+
defer?: boolean;
|
|
991
|
+
}
|
|
992
|
+
declare const TeleportImpl: {
|
|
993
|
+
name: string;
|
|
994
|
+
__isTeleport: boolean;
|
|
995
|
+
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;
|
|
996
|
+
remove(vnode: VNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, {
|
|
997
|
+
um: unmount,
|
|
998
|
+
o: {
|
|
999
|
+
remove: hostRemove
|
|
1000
|
+
}
|
|
1001
|
+
}: RendererInternals, doRemove: boolean): void;
|
|
1002
|
+
move: typeof moveTeleport;
|
|
1003
|
+
hydrate: typeof hydrateTeleport;
|
|
1004
|
+
};
|
|
1005
|
+
declare enum TeleportMoveTypes {
|
|
1006
|
+
TARGET_CHANGE = 0,
|
|
1007
|
+
TOGGLE = 1,
|
|
1008
|
+
// enable / disable
|
|
1009
|
+
REORDER = 2
|
|
1010
|
+
}
|
|
1011
|
+
declare function moveTeleport(vnode: VNode, container: RendererElement, parentAnchor: RendererNode | null, {
|
|
1012
|
+
o: {
|
|
1013
|
+
insert
|
|
1014
|
+
},
|
|
1015
|
+
m: move
|
|
1016
|
+
}: RendererInternals, moveType?: TeleportMoveTypes): void;
|
|
1017
|
+
declare function hydrateTeleport(node: Node, vnode: TeleportVNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, slotScopeIds: string[] | null, optimized: boolean, {
|
|
1018
|
+
o: {
|
|
1019
|
+
nextSibling,
|
|
1020
|
+
parentNode,
|
|
1021
|
+
querySelector,
|
|
1022
|
+
insert,
|
|
1023
|
+
createText
|
|
1024
|
+
}
|
|
1025
|
+
}: 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;
|
|
1026
|
+
declare const Teleport: {
|
|
1027
|
+
__isTeleport: true;
|
|
1028
|
+
new (): {
|
|
1029
|
+
$props: VNodeProps & TeleportProps;
|
|
1030
|
+
$slots: {
|
|
1031
|
+
default(): VNode[];
|
|
1032
|
+
};
|
|
1033
|
+
};
|
|
1034
|
+
};
|
|
1035
|
+
declare const Fragment: {
|
|
1036
|
+
__isFragment: true;
|
|
1037
|
+
new (): {
|
|
1038
|
+
$props: VNodeProps;
|
|
1039
|
+
};
|
|
1040
|
+
};
|
|
1041
|
+
declare const Text: unique symbol;
|
|
1042
|
+
declare const Comment: unique symbol;
|
|
1043
|
+
declare const Static: unique symbol;
|
|
1044
|
+
type VNodeTypes = string | VNode | Component | typeof Text | typeof Static | typeof Comment | typeof Fragment | typeof Teleport | typeof TeleportImpl | typeof Suspense | typeof SuspenseImpl;
|
|
1045
|
+
type VNodeRef = string | Ref | ((ref: Element | ComponentPublicInstance | null, refs: Record<string, any>) => void);
|
|
1046
|
+
type VNodeNormalizedRefAtom = {
|
|
1047
|
+
/**
|
|
1048
|
+
* component instance
|
|
1049
|
+
*/
|
|
1050
|
+
i: ComponentInternalInstance;
|
|
1051
|
+
/**
|
|
1052
|
+
* Actual ref
|
|
1053
|
+
*/
|
|
1054
|
+
r: VNodeRef;
|
|
1055
|
+
/**
|
|
1056
|
+
* setup ref key
|
|
1057
|
+
*/
|
|
1058
|
+
k?: string;
|
|
1059
|
+
/**
|
|
1060
|
+
* refInFor marker
|
|
1061
|
+
*/
|
|
1062
|
+
f?: boolean;
|
|
1063
|
+
};
|
|
1064
|
+
type VNodeNormalizedRef = VNodeNormalizedRefAtom | VNodeNormalizedRefAtom[];
|
|
1065
|
+
type VNodeMountHook = (vnode: VNode) => void;
|
|
1066
|
+
type VNodeUpdateHook = (vnode: VNode, oldVNode: VNode) => void;
|
|
1067
|
+
type VNodeProps = {
|
|
1068
|
+
key?: PropertyKey;
|
|
1069
|
+
ref?: VNodeRef;
|
|
1070
|
+
ref_for?: boolean;
|
|
1071
|
+
ref_key?: string;
|
|
1072
|
+
onVnodeBeforeMount?: VNodeMountHook | VNodeMountHook[];
|
|
1073
|
+
onVnodeMounted?: VNodeMountHook | VNodeMountHook[];
|
|
1074
|
+
onVnodeBeforeUpdate?: VNodeUpdateHook | VNodeUpdateHook[];
|
|
1075
|
+
onVnodeUpdated?: VNodeUpdateHook | VNodeUpdateHook[];
|
|
1076
|
+
onVnodeBeforeUnmount?: VNodeMountHook | VNodeMountHook[];
|
|
1077
|
+
onVnodeUnmounted?: VNodeMountHook | VNodeMountHook[];
|
|
1078
|
+
};
|
|
1079
|
+
type VNodeChildAtom = VNode | string | number | boolean | null | undefined | void;
|
|
1080
|
+
type VNodeArrayChildren = Array<VNodeArrayChildren | VNodeChildAtom>;
|
|
1081
|
+
type VNodeChild = VNodeChildAtom | VNodeArrayChildren;
|
|
1082
|
+
type VNodeNormalizedChildren = string | VNodeArrayChildren | RawSlots | null;
|
|
1083
|
+
interface VNode<HostNode = RendererNode, HostElement = RendererElement, ExtraProps = {
|
|
1084
|
+
[key: string]: any;
|
|
1085
|
+
}> {
|
|
1086
|
+
type: VNodeTypes;
|
|
1087
|
+
props: (VNodeProps & ExtraProps) | null;
|
|
1088
|
+
key: PropertyKey | null;
|
|
1089
|
+
ref: VNodeNormalizedRef | null;
|
|
1090
|
+
/**
|
|
1091
|
+
* SFC only. This is assigned on vnode creation using currentScopeId
|
|
1092
|
+
* which is set alongside currentRenderingInstance.
|
|
1093
|
+
*/
|
|
1094
|
+
scopeId: string | null;
|
|
1095
|
+
children: VNodeNormalizedChildren;
|
|
1096
|
+
component: ComponentInternalInstance | null;
|
|
1097
|
+
dirs: DirectiveBinding[] | null;
|
|
1098
|
+
transition: TransitionHooks<HostElement> | null;
|
|
1099
|
+
el: HostNode | null;
|
|
1100
|
+
placeholder: HostNode | null;
|
|
1101
|
+
anchor: HostNode | null;
|
|
1102
|
+
target: HostElement | null;
|
|
1103
|
+
targetStart: HostNode | null;
|
|
1104
|
+
targetAnchor: HostNode | null;
|
|
1105
|
+
suspense: SuspenseBoundary | null;
|
|
1106
|
+
shapeFlag: number;
|
|
1107
|
+
patchFlag: number;
|
|
1108
|
+
appContext: AppContext | null;
|
|
1109
|
+
}
|
|
1110
|
+
type Data = Record<string, unknown>;
|
|
1111
|
+
/**
|
|
1112
|
+
* Public utility type for extracting the instance type of a component.
|
|
1113
|
+
* Works with all valid component definition types. This is intended to replace
|
|
1114
|
+
* the usage of `InstanceType<typeof Comp>` which only works for
|
|
1115
|
+
* constructor-based component definition types.
|
|
1116
|
+
*
|
|
1117
|
+
* @example
|
|
1118
|
+
* ```ts
|
|
1119
|
+
* const MyComp = { ... }
|
|
1120
|
+
* declare const instance: ComponentInstance<typeof MyComp>
|
|
1121
|
+
* ```
|
|
1122
|
+
*/
|
|
1123
|
+
/**
|
|
1124
|
+
* For extending allowed non-declared props on components in TSX
|
|
1125
|
+
*/
|
|
1126
|
+
interface ComponentCustomProps {}
|
|
1127
|
+
/**
|
|
1128
|
+
* For globally defined Directives
|
|
1129
|
+
* Here is an example of adding a directive `VTooltip` as global directive:
|
|
1130
|
+
*
|
|
1131
|
+
* @example
|
|
1132
|
+
* ```ts
|
|
1133
|
+
* import VTooltip from 'v-tooltip'
|
|
1134
|
+
*
|
|
1135
|
+
* declare module '@vue/runtime-core' {
|
|
1136
|
+
* interface GlobalDirectives {
|
|
1137
|
+
* VTooltip
|
|
1138
|
+
* }
|
|
1139
|
+
* }
|
|
1140
|
+
* ```
|
|
1141
|
+
*/
|
|
1142
|
+
interface GlobalDirectives {}
|
|
1143
|
+
/**
|
|
1144
|
+
* For globally defined Components
|
|
1145
|
+
* Here is an example of adding a component `RouterView` as global component:
|
|
1146
|
+
*
|
|
1147
|
+
* @example
|
|
1148
|
+
* ```ts
|
|
1149
|
+
* import { RouterView } from 'vue-router'
|
|
1150
|
+
*
|
|
1151
|
+
* declare module '@vue/runtime-core' {
|
|
1152
|
+
* interface GlobalComponents {
|
|
1153
|
+
* RouterView
|
|
1154
|
+
* }
|
|
1155
|
+
* }
|
|
1156
|
+
* ```
|
|
1157
|
+
*/
|
|
1158
|
+
interface GlobalComponents {
|
|
1159
|
+
Teleport: DefineComponent<TeleportProps>;
|
|
1160
|
+
Suspense: DefineComponent<SuspenseProps>;
|
|
1161
|
+
KeepAlive: DefineComponent<KeepAliveProps>;
|
|
1162
|
+
BaseTransition: DefineComponent<BaseTransitionProps>;
|
|
1163
|
+
}
|
|
1164
|
+
/**
|
|
1165
|
+
* Default allowed non-declared props on component in TSX
|
|
1166
|
+
*/
|
|
1167
|
+
interface AllowedComponentProps {
|
|
1168
|
+
class?: unknown;
|
|
1169
|
+
style?: unknown;
|
|
1170
|
+
}
|
|
1171
|
+
interface ComponentInternalOptions {
|
|
1172
|
+
/**
|
|
1173
|
+
* Compat build only, for bailing out of certain compatibility behavior
|
|
1174
|
+
*/
|
|
1175
|
+
__isBuiltIn?: boolean;
|
|
1176
|
+
/**
|
|
1177
|
+
* This one should be exposed so that devtools can make use of it
|
|
1178
|
+
*/
|
|
1179
|
+
__file?: string;
|
|
1180
|
+
/**
|
|
1181
|
+
* name inferred from filename
|
|
1182
|
+
*/
|
|
1183
|
+
__name?: string;
|
|
1184
|
+
}
|
|
1185
|
+
interface FunctionalComponent<P = {}, E extends EmitsOptions | Record<string, any[]> = {}, S extends Record<string, any> = any, EE extends EmitsOptions = ShortEmitsToObject<E>> extends ComponentInternalOptions {
|
|
1186
|
+
(props: P & EmitsToProps<EE>, ctx: Omit<SetupContext<EE, IfAny<S, {}, SlotsType<S>>>, 'expose'>): any;
|
|
1187
|
+
props?: ComponentPropsOptions<P>;
|
|
1188
|
+
emits?: EE | (keyof EE)[];
|
|
1189
|
+
slots?: IfAny<S, Slots, SlotsType<S>>;
|
|
1190
|
+
inheritAttrs?: boolean;
|
|
1191
|
+
displayName?: string;
|
|
1192
|
+
compatConfig?: CompatConfig;
|
|
1193
|
+
}
|
|
1194
|
+
/**
|
|
1195
|
+
* Concrete component type matches its actual value: it's either an options
|
|
1196
|
+
* object, or a function. Use this where the code expects to work with actual
|
|
1197
|
+
* values, e.g. checking if its a function or not. This is mostly for internal
|
|
1198
|
+
* implementation code.
|
|
1199
|
+
*/
|
|
1200
|
+
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>;
|
|
1201
|
+
/**
|
|
1202
|
+
* A type used in public APIs where a component type is expected.
|
|
1203
|
+
* The constructor type is an artificial type returned by defineComponent().
|
|
1204
|
+
*/
|
|
1205
|
+
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>;
|
|
1206
|
+
type SetupContext<E = EmitsOptions, S extends SlotsType = {}> = E extends any ? {
|
|
1207
|
+
attrs: Data;
|
|
1208
|
+
slots: UnwrapSlotsType<S>;
|
|
1209
|
+
emit: EmitFn<E>;
|
|
1210
|
+
expose: <Exposed extends Record<string, any> = Record<string, any>>(exposed?: Exposed) => void;
|
|
1211
|
+
} : never;
|
|
1212
|
+
/**
|
|
1213
|
+
* We expose a subset of properties on the internal instance as they are
|
|
1214
|
+
* useful for advanced external libraries and tools.
|
|
1215
|
+
*/
|
|
1216
|
+
interface ComponentInternalInstance {
|
|
1217
|
+
uid: number;
|
|
1218
|
+
type: ConcreteComponent;
|
|
1219
|
+
parent: ComponentInternalInstance | null;
|
|
1220
|
+
root: ComponentInternalInstance;
|
|
1221
|
+
appContext: AppContext;
|
|
1222
|
+
/**
|
|
1223
|
+
* Vnode representing this component in its parent's vdom tree
|
|
1224
|
+
*/
|
|
1225
|
+
vnode: VNode;
|
|
1226
|
+
/**
|
|
1227
|
+
* Root vnode of this component's own vdom tree
|
|
1228
|
+
*/
|
|
1229
|
+
subTree: VNode;
|
|
1230
|
+
/**
|
|
1231
|
+
* Render effect instance
|
|
1232
|
+
*/
|
|
1233
|
+
effect: ReactiveEffect;
|
|
1234
|
+
/**
|
|
1235
|
+
* Force update render effect
|
|
1236
|
+
*/
|
|
1237
|
+
update: () => void;
|
|
1238
|
+
/**
|
|
1239
|
+
* Render effect job to be passed to scheduler (checks if dirty)
|
|
1240
|
+
*/
|
|
1241
|
+
job: SchedulerJob;
|
|
1242
|
+
proxy: ComponentPublicInstance | null;
|
|
1243
|
+
exposed: Record<string, any> | null;
|
|
1244
|
+
exposeProxy: Record<string, any> | null;
|
|
1245
|
+
data: Data;
|
|
1246
|
+
props: Data;
|
|
1247
|
+
attrs: Data;
|
|
1248
|
+
slots: InternalSlots;
|
|
1249
|
+
refs: Data;
|
|
1250
|
+
emit: EmitFn;
|
|
1251
|
+
isMounted: boolean;
|
|
1252
|
+
isUnmounted: boolean;
|
|
1253
|
+
isDeactivated: boolean;
|
|
1254
|
+
}
|
|
1255
|
+
interface WatchEffectOptions extends DebuggerOptions {
|
|
1256
|
+
flush?: 'pre' | 'post' | 'sync';
|
|
1257
|
+
}
|
|
1258
|
+
interface WatchOptions<Immediate = boolean> extends WatchEffectOptions {
|
|
1259
|
+
immediate?: Immediate;
|
|
1260
|
+
deep?: boolean | number;
|
|
1261
|
+
once?: boolean;
|
|
1262
|
+
}
|
|
1263
|
+
declare module '@vue/reactivity' {
|
|
1264
|
+
interface RefUnwrapBailTypes {
|
|
1265
|
+
runtimeCoreBailTypes: VNode | {
|
|
1266
|
+
$: ComponentInternalInstance;
|
|
1267
|
+
};
|
|
1268
|
+
}
|
|
1269
|
+
}
|
|
1270
|
+
// Note: this file is auto concatenated to the end of the bundled d.ts during
|
|
1271
|
+
// build.
|
|
1272
|
+
declare module '@vue/runtime-core' {
|
|
1273
|
+
export interface GlobalComponents {
|
|
1274
|
+
Teleport: DefineComponent<TeleportProps>;
|
|
1275
|
+
Suspense: DefineComponent<SuspenseProps>;
|
|
1276
|
+
KeepAlive: DefineComponent<KeepAliveProps>;
|
|
1277
|
+
BaseTransition: DefineComponent<BaseTransitionProps>;
|
|
1278
|
+
}
|
|
1279
|
+
} // Note: this file is auto concatenated to the end of the bundled d.ts during
|
|
1280
|
+
// build.
|
|
1281
|
+
type _defineProps = typeof defineProps;
|
|
1282
|
+
type _defineEmits = typeof defineEmits;
|
|
1283
|
+
type _defineExpose = typeof defineExpose;
|
|
1284
|
+
type _defineOptions = typeof defineOptions;
|
|
1285
|
+
type _defineSlots = typeof defineSlots;
|
|
1286
|
+
type _defineModel = typeof defineModel;
|
|
1287
|
+
type _withDefaults = typeof withDefaults;
|
|
1288
|
+
declare global {
|
|
1289
|
+
const defineProps: _defineProps;
|
|
1290
|
+
const defineEmits: _defineEmits;
|
|
1291
|
+
const defineExpose: _defineExpose;
|
|
1292
|
+
const defineOptions: _defineOptions;
|
|
1293
|
+
const defineSlots: _defineSlots;
|
|
1294
|
+
const defineModel: _defineModel;
|
|
1295
|
+
const withDefaults: _withDefaults;
|
|
1296
|
+
}
|
|
1297
|
+
//#endregion
|
|
1298
|
+
//#region ../../node_modules/.pnpm/@vue+runtime-dom@3.5.27/node_modules/@vue/runtime-dom/dist/runtime-dom.d.ts
|
|
1299
|
+
declare const TRANSITION = "transition";
|
|
1300
|
+
declare const ANIMATION = "animation";
|
|
1301
|
+
type AnimationTypes = typeof TRANSITION | typeof ANIMATION;
|
|
1302
|
+
interface TransitionProps extends BaseTransitionProps<Element> {
|
|
1303
|
+
name?: string;
|
|
1304
|
+
type?: AnimationTypes;
|
|
1305
|
+
css?: boolean;
|
|
1306
|
+
duration?: number | {
|
|
1307
|
+
enter: number;
|
|
1308
|
+
leave: number;
|
|
1309
|
+
};
|
|
1310
|
+
enterFromClass?: string;
|
|
1311
|
+
enterActiveClass?: string;
|
|
1312
|
+
enterToClass?: string;
|
|
1313
|
+
appearFromClass?: string;
|
|
1314
|
+
appearActiveClass?: string;
|
|
1315
|
+
appearToClass?: string;
|
|
1316
|
+
leaveFromClass?: string;
|
|
1317
|
+
leaveActiveClass?: string;
|
|
1318
|
+
leaveToClass?: string;
|
|
1319
|
+
}
|
|
1320
|
+
type TransitionGroupProps = Omit<TransitionProps, 'mode'> & {
|
|
1321
|
+
tag?: string;
|
|
1322
|
+
moveClass?: string;
|
|
1323
|
+
};
|
|
1324
|
+
declare const vShowOriginalDisplay: unique symbol;
|
|
1325
|
+
declare const vShowHidden: unique symbol;
|
|
1326
|
+
interface VShowElement extends HTMLElement {
|
|
1327
|
+
[vShowOriginalDisplay]: string;
|
|
1328
|
+
[vShowHidden]: boolean;
|
|
1329
|
+
}
|
|
1330
|
+
declare const vShow: ObjectDirective<VShowElement> & {
|
|
1331
|
+
name: 'show';
|
|
1332
|
+
};
|
|
1333
|
+
declare const systemModifiers: readonly ["ctrl", "shift", "alt", "meta"];
|
|
1334
|
+
type SystemModifiers = (typeof systemModifiers)[number];
|
|
1335
|
+
type CompatModifiers = keyof typeof keyNames;
|
|
1336
|
+
type VOnModifiers = SystemModifiers | ModifierGuards | CompatModifiers;
|
|
1337
|
+
type ModifierGuards = 'shift' | 'ctrl' | 'alt' | 'meta' | 'left' | 'right' | 'stop' | 'prevent' | 'self' | 'middle' | 'exact';
|
|
1338
|
+
/**
|
|
1339
|
+
* @private
|
|
1340
|
+
*/
|
|
1341
|
+
declare const keyNames: Record<'esc' | 'space' | 'up' | 'left' | 'right' | 'down' | 'delete', string>;
|
|
1342
|
+
/**
|
|
1343
|
+
* @private
|
|
1344
|
+
*/
|
|
1345
|
+
type VOnDirective = Directive<any, any, VOnModifiers>;
|
|
1346
|
+
type AssignerFn = (value: any) => void;
|
|
1347
|
+
declare const assignKey: unique symbol;
|
|
1348
|
+
type ModelDirective<T, Modifiers extends string = string> = ObjectDirective<T & {
|
|
1349
|
+
[assignKey]: AssignerFn;
|
|
1350
|
+
_assigning?: boolean;
|
|
1351
|
+
}, any, Modifiers>;
|
|
1352
|
+
declare const vModelText: ModelDirective<HTMLInputElement | HTMLTextAreaElement, 'trim' | 'number' | 'lazy'>;
|
|
1353
|
+
declare const vModelCheckbox: ModelDirective<HTMLInputElement>;
|
|
1354
|
+
declare const vModelRadio: ModelDirective<HTMLInputElement>;
|
|
1355
|
+
declare const vModelSelect: ModelDirective<HTMLSelectElement, 'number'>;
|
|
1356
|
+
declare const vModelDynamic: ObjectDirective<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>;
|
|
1357
|
+
type VModelDirective = typeof vModelText | typeof vModelCheckbox | typeof vModelSelect | typeof vModelRadio | typeof vModelDynamic;
|
|
1358
|
+
/**
|
|
1359
|
+
* This is a stub implementation to prevent the need to use dom types.
|
|
1360
|
+
*
|
|
1361
|
+
* To enable proper types, add `"dom"` to `"lib"` in your `tsconfig.json`.
|
|
1362
|
+
*/
|
|
1363
|
+
type DomType<T> = typeof globalThis extends {
|
|
1364
|
+
window: unknown;
|
|
1365
|
+
} ? T : never;
|
|
1366
|
+
declare module '@vue/reactivity' {
|
|
1367
|
+
interface RefUnwrapBailTypes {
|
|
1368
|
+
runtimeDOMBailTypes: DomType<Node | Window>;
|
|
1369
|
+
}
|
|
1370
|
+
}
|
|
1371
|
+
declare module '@vue/runtime-core' {
|
|
1372
|
+
interface GlobalComponents {
|
|
1373
|
+
Transition: DefineComponent<TransitionProps>;
|
|
1374
|
+
TransitionGroup: DefineComponent<TransitionGroupProps>;
|
|
1375
|
+
}
|
|
1376
|
+
interface GlobalDirectives {
|
|
1377
|
+
vShow: typeof vShow;
|
|
1378
|
+
vOn: VOnDirective;
|
|
1379
|
+
vBind: VModelDirective;
|
|
1380
|
+
vIf: Directive<any, boolean>;
|
|
1381
|
+
vOnce: Directive;
|
|
1382
|
+
vSlot: Directive;
|
|
1383
|
+
}
|
|
1384
|
+
}
|
|
1385
|
+
//#endregion
|
|
1386
|
+
//#region src/types/docks.d.ts
|
|
1387
|
+
interface DevToolsDockHost {
|
|
1388
|
+
readonly views: Map<string, DevToolsDockUserEntry>;
|
|
1389
|
+
readonly events: EventEmitter<{
|
|
1390
|
+
'dock:entry:updated': (entry: DevToolsDockUserEntry) => void;
|
|
1391
|
+
}>;
|
|
1392
|
+
register: <T extends DevToolsDockUserEntry>(entry: T, force?: boolean) => {
|
|
1393
|
+
update: (patch: Partial<T>) => void;
|
|
1394
|
+
};
|
|
1395
|
+
update: (entry: DevToolsDockUserEntry) => void;
|
|
1396
|
+
values: (options?: {
|
|
1397
|
+
includeBuiltin?: boolean;
|
|
1398
|
+
}) => DevToolsDockEntry[];
|
|
1399
|
+
}
|
|
1400
|
+
type DevToolsDockEntryCategory = 'app' | 'framework' | 'web' | 'advanced' | 'default' | '~viteplus' | '~builtin';
|
|
1401
|
+
type DevToolsDockEntryIcon = string | {
|
|
1402
|
+
light: string;
|
|
1403
|
+
dark: string;
|
|
1404
|
+
};
|
|
1405
|
+
interface DevToolsDockEntryBase {
|
|
1406
|
+
id: string;
|
|
1407
|
+
title: string;
|
|
1408
|
+
icon: DevToolsDockEntryIcon;
|
|
1409
|
+
/**
|
|
1410
|
+
* The default order of the entry in the dock.
|
|
1411
|
+
* The higher the number the earlier it appears.
|
|
1412
|
+
* @default 0
|
|
1413
|
+
*/
|
|
1414
|
+
defaultOrder?: number;
|
|
1415
|
+
/**
|
|
1416
|
+
* The category of the entry
|
|
1417
|
+
* @default 'default'
|
|
1418
|
+
*/
|
|
1419
|
+
category?: DevToolsDockEntryCategory;
|
|
1420
|
+
/**
|
|
1421
|
+
* Whether the entry should be hidden from the user.
|
|
1422
|
+
* @default false
|
|
1423
|
+
*/
|
|
1424
|
+
isHidden?: boolean;
|
|
1425
|
+
}
|
|
1426
|
+
interface ClientScriptEntry {
|
|
1427
|
+
/**
|
|
1428
|
+
* The filepath or module name to import from
|
|
1429
|
+
*/
|
|
1430
|
+
importFrom: string;
|
|
1431
|
+
/**
|
|
1432
|
+
* The name to import the module as
|
|
1433
|
+
*
|
|
1434
|
+
* @default 'default'
|
|
1435
|
+
*/
|
|
1436
|
+
importName?: string;
|
|
1437
|
+
}
|
|
1438
|
+
interface DevToolsViewIframe extends DevToolsDockEntryBase {
|
|
1439
|
+
type: 'iframe';
|
|
1440
|
+
url: string;
|
|
1441
|
+
/**
|
|
1442
|
+
* The id of the iframe, if multiple tabs is assigned with the same id, the iframe will be shared.
|
|
1443
|
+
*
|
|
1444
|
+
* When not provided, it would be treated as a unique frame.
|
|
1445
|
+
*/
|
|
1446
|
+
frameId?: string;
|
|
1447
|
+
/**
|
|
1448
|
+
* Optional client script to import into the iframe
|
|
1449
|
+
*/
|
|
1450
|
+
clientScript?: ClientScriptEntry;
|
|
1451
|
+
}
|
|
1452
|
+
type DevToolsViewLauncherStatus = 'idle' | 'loading' | 'success' | 'error';
|
|
1453
|
+
interface DevToolsViewLauncher extends DevToolsDockEntryBase {
|
|
1454
|
+
type: 'launcher';
|
|
1455
|
+
launcher: {
|
|
1456
|
+
icon?: DevToolsDockEntryIcon;
|
|
1457
|
+
title: string;
|
|
1458
|
+
status?: DevToolsViewLauncherStatus;
|
|
1459
|
+
error?: string;
|
|
1460
|
+
description?: string;
|
|
1461
|
+
buttonStart?: string;
|
|
1462
|
+
buttonLoading?: string;
|
|
1463
|
+
onLaunch: () => Promise<void>;
|
|
1464
|
+
};
|
|
1465
|
+
}
|
|
1466
|
+
interface DevToolsViewAction extends DevToolsDockEntryBase {
|
|
1467
|
+
type: 'action';
|
|
1468
|
+
action: ClientScriptEntry;
|
|
1469
|
+
}
|
|
1470
|
+
interface DevToolsViewCustomRender extends DevToolsDockEntryBase {
|
|
1471
|
+
type: 'custom-render';
|
|
1472
|
+
renderer: ClientScriptEntry;
|
|
1473
|
+
}
|
|
1474
|
+
interface DevToolsViewBuiltin extends DevToolsDockEntryBase {
|
|
1475
|
+
type: '~builtin';
|
|
1476
|
+
id: '~terminals' | '~logs' | '~client-auth-notice' | '~settings';
|
|
1477
|
+
}
|
|
1478
|
+
type DevToolsDockUserEntry = DevToolsViewIframe | DevToolsViewAction | DevToolsViewCustomRender | DevToolsViewLauncher;
|
|
1479
|
+
type DevToolsDockEntry = DevToolsDockUserEntry | DevToolsViewBuiltin;
|
|
1480
|
+
//#endregion
|
|
1481
|
+
//#region src/types/rpc-augments.d.ts
|
|
1482
|
+
/**
|
|
1483
|
+
* To be extended
|
|
1484
|
+
*/
|
|
1485
|
+
interface DevToolsRpcClientFunctions {}
|
|
1486
|
+
/**
|
|
1487
|
+
* To be extended
|
|
1488
|
+
*/
|
|
1489
|
+
interface DevToolsRpcServerFunctions {}
|
|
1490
|
+
/**
|
|
1491
|
+
* To be extended
|
|
1492
|
+
*/
|
|
1493
|
+
interface DevToolsRpcSharedStates {}
|
|
1494
|
+
//#endregion
|
|
1495
|
+
//#region src/types/terminals.d.ts
|
|
1496
|
+
interface DevToolsTerminalSessionStreamChunkEvent {
|
|
1497
|
+
id: string;
|
|
1498
|
+
chunks: string[];
|
|
1499
|
+
ts: number;
|
|
1500
|
+
}
|
|
1501
|
+
interface DevToolsTerminalHost {
|
|
1502
|
+
readonly sessions: Map<string, DevToolsTerminalSession>;
|
|
1503
|
+
readonly events: EventEmitter<{
|
|
1504
|
+
'terminal:session:updated': (session: DevToolsTerminalSession) => void;
|
|
1505
|
+
'terminal:session:stream-chunk': (data: DevToolsTerminalSessionStreamChunkEvent) => void;
|
|
1506
|
+
}>;
|
|
1507
|
+
register: (session: DevToolsTerminalSession) => DevToolsTerminalSession;
|
|
1508
|
+
update: (session: DevToolsTerminalSession) => void;
|
|
1509
|
+
startChildProcess: (executeOptions: DevToolsChildProcessExecuteOptions, terminal: Omit<DevToolsTerminalSessionBase, 'status'>) => Promise<DevToolsChildProcessTerminalSession>;
|
|
1510
|
+
}
|
|
1511
|
+
type DevToolsTerminalStatus = 'running' | 'stopped' | 'error';
|
|
1512
|
+
interface DevToolsTerminalSessionBase {
|
|
1513
|
+
id: string;
|
|
1514
|
+
title: string;
|
|
1515
|
+
description?: string;
|
|
1516
|
+
status: DevToolsTerminalStatus;
|
|
1517
|
+
icon?: DevToolsDockEntryIcon;
|
|
1518
|
+
}
|
|
1519
|
+
interface DevToolsTerminalSession extends DevToolsTerminalSessionBase {
|
|
1520
|
+
buffer?: string[];
|
|
1521
|
+
stream?: ReadableStream<string>;
|
|
1522
|
+
}
|
|
1523
|
+
interface DevToolsChildProcessExecuteOptions {
|
|
1524
|
+
command: string;
|
|
1525
|
+
args: string[];
|
|
1526
|
+
cwd?: string;
|
|
1527
|
+
env?: Record<string, string>;
|
|
1528
|
+
}
|
|
1529
|
+
interface DevToolsChildProcessTerminalSession extends DevToolsTerminalSession {
|
|
1530
|
+
type: 'child-process';
|
|
1531
|
+
executeOptions: DevToolsChildProcessExecuteOptions;
|
|
1532
|
+
getChildProcess: () => ChildProcess | undefined;
|
|
1533
|
+
terminate: () => Promise<void>;
|
|
1534
|
+
restart: () => Promise<void>;
|
|
1535
|
+
}
|
|
1536
|
+
//#endregion
|
|
1537
|
+
//#region src/types/views.d.ts
|
|
1538
|
+
interface DevToolsViewHost {
|
|
1539
|
+
/**
|
|
1540
|
+
* @internal
|
|
1541
|
+
*/
|
|
1542
|
+
buildStaticDirs: {
|
|
1543
|
+
baseUrl: string;
|
|
1544
|
+
distDir: string;
|
|
1545
|
+
}[];
|
|
1546
|
+
/**
|
|
1547
|
+
* Helper to host static files
|
|
1548
|
+
* - In `dev` mode, it will register middleware to `viteServer.middlewares` to host the static files
|
|
1549
|
+
* - In `build` mode, it will copy the static files to the dist directory
|
|
1550
|
+
*/
|
|
1551
|
+
hostStatic: (baseUrl: string, distDir: string) => void;
|
|
1552
|
+
}
|
|
1553
|
+
//#endregion
|
|
1554
|
+
//#region src/types/vite-plugin.d.ts
|
|
1555
|
+
interface DevToolsCapabilities {
|
|
1556
|
+
rpc?: boolean;
|
|
1557
|
+
views?: boolean;
|
|
1558
|
+
}
|
|
1559
|
+
interface DevToolsPluginOptions {
|
|
1560
|
+
capabilities?: {
|
|
1561
|
+
dev?: DevToolsCapabilities | boolean;
|
|
1562
|
+
build?: DevToolsCapabilities | boolean;
|
|
1563
|
+
};
|
|
1564
|
+
setup: (context: DevToolsNodeContext) => void | Promise<void>;
|
|
1565
|
+
}
|
|
1566
|
+
interface DevToolsNodeContext {
|
|
1567
|
+
/**
|
|
1568
|
+
* Workspace root directory of Vite DevTools
|
|
1569
|
+
*/
|
|
1570
|
+
readonly workspaceRoot: string;
|
|
1571
|
+
/**
|
|
1572
|
+
* Current working directory of Vite DevTools
|
|
1573
|
+
*/
|
|
1574
|
+
readonly cwd: string;
|
|
1575
|
+
/**
|
|
1576
|
+
* Current mode of Vite DevTools
|
|
1577
|
+
* - 'dev' - when Vite DevTools is running in dev mode
|
|
1578
|
+
* - 'build' - when Vite DevTools is running in build mode (no server)
|
|
1579
|
+
*/
|
|
1580
|
+
readonly mode: 'dev' | 'build';
|
|
1581
|
+
/**
|
|
1582
|
+
* Resolved Vite configuration
|
|
1583
|
+
*/
|
|
1584
|
+
readonly viteConfig: ResolvedConfig;
|
|
1585
|
+
/**
|
|
1586
|
+
* Vite dev server instance (only available in dev mode)
|
|
1587
|
+
*/
|
|
1588
|
+
readonly viteServer?: ViteDevServer;
|
|
1589
|
+
/**
|
|
1590
|
+
* RPC functions host, for registering server-side RPC functions and calling client-side RPC functions
|
|
1591
|
+
*/
|
|
1592
|
+
rpc: RpcFunctionsHost;
|
|
1593
|
+
/**
|
|
1594
|
+
* Docks host, for registering dock entries
|
|
1595
|
+
*/
|
|
1596
|
+
docks: DevToolsDockHost;
|
|
1597
|
+
/**
|
|
1598
|
+
* Views host, for registering static views
|
|
1599
|
+
*/
|
|
1600
|
+
views: DevToolsViewHost;
|
|
1601
|
+
/**
|
|
1602
|
+
* Utils for the node context
|
|
1603
|
+
*/
|
|
1604
|
+
utils: DevToolsNodeUtils;
|
|
1605
|
+
/**
|
|
1606
|
+
* Terminals host, for registering terminal sessions and streaming terminal output
|
|
1607
|
+
*/
|
|
1608
|
+
terminals: DevToolsTerminalHost;
|
|
1609
|
+
}
|
|
1610
|
+
interface DevToolsNodeUtils {
|
|
1611
|
+
/**
|
|
1612
|
+
* Create a simple client script from a function or stringified code
|
|
1613
|
+
*
|
|
1614
|
+
* @deprecated DO NOT USE. This is mostly for testing only. Please use a proper importable module instead.
|
|
1615
|
+
* @experimental
|
|
1616
|
+
*/
|
|
1617
|
+
createSimpleClientScript: (fn: string | ((ctx: DockClientScriptContext) => void)) => ClientScriptEntry;
|
|
1618
|
+
}
|
|
1619
|
+
interface ConnectionMeta {
|
|
1620
|
+
backend: 'websocket' | 'static';
|
|
1621
|
+
websocket?: number | string;
|
|
1622
|
+
}
|
|
1623
|
+
//#endregion
|
|
1624
|
+
//#region src/types/rpc.d.ts
|
|
1625
|
+
interface DevToolsNodeRpcSession {
|
|
1626
|
+
meta: DevToolsNodeRpcSessionMeta;
|
|
1627
|
+
rpc: BirpcReturn<DevToolsRpcClientFunctions, DevToolsRpcServerFunctions, false>;
|
|
1628
|
+
}
|
|
1629
|
+
interface RpcBroadcastOptions<METHOD, Args extends any[]> {
|
|
1630
|
+
method: METHOD;
|
|
1631
|
+
args: Args;
|
|
1632
|
+
optional?: boolean;
|
|
1633
|
+
event?: boolean;
|
|
1634
|
+
filter?: (client: BirpcReturn<DevToolsRpcClientFunctions, DevToolsRpcServerFunctions, false>) => boolean | void;
|
|
1635
|
+
}
|
|
1636
|
+
type RpcFunctionsHost = RpcFunctionsCollectorBase<DevToolsRpcServerFunctions, DevToolsNodeContext> & {
|
|
1637
|
+
/**
|
|
1638
|
+
* Broadcast a message to all connected clients
|
|
1639
|
+
*/
|
|
1640
|
+
broadcast: <T extends keyof DevToolsRpcClientFunctions, Args extends Parameters<DevToolsRpcClientFunctions[T]>>(options: RpcBroadcastOptions<T, Args>) => Promise<void>;
|
|
1641
|
+
/**
|
|
1642
|
+
* Get the current RPC client
|
|
1643
|
+
*
|
|
1644
|
+
* Available in RPC functions to get the current RPC client
|
|
1645
|
+
*/
|
|
1646
|
+
getCurrentRpcSession: () => DevToolsNodeRpcSession | undefined;
|
|
1647
|
+
/**
|
|
1648
|
+
* The shared state host
|
|
1649
|
+
*/
|
|
1650
|
+
sharedState: RpcSharedStateHost;
|
|
1651
|
+
};
|
|
1652
|
+
interface RpcSharedStateGetOptions<T> {
|
|
1653
|
+
sharedState?: SharedState<T>;
|
|
1654
|
+
initialValue?: T;
|
|
1655
|
+
}
|
|
1656
|
+
interface RpcSharedStateHost {
|
|
1657
|
+
get: <T extends keyof DevToolsRpcSharedStates>(key: T, options?: RpcSharedStateGetOptions<DevToolsRpcSharedStates[T]>) => Promise<SharedState<DevToolsRpcSharedStates[T]>>;
|
|
1658
|
+
}
|
|
1659
|
+
//#endregion
|
|
1660
|
+
//#region src/types/settings.d.ts
|
|
1661
|
+
interface DevToolsDocksUserSettings {
|
|
1662
|
+
docksHidden: string[];
|
|
1663
|
+
docksCategoriesHidden: string[];
|
|
1664
|
+
docksPinned: string[];
|
|
1665
|
+
docksCustomOrder: Record<string, number>;
|
|
1666
|
+
showIframeAddressBar: boolean;
|
|
1667
|
+
}
|
|
1668
|
+
//#endregion
|
|
1669
|
+
//#region src/types/utils.d.ts
|
|
1670
|
+
type Thenable<T> = T | Promise<T>;
|
|
1671
|
+
type EntriesToObject<T extends readonly [string, any][]> = { [K in T[number] as K[0]]: K[1] };
|
|
1672
|
+
type PartialWithoutId<T extends {
|
|
1673
|
+
id: string;
|
|
1674
|
+
}> = Partial<Omit<T, 'id'>> & {
|
|
1675
|
+
id: string;
|
|
1676
|
+
};
|
|
1677
|
+
//#endregion
|
|
1678
|
+
//#region src/types/vite-augment.d.ts
|
|
1679
|
+
declare module 'vite' {
|
|
1680
|
+
interface Plugin {
|
|
1681
|
+
devtools?: DevToolsPluginOptions;
|
|
1682
|
+
}
|
|
1683
|
+
interface UserConfig {
|
|
1684
|
+
devtools?: ViteConfigDevtoolsOptions;
|
|
1685
|
+
}
|
|
1686
|
+
}
|
|
1687
|
+
interface ViteConfigDevtoolsOptions {
|
|
1688
|
+
/**
|
|
1689
|
+
* Disable client authentication.
|
|
1690
|
+
*
|
|
1691
|
+
* Beware that if you disable client authentication,
|
|
1692
|
+
* any browsers can connect to the devtools and access to your server and filesystem.
|
|
1693
|
+
* (including other devices, if you open server `host` option to LAN or WAN)
|
|
1694
|
+
*
|
|
1695
|
+
* @default true
|
|
1696
|
+
*/
|
|
1697
|
+
clientAuth?: boolean;
|
|
1698
|
+
}
|
|
1699
|
+
interface PluginWithDevTools extends Plugin {
|
|
1700
|
+
devtools?: DevToolsPluginOptions;
|
|
1701
|
+
}
|
|
1702
|
+
//#endregion
|
|
1703
|
+
//#region src/utils/define.d.ts
|
|
1704
|
+
declare const defineRpcFunction: <NAME extends string, TYPE extends _vitejs_devtools_rpc0.RpcFunctionType, ARGS extends any[], RETURN = void, const AS extends _vitejs_devtools_rpc0.RpcArgsSchema | undefined = undefined, const RS extends _vitejs_devtools_rpc0.RpcReturnSchema | undefined = undefined>(definition: _vitejs_devtools_rpc0.RpcFunctionDefinition<NAME, TYPE, ARGS, RETURN, AS, RS, DevToolsNodeContext>) => _vitejs_devtools_rpc0.RpcFunctionDefinition<NAME, TYPE, ARGS, RETURN, AS, RS, DevToolsNodeContext>;
|
|
1705
|
+
//#endregion
|
|
1706
|
+
//#region ../core/src/client/webcomponents/state/dock-settings.d.ts
|
|
1707
|
+
type DevToolsDockEntriesGrouped = [category: string, entries: DevToolsDockEntry[]][];
|
|
1708
|
+
//#endregion
|
|
1709
|
+
//#region src/client/rpc.d.ts
|
|
1710
|
+
interface DevToolsRpcClientOptions {
|
|
1711
|
+
connectionMeta?: ConnectionMeta;
|
|
1712
|
+
baseURL?: string[];
|
|
1713
|
+
/**
|
|
1714
|
+
* The auth id to use for the client
|
|
1715
|
+
*/
|
|
1716
|
+
authId?: string;
|
|
1717
|
+
wsOptions?: Partial<WebSocketRpcClientOptions>;
|
|
1718
|
+
rpcOptions?: Partial<BirpcOptions<DevToolsRpcServerFunctions, DevToolsRpcClientFunctions, boolean>>;
|
|
1719
|
+
}
|
|
1720
|
+
interface DevToolsRpcClient {
|
|
1721
|
+
/**
|
|
1722
|
+
* The events of the client
|
|
1723
|
+
*/
|
|
1724
|
+
events: EventEmitter<RpcClientEvents>;
|
|
1725
|
+
/**
|
|
1726
|
+
* Whether the client is trusted
|
|
1727
|
+
*/
|
|
1728
|
+
readonly isTrusted: boolean | null;
|
|
1729
|
+
/**
|
|
1730
|
+
* The connection meta
|
|
1731
|
+
*/
|
|
1732
|
+
readonly connectionMeta: ConnectionMeta;
|
|
1733
|
+
/**
|
|
1734
|
+
* Return a promise that resolves when the client is trusted
|
|
1735
|
+
*
|
|
1736
|
+
* Rejects with an error if the timeout is reached
|
|
1737
|
+
*
|
|
1738
|
+
* @param timeout - The timeout in milliseconds, default to 60 seconds
|
|
1739
|
+
*/
|
|
1740
|
+
ensureTrusted: (timeout?: number) => Promise<boolean>;
|
|
1741
|
+
/**
|
|
1742
|
+
* Request trust from the server
|
|
1743
|
+
*/
|
|
1744
|
+
requestTrust: () => Promise<boolean>;
|
|
1745
|
+
/**
|
|
1746
|
+
* Call a RPC function on the server
|
|
1747
|
+
*/
|
|
1748
|
+
call: BirpcReturn<DevToolsRpcServerFunctions, DevToolsRpcClientFunctions>['$call'];
|
|
1749
|
+
/**
|
|
1750
|
+
* Call a RPC event on the server, and does not expect a response
|
|
1751
|
+
*/
|
|
1752
|
+
callEvent: BirpcReturn<DevToolsRpcServerFunctions, DevToolsRpcClientFunctions>['$callEvent'];
|
|
1753
|
+
/**
|
|
1754
|
+
* Call a RPC optional function on the server
|
|
1755
|
+
*/
|
|
1756
|
+
callOptional: BirpcReturn<DevToolsRpcServerFunctions, DevToolsRpcClientFunctions>['$callOptional'];
|
|
1757
|
+
/**
|
|
1758
|
+
* The client RPC host
|
|
1759
|
+
*/
|
|
1760
|
+
client: DevToolsClientRpcHost;
|
|
1761
|
+
/**
|
|
1762
|
+
* The shared state host
|
|
1763
|
+
*/
|
|
1764
|
+
sharedState: RpcSharedStateHost;
|
|
1765
|
+
}
|
|
1766
|
+
declare function getDevToolsRpcClient(options?: DevToolsRpcClientOptions): Promise<DevToolsRpcClient>;
|
|
1767
|
+
//#endregion
|
|
1768
|
+
//#region src/client/docks.d.ts
|
|
1769
|
+
interface DockPanelStorage {
|
|
1770
|
+
width: number;
|
|
1771
|
+
height: number;
|
|
1772
|
+
top: number;
|
|
1773
|
+
left: number;
|
|
1774
|
+
position: 'left' | 'right' | 'bottom' | 'top';
|
|
1775
|
+
open: boolean;
|
|
1776
|
+
inactiveTimeout: number;
|
|
1777
|
+
}
|
|
1778
|
+
type DockClientType = 'embedded' | 'standalone';
|
|
1779
|
+
interface DevToolsClientContext {
|
|
1780
|
+
/**
|
|
1781
|
+
* The RPC client to interact with the server
|
|
1782
|
+
*/
|
|
1783
|
+
readonly rpc: DevToolsRpcClient;
|
|
1784
|
+
}
|
|
1785
|
+
interface DocksContext extends DevToolsClientContext {
|
|
1786
|
+
/**
|
|
1787
|
+
* Type of the client environment
|
|
1788
|
+
*
|
|
1789
|
+
* 'embedded' - running inside an embedded floating panel
|
|
1790
|
+
* 'standalone' - running inside a standalone window (no user app)
|
|
1791
|
+
*/
|
|
1792
|
+
readonly clientType: 'embedded' | 'standalone';
|
|
1793
|
+
/**
|
|
1794
|
+
* The panel context
|
|
1795
|
+
*/
|
|
1796
|
+
readonly panel: DocksPanelContext;
|
|
1797
|
+
/**
|
|
1798
|
+
* The docks entries context
|
|
1799
|
+
*/
|
|
1800
|
+
readonly docks: DocksEntriesContext;
|
|
1801
|
+
}
|
|
1802
|
+
type DevToolsClientRpcHost = RpcFunctionsCollector<DevToolsRpcClientFunctions, DevToolsClientContext>;
|
|
1803
|
+
interface DocksPanelContext {
|
|
1804
|
+
store: DockPanelStorage;
|
|
1805
|
+
isDragging: boolean;
|
|
1806
|
+
isResizing: boolean;
|
|
1807
|
+
readonly isVertical: boolean;
|
|
1808
|
+
}
|
|
1809
|
+
interface DocksEntriesContext {
|
|
1810
|
+
selectedId: string | null;
|
|
1811
|
+
readonly selected: DevToolsDockEntry | null;
|
|
1812
|
+
entries: DevToolsDockEntry[];
|
|
1813
|
+
entryToStateMap: Map<string, DockEntryState>;
|
|
1814
|
+
groupedEntries: DevToolsDockEntriesGrouped;
|
|
1815
|
+
settings: SharedState<DevToolsDocksUserSettings>;
|
|
1816
|
+
/**
|
|
1817
|
+
* Get the state of a dock entry by its ID
|
|
1818
|
+
*/
|
|
1819
|
+
getStateById: (id: string) => DockEntryState | undefined;
|
|
1820
|
+
/**
|
|
1821
|
+
* Switch to the selected dock entry, pass `null` to clear the selection
|
|
1822
|
+
*
|
|
1823
|
+
* @returns Whether the selection was changed successfully
|
|
1824
|
+
*/
|
|
1825
|
+
switchEntry: (id?: string | null) => Promise<boolean>;
|
|
1826
|
+
/**
|
|
1827
|
+
* Toggle the selected dock entry
|
|
1828
|
+
*
|
|
1829
|
+
* @returns Whether the selection was changed successfully
|
|
1830
|
+
*/
|
|
1831
|
+
toggleEntry: (id: string) => Promise<boolean>;
|
|
1832
|
+
}
|
|
1833
|
+
interface DockEntryState {
|
|
1834
|
+
entryMeta: DevToolsDockEntry;
|
|
1835
|
+
readonly isActive: boolean;
|
|
1836
|
+
domElements: {
|
|
1837
|
+
iframe?: HTMLIFrameElement | null;
|
|
1838
|
+
panel?: HTMLDivElement | null;
|
|
1839
|
+
};
|
|
1840
|
+
events: Raw<EventEmitter<DockEntryStateEvents>>;
|
|
1841
|
+
}
|
|
1842
|
+
interface DockEntryStateEvents {
|
|
1843
|
+
'entry:activated': () => void;
|
|
1844
|
+
'entry:deactivated': () => void;
|
|
1845
|
+
'entry:updated': (newMeta: DevToolsDockUserEntry) => void;
|
|
1846
|
+
'dom:panel:mounted': (panel: HTMLDivElement) => void;
|
|
1847
|
+
'dom:iframe:mounted': (iframe: HTMLIFrameElement) => void;
|
|
1848
|
+
}
|
|
1849
|
+
interface RpcClientEvents {
|
|
1850
|
+
'rpc:is-trusted:updated': (isTrusted: boolean) => void;
|
|
1851
|
+
}
|
|
1852
|
+
//#endregion
|
|
1853
|
+
//#region src/client/client-script.d.ts
|
|
1854
|
+
/**
|
|
1855
|
+
* Context for client scripts running in dock entries
|
|
1856
|
+
*/
|
|
1857
|
+
interface DockClientScriptContext extends DocksContext {
|
|
1858
|
+
/**
|
|
1859
|
+
* The state of the current dock entry
|
|
1860
|
+
*/
|
|
1861
|
+
current: DockEntryState;
|
|
1862
|
+
}
|
|
1863
|
+
//#endregion
|
|
1864
|
+
export { DevToolsViewAction as $, ConnectionMeta as A, DevToolsTerminalSessionBase as B, DevToolsDocksUserSettings as C, RpcFunctionsHost as D, RpcBroadcastOptions as E, DevToolsViewHost as F, DevToolsRpcSharedStates as G, DevToolsTerminalStatus as H, DevToolsChildProcessExecuteOptions as I, DevToolsDockEntryBase as J, ClientScriptEntry as K, DevToolsChildProcessTerminalSession as L, DevToolsNodeContext as M, DevToolsNodeUtils as N, RpcSharedStateGetOptions as O, DevToolsPluginOptions as P, DevToolsDockUserEntry as Q, DevToolsTerminalHost as R, Thenable as S, DevToolsNodeRpcSessionMeta as T, DevToolsRpcClientFunctions as U, DevToolsTerminalSessionStreamChunkEvent as V, DevToolsRpcServerFunctions as W, DevToolsDockEntryIcon as X, DevToolsDockEntryCategory as Y, DevToolsDockHost as Z, RpcDefinitionsToFunctions as _, DockEntryState as a, EntriesToObject as b, DocksContext as c, RpcClientEvents as d, DevToolsViewBuiltin as et, DevToolsRpcClient as f, RpcDefinitionsFilter as g, defineRpcFunction as h, DockClientType as i, DevToolsViewLauncherStatus as it, DevToolsCapabilities as j, RpcSharedStateHost as k, DocksEntriesContext as l, getDevToolsRpcClient as m, DevToolsClientContext as n, DevToolsViewIframe as nt, DockEntryStateEvents as o, DevToolsRpcClientOptions as p, DevToolsDockEntry as q, DevToolsClientRpcHost as r, DevToolsViewLauncher as rt, DockPanelStorage as s, DockClientScriptContext as t, DevToolsViewCustomRender as tt, DocksPanelContext as u, PluginWithDevTools as v, DevToolsNodeRpcSession as w, PartialWithoutId as x, ViteConfigDevtoolsOptions as y, DevToolsTerminalSession as z };
|