@aignostics/sdk 3.7.0 → 3.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,69 +1,1956 @@
1
- import * as msw_node from 'msw/node';
2
- import * as msw from 'msw';
3
- import * as fishery from 'fishery';
4
- import { Factory } from 'fishery';
5
- import { A as ApplicationReadShortResponse, a as ApplicationReadResponse, f as ApplicationVersion, V as VersionReadResponse, o as InputArtifact, t as OutputArtifact, R as RunReadResponse, c as RunCreationResponse, I as ItemResultReadResponse, u as OutputArtifactResultReadResponse } from '../api-CGkiPRMR.js';
6
- import 'axios';
1
+ import { C as OutputArtifact, St as VersionReadResponse, at as RunCreationResponse, c as CustomMetadataUpdateResponse, ct as RunReadResponse, ht as ShareTokenReadResponse, mt as ShareTokenCreateResponse, n as ApplicationReadShortResponse, p as InputArtifact, r as ApplicationVersion, t as ApplicationReadResponse, u as GrantReadResponse, v as ItemResultReadResponse, w as OutputArtifactResultReadResponse } from "../index-B3pQQ0Yu.js";
2
+ import { Factory } from "fishery";
3
+ //#region ../../node_modules/type-fest/source/primitive.d.ts
4
+ /**
5
+ Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
6
+
7
+ @category Type
8
+ */
9
+ type Primitive = null | undefined | string | number | boolean | symbol | bigint;
10
+ //#endregion
11
+ //#region ../../node_modules/type-fest/source/is-any.d.ts
12
+ /**
13
+ Returns a boolean for whether the given type is `any`.
14
+
15
+ @link https://stackoverflow.com/a/49928360/1490091
16
+
17
+ Useful in type utilities, such as disallowing `any`s to be passed to a function.
18
+
19
+ @example
20
+ ```
21
+ import type {IsAny} from 'type-fest';
22
+
23
+ const typedObject = {a: 1, b: 2} as const;
24
+ const anyObject: any = {a: 1, b: 2};
25
+
26
+ function get<O extends (IsAny<O> extends true ? {} : Record<string, number>), K extends keyof O = keyof O>(object: O, key: K) {
27
+ return object[key];
28
+ }
29
+
30
+ const typedA = get(typedObject, 'a');
31
+ //=> 1
32
+
33
+ const anyA = get(anyObject, 'a');
34
+ //=> any
35
+ ```
36
+
37
+ @category Type Guard
38
+ @category Utilities
39
+ */
40
+ type IsAny<T> = 0 extends 1 & NoInfer<T> ? true : false;
41
+ //#endregion
42
+ //#region ../../node_modules/type-fest/source/is-optional-key-of.d.ts
43
+ /**
44
+ Returns a boolean for whether the given key is an optional key of type.
45
+
46
+ This is useful when writing utility types or schema validators that need to differentiate `optional` keys.
47
+
48
+ @example
49
+ ```
50
+ import type {IsOptionalKeyOf} from 'type-fest';
51
+
52
+ type User = {
53
+ name: string;
54
+ surname: string;
55
+
56
+ luckyNumber?: number;
57
+ };
58
+
59
+ type Admin = {
60
+ name: string;
61
+ surname?: string;
62
+ };
63
+
64
+ type T1 = IsOptionalKeyOf<User, 'luckyNumber'>;
65
+ //=> true
66
+
67
+ type T2 = IsOptionalKeyOf<User, 'name'>;
68
+ //=> false
69
+
70
+ type T3 = IsOptionalKeyOf<User, 'name' | 'luckyNumber'>;
71
+ //=> boolean
72
+
73
+ type T4 = IsOptionalKeyOf<User | Admin, 'name'>;
74
+ //=> false
75
+
76
+ type T5 = IsOptionalKeyOf<User | Admin, 'surname'>;
77
+ //=> boolean
78
+ ```
79
+
80
+ @category Type Guard
81
+ @category Utilities
82
+ */
83
+ type IsOptionalKeyOf<Type extends object, Key extends keyof Type> = IsAny<Type | Key> extends true ? never : Key extends keyof Type ? Type extends Record<Key, Type[Key]> ? false : true : false;
84
+ //#endregion
85
+ //#region ../../node_modules/type-fest/source/optional-keys-of.d.ts
86
+ /**
87
+ Extract all optional keys from the given type.
88
+
89
+ This is useful when you want to create a new type that contains different type values for the optional keys only.
90
+
91
+ @example
92
+ ```
93
+ import type {OptionalKeysOf, Except} from 'type-fest';
94
+
95
+ type User = {
96
+ name: string;
97
+ surname: string;
98
+
99
+ luckyNumber?: number;
100
+ };
101
+
102
+ const REMOVE_FIELD = Symbol('remove field symbol');
103
+ type UpdateOperation<Entity extends object> = Except<Partial<Entity>, OptionalKeysOf<Entity>> & {
104
+ [Key in OptionalKeysOf<Entity>]?: Entity[Key] | typeof REMOVE_FIELD;
105
+ };
106
+
107
+ const update1: UpdateOperation<User> = {
108
+ name: 'Alice',
109
+ };
110
+
111
+ const update2: UpdateOperation<User> = {
112
+ name: 'Bob',
113
+ luckyNumber: REMOVE_FIELD,
114
+ };
115
+ ```
116
+
117
+ @category Utilities
118
+ */
119
+ type OptionalKeysOf<Type extends object> = Type extends unknown // For distributing `Type`
120
+ ? (keyof { [Key in keyof Type as IsOptionalKeyOf<Type, Key> extends false ? never : Key]: never; }) & keyof Type // Intersect with `keyof Type` to ensure result of `OptionalKeysOf<Type>` is always assignable to `keyof Type`
121
+ : never; // Should never happen
122
+ //#endregion
123
+ //#region ../../node_modules/type-fest/source/required-keys-of.d.ts
124
+ /**
125
+ Extract all required keys from the given type.
126
+
127
+ This is useful when you want to create a new type that contains different type values for the required keys only or use the list of keys for validation purposes, etc...
128
+
129
+ @example
130
+ ```
131
+ import type {RequiredKeysOf} from 'type-fest';
132
+
133
+ declare function createValidation<
134
+ Entity extends object,
135
+ Key extends RequiredKeysOf<Entity> = RequiredKeysOf<Entity>,
136
+ >(field: Key, validator: (value: Entity[Key]) => boolean): (entity: Entity) => boolean;
137
+
138
+ type User = {
139
+ name: string;
140
+ surname: string;
141
+ luckyNumber?: number;
142
+ };
143
+
144
+ const validator1 = createValidation<User>('name', value => value.length < 25);
145
+ const validator2 = createValidation<User>('surname', value => value.length < 25);
146
+
147
+ // @ts-expect-error
148
+ const validator3 = createValidation<User>('luckyNumber', value => value > 0);
149
+ // Error: Argument of type '"luckyNumber"' is not assignable to parameter of type '"name" | "surname"'.
150
+ ```
151
+
152
+ @category Utilities
153
+ */
154
+ type RequiredKeysOf<Type extends object> = Type extends unknown // For distributing `Type`
155
+ ? Exclude<keyof Type, OptionalKeysOf<Type>> : never; // Should never happen
156
+ //#endregion
157
+ //#region ../../node_modules/type-fest/source/is-never.d.ts
158
+ /**
159
+ Returns a boolean for whether the given type is `never`.
160
+
161
+ @link https://github.com/microsoft/TypeScript/issues/31751#issuecomment-498526919
162
+ @link https://stackoverflow.com/a/53984913/10292952
163
+ @link https://www.zhenghao.io/posts/ts-never
164
+
165
+ Useful in type utilities, such as checking if something does not occur.
166
+
167
+ @example
168
+ ```
169
+ import type {IsNever, And} from 'type-fest';
170
+
171
+ type A = IsNever<never>;
172
+ //=> true
173
+
174
+ type B = IsNever<any>;
175
+ //=> false
176
+
177
+ type C = IsNever<unknown>;
178
+ //=> false
179
+
180
+ type D = IsNever<never[]>;
181
+ //=> false
182
+
183
+ type E = IsNever<object>;
184
+ //=> false
185
+
186
+ type F = IsNever<string>;
187
+ //=> false
188
+ ```
189
+
190
+ @example
191
+ ```
192
+ import type {IsNever} from 'type-fest';
193
+
194
+ type IsTrue<T> = T extends true ? true : false;
195
+
196
+ // When a distributive conditional is instantiated with `never`, the entire conditional results in `never`.
197
+ type A = IsTrue<never>;
198
+ //=> never
199
+
200
+ // If you don't want that behaviour, you can explicitly add an `IsNever` check before the distributive conditional.
201
+ type IsTrueFixed<T> =
202
+ IsNever<T> extends true ? false : T extends true ? true : false;
203
+
204
+ type B = IsTrueFixed<never>;
205
+ //=> false
206
+ ```
207
+
208
+ @category Type Guard
209
+ @category Utilities
210
+ */
211
+ type IsNever<T> = [T] extends [never] ? true : false;
212
+ //#endregion
213
+ //#region ../../node_modules/type-fest/source/if.d.ts
214
+ /**
215
+ An if-else-like type that resolves depending on whether the given `boolean` type is `true` or `false`.
216
+
217
+ Use-cases:
218
+ - You can use this in combination with `Is*` types to create an if-else-like experience. For example, `If<IsAny<any>, 'is any', 'not any'>`.
219
+
220
+ Note:
221
+ - Returns a union of if branch and else branch if the given type is `boolean` or `any`. For example, `If<boolean, 'Y', 'N'>` will return `'Y' | 'N'`.
222
+ - Returns the else branch if the given type is `never`. For example, `If<never, 'Y', 'N'>` will return `'N'`.
223
+
224
+ @example
225
+ ```
226
+ import type {If} from 'type-fest';
227
+
228
+ type A = If<true, 'yes', 'no'>;
229
+ //=> 'yes'
230
+
231
+ type B = If<false, 'yes', 'no'>;
232
+ //=> 'no'
233
+
234
+ type C = If<boolean, 'yes', 'no'>;
235
+ //=> 'yes' | 'no'
236
+
237
+ type D = If<any, 'yes', 'no'>;
238
+ //=> 'yes' | 'no'
239
+
240
+ type E = If<never, 'yes', 'no'>;
241
+ //=> 'no'
242
+ ```
243
+
244
+ @example
245
+ ```
246
+ import type {If, IsAny, IsNever} from 'type-fest';
247
+
248
+ type A = If<IsAny<unknown>, 'is any', 'not any'>;
249
+ //=> 'not any'
250
+
251
+ type B = If<IsNever<never>, 'is never', 'not never'>;
252
+ //=> 'is never'
253
+ ```
254
+
255
+ @example
256
+ ```
257
+ import type {If, IsEqual} from 'type-fest';
258
+
259
+ type IfEqual<T, U, IfBranch, ElseBranch> = If<IsEqual<T, U>, IfBranch, ElseBranch>;
260
+
261
+ type A = IfEqual<string, string, 'equal', 'not equal'>;
262
+ //=> 'equal'
263
+
264
+ type B = IfEqual<string, number, 'equal', 'not equal'>;
265
+ //=> 'not equal'
266
+ ```
267
+
268
+ Note: Sometimes using the `If` type can make an implementation non–tail-recursive, which can impact performance. In such cases, it’s better to use a conditional directly. Refer to the following example:
269
+
270
+ @example
271
+ ```
272
+ import type {If, IsEqual, StringRepeat} from 'type-fest';
273
+
274
+ type HundredZeroes = StringRepeat<'0', 100>;
275
+
276
+ // The following implementation is not tail recursive
277
+ type Includes<S extends string, Char extends string> =
278
+ S extends `${infer First}${infer Rest}`
279
+ ? If<IsEqual<First, Char>,
280
+ 'found',
281
+ Includes<Rest, Char>>
282
+ : 'not found';
283
+
284
+ // Hence, instantiations with long strings will fail
285
+ // @ts-expect-error
286
+ type Fails = Includes<HundredZeroes, '1'>;
287
+ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
288
+ // Error: Type instantiation is excessively deep and possibly infinite.
289
+
290
+ // However, if we use a simple conditional instead of `If`, the implementation becomes tail-recursive
291
+ type IncludesWithoutIf<S extends string, Char extends string> =
292
+ S extends `${infer First}${infer Rest}`
293
+ ? IsEqual<First, Char> extends true
294
+ ? 'found'
295
+ : IncludesWithoutIf<Rest, Char>
296
+ : 'not found';
297
+
298
+ // Now, instantiations with long strings will work
299
+ type Works = IncludesWithoutIf<HundredZeroes, '1'>;
300
+ //=> 'not found'
301
+ ```
302
+
303
+ @category Type Guard
304
+ @category Utilities
305
+ */
306
+ type If<Type extends boolean, IfBranch, ElseBranch> = IsNever<Type> extends true ? ElseBranch : Type extends true ? IfBranch : ElseBranch;
307
+ //#endregion
308
+ //#region ../../node_modules/type-fest/source/internal/type.d.ts
309
+ /**
310
+ Matches any primitive, `void`, `Date`, or `RegExp` value.
311
+ */
312
+ type BuiltIns = Primitive | void | Date | RegExp;
313
+ /**
314
+ Test if the given function has multiple call signatures.
315
+
316
+ Needed to handle the case of a single call signature with properties.
317
+
318
+ Multiple call signatures cannot currently be supported due to a TypeScript limitation.
319
+ @see https://github.com/microsoft/TypeScript/issues/29732
320
+ */
321
+ type HasMultipleCallSignatures<T extends (...arguments_: any[]) => unknown> = T extends {
322
+ (...arguments_: infer A): unknown;
323
+ (...arguments_: infer B): unknown;
324
+ } ? B extends A ? A extends B ? false : true : true : false;
325
+ //#endregion
326
+ //#region ../../node_modules/type-fest/source/simplify.d.ts
327
+ /**
328
+ Useful to flatten the type output to improve type hints shown in editors. And also to transform an interface into a type to aide with assignability.
329
+
330
+ @example
331
+ ```
332
+ import type {Simplify} from 'type-fest';
333
+
334
+ type PositionProps = {
335
+ top: number;
336
+ left: number;
337
+ };
338
+
339
+ type SizeProps = {
340
+ width: number;
341
+ height: number;
342
+ };
343
+
344
+ // In your editor, hovering over `Props` will show a flattened object with all the properties.
345
+ type Props = Simplify<PositionProps & SizeProps>;
346
+ ```
347
+
348
+ Sometimes it is desired to pass a value as a function argument that has a different type. At first inspection it may seem assignable, and then you discover it is not because the `value`'s type definition was defined as an interface. In the following example, `fn` requires an argument of type `Record<string, unknown>`. If the value is defined as a literal, then it is assignable. And if the `value` is defined as type using the `Simplify` utility the value is assignable. But if the `value` is defined as an interface, it is not assignable because the interface is not sealed and elsewhere a non-string property could be added to the interface.
349
+
350
+ If the type definition must be an interface (perhaps it was defined in a third-party npm package), then the `value` can be defined as `const value: Simplify<SomeInterface> = ...`. Then `value` will be assignable to the `fn` argument. Or the `value` can be cast as `Simplify<SomeInterface>` if you can't re-declare the `value`.
351
+
352
+ @example
353
+ ```
354
+ import type {Simplify} from 'type-fest';
355
+
356
+ interface SomeInterface {
357
+ foo: number;
358
+ bar?: string;
359
+ baz: number | undefined;
360
+ }
361
+
362
+ type SomeType = {
363
+ foo: number;
364
+ bar?: string;
365
+ baz: number | undefined;
366
+ };
367
+
368
+ const literal = {foo: 123, bar: 'hello', baz: 456};
369
+ const someType: SomeType = literal;
370
+ const someInterface: SomeInterface = literal;
371
+
372
+ declare function fn(object: Record<string, unknown>): void;
373
+
374
+ fn(literal); // Good: literal object type is sealed
375
+ fn(someType); // Good: type is sealed
376
+ // @ts-expect-error
377
+ fn(someInterface); // Error: Index signature for type 'string' is missing in type 'someInterface'. Because `interface` can be re-opened
378
+ fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface` into a `type`
379
+ ```
380
+
381
+ @link https://github.com/microsoft/TypeScript/issues/15300
382
+ @see {@link SimplifyDeep}
383
+ @category Object
384
+ */
385
+ type Simplify<T> = { [KeyType in keyof T]: T[KeyType]; } & {};
386
+ //#endregion
387
+ //#region ../../node_modules/type-fest/source/is-equal.d.ts
388
+ /**
389
+ Returns a boolean for whether the two given types are equal.
390
+
391
+ @link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
392
+ @link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
393
+
394
+ Use-cases:
395
+ - If you want to make a conditional branch based on the result of a comparison of two types.
396
+
397
+ @example
398
+ ```
399
+ import type {IsEqual} from 'type-fest';
400
+
401
+ // This type returns a boolean for whether the given array includes the given item.
402
+ // `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
403
+ type Includes<Value extends readonly any[], Item> =
404
+ Value extends readonly [Value[0], ...infer rest]
405
+ ? IsEqual<Value[0], Item> extends true
406
+ ? true
407
+ : Includes<rest, Item>
408
+ : false;
409
+ ```
410
+
411
+ @category Type Guard
412
+ @category Utilities
413
+ */
414
+ type IsEqual<A, B> = [A] extends [B] ? [B] extends [A] ? _IsEqual<A, B> : false : false;
415
+ // This version fails the `equalWrappedTupleIntersectionToBeNeverAndNeverExpanded` test in `test-d/is-equal.ts`.
416
+ type _IsEqual<A, B> = (<G>() => G extends A & G | G ? 1 : 2) extends (<G>() => G extends B & G | G ? 1 : 2) ? true : false;
417
+ //#endregion
418
+ //#region ../../node_modules/type-fest/source/omit-index-signature.d.ts
419
+ /**
420
+ Omit any index signatures from the given object type, leaving only explicitly defined properties.
421
+
422
+ This is the counterpart of `PickIndexSignature`.
423
+
424
+ Use-cases:
425
+ - Remove overly permissive signatures from third-party types.
426
+
427
+ This type was taken from this [StackOverflow answer](https://stackoverflow.com/a/68261113/420747).
428
+
429
+ It relies on the fact that an empty object (`{}`) is assignable to an object with just an index signature, like `Record<string, unknown>`, but not to an object with explicitly defined keys, like `Record<'foo' | 'bar', unknown>`.
430
+
431
+ (The actual value type, `unknown`, is irrelevant and could be any type. Only the key type matters.)
432
+
433
+ ```
434
+ const indexed: Record<string, unknown> = {}; // Allowed
435
+
436
+ // @ts-expect-error
437
+ const keyed: Record<'foo', unknown> = {}; // Error
438
+ // TS2739: Type '{}' is missing the following properties from type 'Record<"foo" | "bar", unknown>': foo, bar
439
+ ```
440
+
441
+ Instead of causing a type error like the above, you can also use a [conditional type](https://www.typescriptlang.org/docs/handbook/2/conditional-types.html) to test whether a type is assignable to another:
442
+
443
+ ```
444
+ type Indexed = {} extends Record<string, unknown>
445
+ ? '✅ `{}` is assignable to `Record<string, unknown>`'
446
+ : '❌ `{}` is NOT assignable to `Record<string, unknown>`';
447
+
448
+ type IndexedResult = Indexed;
449
+ //=> '✅ `{}` is assignable to `Record<string, unknown>`'
450
+
451
+ type Keyed = {} extends Record<'foo' | 'bar', unknown>
452
+ ? '✅ `{}` is assignable to `Record<\'foo\' | \'bar\', unknown>`'
453
+ : '❌ `{}` is NOT assignable to `Record<\'foo\' | \'bar\', unknown>`';
454
+
455
+ type KeyedResult = Keyed;
456
+ //=> '❌ `{}` is NOT assignable to `Record<\'foo\' | \'bar\', unknown>`'
457
+ ```
7
458
 
459
+ Using a [mapped type](https://www.typescriptlang.org/docs/handbook/2/mapped-types.html#further-exploration), you can then check for each `KeyType` of `ObjectType`...
460
+
461
+ ```
462
+ type OmitIndexSignature<ObjectType> = {
463
+ [KeyType in keyof ObjectType // Map each key of `ObjectType`...
464
+ ]: ObjectType[KeyType]; // ...to its original value, i.e. `OmitIndexSignature<Foo> == Foo`.
465
+ };
466
+ ```
467
+
468
+ ...whether an empty object (`{}`) would be assignable to an object with that `KeyType` (`Record<KeyType, unknown>`)...
469
+
470
+ ```
471
+ type OmitIndexSignature<ObjectType> = {
472
+ [KeyType in keyof ObjectType
473
+ // Is `{}` assignable to `Record<KeyType, unknown>`?
474
+ as {} extends Record<KeyType, unknown>
475
+ ? never // ✅ `{}` is assignable to `Record<KeyType, unknown>`
476
+ : KeyType // ❌ `{}` is NOT assignable to `Record<KeyType, unknown>`
477
+ ]: ObjectType[KeyType];
478
+ };
479
+ ```
480
+
481
+ If `{}` is assignable, it means that `KeyType` is an index signature and we want to remove it. If it is not assignable, `KeyType` is a "real" key and we want to keep it.
482
+
483
+ @example
484
+ ```
485
+ import type {OmitIndexSignature} from 'type-fest';
486
+
487
+ type Example = {
488
+ // These index signatures will be removed.
489
+ [x: string]: any;
490
+ [x: number]: any;
491
+ [x: symbol]: any;
492
+ [x: `head-${string}`]: string;
493
+ [x: `${string}-tail`]: string;
494
+ [x: `head-${string}-tail`]: string;
495
+ [x: `${bigint}`]: string;
496
+ [x: `embedded-${number}`]: string;
497
+
498
+ // These explicitly defined keys will remain.
499
+ foo: 'bar';
500
+ qux?: 'baz';
501
+ };
502
+
503
+ type ExampleWithoutIndexSignatures = OmitIndexSignature<Example>;
504
+ //=> {foo: 'bar'; qux?: 'baz'}
505
+ ```
506
+
507
+ @see {@link PickIndexSignature}
508
+ @category Object
509
+ */
510
+ type OmitIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? never : KeyType]: ObjectType[KeyType]; };
511
+ //#endregion
512
+ //#region ../../node_modules/type-fest/source/pick-index-signature.d.ts
513
+ /**
514
+ Pick only index signatures from the given object type, leaving out all explicitly defined properties.
515
+
516
+ This is the counterpart of `OmitIndexSignature`.
517
+
518
+ @example
519
+ ```
520
+ import type {PickIndexSignature} from 'type-fest';
521
+
522
+ declare const symbolKey: unique symbol;
523
+
524
+ type Example = {
525
+ // These index signatures will remain.
526
+ [x: string]: unknown;
527
+ [x: number]: unknown;
528
+ [x: symbol]: unknown;
529
+ [x: `head-${string}`]: string;
530
+ [x: `${string}-tail`]: string;
531
+ [x: `head-${string}-tail`]: string;
532
+ [x: `${bigint}`]: string;
533
+ [x: `embedded-${number}`]: string;
534
+
535
+ // These explicitly defined keys will be removed.
536
+ ['kebab-case-key']: string;
537
+ [symbolKey]: string;
538
+ foo: 'bar';
539
+ qux?: 'baz';
540
+ };
541
+
542
+ type ExampleIndexSignature = PickIndexSignature<Example>;
543
+ // {
544
+ // [x: string]: unknown;
545
+ // [x: number]: unknown;
546
+ // [x: symbol]: unknown;
547
+ // [x: `head-${string}`]: string;
548
+ // [x: `${string}-tail`]: string;
549
+ // [x: `head-${string}-tail`]: string;
550
+ // [x: `${bigint}`]: string;
551
+ // [x: `embedded-${number}`]: string;
552
+ // }
553
+ ```
554
+
555
+ @see {@link OmitIndexSignature}
556
+ @category Object
557
+ */
558
+ type PickIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? KeyType : never]: ObjectType[KeyType]; };
559
+ //#endregion
560
+ //#region ../../node_modules/type-fest/source/merge.d.ts
561
+ // Merges two objects without worrying about index signatures.
562
+ type SimpleMerge<Destination, Source> = Simplify<{ [Key in keyof Destination as Key extends keyof Source ? never : Key]: Destination[Key]; } & Source>;
563
+ /**
564
+ Merge two types into a new type. Keys of the second type overrides keys of the first type.
565
+
566
+ This is different from the TypeScript `&` (intersection) operator. With `&`, conflicting property types are intersected, which often results in `never`. For example, `{a: string} & {a: number}` makes `a` become `string & number`, which resolves to `never`. With `Merge`, the second type's keys cleanly override the first, so `Merge<{a: string}, {a: number}>` gives `{a: number}` as expected. `Merge` also produces a flattened type (via `Simplify`), making it more readable in IDE tooltips compared to `A & B`.
567
+
568
+ @example
569
+ ```
570
+ import type {Merge} from 'type-fest';
571
+
572
+ type Foo = {
573
+ a: string;
574
+ b: number;
575
+ };
576
+
577
+ type Bar = {
578
+ a: number; // Conflicts with Foo['a']
579
+ c: boolean;
580
+ };
581
+
582
+ // With `&`, `a` becomes `string & number` which is `never`. Not what you want.
583
+ type WithIntersection = (Foo & Bar)['a'];
584
+ //=> never
585
+
586
+ // With `Merge`, `a` is cleanly overridden to `number`.
587
+ type WithMerge = Merge<Foo, Bar>['a'];
588
+ //=> number
589
+ ```
590
+
591
+ @example
592
+ ```
593
+ import type {Merge} from 'type-fest';
594
+
595
+ type Foo = {
596
+ [x: string]: unknown;
597
+ [x: number]: unknown;
598
+ foo: string;
599
+ bar: symbol;
600
+ };
601
+
602
+ type Bar = {
603
+ [x: number]: number;
604
+ [x: symbol]: unknown;
605
+ bar: Date;
606
+ baz: boolean;
607
+ };
608
+
609
+ export type FooBar = Merge<Foo, Bar>;
610
+ //=> {
611
+ // [x: string]: unknown;
612
+ // [x: number]: number;
613
+ // [x: symbol]: unknown;
614
+ // foo: string;
615
+ // bar: Date;
616
+ // baz: boolean;
617
+ // }
618
+ ```
619
+
620
+ Note: If you want a merge type that more accurately reflects the runtime behavior of object spread or `Object.assign`, refer to the {@link ObjectMerge} type.
621
+
622
+ @see {@link ObjectMerge}
623
+ @category Object
624
+ */
625
+ type Merge<Destination, Source> = Destination extends unknown // For distributing `Destination`
626
+ ? Source extends unknown // For distributing `Source`
627
+ ? If<IsEqual<Destination, Source>, Destination, _Merge<Destination, Source>> : never // Should never happen
628
+ : never; // Should never happen
629
+ type _Merge<Destination, Source> = Simplify<SimpleMerge<PickIndexSignature<Destination>, PickIndexSignature<Source>> & SimpleMerge<OmitIndexSignature<Destination>, OmitIndexSignature<Source>>>;
630
+ //#endregion
631
+ //#region ../../node_modules/type-fest/source/internal/object.d.ts
632
+ /**
633
+ Merges user specified options with default options.
634
+
635
+ @example
636
+ ```
637
+ type PathsOptions = {maxRecursionDepth?: number; leavesOnly?: boolean};
638
+ type DefaultPathsOptions = {maxRecursionDepth: 10; leavesOnly: false};
639
+ type SpecifiedOptions = {leavesOnly: true};
640
+
641
+ type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOptions>;
642
+ //=> {maxRecursionDepth: 10; leavesOnly: true}
643
+ ```
644
+
645
+ @example
646
+ ```
647
+ // Complains if default values are not provided for optional options
648
+
649
+ type PathsOptions = {maxRecursionDepth?: number; leavesOnly?: boolean};
650
+ type DefaultPathsOptions = {maxRecursionDepth: 10};
651
+ type SpecifiedOptions = {};
652
+
653
+ type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOptions>;
654
+ // ~~~~~~~~~~~~~~~~~~~
655
+ // Property 'leavesOnly' is missing in type 'DefaultPathsOptions' but required in type '{ maxRecursionDepth: number; leavesOnly: boolean; }'.
656
+ ```
657
+
658
+ @example
659
+ ```
660
+ // Complains if an option's default type does not conform to the expected type
661
+
662
+ type PathsOptions = {maxRecursionDepth?: number; leavesOnly?: boolean};
663
+ type DefaultPathsOptions = {maxRecursionDepth: 10; leavesOnly: 'no'};
664
+ type SpecifiedOptions = {};
665
+
666
+ type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOptions>;
667
+ // ~~~~~~~~~~~~~~~~~~~
668
+ // Types of property 'leavesOnly' are incompatible. Type 'string' is not assignable to type 'boolean'.
669
+ ```
670
+
671
+ @example
672
+ ```
673
+ // Complains if an option's specified type does not conform to the expected type
674
+
675
+ type PathsOptions = {maxRecursionDepth?: number; leavesOnly?: boolean};
676
+ type DefaultPathsOptions = {maxRecursionDepth: 10; leavesOnly: false};
677
+ type SpecifiedOptions = {leavesOnly: 'yes'};
678
+
679
+ type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOptions>;
680
+ // ~~~~~~~~~~~~~~~~
681
+ // Types of property 'leavesOnly' are incompatible. Type 'string' is not assignable to type 'boolean'.
682
+ ```
683
+ */
684
+ type ApplyDefaultOptions<Options extends object, Defaults extends Simplify<Omit<Required<Options>, RequiredKeysOf<Options>> & Partial<Record<RequiredKeysOf<Options>, never>>>, SpecifiedOptions extends Options> = _ApplyDefaultOptions<Options, Defaults, SpecifiedOptions> extends (infer Result extends Required<Options> // `extends Required<Options>` ensures that `ApplyDefaultOptions<SomeOption, ...>` is always assignable to `Required<SomeOption>`
685
+ ) ? Result : never;
686
+ type _ApplyDefaultOptions<Options, Defaults, SpecifiedOptions> = If<IsAny<SpecifiedOptions>, Defaults, If<IsNever<SpecifiedOptions>, Defaults, Merge<Defaults, { [Key in keyof SpecifiedOptions as undefined extends Required<Options>[Key & keyof Options] ? Key : undefined extends SpecifiedOptions[Key] ? never : Key]: SpecifiedOptions[Key]; }>>>;
687
+ //#endregion
688
+ //#region ../../node_modules/type-fest/source/partial-deep.d.ts
689
+ /**
690
+ @see {@link PartialDeep}
691
+ */
692
+ type PartialDeepOptions = {
693
+ /**
694
+ Whether to affect the individual elements of arrays and tuples.
695
+
696
+ @default false
697
+ */
698
+ readonly recurseIntoArrays?: boolean;
699
+ /**
700
+ Allows `undefined` values in non-tuple arrays.
701
+
702
+ - When set to `true`, elements of non-tuple arrays can be `undefined`.
703
+ - When set to `false`, only explicitly defined elements are allowed in non-tuple arrays, ensuring stricter type checking.
704
+
705
+ @default false
706
+
707
+ @example
708
+ You can allow `undefined` values in non-tuple arrays by passing `{recurseIntoArrays: true; allowUndefinedInNonTupleArrays: true}` as the second type argument:
709
+
710
+ ```
711
+ import type {PartialDeep} from 'type-fest';
712
+
713
+ type Settings = {
714
+ languages: string[];
715
+ };
716
+
717
+ declare const partialSettings: PartialDeep<Settings, {recurseIntoArrays: true; allowUndefinedInNonTupleArrays: true}>;
718
+
719
+ partialSettings.languages = [undefined]; // OK
720
+ ```
721
+ */
722
+ readonly allowUndefinedInNonTupleArrays?: boolean;
723
+ };
724
+ type DefaultPartialDeepOptions = {
725
+ recurseIntoArrays: false;
726
+ allowUndefinedInNonTupleArrays: false;
727
+ };
728
+ /**
729
+ Create a deeply optional version of another type.
730
+
731
+ Use-cases:
732
+ - Merging a default settings/config object with another object, the second object would be a deep partial of the default object.
733
+ - Mocking and testing complex entities, where populating an entire object with its keys would be redundant in terms of the mock or test.
734
+
735
+ Use [`Partial<T>`](https://www.typescriptlang.org/docs/handbook/utility-types.html#partialtype) if you only need one level deep.
736
+
737
+ @example
738
+ ```
739
+ import type {PartialDeep} from 'type-fest';
740
+
741
+ let settings = {
742
+ textEditor: {
743
+ fontSize: 14,
744
+ fontColor: '#000000',
745
+ fontWeight: 400,
746
+ },
747
+ autocomplete: false,
748
+ autosave: true,
749
+ };
750
+
751
+ const applySavedSettings = (savedSettings: PartialDeep<typeof settings>) => (
752
+ {...settings, ...savedSettings, textEditor: {...settings.textEditor, ...savedSettings.textEditor}}
753
+ );
754
+
755
+ settings = applySavedSettings({textEditor: {fontWeight: 500}});
756
+ ```
757
+
758
+ By default, this does not affect elements in array and tuple types. You can change this by passing `{recurseIntoArrays: true}` as the second type argument:
759
+
760
+ ```
761
+ import type {PartialDeep} from 'type-fest';
762
+
763
+ type Shape = {
764
+ dimensions: [number, number];
765
+ };
766
+
767
+ const partialShape: PartialDeep<Shape, {recurseIntoArrays: true}> = {
768
+ dimensions: [], // OK
769
+ };
770
+
771
+ partialShape.dimensions = [15]; // OK
772
+ ```
773
+
774
+ @see {@link PartialDeepOptions}
775
+
776
+ @category Object
777
+ @category Array
778
+ @category Set
779
+ @category Map
780
+ */
781
+ type PartialDeep<T, Options extends PartialDeepOptions = {}> = _PartialDeep<T, ApplyDefaultOptions<PartialDeepOptions, DefaultPartialDeepOptions, Options>>;
782
+ type _PartialDeep<T, Options extends Required<PartialDeepOptions>> = T extends BuiltIns | ((new (...arguments_: any[]) => unknown)) ? T : T extends Map<infer KeyType, infer ValueType> ? PartialMapDeep<KeyType, ValueType, Options> : T extends Set<infer ItemType> ? PartialSetDeep<ItemType, Options> : T extends ReadonlyMap<infer KeyType, infer ValueType> ? PartialReadonlyMapDeep<KeyType, ValueType, Options> : T extends ReadonlySet<infer ItemType> ? PartialReadonlySetDeep<ItemType, Options> : T extends ((...arguments_: any[]) => unknown) ? IsNever<keyof T> extends true ? T // For functions with no properties
783
+ : HasMultipleCallSignatures<T> extends true ? T : ((...arguments_: Parameters<T>) => ReturnType<T>) & PartialObjectDeep<T, Options> : T extends object ? T extends ReadonlyArray<infer ItemType> // Test for arrays/tuples, per https://github.com/microsoft/TypeScript/issues/35156
784
+ ? Options['recurseIntoArrays'] extends true ? ItemType[] extends T // Test for arrays (non-tuples) specifically
785
+ ? readonly ItemType[] extends T // Differentiate readonly and mutable arrays
786
+ ? ReadonlyArray<_PartialDeep<Options['allowUndefinedInNonTupleArrays'] extends false ? ItemType : ItemType | undefined, Options>> : Array<_PartialDeep<Options['allowUndefinedInNonTupleArrays'] extends false ? ItemType : ItemType | undefined, Options>> : PartialObjectDeep<T, Options> // Tuples behave properly
787
+ : T // If they don't opt into array testing, just use the original type
788
+ : PartialObjectDeep<T, Options> : unknown;
789
+ /**
790
+ Same as `PartialDeep`, but accepts only `Map`s and as inputs. Internal helper for `PartialDeep`.
791
+ */
792
+ type PartialMapDeep<KeyType, ValueType, Options extends Required<PartialDeepOptions>> = {} & Map<_PartialDeep<KeyType, Options>, _PartialDeep<ValueType, Options>>;
793
+ /**
794
+ Same as `PartialDeep`, but accepts only `Set`s as inputs. Internal helper for `PartialDeep`.
795
+ */
796
+ type PartialSetDeep<T, Options extends Required<PartialDeepOptions>> = {} & Set<_PartialDeep<T, Options>>;
797
+ /**
798
+ Same as `PartialDeep`, but accepts only `ReadonlyMap`s as inputs. Internal helper for `PartialDeep`.
799
+ */
800
+ type PartialReadonlyMapDeep<KeyType, ValueType, Options extends Required<PartialDeepOptions>> = {} & ReadonlyMap<_PartialDeep<KeyType, Options>, _PartialDeep<ValueType, Options>>;
801
+ /**
802
+ Same as `PartialDeep`, but accepts only `ReadonlySet`s as inputs. Internal helper for `PartialDeep`.
803
+ */
804
+ type PartialReadonlySetDeep<T, Options extends Required<PartialDeepOptions>> = {} & ReadonlySet<_PartialDeep<T, Options>>;
805
+ /**
806
+ Same as `PartialDeep`, but accepts only `object`s as inputs. Internal helper for `PartialDeep`.
807
+ */
808
+ type PartialObjectDeep<ObjectType extends object, Options extends Required<PartialDeepOptions>> = { [KeyType in keyof ObjectType]?: _PartialDeep<ObjectType[KeyType], Options>; };
809
+ //#endregion
810
+ //#region ../../node_modules/rettime/build/index.d.mts
811
+ //#region src/index.d.ts
812
+ type DefaultEventMap = {
813
+ [eventType: string]: TypedEvent<any, any>;
814
+ };
815
+ /**
816
+ * Reserved event map containing special event types like '*' for catch-all listeners.
817
+ */
818
+ type ReservedEventMap = {
819
+ '*': TypedEvent<any, any, '*'>;
820
+ };
821
+ type IsReservedEvent<Type extends string> = Type extends keyof ReservedEventMap ? true : false;
822
+ interface TypedEvent<DataType = void, ReturnType = void, EventType extends string = string> extends Omit<MessageEvent<DataType>, 'type'> {
823
+ type: EventType;
824
+ }
825
+ declare const kDefaultPrevented: unique symbol;
826
+ declare const kPropagationStopped: unique symbol;
827
+ declare const kImmediatePropagationStopped: unique symbol;
828
+ declare class TypedEvent<DataType = void, ReturnType = void, EventType extends string = string> extends MessageEvent<DataType> implements TypedEvent<DataType, ReturnType, EventType> {
829
+ #private;
830
+ [kDefaultPrevented]: boolean;
831
+ [kPropagationStopped]?: Emitter$1<any>;
832
+ [kImmediatePropagationStopped]?: boolean;
833
+ constructor(...args: [DataType] extends [void] ? [type: EventType] : [type: EventType, init: {
834
+ data: DataType;
835
+ }]);
836
+ get defaultPrevented(): boolean;
837
+ preventDefault(): void;
838
+ stopImmediatePropagation(): void;
839
+ }
840
+ /**
841
+ * Brands a TypedEvent or its subclass while preserving its (narrower) type.
842
+ */
843
+ type Brand<Event extends TypedEvent, EventType extends string, Loose extends boolean = false> = Loose extends true ? Event extends TypedEvent<infer Data, any, any> ?
844
+ /**
845
+ * @note Omit the `ReturnType` so emit methods can accept type events
846
+ * where infering the return type is impossible.
847
+ */
848
+ TypedEvent<Data, any, EventType> & {
849
+ type: EventType;
850
+ } : never : Event & {
851
+ type: EventType;
852
+ };
853
+ type InferEventMap<Target extends Emitter$1<any>> = Target extends Emitter$1<infer EventMap> ? WithReservedEvents<EventMap$2> : never;
854
+ /**
855
+ * Extracts only user-defined events, excluding reserved event types.
856
+ */
857
+ type UserEventMap<EventMap$1 extends DefaultEventMap> = Omit<EventMap$1, keyof ReservedEventMap>;
858
+ /**
859
+ * Decorates the given `EventMap` with the reserved emitter events (e.g. `*`).
860
+ */
861
+ type WithReservedEvents<EventMap$1 extends DefaultEventMap> = EventMap$1 & ReservedEventMap;
862
+ /**
863
+ * Creates a union of all events in the EventMap with their literal type strings.
864
+ */
865
+ type AllEvents<EventMap$1 extends DefaultEventMap> = { [K in keyof EventMap$1 & string]: Brand<EventMap$1[K], K>; }[keyof EventMap$1 & string];
866
+ type TypedListenerOptions = {
867
+ once?: boolean;
868
+ signal?: AbortSignal;
869
+ };
870
+ interface HookListenerOptions extends TypedListenerOptions {
871
+ persist?: boolean;
872
+ }
873
+ type EmitterHookMap<EventMap$1 extends DefaultEventMap> = {
874
+ newListener: (type: keyof WithReservedEvents<EventMap$1> & string, listener: { [K in keyof WithReservedEvents<EventMap$1> & string]: Emitter$1.Listener<Emitter$1<EventMap$1>, K, WithReservedEvents<EventMap$1>>; }[keyof WithReservedEvents<EventMap$1> & string], options: HookListenerOptions | undefined) => void;
875
+ removeListener: (type: keyof WithReservedEvents<EventMap$1> & string, listener: { [K in keyof WithReservedEvents<EventMap$1> & string]: Emitter$1.Listener<Emitter$1<EventMap$1>, K, WithReservedEvents<EventMap$1>>; }[keyof WithReservedEvents<EventMap$1> & string], options: HookListenerOptions | undefined) => void;
876
+ beforeEmit: (event: EventMap$1[keyof EventMap$1 & string]) => boolean | void;
877
+ };
878
+ declare namespace Emitter$1 {
879
+ /**
880
+ * Returns a union of all event types, both public and reserved, for the given emitter.
881
+ *
882
+ * @example
883
+ * const emitter = new Emitter<{ greeting: TypedEvent, handshake: TypedEvent }>()
884
+ * type AllEventTypes = Emitter.AllEventTypes<typeof emitter>
885
+ * // "*" | "greeting" | "handshake"
886
+ */
887
+ type AllEventTypes<Target extends Emitter$1<any>, EventMap$1 extends DefaultEventMap = InferEventMap<Target>> = string extends keyof EventMap$1 ? never : keyof EventMap$1 & string;
888
+ /**
889
+ * Returns a union of all public event types for the given emitter.
890
+ *
891
+ * @example
892
+ * const emitter = new Emitter<{ greeting: TypedEvent, handshake: TypedEvent }>()
893
+ * type EventTypes = Emitter.EventTypes<typeof emitter>
894
+ * // "greeting" | "handshake"
895
+ */
896
+ type PublicEventTypes<Target extends Emitter$1<any>, EventMap$1 extends DefaultEventMap = InferEventMap<Target>, UserEvents extends UserEventMap<EventMap$1> = UserEventMap<EventMap$1>> = string extends keyof UserEvents ? never : keyof UserEvents & string;
897
+ /**
898
+ * Returns a union of all public event type for the given emitter.
899
+ *
900
+ * @example
901
+ * const emitter = new Emitter<{ greeting: GreetingEvent, handshake: HandshakeEvent }>()
902
+ * type Events = Emitter.Events<typeof emitter>
903
+ * // GreetingEvent | HandshakeEvent
904
+ */
905
+ type Events<Target extends Emitter$1<any>, EventMap$1 extends DefaultEventMap = InferEventMap<Target>> = string extends keyof UserEventMap<EventMap$1> ? never : UserEventMap<EventMap$1>[keyof UserEventMap<EventMap$1>];
906
+ /**
907
+ * Returns an appropriate `Event` type for the given event type.
908
+ *
909
+ * @example
910
+ * const emitter = new Emitter<{ greeting: TypedEvent<string> }>()
911
+ * type GreetingEvent = Emitter.Event<typeof emitter, 'greeting'>
912
+ * // TypedEvent<string>
913
+ */
914
+ type Event<Target extends Emitter$1<any>, EventType extends keyof EventMap$1 & string, EventMap$1 extends DefaultEventMap = InferEventMap<Target>> = IsReservedEvent<EventType> extends true ? AllEvents<UserEventMap<EventMap$1>> : Brand<EventMap$1[EventType], EventType>;
915
+ /**
916
+ * Returns an appropriate event data type for the given event type.
917
+ *
918
+ * @example
919
+ * const emitter = new Emitter<{ greeting: TypedEvent<'hello'> }>()
920
+ * type GreetingData = Emitter.EventData<typeof emitter, 'gretting'>
921
+ * // "hello"
922
+ */
923
+ type EventData<Target extends Emitter$1<any>, EventType extends keyof EventMap$1 & string, EventMap$1 extends DefaultEventMap = InferEventMap<Target>> = EventMap$1[EventType] extends TypedEvent<infer DataType> ? DataType : never;
924
+ /**
925
+ * Returns the listener type for the given event type.
926
+ *
927
+ * @example
928
+ * const emitter = new Emitter<{ getTotalPrice: TypedEvent<Cart, number> }>()
929
+ * type Listener = Emitter.ListenerType<typeof emitter, 'getTotalPrice'>
930
+ * // (event: TypedEvent<Cart>) => number
931
+ */
932
+ type Listener<Target extends Emitter$1<any>, EventType extends keyof EventMap$1 & string, EventMap$1 extends DefaultEventMap = InferEventMap<Target>> = IsReservedEvent<EventType> extends true ? (event: Emitter$1.Event<Target, EventType, EventMap$1>) => void : (event: Emitter$1.Event<Target, EventType, EventMap$1>) => Emitter$1.ListenerReturnType<Target, EventType, EventMap$1> extends [void] ? void : Emitter$1.ListenerReturnType<Target, EventType, EventMap$1>;
933
+ /**
934
+ * Returns the return type of the listener for the given event type.
935
+ *
936
+ * @example
937
+ * const emitter = new Emitter<{ getTotalPrice: TypedEvent<Cart, number> }>()
938
+ * type ListenerReturnType = Emitter.ListenerReturnType<typeof emitter, 'getTotalPrice'>
939
+ * // number
940
+ */
941
+ type ListenerReturnType<Target extends Emitter$1<any>, EventType extends keyof EventMap$1 & string, EventMap$1 extends DefaultEventMap = InferEventMap<Target>> = IsReservedEvent<EventType> extends true ? void : EventMap$1[EventType] extends TypedEvent<unknown, infer ReturnType> ? ReturnType : never;
942
+ }
943
+ declare namespace EventMap$2 {
944
+ /**
945
+ * Returns a union of all public event types from the given event map.
946
+ *
947
+ * @example
948
+ * type MyEventMap = { greeting: TypedEvent, handshake: TypedEvent }
949
+ * type EventTypes = EventMap.EventTypes<MyEventMap>
950
+ * // "greeting" | "handshake"
951
+ */
952
+ type EventTypes<Map extends DefaultEventMap> = Emitter$1.PublicEventTypes<Emitter$1<Map>>;
953
+ /**
954
+ * Returns a union of all public event type from the given event map.
955
+ *
956
+ * @example
957
+ * type MyEventMap = { greeting: GreetingEvent, handshake: HandshakeEvent }
958
+ * type Events = EventMap.Events<MyEventMap>
959
+ * // GreetingEvent | HandshakeEvent
960
+ */
961
+ type Events<Map extends DefaultEventMap> = Emitter$1.Events<Emitter$1<Map>>;
962
+ /**
963
+ * Returns an appropriate `Event` type for the given event type.
964
+ *
965
+ * @example
966
+ * type MyEventMap = { greeting: TypedEvent<string> }
967
+ * type GreetingEvent = EventMap.Event<MyEventMap, 'greeting'>
968
+ * // TypedEvent<string>
969
+ */
970
+ type Event<Map extends DefaultEventMap, Type extends keyof WithReservedEvents<Map> & string> = Emitter$1.Event<Emitter$1<Map>, Type, WithReservedEvents<Map>>;
971
+ /**
972
+ * Returns an appropriate event data type for the given event type.
973
+ *
974
+ * @example
975
+ * type MyEventMap = { greeting: TypedEvent<'hello'> }
976
+ * type GreetingData = EventMap.EventData<MyEventMap, 'greeting'>
977
+ * // "hello"
978
+ */
979
+ type EventData<Map extends DefaultEventMap, Type extends keyof WithReservedEvents<Map> & string> = Emitter$1.EventData<Emitter$1<Map>, Type, WithReservedEvents<Map>>;
980
+ /**
981
+ * Returns the listener type for the given event type.
982
+ *
983
+ * @example
984
+ * type MyEventMap = { getTotalPrice: TypedEvent<Cart, number> }>
985
+ * type Listener = EventMap.Listener<MyEventMap, 'getTotalPrice'>
986
+ * // (event: TypedEvent<Cart>) => number
987
+ */
988
+ type Listener<Map extends DefaultEventMap, Type extends keyof WithReservedEvents<Map> & string> = Emitter$1.Listener<Emitter$1<Map>, Type, WithReservedEvents<Map>>;
989
+ /**
990
+ * Returns the return type of the listener for the given event type.
991
+ *
992
+ * @example
993
+ * type MyEventMap = { getTotalPrice: TypedEvent<Cart, number> }
994
+ * type ListenerReturnType = EventMap.ListenerReturnType<MyEventMap, 'getTotalPrice'>
995
+ * // number
996
+ */
997
+ type ListenerReturnType<Map extends DefaultEventMap, Type extends keyof WithReservedEvents<Map> & string> = Emitter$1.ListenerReturnType<Emitter$1<Map>, Type, WithReservedEvents<Map>>;
998
+ }
999
+ declare class Emitter$1<EventMap$1 extends DefaultEventMap> {
1000
+ #private;
1001
+ readonly hooks: {
1002
+ on<HookType extends keyof EmitterHookMap<EventMap$1>>(type: HookType, callback: EmitterHookMap<EventMap$1>[HookType], options?: HookListenerOptions): void;
1003
+ removeListener<HookType extends keyof EmitterHookMap<EventMap$1>>(type: HookType, callback: EmitterHookMap<EventMap$1>[HookType], options?: HookListenerOptions): void;
1004
+ };
1005
+ constructor();
1006
+ /**
1007
+ * Adds a listener for the given event type.
1008
+ */
1009
+ on<EventType extends keyof WithReservedEvents<EventMap$1> & string>(type: EventType, listener: Emitter$1.Listener<typeof this, EventType, WithReservedEvents<EventMap$1>>, options?: TypedListenerOptions): typeof this;
1010
+ /**
1011
+ * Adds a one-time listener for the given event type.
1012
+ */
1013
+ once<EventType extends keyof WithReservedEvents<EventMap$1> & string>(type: EventType, listener: Emitter$1.Listener<typeof this, EventType, WithReservedEvents<EventMap$1>>, options?: Omit<TypedListenerOptions, 'once'>): typeof this;
1014
+ /**
1015
+ * Prepends a listener for the given event type.
1016
+ */
1017
+ earlyOn<EventType extends keyof WithReservedEvents<EventMap$1> & string>(type: EventType, listener: Emitter$1.Listener<typeof this, EventType, WithReservedEvents<EventMap$1>>, options?: TypedListenerOptions): typeof this;
1018
+ /**
1019
+ * Prepends a one-time listener for the given event type.
1020
+ */
1021
+ earlyOnce<EventType extends keyof WithReservedEvents<EventMap$1> & string>(type: EventType, listener: Emitter$1.Listener<typeof this, EventType, WithReservedEvents<EventMap$1>>, options?: Omit<TypedListenerOptions, 'once'>): typeof this;
1022
+ /**
1023
+ * Emits the given typed event.
1024
+ *
1025
+ * @returns {boolean} Returns `true` if the event had any listeners, `false` otherwise.
1026
+ */
1027
+ emit<EventType extends keyof EventMap$1 & string>(event: Brand<EventMap$1[EventType], EventType, true>): boolean;
1028
+ /**
1029
+ * Emits the given typed event and returns a promise that resolves
1030
+ * when all the listeners for that event have settled.
1031
+ *
1032
+ * @returns {Promise<Array<Emitter.ListenerReturnType>>} A promise that resolves
1033
+ * with the return values of all listeners.
1034
+ */
1035
+ emitAsPromise<EventType extends keyof EventMap$1 & string>(event: Brand<EventMap$1[EventType], EventType, true>): Promise<Array<Emitter$1.ListenerReturnType<typeof this, EventType, EventMap$1>>>;
1036
+ /**
1037
+ * Emits the given event and returns a generator that yields
1038
+ * the result of each listener in the order of their registration.
1039
+ * This way, you stop exhausting the listeners once you get the expected value.
1040
+ */
1041
+ emitAsGenerator<EventType extends keyof EventMap$1 & string>(event: Brand<EventMap$1[EventType], EventType, true>): Generator<Emitter$1.ListenerReturnType<typeof this, EventType, EventMap$1>>;
1042
+ /**
1043
+ * Removes a listener for the given event type.
1044
+ */
1045
+ removeListener<EventType extends keyof WithReservedEvents<EventMap$1> & string>(type: EventType, listener: Emitter$1.Listener<typeof this, EventType, WithReservedEvents<EventMap$1>>): void;
1046
+ /**
1047
+ * Removes all listeners for the given event type.
1048
+ * If no event type is provided, removes all existing listeners.
1049
+ */
1050
+ removeAllListeners<EventType extends keyof WithReservedEvents<EventMap$1> & string>(type?: EventType): void;
1051
+ /**
1052
+ * Returns the list of listeners for the given event type.
1053
+ * If no even type is provided, returns all listeners.
1054
+ */
1055
+ listeners<EventType extends keyof WithReservedEvents<EventMap$1> & string>(type?: EventType): Array<Emitter$1.Listener<typeof this, EventType, WithReservedEvents<EventMap$1>>>;
1056
+ /**
1057
+ * Returns the number of listeners for the given event type.
1058
+ * If no even type is provided, returns the total number of listeners.
1059
+ */
1060
+ listenerCount<EventType extends keyof WithReservedEvents<EventMap$1> & string>(type?: EventType): number;
1061
+ }
1062
+ //#endregion
1063
+ //#region ../../node_modules/strict-event-emitter/lib/index.d.ts
1064
+ declare type EventMap = {
1065
+ [eventName: string]: Array<unknown>;
1066
+ };
1067
+ declare type InternalEventNames = 'newListener' | 'removeListener';
1068
+ declare type InternalListener<Events extends EventMap> = Listener<[eventName: keyof Events, listener: Listener<Array<unknown>>]>;
1069
+ declare type Listener<Data extends Array<unknown>> = (...data: Data) => void;
1070
+ /**
1071
+ * Node.js-compatible implementation of `EventEmitter`.
1072
+ *
1073
+ * @example
1074
+ * const emitter = new Emitter<{ hello: [string] }>()
1075
+ * emitter.on('hello', (name) => console.log(name))
1076
+ * emitter.emit('hello', 'John')
1077
+ */
1078
+ declare class Emitter<Events extends EventMap> {
1079
+ private events;
1080
+ private maxListeners;
1081
+ private hasWarnedAboutPotentialMemoryLeak;
1082
+ static defaultMaxListeners: number;
1083
+ static listenerCount<Events extends EventMap>(emitter: Emitter<EventMap>, eventName: keyof Events): number;
1084
+ constructor();
1085
+ private _emitInternalEvent;
1086
+ private _getListeners;
1087
+ private _removeListener;
1088
+ private _wrapOnceListener;
1089
+ setMaxListeners(maxListeners: number): this;
1090
+ /**
1091
+ * Returns the current max listener value for the `Emitter` which is
1092
+ * either set by `emitter.setMaxListeners(n)` or defaults to
1093
+ * `Emitter.defaultMaxListeners`.
1094
+ */
1095
+ getMaxListeners(): number;
1096
+ /**
1097
+ * Returns an array listing the events for which the emitter has registered listeners.
1098
+ * The values in the array will be strings or Symbols.
1099
+ */
1100
+ eventNames(): Array<keyof Events>;
1101
+ /**
1102
+ * Synchronously calls each of the listeners registered for the event named `eventName`,
1103
+ * in the order they were registered, passing the supplied arguments to each.
1104
+ * Returns `true` if the event has listeners, `false` otherwise.
1105
+ *
1106
+ * @example
1107
+ * const emitter = new Emitter<{ hello: [string] }>()
1108
+ * emitter.emit('hello', 'John')
1109
+ */
1110
+ emit<EventName extends keyof Events>(eventName: EventName, ...data: Events[EventName]): boolean;
1111
+ addListener(eventName: InternalEventNames, listener: InternalListener<Events>): this;
1112
+ addListener<EventName extends keyof Events>(eventName: EventName, listener: Listener<Events[EventName]>): this;
1113
+ on(eventName: InternalEventNames, listener: InternalListener<Events>): this;
1114
+ on<EventName extends keyof Events>(eventName: EventName, listener: Listener<Events[EventName]>): this;
1115
+ once(eventName: InternalEventNames, listener: InternalListener<Events>): this;
1116
+ once<EventName extends keyof Events>(eventName: EventName, listener: Listener<Events[EventName]>): this;
1117
+ prependListener(eventName: InternalEventNames, listener: InternalListener<Events>): this;
1118
+ prependListener<EventName extends keyof Events>(eventName: EventName, listener: Listener<Events[EventName]>): this;
1119
+ prependOnceListener(eventName: InternalEventNames, listener: InternalListener<Events>): this;
1120
+ prependOnceListener<EventName extends keyof Events>(eventName: EventName, listener: Listener<Events[EventName]>): this;
1121
+ removeListener(eventName: InternalEventNames, listener: InternalListener<Events>): this;
1122
+ removeListener<EventName extends keyof Events>(eventName: EventName, listener: Listener<Events[EventName]>): this;
1123
+ off(eventName: InternalEventNames, listener: InternalListener<Events>): this;
1124
+ off<EventName extends keyof Events>(eventName: EventName, listener: Listener<Events[EventName]>): this;
1125
+ removeAllListeners(eventName?: InternalEventNames): this;
1126
+ removeAllListeners<EventName extends keyof Events>(eventName?: EventName): this;
1127
+ listeners(eventName: InternalEventNames): Array<Listener<any>>;
1128
+ listeners<EventName extends keyof Events>(eventName: EventName): Array<Listener<Events[EventName]>>;
1129
+ listenerCount(eventName: InternalEventNames): number;
1130
+ listenerCount<EventName extends keyof Events>(eventName: EventName): number;
1131
+ rawListeners<EventName extends keyof Events>(eventName: EventName): Array<Listener<Events[EventName]>>;
1132
+ }
1133
+ //#endregion
1134
+ //#region ../../node_modules/@mswjs/interceptors/lib/node/index.d.mts
1135
+ interface FetchResponseInit extends ResponseInit {
1136
+ url?: string;
1137
+ }
1138
+ declare class FetchResponse extends Response {
1139
+ /**
1140
+ * Response status codes for responses that cannot have body.
1141
+ * @see https://fetch.spec.whatwg.org/#statuses
1142
+ */
1143
+ static readonly STATUS_CODES_WITHOUT_BODY: number[];
1144
+ static readonly STATUS_CODES_WITH_REDIRECT: number[];
1145
+ static isConfigurableStatusCode(status: number): boolean;
1146
+ static isRedirectResponse(status: number): boolean;
1147
+ /**
1148
+ * Returns a boolean indicating whether the given response status
1149
+ * code represents a response that can have a body.
1150
+ */
1151
+ static isResponseWithBody(status: number): boolean;
1152
+ static setStatus(status: number, response: Response): void;
1153
+ static setUrl(url: string | undefined, response: Response): void;
1154
+ /**
1155
+ * Parses the given raw HTTP headers into a Fetch API `Headers` instance.
1156
+ */
1157
+ static parseRawHeaders(rawHeaders: Array<string>): Headers;
1158
+ /**
1159
+ * Safely clones the given `Response`.
1160
+ * Coerces response clone exceptions into 500 mocked responses.
1161
+ * Handy in the environments that introduce arbitrary response
1162
+ * cloning restrictions, like "101 Switching Protocols" cloning
1163
+ * in "miniflare".
1164
+ */
1165
+ static clone(response: Response): Response;
1166
+ constructor(body?: BodyInit | null, init?: FetchResponseInit);
1167
+ clone(): Response;
1168
+ }
1169
+ //#endregion
1170
+ //#region ../../node_modules/msw/lib/core/utils/internal/isIterable.d.mts
1171
+ /**
1172
+ * This is the same as TypeScript's `Iterable`, but with all three type parameters.
1173
+ * @todo Remove once TypeScript 5.6 is the minimum.
1174
+ */
1175
+ interface Iterable<T, TReturn, TNext> {
1176
+ [Symbol.iterator](): Iterator<T, TReturn, TNext>;
1177
+ }
1178
+ /**
1179
+ * This is the same as TypeScript's `AsyncIterable`, but with all three type parameters.
1180
+ * @todo Remove once TypeScript 5.6 is the minimum.
1181
+ */
1182
+ interface AsyncIterable<T, TReturn, TNext> {
1183
+ [Symbol.asyncIterator](): AsyncIterator<T, TReturn, TNext>;
1184
+ }
1185
+ //#endregion
1186
+ //#region ../../node_modules/msw/lib/core/typeUtils.d.mts
1187
+ type MaybePromise<T> = T | Promise<T>;
1188
+ /**
1189
+ * @fixme Remove this once TS 5.4 is the lowest supported version.
1190
+ * Because "NoInfer" is a built-in type utility there.
1191
+ */
1192
+ type NoInfer$1<T> = [T][T extends any ? 0 : never];
1193
+ //#endregion
1194
+ //#region ../../node_modules/msw/lib/core/utils/matching/matchRequestUrl.d.mts
1195
+ type Path = string | RegExp;
1196
+ type PathParams<KeyType extends keyof any = string> = { [ParamName in KeyType]?: string | ReadonlyArray<string>; };
1197
+ interface Match {
1198
+ matches: boolean;
1199
+ params?: PathParams;
1200
+ }
1201
+ //#endregion
1202
+ //#region ../../node_modules/msw/lib/core/HttpResponse-BE_Y2Ak9.d.mts
1203
+ interface ResponseResolutionContext {
1204
+ /**
1205
+ * A base url to use when resolving relative urls.
1206
+ * @note This is primarily used by the `@mswjs/http-middleware`
1207
+ * to resolve relative urls in the context of the running server
1208
+ */
1209
+ baseUrl?: string;
1210
+ quiet?: boolean;
1211
+ }
1212
+ type GraphQLMultipartRequestBody = {
1213
+ operations: string;
1214
+ map?: string;
1215
+ } & {
1216
+ [fileName: string]: File;
1217
+ };
1218
+ type GraphQLVariables = Record<string, any>;
1219
+ type GraphQLRequestBody<VariablesType extends GraphQLVariables> = GraphQLJsonRequestBody<VariablesType> | GraphQLMultipartRequestBody | Record<string, any> | undefined;
1220
+ interface GraphQLJsonRequestBody<Variables extends GraphQLVariables> {
1221
+ query: string;
1222
+ variables?: Variables;
1223
+ }
1224
+ type DefaultRequestMultipartBody = Record<string, string | File | Array<string | File>>;
1225
+ type DefaultBodyType = Record<string, any> | DefaultRequestMultipartBody | string | number | boolean | null | undefined;
1226
+ type JsonBodyType = Record<string, any> | string | number | boolean | null | undefined;
1227
+ interface RequestHandlerDefaultInfo {
1228
+ header: string;
1229
+ }
1230
+ interface RequestHandlerInternalInfo {
1231
+ callFrame?: string;
1232
+ }
1233
+ type ResponseResolverReturnType<ResponseBodyType extends DefaultBodyType = undefined> = ([ResponseBodyType] extends [undefined] ? Response : ResponseBodyType extends GraphQLRequestBody<any> ? HttpResponse<ResponseBodyType> | DefaultUnsafeFetchResponse : HttpResponse<ResponseBodyType>) | undefined | void;
1234
+ type MaybeAsyncResponseResolverReturnType<ResponseBodyType extends DefaultBodyType> = MaybePromise<ResponseResolverReturnType<ResponseBodyType>>;
1235
+ type AsyncResponseResolverReturnType<ResponseBodyType extends DefaultBodyType> = MaybePromise<ResponseResolverReturnType<ResponseBodyType> | Iterable<MaybeAsyncResponseResolverReturnType<ResponseBodyType>, MaybeAsyncResponseResolverReturnType<ResponseBodyType>, MaybeAsyncResponseResolverReturnType<ResponseBodyType>> | AsyncIterable<MaybeAsyncResponseResolverReturnType<ResponseBodyType>, MaybeAsyncResponseResolverReturnType<ResponseBodyType>, MaybeAsyncResponseResolverReturnType<ResponseBodyType>>>;
1236
+ type ResponseResolverInfo<ResolverExtraInfo extends Record<string, unknown>, RequestBodyType extends DefaultBodyType = DefaultBodyType> = {
1237
+ request: StrictRequest<RequestBodyType>;
1238
+ requestId: string;
1239
+ /**
1240
+ * Schedule a callback to run after this response resolver completes.
1241
+ * Handy for cleaning up the side effects introduced in the resolver.
1242
+ *
1243
+ * For responses with a `ReadableStream` body (including `sse()` handlers),
1244
+ * the callback runs once the response stream settles: it is read to
1245
+ * completion, errored, or canceled, or the request is aborted.
1246
+ * @example
1247
+ * sse('/', ({ client, finalize }) => {
1248
+ * const interval = setInterval(() => client.send({ data: 'ping' }))
1249
+ * finalize(() => clearInterval(interval))
1250
+ * })
1251
+ */
1252
+ finalize: ResponseResolverFinalizeFunction;
1253
+ } & ResolverExtraInfo;
1254
+ type ResponseResolverFinalizeFunction = (callback: () => MaybePromise<void>) => void;
1255
+ type ResponseResolver<ResolverExtraInfo extends Record<string, unknown> = Record<string, unknown>, RequestBodyType extends DefaultBodyType = DefaultBodyType, ResponseBodyType extends DefaultBodyType = undefined> = (info: ResponseResolverInfo<ResolverExtraInfo, RequestBodyType>) => AsyncResponseResolverReturnType<ResponseBodyType>;
1256
+ interface RequestHandlerArgs<HandlerInfo, HandlerOptions extends RequestHandlerOptions> {
1257
+ info: HandlerInfo;
1258
+ resolver: ResponseResolver<any>;
1259
+ options?: HandlerOptions;
1260
+ }
1261
+ interface RequestHandlerOptions {
1262
+ once?: boolean;
1263
+ }
1264
+ interface RequestHandlerExecutionResult<ParsedResult extends object | undefined> {
1265
+ handler: RequestHandler;
1266
+ parsedResult?: ParsedResult;
1267
+ request: Request;
1268
+ requestId: string;
1269
+ response?: Response;
1270
+ }
1271
+ declare abstract class RequestHandler<HandlerInfo extends RequestHandlerDefaultInfo = RequestHandlerDefaultInfo, ParsedResult extends Record<string, any> | undefined = any, ResolverExtras extends Record<string, unknown> = any, HandlerOptions extends RequestHandlerOptions = RequestHandlerOptions> {
1272
+ static cache: WeakMap<StrictRequest<DefaultBodyType>, StrictRequest<DefaultBodyType>>;
1273
+ readonly kind: "request";
1274
+ protected resolver: ResponseResolver<ResolverExtras, any, any>;
1275
+ private resolverIterator?;
1276
+ private resolverIteratorResult?;
1277
+ private resolverIteratorCleanups?;
1278
+ private options?;
1279
+ private scheduledCleanups;
1280
+ info: HandlerInfo & RequestHandlerInternalInfo;
1281
+ /**
1282
+ * Indicates whether this request handler has been used
1283
+ * (its resolver has successfully executed).
1284
+ */
1285
+ isUsed: boolean;
1286
+ constructor(args: RequestHandlerArgs<HandlerInfo, HandlerOptions>);
1287
+ /**
1288
+ * Reset the runtime state accumulated during response resolution,
1289
+ * such as generator iterator progress. Called when this handler is
1290
+ * removed from the active handlers list so re-adding it later starts
1291
+ * from a clean state.
1292
+ */
1293
+ protected reset(): void;
1294
+ /**
1295
+ * Restore this handler so it can match requests again after being
1296
+ * exhausted (e.g. via `{ once: true }`). Also clears any accumulated
1297
+ * resolution state.
1298
+ */
1299
+ protected restore(): void;
1300
+ /**
1301
+ * Determine if the intercepted request should be mocked.
1302
+ */
1303
+ abstract predicate(args: {
1304
+ request: Request;
1305
+ parsedResult: ParsedResult;
1306
+ resolutionContext?: ResponseResolutionContext;
1307
+ }): boolean | Promise<boolean>;
1308
+ /**
1309
+ * Print out the successfully handled request.
1310
+ */
1311
+ abstract log(args: {
1312
+ request: Request;
1313
+ response: Response;
1314
+ parsedResult: ParsedResult;
1315
+ }): void;
1316
+ /**
1317
+ * Parse the intercepted request to extract additional information from it.
1318
+ * Parsed result is then exposed to other methods of this request handler.
1319
+ */
1320
+ parse(_args: {
1321
+ request: Request;
1322
+ resolutionContext?: ResponseResolutionContext;
1323
+ }): Promise<ParsedResult>;
1324
+ /**
1325
+ * Test if this handler matches the given request.
1326
+ *
1327
+ * This method is not used internally but is exposed
1328
+ * as a convenience method for consumers writing custom
1329
+ * handlers.
1330
+ */
1331
+ test(args: {
1332
+ request: Request;
1333
+ resolutionContext?: ResponseResolutionContext;
1334
+ }): Promise<boolean>;
1335
+ protected extendResolverArgs(_args: {
1336
+ request: Request;
1337
+ parsedResult: ParsedResult;
1338
+ }): ResolverExtras;
1339
+ private cloneRequestOrGetFromCache;
1340
+ /**
1341
+ * Execute this request handler and produce a mocked response
1342
+ * using the given resolver function.
1343
+ */
1344
+ run(args: {
1345
+ request: StrictRequest<any>;
1346
+ requestId: string;
1347
+ resolutionContext?: ResponseResolutionContext;
1348
+ }): Promise<RequestHandlerExecutionResult<ParsedResult> | null>;
1349
+ private wrapResolver;
1350
+ private createExecutionResult;
1351
+ private scheduleCleanup;
1352
+ private exhaustCleanups;
1353
+ /**
1354
+ * Remove and return the cleanups scheduled for the given request
1355
+ * (or the pending iterator cleanups for generator resolvers).
1356
+ */
1357
+ private takeScheduledCleanups;
1358
+ private runScheduledCleanups;
1359
+ /**
1360
+ * Conclude the response resolution for the given request.
1361
+ * Runs the scheduled cleanups immediately for responses without a
1362
+ * `ReadableStream` body. For streamed responses, returns an observed
1363
+ * copy of the response and defers the cleanups until its body settles
1364
+ * (is read to completion, errored, or canceled) or the request is
1365
+ * aborted, whichever comes first.
1366
+ */
1367
+ private complete;
1368
+ }
1369
+ interface HttpResponseInit extends ResponseInit {
1370
+ type?: ResponseType;
1371
+ }
1372
+ declare const bodyType: unique symbol;
1373
+ type DefaultUnsafeFetchResponse = Response & {
1374
+ [bodyType]?: never;
1375
+ };
1376
+ interface StrictRequest<BodyType extends JsonBodyType> extends Request {
1377
+ json(): Promise<BodyType>;
1378
+ clone(): StrictRequest<BodyType>;
1379
+ }
1380
+ /**
1381
+ * A drop-in replacement for the standard `Response` class
1382
+ * to allow additional features, like mocking the response `Set-Cookie` header.
1383
+ *
1384
+ * @example
1385
+ * new HttpResponse('Hello world', { status: 201 })
1386
+ * HttpResponse.json({ name: 'John' })
1387
+ * HttpResponse.formData(form)
1388
+ *
1389
+ * @see {@link https://mswjs.io/docs/api/http-response `HttpResponse` API reference}
1390
+ */
1391
+ declare class HttpResponse<BodyType extends DefaultBodyType> extends FetchResponse {
1392
+ readonly [bodyType]: BodyType;
1393
+ constructor(body?: NoInfer$1<BodyType> | null, init?: HttpResponseInit);
1394
+ static error(): HttpResponse<any>;
1395
+ /**
1396
+ * Create a `Response` with a `Content-Type: "text/plain"` body.
1397
+ * @example
1398
+ * HttpResponse.text('hello world')
1399
+ * HttpResponse.text('Error', { status: 500 })
1400
+ */
1401
+ static text<BodyType extends string>(body?: NoInfer$1<BodyType> | null, init?: HttpResponseInit): HttpResponse<BodyType>;
1402
+ /**
1403
+ * Create a `Response` with a `Content-Type: "application/json"` body.
1404
+ * @example
1405
+ * HttpResponse.json({ firstName: 'John' })
1406
+ * HttpResponse.json({ error: 'Not Authorized' }, { status: 401 })
1407
+ */
1408
+ static json<BodyType extends JsonBodyType>(body?: NoInfer$1<BodyType> | null | undefined, init?: HttpResponseInit): HttpResponse<BodyType>;
1409
+ /**
1410
+ * Create a `Response` with a `Content-Type: "application/xml"` body.
1411
+ * @example
1412
+ * HttpResponse.xml(`<user name="John" />`)
1413
+ * HttpResponse.xml(`<article id="abc-123" />`, { status: 201 })
1414
+ */
1415
+ static xml<BodyType extends string>(body?: BodyType | null, init?: HttpResponseInit): HttpResponse<BodyType>;
1416
+ /**
1417
+ * Create a `Response` with a `Content-Type: "text/html"` body.
1418
+ * @example
1419
+ * HttpResponse.html(`<p class="author">Jane Doe</p>`)
1420
+ * HttpResponse.html(`<main id="abc-123">Main text</main>`, { status: 201 })
1421
+ */
1422
+ static html<BodyType extends string>(body?: BodyType | null, init?: HttpResponseInit): HttpResponse<BodyType>;
1423
+ /**
1424
+ * Create a `Response` with an `ArrayBuffer` body.
1425
+ * @example
1426
+ * const buffer = new ArrayBuffer(3)
1427
+ * const view = new Uint8Array(buffer)
1428
+ * view.set([1, 2, 3])
1429
+ *
1430
+ * HttpResponse.arrayBuffer(buffer)
1431
+ */
1432
+ static arrayBuffer<BodyType extends ArrayBuffer | SharedArrayBuffer>(body?: BodyType, init?: HttpResponseInit): HttpResponse<BodyType>;
1433
+ /**
1434
+ * Create a `Response` with a `FormData` body.
1435
+ * @example
1436
+ * const data = new FormData()
1437
+ * data.set('name', 'Alice')
1438
+ *
1439
+ * HttpResponse.formData(data)
1440
+ */
1441
+ static formData(body?: FormData, init?: HttpResponseInit): HttpResponse<FormData>;
1442
+ }
1443
+ //#endregion
1444
+ //#region ../../node_modules/@mswjs/interceptors/lib/browser/interceptors/WebSocket/index.d.cts
1445
+ interface CloseEventInit extends EventInit {
1446
+ code?: number;
1447
+ reason?: string;
1448
+ wasClean?: boolean;
1449
+ }
1450
+ declare class CloseEvent extends Event {
1451
+ code: number;
1452
+ reason: string;
1453
+ wasClean: boolean;
1454
+ constructor(type: string, init?: CloseEventInit);
1455
+ }
1456
+ //#endregion
1457
+ //#region src/interceptors/WebSocket/WebSocketTransport.d.ts
1458
+ type WebSocketData = string | ArrayBufferLike | Blob | ArrayBufferView;
1459
+ type WebSocketTransportEventMap = {
1460
+ incoming: MessageEvent<WebSocketData>;
1461
+ outgoing: MessageEvent<WebSocketData>;
1462
+ close: CloseEvent;
1463
+ };
1464
+ type StrictEventListenerOrEventListenerObject<EventType extends Event> = ((this: WebSocket, event: EventType) => void) | {
1465
+ handleEvent(this: WebSocket, event: EventType): void;
1466
+ };
1467
+ interface WebSocketTransport {
1468
+ addEventListener<EventType extends keyof WebSocketTransportEventMap>(event: EventType, listener: StrictEventListenerOrEventListenerObject<WebSocketTransportEventMap[EventType]> | null, options?: boolean | AddEventListenerOptions): void;
1469
+ dispatchEvent<EventType extends keyof WebSocketTransportEventMap>(event: WebSocketTransportEventMap[EventType]): boolean;
1470
+ /**
1471
+ * Send the data from the server to this client.
1472
+ */
1473
+ send(data: WebSocketData): void;
1474
+ /**
1475
+ * Close the client connection.
1476
+ */
1477
+ close(code?: number, reason?: string): void;
1478
+ }
1479
+ //#endregion
1480
+ //#region src/interceptors/WebSocket/WebSocketOverride.d.ts
1481
+ type WebSocketEventListener<EventType extends WebSocketEventMap[keyof WebSocketEventMap] = Event> = (this: WebSocket, event: EventType) => void;
1482
+ declare const kPassthroughPromise: unique symbol;
1483
+ declare const kOnSend: unique symbol;
1484
+ declare const kClose: unique symbol;
1485
+ declare class WebSocketOverride extends EventTarget implements WebSocket {
1486
+ static readonly CONNECTING = 0;
1487
+ static readonly OPEN = 1;
1488
+ static readonly CLOSING = 2;
1489
+ static readonly CLOSED = 3;
1490
+ readonly CONNECTING = 0;
1491
+ readonly OPEN = 1;
1492
+ readonly CLOSING = 2;
1493
+ readonly CLOSED = 3;
1494
+ url: string;
1495
+ protocol: string;
1496
+ extensions: string;
1497
+ binaryType: BinaryType;
1498
+ readyState: WebSocket['readyState'];
1499
+ bufferedAmount: number;
1500
+ private _onopen;
1501
+ private _onmessage;
1502
+ private _onerror;
1503
+ private _onclose;
1504
+ private [kPassthroughPromise];
1505
+ private [kOnSend]?;
1506
+ constructor(url: string | URL, protocols?: string | Array<string>);
1507
+ set onopen(listener: WebSocketEventListener | null);
1508
+ get onopen(): WebSocketEventListener | null;
1509
+ set onmessage(listener: WebSocketEventListener<MessageEvent<WebSocketData>> | null);
1510
+ get onmessage(): WebSocketEventListener<MessageEvent<WebSocketData>> | null;
1511
+ set onerror(listener: WebSocketEventListener | null);
1512
+ get onerror(): WebSocketEventListener | null;
1513
+ set onclose(listener: WebSocketEventListener<CloseEvent> | null);
1514
+ get onclose(): WebSocketEventListener<CloseEvent> | null;
1515
+ /**
1516
+ * @see https://websockets.spec.whatwg.org/#ref-for-dom-websocket-send%E2%91%A0
1517
+ */
1518
+ send(data: WebSocketData): void;
1519
+ close(code?: number, reason?: string): void;
1520
+ private [kClose];
1521
+ addEventListener<K extends keyof WebSocketEventMap>(type: K, listener: (this: WebSocket, event: WebSocketEventMap[K]) => void, options?: boolean | AddEventListenerOptions): void;
1522
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
1523
+ removeEventListener<K extends keyof WebSocketEventMap>(type: K, callback: EventListenerOrEventListenerObject | null, options?: boolean | EventListenerOptions): void;
1524
+ }
1525
+ //#endregion
1526
+ //#region src/interceptors/WebSocket/WebSocketClientConnection.d.ts
1527
+ declare const kEmitter$1: unique symbol;
1528
+ interface WebSocketClientEventMap {
1529
+ message: MessageEvent<WebSocketData>;
1530
+ close: CloseEvent;
1531
+ }
1532
+ declare abstract class WebSocketClientConnectionProtocol {
1533
+ abstract id: string;
1534
+ abstract url: URL;
1535
+ abstract send(data: WebSocketData): void;
1536
+ abstract close(code?: number, reason?: string): void;
1537
+ abstract addEventListener<EventType extends keyof WebSocketClientEventMap>(type: EventType, listener: WebSocketEventListener<WebSocketClientEventMap[EventType]>, options?: AddEventListenerOptions | boolean): void;
1538
+ abstract removeEventListener<EventType extends keyof WebSocketClientEventMap>(event: EventType, listener: WebSocketEventListener<WebSocketClientEventMap[EventType]>, options?: EventListenerOptions | boolean): void;
1539
+ }
1540
+ /**
1541
+ * The WebSocket client instance represents an incoming
1542
+ * client connection. The user can control the connection,
1543
+ * send and receive events.
1544
+ */
1545
+ declare class WebSocketClientConnection implements WebSocketClientConnectionProtocol {
1546
+ readonly socket: WebSocket;
1547
+ private readonly transport;
1548
+ readonly id: string;
1549
+ readonly url: URL;
1550
+ private [kEmitter$1];
1551
+ constructor(socket: WebSocket, transport: WebSocketTransport);
1552
+ /**
1553
+ * Listen for the outgoing events from the connected WebSocket client.
1554
+ */
1555
+ addEventListener<EventType extends keyof WebSocketClientEventMap>(type: EventType, listener: WebSocketEventListener<WebSocketClientEventMap[EventType]>, options?: AddEventListenerOptions | boolean): void;
1556
+ /**
1557
+ * Removes the listener for the given event.
1558
+ */
1559
+ removeEventListener<EventType extends keyof WebSocketClientEventMap>(event: EventType, listener: WebSocketEventListener<WebSocketClientEventMap[EventType]>, options?: EventListenerOptions | boolean): void;
1560
+ /**
1561
+ * Send data to the connected client.
1562
+ */
1563
+ send(data: WebSocketData): void;
1564
+ /**
1565
+ * Close the WebSocket connection.
1566
+ * @param {number} code A status code (see https://www.rfc-editor.org/rfc/rfc6455#section-7.4.1).
1567
+ * @param {string} reason A custom connection close reason.
1568
+ */
1569
+ close(code?: number, reason?: string): void;
1570
+ }
1571
+ //#endregion
1572
+ //#region src/interceptors/WebSocket/WebSocketClassTransport.d.ts
1573
+ /**
1574
+ * Abstraction over the given mock `WebSocket` instance that allows
1575
+ * for controlling that instance (e.g. sending and receiving messages).
1576
+ */
1577
+ declare class WebSocketClassTransport extends EventTarget implements WebSocketTransport {
1578
+ protected readonly socket: WebSocketOverride;
1579
+ constructor(socket: WebSocketOverride);
1580
+ addEventListener<EventType extends keyof WebSocketTransportEventMap>(type: EventType, callback: StrictEventListenerOrEventListenerObject<WebSocketTransportEventMap[EventType]> | null, options?: boolean | AddEventListenerOptions): void;
1581
+ dispatchEvent<EventType extends keyof WebSocketTransportEventMap>(event: WebSocketTransportEventMap[EventType]): boolean;
1582
+ send(data: WebSocketData): void;
1583
+ close(code: number, reason?: string): void;
1584
+ }
1585
+ //#endregion
1586
+ //#region src/interceptors/WebSocket/WebSocketServerConnection.d.ts
1587
+ declare const kEmitter$2: unique symbol;
1588
+ declare const kSend: unique symbol;
1589
+ interface WebSocketServerEventMap {
1590
+ open: Event;
1591
+ message: MessageEvent<WebSocketData>;
1592
+ error: Event;
1593
+ close: CloseEvent;
1594
+ }
1595
+ declare abstract class WebSocketServerConnectionProtocol {
1596
+ abstract connect(): void;
1597
+ abstract send(data: WebSocketData): void;
1598
+ abstract close(): void;
1599
+ abstract addEventListener<EventType extends keyof WebSocketServerEventMap>(event: EventType, listener: WebSocketEventListener<WebSocketServerEventMap[EventType]>, options?: AddEventListenerOptions | boolean): void;
1600
+ abstract removeEventListener<EventType extends keyof WebSocketServerEventMap>(event: EventType, listener: WebSocketEventListener<WebSocketServerEventMap[EventType]>, options?: EventListenerOptions | boolean): void;
1601
+ }
1602
+ /**
1603
+ * The WebSocket server instance represents the actual production
1604
+ * WebSocket server connection. It's idle by default but you can
1605
+ * establish it by calling `server.connect()`.
1606
+ */
1607
+ declare class WebSocketServerConnection implements WebSocketServerConnectionProtocol {
1608
+ private readonly client;
1609
+ private readonly transport;
1610
+ private readonly createConnection;
1611
+ /**
1612
+ * A WebSocket instance connected to the original server.
1613
+ */
1614
+ private realWebSocket?;
1615
+ private mockCloseController;
1616
+ private realCloseController;
1617
+ private [kEmitter$2];
1618
+ constructor(client: WebSocketOverride, transport: WebSocketClassTransport, createConnection: () => WebSocket);
1619
+ /**
1620
+ * The `WebSocket` instance connected to the original server.
1621
+ * Accessing this before calling `server.connect()` will throw.
1622
+ */
1623
+ get socket(): WebSocket;
1624
+ /**
1625
+ * Open connection to the original WebSocket server.
1626
+ */
1627
+ connect(): void;
1628
+ /**
1629
+ * Listen for the incoming events from the original WebSocket server.
1630
+ */
1631
+ addEventListener<EventType extends keyof WebSocketServerEventMap>(event: EventType, listener: WebSocketEventListener<WebSocketServerEventMap[EventType]>, options?: AddEventListenerOptions | boolean): void;
1632
+ /**
1633
+ * Remove the listener for the given event.
1634
+ */
1635
+ removeEventListener<EventType extends keyof WebSocketServerEventMap>(event: EventType, listener: WebSocketEventListener<WebSocketServerEventMap[EventType]>, options?: EventListenerOptions | boolean): void;
1636
+ /**
1637
+ * Send data to the original WebSocket server.
1638
+ * @example
1639
+ * server.send('hello')
1640
+ * server.send(new Blob(['hello']))
1641
+ * server.send(new TextEncoder().encode('hello'))
1642
+ */
1643
+ send(data: WebSocketData): void;
1644
+ private [kSend];
1645
+ /**
1646
+ * Close the actual server connection.
1647
+ */
1648
+ close(): void;
1649
+ private handleIncomingMessage;
1650
+ private handleMockClose;
1651
+ private handleRealClose;
1652
+ }
1653
+ type WebSocketConnectionData = {
1654
+ /**
1655
+ * The incoming WebSocket client connection.
1656
+ */
1657
+ client: WebSocketClientConnection;
1658
+ /**
1659
+ * The original WebSocket server connection.
1660
+ */
1661
+ server: WebSocketServerConnection;
1662
+ /**
1663
+ * The connection information.
1664
+ */
1665
+ info: {
1666
+ /**
1667
+ * The protocols supported by the WebSocket client.
1668
+ */
1669
+ protocols: string | Array<string> | undefined;
1670
+ };
1671
+ };
1672
+ //#endregion
1673
+ //#region ../../node_modules/msw/lib/core/handlers/WebSocketHandler.d.mts
1674
+ type WebSocketHandlerParsedResult = {
1675
+ match: Match;
1676
+ };
1677
+ type WebSocketHandlerEventMap = {
1678
+ connection: [args: WebSocketHandlerConnection];
1679
+ };
1680
+ interface WebSocketHandlerConnection {
1681
+ client: WebSocketClientConnectionProtocol;
1682
+ server: WebSocketServerConnectionProtocol;
1683
+ info: WebSocketConnectionData['info'];
1684
+ params: PathParams;
1685
+ }
1686
+ interface WebSocketResolutionContext {
1687
+ baseUrl?: string;
1688
+ [kAutoConnect]?: boolean;
1689
+ }
1690
+ declare const kEmitter: unique symbol;
1691
+ declare const kConnect: unique symbol;
1692
+ declare const kAutoConnect: unique symbol;
1693
+ declare class WebSocketHandler {
1694
+ #private;
1695
+ protected readonly url: Path;
1696
+ id: string;
1697
+ callFrame?: string;
1698
+ kind: "websocket";
1699
+ protected [kEmitter]: Emitter<WebSocketHandlerEventMap>;
1700
+ constructor(url: Path);
1701
+ parse(args: {
1702
+ url: string | URL;
1703
+ resolutionContext?: WebSocketResolutionContext;
1704
+ }): WebSocketHandlerParsedResult;
1705
+ predicate(args: {
1706
+ url: string | URL;
1707
+ parsedResult: WebSocketHandlerParsedResult;
1708
+ }): boolean;
1709
+ test(url: string | URL, resolutionContext?: WebSocketResolutionContext & {
1710
+ strict?: boolean;
1711
+ }): boolean;
1712
+ run(connection: WebSocketConnectionData, resolutionContext?: WebSocketResolutionContext): Promise<WebSocketHandlerConnection | null>;
1713
+ protected [kConnect](connection: WebSocketHandlerConnection): boolean;
1714
+ log(connection: WebSocketConnectionData): () => void;
1715
+ }
1716
+ //#endregion
1717
+ //#region ../../node_modules/msw/lib/core/experimental/handlers-controller.d.mts
1718
+ type AnyHandler = RequestHandler | WebSocketHandler;
1719
+ //#endregion
1720
+ //#region ../../node_modules/msw/lib/core/experimental/frames/http-frame.d.mts
1721
+ declare class RequestEvent<DataType extends {
1722
+ requestId: string;
1723
+ request: Request;
1724
+ } = {
1725
+ requestId: string;
1726
+ request: Request;
1727
+ }, ReturnType = void, EventType extends string = string> extends TypedEvent<DataType, ReturnType, EventType> {
1728
+ readonly requestId: string;
1729
+ readonly request: Request;
1730
+ constructor(type: EventType, data: DataType);
1731
+ }
1732
+ declare class ResponseEvent<DataType extends {
1733
+ requestId: string;
1734
+ request: Request;
1735
+ response: Response;
1736
+ } = {
1737
+ requestId: string;
1738
+ request: Request;
1739
+ response: Response;
1740
+ }, ReturnType = void, EventType extends string = string> extends TypedEvent<DataType, ReturnType, EventType> {
1741
+ readonly requestId: string;
1742
+ readonly request: Request;
1743
+ readonly response: Response;
1744
+ constructor(type: EventType, data: DataType);
1745
+ }
1746
+ declare class UnhandledExceptionEvent<DataType extends {
1747
+ error: Error;
1748
+ requestId: string;
1749
+ request: Request;
1750
+ } = {
1751
+ error: Error;
1752
+ requestId: string;
1753
+ request: Request;
1754
+ }, ReturnType = void, EventType extends string = string> extends TypedEvent<DataType, ReturnType, EventType> {
1755
+ readonly error: Error;
1756
+ readonly requestId: string;
1757
+ readonly request: Request;
1758
+ constructor(type: EventType, data: DataType);
1759
+ }
1760
+ type HttpNetworkFrameEventMap = {
1761
+ 'request:start': RequestEvent;
1762
+ 'request:match': RequestEvent;
1763
+ 'request:unhandled': RequestEvent;
1764
+ 'request:end': RequestEvent;
1765
+ 'response:mocked': ResponseEvent;
1766
+ 'response:bypass': ResponseEvent;
1767
+ unhandledException: UnhandledExceptionEvent;
1768
+ };
1769
+ //#endregion
1770
+ //#region ../../node_modules/msw/lib/core/experimental/frames/websocket-frame.d.mts
1771
+ type WebSocketNetworkFrameEventMap = {
1772
+ connection: WebSocketConnectionEvent;
1773
+ unhandledException: UnhandledWebSocketExceptionEvent;
1774
+ };
1775
+ declare class WebSocketConnectionEvent<DataType extends {
1776
+ url: URL;
1777
+ protocols: string | Array<string> | undefined;
1778
+ } = {
1779
+ url: URL;
1780
+ protocols: string | Array<string> | undefined;
1781
+ }, ReturnType = void, EventType extends string = string> extends TypedEvent<DataType, ReturnType, EventType> {
1782
+ readonly url: URL;
1783
+ readonly protocols: string | Array<string> | undefined;
1784
+ constructor(type: EventType, data: DataType);
1785
+ }
1786
+ declare class UnhandledWebSocketExceptionEvent<DataType extends {
1787
+ url: URL;
1788
+ protocols: string | Array<string> | undefined;
1789
+ error: unknown;
1790
+ } = {
1791
+ url: URL;
1792
+ protocols: string | Array<string> | undefined;
1793
+ error: unknown;
1794
+ }, ReturnType = void, EventType extends string = string> extends TypedEvent<DataType, ReturnType, EventType> {
1795
+ readonly url: URL;
1796
+ readonly protocols: string | Array<string> | undefined;
1797
+ readonly error: unknown;
1798
+ constructor(type: EventType, data: DataType);
1799
+ }
1800
+ //#endregion
1801
+ //#region ../../node_modules/msw/lib/core/utils/request/onUnhandledRequest.d.mts
1802
+ interface UnhandledRequestPrint {
1803
+ warning: () => void;
1804
+ error: () => void;
1805
+ }
1806
+ type UnhandledRequestCallback = (request: Request, print: UnhandledRequestPrint) => void;
1807
+ type UnhandledRequestStrategy = 'bypass' | 'warn' | 'error' | UnhandledRequestCallback;
1808
+ //#endregion
1809
+ //#region ../../node_modules/msw/lib/core/sharedOptions.d.mts
1810
+ interface SharedOptions {
1811
+ /**
1812
+ * Specifies how to react to a request that has no corresponding
1813
+ * request handler. Warns on unhandled requests by default.
1814
+ *
1815
+ * @example worker.start({ onUnhandledRequest: 'bypass' })
1816
+ * @example worker.start({ onUnhandledRequest: 'warn' })
1817
+ * @example server.listen({ onUnhandledRequest: 'error' })
1818
+ */
1819
+ onUnhandledRequest?: UnhandledRequestStrategy;
1820
+ }
1821
+ type LifeCycleEventEmitter<EventMap extends DefaultEventMap> = Pick<Emitter$1<EventMap>, 'on' | 'removeListener' | 'removeAllListeners'>;
1822
+ //#endregion
1823
+ //#region ../../node_modules/msw/lib/node/index.d.mts
1824
+ interface ListenOptions extends SharedOptions {}
1825
+ interface SetupServerCommon {
1826
+ /**
1827
+ * Starts the request interception based on the previously provided request handlers.
1828
+ *
1829
+ * @see {@link https://mswjs.io/docs/api/setup-server/listen `server.listen()` API reference}
1830
+ */
1831
+ listen: (options?: PartialDeep<ListenOptions>) => void;
1832
+ /**
1833
+ * Stops the request interception by restoring all augmented modules.
1834
+ *
1835
+ * @see {@link https://mswjs.io/docs/api/setup-server/close `server.close()` API reference}
1836
+ */
1837
+ close: () => void;
1838
+ /**
1839
+ * Prepends given request handlers to the list of existing handlers.
1840
+ *
1841
+ * @see {@link https://mswjs.io/docs/api/setup-server/use `server.use()` API reference}
1842
+ */
1843
+ use: (...handlers: Array<AnyHandler>) => void;
1844
+ /**
1845
+ * Marks all request handlers that respond using `res.once()` as unused.
1846
+ *
1847
+ * @see {@link https://mswjs.io/docs/api/setup-server/restore-handlers `server.restore-handlers()` API reference}
1848
+ */
1849
+ restoreHandlers: () => void;
1850
+ /**
1851
+ * Resets request handlers to the initial list given to the `setupServer` call, or to the explicit next request handlers list, if given.
1852
+ *
1853
+ * @see {@link https://mswjs.io/docs/api/setup-server/reset-handlers `server.reset-handlers()` API reference}
1854
+ */
1855
+ resetHandlers: (...nextHandlers: Array<AnyHandler>) => void;
1856
+ /**
1857
+ * Returns a readonly list of currently active request handlers.
1858
+ *
1859
+ * @see {@link https://mswjs.io/docs/api/setup-server/list-handlers `server.listHandlers()` API reference}
1860
+ */
1861
+ listHandlers: () => ReadonlyArray<AnyHandler>;
1862
+ /**
1863
+ * Life-cycle events.
1864
+ * Life-cycle events allow you to subscribe to the internal library events occurring during the request/response handling.
1865
+ *
1866
+ * @see {@link https://mswjs.io/docs/api/life-cycle-events Life-cycle Events API reference}
1867
+ */
1868
+ events: LifeCycleEventEmitter<HttpNetworkFrameEventMap & WebSocketNetworkFrameEventMap>;
1869
+ }
1870
+ interface SetupServer extends SetupServerCommon {
1871
+ /**
1872
+ * Wraps the given function in a boundary. Any changes to the
1873
+ * network behavior (e.g. adding runtime request handlers via
1874
+ * `server.use()`) will be scoped to this boundary only.
1875
+ * @param callback A function to run (e.g. a test)
1876
+ *
1877
+ * @see {@link https://mswjs.io/docs/api/setup-server/boundary `server.boundary()` API reference}
1878
+ */
1879
+ boundary: <Args extends Array<any>, R>(callback: (...args: Args) => R) => (...args: Args) => R;
1880
+ }
1881
+ //#endregion
1882
+ //#region src/test-utils/http-mocks.d.ts
8
1883
  /**
9
1884
  * Mock responses for API endpoints using factories
10
1885
  */
11
1886
  declare const mockResponses: {
12
- applicationsSuccess: ApplicationReadShortResponse[];
13
- applicationsEmpty: never[];
14
- applicationSuccess: ApplicationReadResponse;
15
- versionDetailsSuccess: VersionReadResponse;
16
- applicationRunsSuccess: RunReadResponse[];
17
- runSuccess: RunReadResponse;
18
- createRunSuccess: RunCreationResponse;
19
- runResultsSuccess: ItemResultReadResponse[];
20
- error: {
21
- error: string;
22
- message: string;
23
- statusCode: number;
24
- };
25
- validationError: {
26
- detail: {
27
- loc: string[];
28
- type: string;
29
- msg: string;
30
- }[];
31
- };
1887
+ applicationsSuccess: ApplicationReadShortResponse[];
1888
+ applicationsEmpty: never[];
1889
+ applicationSuccess: ApplicationReadResponse;
1890
+ versionDetailsSuccess: VersionReadResponse;
1891
+ applicationRunsSuccess: RunReadResponse[];
1892
+ runSuccess: RunReadResponse;
1893
+ createRunSuccess: RunCreationResponse;
1894
+ runResultsSuccess: ItemResultReadResponse[];
1895
+ runItemSuccess: ItemResultReadResponse;
1896
+ customMetadataUpdateSuccess: CustomMetadataUpdateResponse;
1897
+ grantSuccess: GrantReadResponse;
1898
+ grantsSuccess: GrantReadResponse[];
1899
+ shareTokenCreateSuccess: ShareTokenCreateResponse;
1900
+ shareTokenSuccess: ShareTokenReadResponse;
1901
+ shareTokensSuccess: ShareTokenReadResponse[];
1902
+ error: {
1903
+ error: string;
1904
+ message: string;
1905
+ statusCode: number;
1906
+ };
1907
+ validationError: {
1908
+ detail: {
1909
+ loc: string[];
1910
+ type: string;
1911
+ msg: string;
1912
+ }[];
1913
+ };
32
1914
  };
33
1915
  declare const factories: {
34
- applicationShort: Factory<ApplicationReadShortResponse, any, ApplicationReadShortResponse, fishery.DeepPartialObject<ApplicationReadShortResponse>>;
35
- application: Factory<ApplicationReadResponse, any, ApplicationReadResponse, fishery.DeepPartialObject<ApplicationReadResponse>>;
36
- applicationVersion: Factory<ApplicationVersion, any, ApplicationVersion, fishery.DeepPartialObject<ApplicationVersion>>;
37
- versionDetails: Factory<VersionReadResponse, any, VersionReadResponse, fishery.DeepPartialObject<VersionReadResponse>>;
38
- inputArtifact: Factory<InputArtifact, any, InputArtifact, fishery.DeepPartialObject<InputArtifact>>;
39
- outputArtifactSchema: Factory<OutputArtifact, any, OutputArtifact, fishery.DeepPartialObject<OutputArtifact>>;
40
- run: Factory<RunReadResponse, any, RunReadResponse, fishery.DeepPartialObject<RunReadResponse>>;
41
- runCreationResponse: Factory<RunCreationResponse, any, RunCreationResponse, fishery.DeepPartialObject<RunCreationResponse>>;
42
- itemResult: Factory<ItemResultReadResponse, any, ItemResultReadResponse, fishery.DeepPartialObject<ItemResultReadResponse>>;
43
- outputArtifact: Factory<OutputArtifactResultReadResponse, any, OutputArtifactResultReadResponse, fishery.DeepPartialObject<OutputArtifactResultReadResponse>>;
1916
+ applicationShort: Factory<ApplicationReadShortResponse, any, ApplicationReadShortResponse, import("fishery").DeepPartialObject<ApplicationReadShortResponse>>;
1917
+ application: Factory<ApplicationReadResponse, any, ApplicationReadResponse, import("fishery").DeepPartialObject<ApplicationReadResponse>>;
1918
+ applicationVersion: Factory<ApplicationVersion, any, ApplicationVersion, import("fishery").DeepPartialObject<ApplicationVersion>>;
1919
+ versionDetails: Factory<VersionReadResponse, any, VersionReadResponse, import("fishery").DeepPartialObject<VersionReadResponse>>;
1920
+ inputArtifact: Factory<InputArtifact, any, InputArtifact, import("fishery").DeepPartialObject<InputArtifact>>;
1921
+ outputArtifactSchema: Factory<OutputArtifact, any, OutputArtifact, import("fishery").DeepPartialObject<OutputArtifact>>;
1922
+ run: Factory<RunReadResponse, any, RunReadResponse, import("fishery").DeepPartialObject<RunReadResponse>>;
1923
+ runCreationResponse: Factory<RunCreationResponse, any, RunCreationResponse, import("fishery").DeepPartialObject<RunCreationResponse>>;
1924
+ itemResult: Factory<ItemResultReadResponse, any, ItemResultReadResponse, import("fishery").DeepPartialObject<ItemResultReadResponse>>;
1925
+ outputArtifact: Factory<OutputArtifactResultReadResponse, any, OutputArtifactResultReadResponse, import("fishery").DeepPartialObject<OutputArtifactResultReadResponse>>;
1926
+ customMetadataUpdateResponse: Factory<CustomMetadataUpdateResponse, any, CustomMetadataUpdateResponse, import("fishery").DeepPartialObject<CustomMetadataUpdateResponse>>;
1927
+ grant: Factory<GrantReadResponse, any, GrantReadResponse, import("fishery").DeepPartialObject<GrantReadResponse>>;
1928
+ shareTokenCreateResponse: Factory<ShareTokenCreateResponse, any, ShareTokenCreateResponse, import("fishery").DeepPartialObject<ShareTokenCreateResponse>>;
1929
+ shareTokenReadResponse: Factory<ShareTokenReadResponse, any, ShareTokenReadResponse, import("fishery").DeepPartialObject<ShareTokenReadResponse>>;
44
1930
  };
45
1931
  /**
46
1932
  * HTTP request handlers for different scenarios
47
1933
  */
48
- declare const handlers: {
49
- success: msw.HttpHandler[];
50
- empty: msw.HttpHandler[];
51
- notFoundError: msw.HttpHandler[];
52
- validationError: msw.HttpHandler[];
53
- internalServerError: msw.HttpHandler[];
54
- networkError: msw.HttpHandler[];
1934
+ declare const handlers$1: {
1935
+ success: import("msw").HttpHandler[];
1936
+ empty: import("msw").HttpHandler[];
1937
+ notFoundError: import("msw").HttpHandler[];
1938
+ validationError: import("msw").HttpHandler[];
1939
+ internalServerError: import("msw").HttpHandler[];
1940
+ networkError: import("msw").HttpHandler[];
55
1941
  };
56
1942
  /**
57
1943
  * Create a mock server with specific handlers
58
1944
  */
59
- declare function createMockServer(handlerSet?: keyof typeof handlers): msw_node.SetupServerApi;
1945
+ declare function createMockServer(handlerSet?: keyof typeof handlers$1): SetupServer;
60
1946
  /**
61
1947
  * Default mock server for successful responses
62
1948
  */
63
- declare const server: msw_node.SetupServerApi;
1949
+ declare const server: SetupServer;
64
1950
  /**
65
1951
  * Helper function to reset handlers for a specific scenario
66
1952
  */
67
- declare function setMockScenario(scenario: keyof typeof handlers): void;
68
-
69
- export { createMockServer, factories, handlers, mockResponses, server, setMockScenario };
1953
+ declare function setMockScenario(scenario: keyof typeof handlers$1): void;
1954
+ //#endregion
1955
+ export { createMockServer, factories, handlers$1 as handlers, mockResponses, server, setMockScenario };
1956
+ //# sourceMappingURL=http-mocks.d.ts.map