@katlux/providers 0.1.0-beta.2 → 0.1.0-beta.3

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