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