@bemoje/composition 3.0.2 → 3.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.cjs +1 -6
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +1152 -439
- package/lib/index.d.ts +1152 -439
- package/lib/index.js +1 -6
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
package/lib/index.d.cts
CHANGED
|
@@ -14,20 +14,138 @@ interface IView<T extends object> {
|
|
|
14
14
|
readonly target: T;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
/**
|
|
18
|
+
Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
|
|
19
|
+
|
|
20
|
+
@category Type
|
|
21
|
+
*/
|
|
22
|
+
type Primitive =
|
|
23
|
+
| null
|
|
24
|
+
| undefined
|
|
25
|
+
| string
|
|
26
|
+
| number
|
|
27
|
+
| boolean
|
|
28
|
+
| symbol
|
|
29
|
+
| bigint;
|
|
30
|
+
|
|
17
31
|
/**
|
|
18
32
|
Matches a [`class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes).
|
|
19
33
|
|
|
20
34
|
@category Class
|
|
21
35
|
*/
|
|
22
|
-
type Class<T, Arguments extends unknown[] = any[]> = {
|
|
36
|
+
type Class<T, Arguments extends readonly unknown[] = any[]> = {
|
|
23
37
|
prototype: Pick<T, keyof T>;
|
|
24
38
|
new(...arguments_: Arguments): T;
|
|
25
39
|
};
|
|
26
40
|
|
|
41
|
+
/**
|
|
42
|
+
Create a union of all keys from a given type, even those exclusive to specific union members.
|
|
43
|
+
|
|
44
|
+
Unlike the native `keyof` keyword, which returns keys present in **all** union members, this type returns keys from **any** member.
|
|
45
|
+
|
|
46
|
+
@see https://stackoverflow.com/a/49402091
|
|
47
|
+
|
|
48
|
+
@example
|
|
49
|
+
```
|
|
50
|
+
import type {KeysOfUnion} from 'type-fest';
|
|
51
|
+
|
|
52
|
+
type A = {
|
|
53
|
+
common: string;
|
|
54
|
+
a: number;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
type B = {
|
|
58
|
+
common: string;
|
|
59
|
+
b: string;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
type C = {
|
|
63
|
+
common: string;
|
|
64
|
+
c: boolean;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
type Union = A | B | C;
|
|
68
|
+
|
|
69
|
+
type CommonKeys = keyof Union;
|
|
70
|
+
//=> 'common'
|
|
71
|
+
|
|
72
|
+
type AllKeys = KeysOfUnion<Union>;
|
|
73
|
+
//=> 'common' | 'a' | 'b' | 'c'
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
@category Object
|
|
77
|
+
*/
|
|
78
|
+
type KeysOfUnion<ObjectType> =
|
|
79
|
+
// Adds no keys, since these are the keys all members share, but it lets the compiler accept a key narrowed with `keyof` when `ObjectType` is generic, such as a conditional type that is not resolved yet.
|
|
80
|
+
| keyof ObjectType
|
|
81
|
+
// Infer a union of each member's keys from function return types.
|
|
82
|
+
// This avoids the record intersections and extra `& Union` that `UnionToIntersection` would create.
|
|
83
|
+
// The outer conditional prevents unresolved generic union keys from being treated as safe to index every member.
|
|
84
|
+
| ((ObjectType extends unknown ? () => keyof ObjectType : never) extends (() => infer Keys extends PropertyKey)
|
|
85
|
+
? Keys
|
|
86
|
+
: never);
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
Returns a boolean for whether the given type is `never`.
|
|
90
|
+
|
|
91
|
+
@see https://github.com/microsoft/TypeScript/issues/31751#issuecomment-498526919
|
|
92
|
+
@see https://stackoverflow.com/a/53984913/10292952
|
|
93
|
+
@see https://www.zhenghao.io/posts/ts-never
|
|
94
|
+
|
|
95
|
+
Useful in type utilities, such as checking if something does not occur.
|
|
96
|
+
|
|
97
|
+
@example
|
|
98
|
+
```
|
|
99
|
+
import type {IsNever, And} from 'type-fest';
|
|
100
|
+
|
|
101
|
+
type A = IsNever<never>;
|
|
102
|
+
//=> true
|
|
103
|
+
|
|
104
|
+
type B = IsNever<any>;
|
|
105
|
+
//=> false
|
|
106
|
+
|
|
107
|
+
type C = IsNever<unknown>;
|
|
108
|
+
//=> false
|
|
109
|
+
|
|
110
|
+
type D = IsNever<never[]>;
|
|
111
|
+
//=> false
|
|
112
|
+
|
|
113
|
+
type E = IsNever<object>;
|
|
114
|
+
//=> false
|
|
115
|
+
|
|
116
|
+
type F = IsNever<string>;
|
|
117
|
+
//=> false
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
@example
|
|
121
|
+
```
|
|
122
|
+
import type {IsNever} from 'type-fest';
|
|
123
|
+
|
|
124
|
+
type IsTrue<T> = T extends true ? true : false;
|
|
125
|
+
|
|
126
|
+
// When a distributive conditional is instantiated with `never`, the entire conditional results in `never`.
|
|
127
|
+
type A = IsTrue<never>;
|
|
128
|
+
//=> never
|
|
129
|
+
|
|
130
|
+
// If you don't want that behaviour, you can explicitly add an `IsNever` check before the distributive conditional.
|
|
131
|
+
type IsTrueFixed<T> =
|
|
132
|
+
IsNever<T> extends true ? false : T extends true ? true : false;
|
|
133
|
+
|
|
134
|
+
type B = IsTrueFixed<never>;
|
|
135
|
+
//=> false
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
@category Type Guard
|
|
139
|
+
@category Utilities
|
|
140
|
+
*/
|
|
141
|
+
type IsNever<T> = [T] extends [never] ? true : false;
|
|
142
|
+
|
|
27
143
|
/**
|
|
28
144
|
Returns a boolean for whether the given type is `any`.
|
|
29
145
|
|
|
30
|
-
|
|
146
|
+
Returns `false` for `never` and `unknown`. Unions are normalized before the check.
|
|
147
|
+
|
|
148
|
+
@see https://stackoverflow.com/a/49928360/1490091
|
|
31
149
|
|
|
32
150
|
Useful in type utilities, such as disallowing `any`s to be passed to a function.
|
|
33
151
|
|
|
@@ -54,186 +172,206 @@ const anyA = get(anyObject, 'a');
|
|
|
54
172
|
*/
|
|
55
173
|
type IsAny<T> = 0 extends 1 & NoInfer<T> ? true : false;
|
|
56
174
|
|
|
175
|
+
declare const tag: unique symbol;
|
|
176
|
+
|
|
57
177
|
/**
|
|
58
|
-
Returns
|
|
178
|
+
Returns an arbitrary member of a union type.
|
|
59
179
|
|
|
60
|
-
|
|
180
|
+
Use-cases:
|
|
181
|
+
- Implementing recursive type functions that accept a union type.
|
|
61
182
|
|
|
62
183
|
@example
|
|
63
184
|
```
|
|
64
|
-
import type {
|
|
185
|
+
import type {UnionMember, IsNever} from 'type-fest';
|
|
65
186
|
|
|
66
|
-
type
|
|
67
|
-
|
|
68
|
-
|
|
187
|
+
type UnionLength<T, Acc extends any[] = []> =
|
|
188
|
+
UnionMember<T> extends infer Member
|
|
189
|
+
? IsNever<Member> extends false
|
|
190
|
+
? UnionLength<Exclude<T, Member>, [...Acc, Member]>
|
|
191
|
+
: Acc['length']
|
|
192
|
+
: never;
|
|
69
193
|
|
|
70
|
-
|
|
71
|
-
|
|
194
|
+
type T1 = UnionLength<'foo' | 'bar' | 'baz'>;
|
|
195
|
+
//=> 3
|
|
72
196
|
|
|
73
|
-
type
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
197
|
+
type T2 = UnionLength<{a: string}>;
|
|
198
|
+
//=> 1
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
- Picking an arbitrary member from a union
|
|
202
|
+
|
|
203
|
+
@example
|
|
204
|
+
```
|
|
205
|
+
import type {UnionMember, Primitive, LiteralToPrimitive} from 'type-fest';
|
|
206
|
+
|
|
207
|
+
type IsHomogenous<T extends Primitive> = [T] extends [LiteralToPrimitive<UnionMember<T>>] ? true : false;
|
|
208
|
+
|
|
209
|
+
type T1 = IsHomogenous<1 | 2 | 3 | 4>;
|
|
210
|
+
//=> true
|
|
77
211
|
|
|
78
|
-
type
|
|
212
|
+
type T2 = IsHomogenous<'foo' | 'bar'>;
|
|
79
213
|
//=> true
|
|
80
214
|
|
|
81
|
-
type
|
|
215
|
+
type T3 = IsHomogenous<'foo' | 'bar' | 1>;
|
|
82
216
|
//=> false
|
|
217
|
+
```
|
|
83
218
|
|
|
84
|
-
|
|
85
|
-
//=> boolean
|
|
219
|
+
Returns `never` when the input is `never`.
|
|
86
220
|
|
|
87
|
-
|
|
88
|
-
|
|
221
|
+
@example
|
|
222
|
+
```
|
|
223
|
+
import type {UnionMember} from 'type-fest';
|
|
89
224
|
|
|
90
|
-
type
|
|
91
|
-
//=>
|
|
225
|
+
type LastNever = UnionMember<never>;
|
|
226
|
+
//=> never
|
|
92
227
|
```
|
|
93
228
|
|
|
94
|
-
@category Type
|
|
95
|
-
@category Utilities
|
|
229
|
+
@category Type
|
|
96
230
|
*/
|
|
97
|
-
type
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
231
|
+
type UnionMember<T> =
|
|
232
|
+
IsNever<T> extends true
|
|
233
|
+
? never
|
|
234
|
+
// This infers the intersection itself instead of using `UnionToIntersection`, whose `& Union` makes TypeScript distribute the intersection over every member, which is slow for large unions and for types like `Tagged` that call this in a loop.
|
|
235
|
+
: (T extends any ? (member: () => T) => void : never) extends (member: infer Intersection) => void
|
|
236
|
+
? Intersection extends () => (infer R)
|
|
237
|
+
? R
|
|
238
|
+
: never
|
|
239
|
+
: never;
|
|
240
|
+
|
|
241
|
+
// For `@link`
|
|
242
|
+
|
|
243
|
+
// Declaration emit cannot name the `tag` symbol unless the user's file imports it. So exporting a value whose inferred type contains the `[tag]` key directly (for example, after spreading a tagged object) fails with TS4023: https://github.com/microsoft/TypeScript/issues/64812
|
|
244
|
+
// eslint-disable-next-line type-fest/require-exported-types
|
|
245
|
+
type TagContainer<Token> = {
|
|
246
|
+
readonly [tag]: Token;
|
|
247
|
+
};
|
|
104
248
|
|
|
105
249
|
/**
|
|
106
|
-
|
|
250
|
+
The tag part of a {@link Tagged} type, without the underlying type.
|
|
251
|
+
|
|
252
|
+
`Tagged<Type, TagName, TagMetadata>` is `Type & Tag<TagName, TagMetadata>`. Use `Tagged` to create tagged types. Use `Tag` to accept any type that has a given tag, whatever its underlying type is.
|
|
107
253
|
|
|
108
|
-
|
|
254
|
+
TypeScript can also show a tagged type as an intersection with `Tag`, for example in emitted declaration files. This is why `Tag` is exported.
|
|
109
255
|
|
|
110
256
|
@example
|
|
111
257
|
```
|
|
112
|
-
import type {
|
|
113
|
-
|
|
114
|
-
type User = {
|
|
115
|
-
name: string;
|
|
116
|
-
surname: string;
|
|
258
|
+
import type {Tag, Tagged} from 'type-fest';
|
|
117
259
|
|
|
118
|
-
|
|
119
|
-
|
|
260
|
+
type Url = Tagged<string, 'URL'>;
|
|
261
|
+
type UrlObject = Tagged<URL, 'URL'>;
|
|
120
262
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
[Key in OptionalKeysOf<Entity>]?: Entity[Key] | typeof REMOVE_FIELD;
|
|
124
|
-
};
|
|
263
|
+
// Accepts any type that has the `URL` tag, with any metadata.
|
|
264
|
+
declare function fetchUrl(url: Tag<'URL', unknown>): void;
|
|
125
265
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
};
|
|
266
|
+
fetchUrl('https://example.com' as Url);
|
|
267
|
+
fetchUrl(new URL('https://example.com') as UrlObject);
|
|
129
268
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
luckyNumber: REMOVE_FIELD,
|
|
133
|
-
};
|
|
269
|
+
// @ts-expect-error
|
|
270
|
+
fetchUrl('https://example.com');
|
|
134
271
|
```
|
|
135
272
|
|
|
136
|
-
@category
|
|
273
|
+
@category Type
|
|
137
274
|
*/
|
|
138
|
-
type
|
|
139
|
-
|
|
140
|
-
? (keyof {[Key in keyof Type as
|
|
141
|
-
IsOptionalKeyOf<Type, Key> extends false
|
|
142
|
-
? never
|
|
143
|
-
: Key
|
|
144
|
-
]: never
|
|
145
|
-
}) & keyof Type // Intersect with `keyof Type` to ensure result of `OptionalKeysOf<Type>` is always assignable to `keyof Type`
|
|
146
|
-
: never; // Should never happen
|
|
275
|
+
// Exported so that declaration emit can name it. TypeScript can reduce a `Tagged` type to `Type & Tag<…>` (for example, `Tagged<T, 'A'> & T`), and package `exports` hide this file, so a user's exported value with that type would otherwise fail with TS4023: https://github.com/sindresorhus/type-fest/pull/1243
|
|
276
|
+
type Tag<TagName extends PropertyKey, TagMetadata> = TagContainer<{[Key in TagName]: TagMetadata}>;
|
|
147
277
|
|
|
148
278
|
/**
|
|
149
|
-
|
|
279
|
+
Get the untagged portion of a tagged type created with `Tagged`.
|
|
150
280
|
|
|
151
|
-
|
|
281
|
+
For nested tags, keep each tag’s metadata in one layer and add one distinct tag name per layer. Reusing a name with different metadata, or nesting multiple layers that each add several names, is not supported.
|
|
282
|
+
|
|
283
|
+
Why is this necessary?
|
|
284
|
+
|
|
285
|
+
1. Use a `Tagged` type as object keys
|
|
286
|
+
2. Prevent TS4058 error: "Return type of exported function has or is using name X from external module Y but cannot be named"
|
|
152
287
|
|
|
153
288
|
@example
|
|
154
289
|
```
|
|
155
|
-
import type {
|
|
290
|
+
import type {Tagged, UnwrapTagged} from 'type-fest';
|
|
156
291
|
|
|
157
|
-
|
|
158
|
-
Entity extends object,
|
|
159
|
-
Key extends RequiredKeysOf<Entity> = RequiredKeysOf<Entity>,
|
|
160
|
-
>(field: Key, validator: (value: Entity[Key]) => boolean): (entity: Entity) => boolean;
|
|
292
|
+
type AccountType = Tagged<'SAVINGS' | 'CHECKING', 'AccountType'>;
|
|
161
293
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
luckyNumber?: number;
|
|
294
|
+
const moneyByAccountType: Record<UnwrapTagged<AccountType>, number> = {
|
|
295
|
+
SAVINGS: 99,
|
|
296
|
+
CHECKING: 0.1,
|
|
166
297
|
};
|
|
167
298
|
|
|
168
|
-
|
|
169
|
-
const
|
|
299
|
+
// Without UnwrapTagged, the following expression would throw a type error.
|
|
300
|
+
const money = moneyByAccountType.SAVINGS; // TS error: Property 'SAVINGS' does not exist
|
|
170
301
|
|
|
302
|
+
// Attempting to pass a non-Tagged type to UnwrapTagged will raise a type error.
|
|
171
303
|
// @ts-expect-error
|
|
172
|
-
|
|
173
|
-
// Error: Argument of type '"luckyNumber"' is not assignable to parameter of type '"name" | "surname"'.
|
|
304
|
+
type WontWork = UnwrapTagged<string>;
|
|
174
305
|
```
|
|
175
306
|
|
|
176
|
-
@
|
|
177
|
-
|
|
178
|
-
type
|
|
179
|
-
Type extends unknown // For distributing `Type`
|
|
180
|
-
? Exclude<keyof Type, OptionalKeysOf<Type>>
|
|
181
|
-
: never; // Should never happen
|
|
307
|
+
@example
|
|
308
|
+
```
|
|
309
|
+
import type {Tagged, UnwrapTagged} from 'type-fest';
|
|
182
310
|
|
|
183
|
-
|
|
184
|
-
|
|
311
|
+
// Keep a tag’s metadata in one layer.
|
|
312
|
+
type CheckedUserId = Tagged<string, 'Checked', {parsed: true; validated: true}>;
|
|
185
313
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
@link https://www.zhenghao.io/posts/ts-never
|
|
314
|
+
type UserId = UnwrapTagged<CheckedUserId>;
|
|
315
|
+
//=> string
|
|
189
316
|
|
|
190
|
-
|
|
317
|
+
// Use a distinct tag name for another stage.
|
|
318
|
+
type StoredUserId = Tagged<CheckedUserId, 'Stored', {table: 'users'}>;
|
|
191
319
|
|
|
192
|
-
|
|
320
|
+
type StoredUserIdValue = UnwrapTagged<StoredUserId>;
|
|
321
|
+
//=> string
|
|
193
322
|
```
|
|
194
|
-
import type {IsNever, And} from 'type-fest';
|
|
195
323
|
|
|
196
|
-
|
|
197
|
-
|
|
324
|
+
@category Type
|
|
325
|
+
*/
|
|
326
|
+
// The constraint accepts a bare `TagContainer` too, so that the deprecated `Opaque` form, which tags with a token rather than a keyed object, can be unwrapped as well.
|
|
327
|
+
type UnwrapTagged<TaggedType extends TagContainer<any>> =
|
|
328
|
+
RemoveAllTags<TaggedType>;
|
|
198
329
|
|
|
199
|
-
type
|
|
200
|
-
|
|
330
|
+
type RemoveAllTags<T> = T extends TagContainer<any>
|
|
331
|
+
// Every order of removing the tags ends at the same type, so following only one of them avoids branching recursively over every removal order.
|
|
332
|
+
? RemoveAllTags<UnionMember<RemoveTag<T>>>
|
|
333
|
+
: T;
|
|
201
334
|
|
|
202
|
-
|
|
203
|
-
|
|
335
|
+
/**
|
|
336
|
+
Removes a single tag from `T`, returning every possible result.
|
|
204
337
|
|
|
205
|
-
|
|
206
|
-
|
|
338
|
+
A tag can be applied one tag-name at a time (each application contributes its own layer to the intersection) or as a union of tag names in a single application (one layer holding a multi-key tag object). Because the intersection is only stripped when a layer matches a target tag object exactly, both shapes are peeled here, and only strictly smaller results are kept so that the recursion always makes progress and terminates.
|
|
339
|
+
*/
|
|
340
|
+
type RemoveTag<T extends TagContainer<unknown>> =
|
|
341
|
+
| {
|
|
342
|
+
[ThisTag in keyof T[typeof tag]]: T extends infer Underlying & Tag<ThisTag, T[typeof tag][ThisTag]>
|
|
343
|
+
? [Underlying] extends [T] ? never : Underlying
|
|
344
|
+
: never
|
|
345
|
+
}[keyof T[typeof tag]]
|
|
346
|
+
| (T extends infer Underlying & TagContainer<T[typeof tag]>
|
|
347
|
+
? [Underlying] extends [T] ? never : Underlying
|
|
348
|
+
: never);
|
|
207
349
|
|
|
208
|
-
|
|
209
|
-
|
|
350
|
+
/**
|
|
351
|
+
Represents an array with `unknown` value.
|
|
210
352
|
|
|
211
|
-
type
|
|
212
|
-
//=> false
|
|
213
|
-
```
|
|
353
|
+
Use case: You want a type that all arrays can be assigned to, but you don't care about the value.
|
|
214
354
|
|
|
215
355
|
@example
|
|
216
356
|
```
|
|
217
|
-
import type {
|
|
357
|
+
import type {UnknownArray} from 'type-fest';
|
|
218
358
|
|
|
219
|
-
type
|
|
359
|
+
type IsArray<T> = T extends UnknownArray ? true : false;
|
|
220
360
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
//=> never
|
|
361
|
+
type A = IsArray<['foo']>;
|
|
362
|
+
//=> true
|
|
224
363
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
IsNever<T> extends true ? false : T extends true ? true : false;
|
|
364
|
+
type B = IsArray<readonly number[]>;
|
|
365
|
+
//=> true
|
|
228
366
|
|
|
229
|
-
type
|
|
367
|
+
type C = IsArray<string>;
|
|
230
368
|
//=> false
|
|
231
369
|
```
|
|
232
370
|
|
|
233
|
-
@category Type
|
|
234
|
-
@category
|
|
371
|
+
@category Type
|
|
372
|
+
@category Array
|
|
235
373
|
*/
|
|
236
|
-
type
|
|
374
|
+
type UnknownArray = readonly unknown[];
|
|
237
375
|
|
|
238
376
|
/**
|
|
239
377
|
An if-else-like type that resolves depending on whether the given `boolean` type is `true` or `false`.
|
|
@@ -335,143 +473,140 @@ type If<Type extends boolean, IfBranch, ElseBranch> =
|
|
|
335
473
|
: ElseBranch;
|
|
336
474
|
|
|
337
475
|
/**
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
@example
|
|
341
|
-
```
|
|
342
|
-
import type {Simplify} from 'type-fest';
|
|
343
|
-
|
|
344
|
-
type PositionProps = {
|
|
345
|
-
top: number;
|
|
346
|
-
left: number;
|
|
347
|
-
};
|
|
348
|
-
|
|
349
|
-
type SizeProps = {
|
|
350
|
-
width: number;
|
|
351
|
-
height: number;
|
|
352
|
-
};
|
|
476
|
+
Returns the canonical numeric spelling of the mapped `Key` when the selector `Keys` names it, or `never`.
|
|
353
477
|
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
478
|
+
A mapped type hands tuple elements over under their string form, so `'0'` must match a selector of `0`. Other numeric-looking names, such as `'01'`, stay distinct.
|
|
479
|
+
*/
|
|
480
|
+
type SelectedKeyAlias<Keys, Key> = MatchingKey<Record<Keys & PropertyKey, never>, Extract<Key, number | `${number}`>>;
|
|
357
481
|
|
|
358
|
-
|
|
482
|
+
/**
|
|
483
|
+
Returns the keys of `Type` that the given `Keys` select.
|
|
359
484
|
|
|
360
|
-
|
|
485
|
+
A string enum member also selects the declared key with its value's name. A numeric enum member selects the declared key with its value, but not a `number` index signature. It is matched by its value, because `number` is assignable to a numeric enum.
|
|
361
486
|
|
|
362
487
|
@example
|
|
363
488
|
```
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
foo: number;
|
|
368
|
-
bar?: string;
|
|
369
|
-
baz: number | undefined;
|
|
489
|
+
enum Index {
|
|
490
|
+
Zero,
|
|
491
|
+
One,
|
|
370
492
|
}
|
|
371
493
|
|
|
372
|
-
type
|
|
373
|
-
|
|
374
|
-
bar?: string;
|
|
375
|
-
baz: number | undefined;
|
|
376
|
-
};
|
|
377
|
-
|
|
378
|
-
const literal = {foo: 123, bar: 'hello', baz: 456};
|
|
379
|
-
const someType: SomeType = literal;
|
|
380
|
-
const someInterface: SomeInterface = literal;
|
|
381
|
-
|
|
382
|
-
declare function fn(object: Record<string, unknown>): void;
|
|
383
|
-
|
|
384
|
-
fn(literal); // Good: literal object type is sealed
|
|
385
|
-
fn(someType); // Good: type is sealed
|
|
386
|
-
// @ts-expect-error
|
|
387
|
-
fn(someInterface); // Error: Index signature for type 'string' is missing in type 'someInterface'. Because `interface` can be re-opened
|
|
388
|
-
fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface` into a `type`
|
|
494
|
+
type Keys = SelectedKeys<{[key: number]: string; 0: string; 1: string}, Index.One>;
|
|
495
|
+
//=> 1
|
|
389
496
|
```
|
|
390
|
-
|
|
391
|
-
@link https://github.com/microsoft/TypeScript/issues/15300
|
|
392
|
-
@see {@link SimplifyDeep}
|
|
393
|
-
@category Object
|
|
394
497
|
*/
|
|
395
|
-
type
|
|
498
|
+
type SelectedKeys<Type, Keys> =
|
|
499
|
+
| (KeySelector<Keys> & keyof Type)
|
|
500
|
+
// A numeric enum key and its value do not intersect, so declared numeric keys are also matched by their value. The values are compared instead of the enum members, because `number` is assignable to a numeric enum.
|
|
501
|
+
// The `keyof Type` filter is on the `Type` side, because nesting it around the `Keys` side makes type-checking run out of memory when `Keys` is an unresolved generic.
|
|
502
|
+
| Extract<KeySelector<Keys>, Extract<KeySelector<keyof Type & number>, keyof Type>>;
|
|
396
503
|
|
|
397
504
|
/**
|
|
398
|
-
|
|
505
|
+
Replaces a numeric enum member with its value, and adds the value's name of a string enum member.
|
|
506
|
+
*/
|
|
507
|
+
type KeySelector<Key> =
|
|
508
|
+
Key extends unknown // To distribute `Key`
|
|
509
|
+
// A wide key, such as `number` or `string & {}`, is kept as is.
|
|
510
|
+
? {} extends Record<Key & PropertyKey, never>
|
|
511
|
+
? Key
|
|
512
|
+
: Key extends number
|
|
513
|
+
? `${Key}` extends `${infer Value extends number}` ? Value : Key
|
|
514
|
+
: Key | KeyToString<Key & string>
|
|
515
|
+
: never;
|
|
516
|
+
|
|
517
|
+
// For `@link`
|
|
399
518
|
|
|
400
|
-
|
|
401
|
-
|
|
519
|
+
/**
|
|
520
|
+
Pick only index signatures from the given object type, leaving out all explicitly defined properties.
|
|
402
521
|
|
|
403
|
-
|
|
404
|
-
- If you want to make a conditional branch based on the result of a comparison of two types.
|
|
522
|
+
This is the counterpart of `OmitIndexSignature`.
|
|
405
523
|
|
|
406
524
|
@example
|
|
407
525
|
```
|
|
408
|
-
import type {
|
|
409
|
-
|
|
410
|
-
// This type returns a boolean for whether the given array includes the given item.
|
|
411
|
-
// `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
|
|
412
|
-
type Includes<Value extends readonly any[], Item> =
|
|
413
|
-
Value extends readonly [Value[0], ...infer rest]
|
|
414
|
-
? IsEqual<Value[0], Item> extends true
|
|
415
|
-
? true
|
|
416
|
-
: Includes<rest, Item>
|
|
417
|
-
: false;
|
|
418
|
-
```
|
|
526
|
+
import type {PickIndexSignature} from 'type-fest';
|
|
419
527
|
|
|
420
|
-
|
|
421
|
-
@category Utilities
|
|
422
|
-
*/
|
|
423
|
-
type IsEqual<A, B> =
|
|
424
|
-
[A] extends [B]
|
|
425
|
-
? [B] extends [A]
|
|
426
|
-
? _IsEqual<A, B>
|
|
427
|
-
: false
|
|
428
|
-
: false;
|
|
429
|
-
|
|
430
|
-
// This version fails the `equalWrappedTupleIntersectionToBeNeverAndNeverExpanded` test in `test-d/is-equal.ts`.
|
|
431
|
-
type _IsEqual<A, B> =
|
|
432
|
-
(<G>() => G extends A & G | G ? 1 : 2) extends
|
|
433
|
-
(<G>() => G extends B & G | G ? 1 : 2)
|
|
434
|
-
? true
|
|
435
|
-
: false;
|
|
528
|
+
declare const symbolKey: unique symbol;
|
|
436
529
|
|
|
437
|
-
|
|
438
|
-
|
|
530
|
+
type Example = {
|
|
531
|
+
// These index signatures will remain.
|
|
532
|
+
[x: string]: unknown;
|
|
533
|
+
[x: number]: unknown;
|
|
534
|
+
[x: symbol]: unknown;
|
|
535
|
+
[x: `head-${string}`]: string;
|
|
536
|
+
[x: `${string}-tail`]: string;
|
|
537
|
+
[x: `head-${string}-tail`]: string;
|
|
538
|
+
[x: `${bigint}`]: string;
|
|
539
|
+
[x: `embedded-${number}`]: string;
|
|
439
540
|
|
|
440
|
-
|
|
541
|
+
// These explicitly defined keys will be removed.
|
|
542
|
+
['kebab-case-key']: string;
|
|
543
|
+
[symbolKey]: string;
|
|
544
|
+
foo: 'bar';
|
|
545
|
+
qux?: 'baz';
|
|
546
|
+
};
|
|
547
|
+
|
|
548
|
+
type ExampleIndexSignature = PickIndexSignature<Example>;
|
|
549
|
+
// {
|
|
550
|
+
// [x: string]: unknown;
|
|
551
|
+
// [x: number]: unknown;
|
|
552
|
+
// [x: symbol]: unknown;
|
|
553
|
+
// [x: `head-${string}`]: string;
|
|
554
|
+
// [x: `${string}-tail`]: string;
|
|
555
|
+
// [x: `head-${string}-tail`]: string;
|
|
556
|
+
// [x: `${bigint}`]: string;
|
|
557
|
+
// [x: `embedded-${number}`]: string;
|
|
558
|
+
// }
|
|
559
|
+
```
|
|
560
|
+
|
|
561
|
+
@see {@link OmitIndexSignature}
|
|
562
|
+
@category Object
|
|
563
|
+
*/
|
|
564
|
+
type PickIndexSignature<ObjectType> = {
|
|
565
|
+
[KeyType in keyof ObjectType as {} extends Record<KeyType, never>
|
|
566
|
+
? KeyType
|
|
567
|
+
: never]: ObjectType[KeyType];
|
|
568
|
+
};
|
|
569
|
+
|
|
570
|
+
// For `@link`
|
|
571
|
+
|
|
572
|
+
/**
|
|
573
|
+
Omit any index signatures from the given object type, leaving only explicitly defined properties.
|
|
574
|
+
|
|
575
|
+
This is the counterpart of `PickIndexSignature`.
|
|
441
576
|
|
|
442
577
|
Use-cases:
|
|
443
578
|
- Remove overly permissive signatures from third-party types.
|
|
444
579
|
|
|
445
580
|
This type was taken from this [StackOverflow answer](https://stackoverflow.com/a/68261113/420747).
|
|
446
581
|
|
|
447
|
-
It relies on the fact that an empty object (`{}`) is assignable to an object with just an index signature, like `Record<string,
|
|
582
|
+
It relies on the fact that an empty object (`{}`) is assignable to an object with just an index signature, like `Record<string, never>`, but not to an object with explicitly defined keys, like `Record<'foo' | 'bar', never>`.
|
|
448
583
|
|
|
449
|
-
|
|
584
|
+
The `never` value type prevents inherited `Object.prototype` members, such as `toString`, from satisfying an explicitly defined key.
|
|
450
585
|
|
|
451
586
|
```
|
|
452
|
-
const indexed: Record<string,
|
|
587
|
+
const indexed: Record<string, never> = {}; // Allowed
|
|
453
588
|
|
|
454
589
|
// @ts-expect-error
|
|
455
|
-
const keyed: Record<'foo',
|
|
456
|
-
// TS2739: Type '{}' is missing the following properties from type 'Record<"foo" | "bar",
|
|
590
|
+
const keyed: Record<'foo' | 'bar', never> = {}; // Error
|
|
591
|
+
// TS2739: Type '{}' is missing the following properties from type 'Record<"foo" | "bar", never>': foo, bar
|
|
457
592
|
```
|
|
458
593
|
|
|
459
594
|
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:
|
|
460
595
|
|
|
461
596
|
```
|
|
462
|
-
type Indexed = {} extends Record<string,
|
|
463
|
-
? '✅ `{}` is assignable to `Record<string,
|
|
464
|
-
: '❌ `{}` is NOT assignable to `Record<string,
|
|
597
|
+
type Indexed = {} extends Record<string, never>
|
|
598
|
+
? '✅ `{}` is assignable to `Record<string, never>`'
|
|
599
|
+
: '❌ `{}` is NOT assignable to `Record<string, never>`';
|
|
465
600
|
|
|
466
601
|
type IndexedResult = Indexed;
|
|
467
|
-
//=> '✅ `{}` is assignable to `Record<string,
|
|
602
|
+
//=> '✅ `{}` is assignable to `Record<string, never>`'
|
|
468
603
|
|
|
469
|
-
type Keyed = {} extends Record<'foo' | 'bar',
|
|
470
|
-
? '✅ `{}` is assignable to `Record<\'foo\' | \'bar\',
|
|
471
|
-
: '❌ `{}` is NOT assignable to `Record<\'foo\' | \'bar\',
|
|
604
|
+
type Keyed = {} extends Record<'foo' | 'bar', never>
|
|
605
|
+
? '✅ `{}` is assignable to `Record<\'foo\' | \'bar\', never>`'
|
|
606
|
+
: '❌ `{}` is NOT assignable to `Record<\'foo\' | \'bar\', never>`';
|
|
472
607
|
|
|
473
608
|
type KeyedResult = Keyed;
|
|
474
|
-
//=> '❌ `{}` is NOT assignable to `Record<\'foo\' | \'bar\',
|
|
609
|
+
//=> '❌ `{}` is NOT assignable to `Record<\'foo\' | \'bar\', never>`'
|
|
475
610
|
```
|
|
476
611
|
|
|
477
612
|
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`...
|
|
@@ -481,251 +616,699 @@ type OmitIndexSignature<ObjectType> = {
|
|
|
481
616
|
[KeyType in keyof ObjectType // Map each key of `ObjectType`...
|
|
482
617
|
]: ObjectType[KeyType]; // ...to its original value, i.e. `OmitIndexSignature<Foo> == Foo`.
|
|
483
618
|
};
|
|
484
|
-
```
|
|
485
|
-
|
|
486
|
-
...whether an empty object (`{}`) would be assignable to an object with that `KeyType` (`Record<KeyType,
|
|
619
|
+
```
|
|
620
|
+
|
|
621
|
+
...whether an empty object (`{}`) would be assignable to an object with that `KeyType` (`Record<KeyType, never>`)...
|
|
622
|
+
|
|
623
|
+
```
|
|
624
|
+
type OmitIndexSignature<ObjectType> = {
|
|
625
|
+
[KeyType in keyof ObjectType
|
|
626
|
+
// Is `{}` assignable to `Record<KeyType, never>`?
|
|
627
|
+
as {} extends Record<KeyType, never>
|
|
628
|
+
? never // ✅ `{}` is assignable to `Record<KeyType, never>`
|
|
629
|
+
: KeyType // ❌ `{}` is NOT assignable to `Record<KeyType, never>`
|
|
630
|
+
]: ObjectType[KeyType];
|
|
631
|
+
};
|
|
632
|
+
```
|
|
633
|
+
|
|
634
|
+
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.
|
|
635
|
+
|
|
636
|
+
@example
|
|
637
|
+
```
|
|
638
|
+
import type {OmitIndexSignature} from 'type-fest';
|
|
639
|
+
|
|
640
|
+
type Example = {
|
|
641
|
+
// These index signatures will be removed.
|
|
642
|
+
[x: string]: any;
|
|
643
|
+
[x: number]: any;
|
|
644
|
+
[x: symbol]: any;
|
|
645
|
+
[x: `head-${string}`]: string;
|
|
646
|
+
[x: `${string}-tail`]: string;
|
|
647
|
+
[x: `head-${string}-tail`]: string;
|
|
648
|
+
[x: `${bigint}`]: string;
|
|
649
|
+
[x: `embedded-${number}`]: string;
|
|
650
|
+
|
|
651
|
+
// These explicitly defined keys will remain.
|
|
652
|
+
foo: 'bar';
|
|
653
|
+
qux?: 'baz';
|
|
654
|
+
};
|
|
655
|
+
|
|
656
|
+
type ExampleWithoutIndexSignatures = OmitIndexSignature<Example>;
|
|
657
|
+
//=> {foo: 'bar'; qux?: 'baz'}
|
|
658
|
+
```
|
|
659
|
+
|
|
660
|
+
@see {@link PickIndexSignature}
|
|
661
|
+
@category Object
|
|
662
|
+
*/
|
|
663
|
+
type OmitIndexSignature<ObjectType> = {
|
|
664
|
+
[KeyType in keyof ObjectType as {} extends Record<KeyType, never>
|
|
665
|
+
? never
|
|
666
|
+
: KeyType]: ObjectType[KeyType];
|
|
667
|
+
};
|
|
668
|
+
|
|
669
|
+
/**
|
|
670
|
+
An if-else-like type that resolves depending on whether the given type is `any` or `never`.
|
|
671
|
+
|
|
672
|
+
@example
|
|
673
|
+
```
|
|
674
|
+
// When `T` is neither `any` nor `never` (like `string`) => Returns the `ifNot` branch
|
|
675
|
+
type A = IfNotAnyOrNever<string, {ifNot: 'VALID'; ifAny: 'IS_ANY'; ifNever: 'IS_NEVER'}>;
|
|
676
|
+
//=> 'VALID'
|
|
677
|
+
|
|
678
|
+
// When `T` is `any` => Returns the `ifAny` branch
|
|
679
|
+
type B = IfNotAnyOrNever<any, {ifNot: 'VALID'; ifAny: 'IS_ANY'; ifNever: 'IS_NEVER'}>;
|
|
680
|
+
//=> 'IS_ANY'
|
|
681
|
+
|
|
682
|
+
// When `T` is `never` => Returns the `ifNever` branch
|
|
683
|
+
type C = IfNotAnyOrNever<never, {ifNot: 'VALID'; ifAny: 'IS_ANY'; ifNever: 'IS_NEVER'}>;
|
|
684
|
+
//=> 'IS_NEVER'
|
|
685
|
+
```
|
|
686
|
+
|
|
687
|
+
Note: Wrapping a tail-recursive type with `IfNotAnyOrNever` makes the implementation non-tail-recursive. To fix this, move the recursion into a helper type. Refer to the following example:
|
|
688
|
+
|
|
689
|
+
@example
|
|
690
|
+
```ts
|
|
691
|
+
import type {StringRepeat} from 'type-fest';
|
|
692
|
+
|
|
693
|
+
type NineHundredNinetyNineSpaces = StringRepeat<' ', 999>;
|
|
694
|
+
|
|
695
|
+
// The following implementation is not tail recursive
|
|
696
|
+
type TrimLeft<S extends string> = IfNotAnyOrNever<S, {ifNot: S extends ` ${infer R}` ? TrimLeft<R> : S}>;
|
|
697
|
+
|
|
698
|
+
// Hence, instantiations with long strings will fail
|
|
699
|
+
// @ts-expect-error
|
|
700
|
+
type T1 = TrimLeft<NineHundredNinetyNineSpaces>;
|
|
701
|
+
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
702
|
+
// Error: Type instantiation is excessively deep and possibly infinite.
|
|
703
|
+
|
|
704
|
+
// To fix this, move the recursion into a helper type
|
|
705
|
+
type TrimLeftOptimised<S extends string> = IfNotAnyOrNever<S, {ifNot: _TrimLeftOptimised<S>}>;
|
|
706
|
+
|
|
707
|
+
type _TrimLeftOptimised<S extends string> = S extends ` ${infer R}` ? _TrimLeftOptimised<R> : S;
|
|
708
|
+
|
|
709
|
+
type T2 = TrimLeftOptimised<NineHundredNinetyNineSpaces>;
|
|
710
|
+
//=> ''
|
|
711
|
+
```
|
|
712
|
+
*/
|
|
713
|
+
type IfNotAnyOrNever<T, Cases extends {ifNot: unknown; ifAny?: unknown; ifNever?: unknown}> =
|
|
714
|
+
IsAny<T> extends true
|
|
715
|
+
? 'ifAny' extends keyof Cases
|
|
716
|
+
? Cases['ifAny']
|
|
717
|
+
: any
|
|
718
|
+
: IsNever<T> extends true
|
|
719
|
+
? 'ifNever' extends keyof Cases
|
|
720
|
+
? Cases['ifNever']
|
|
721
|
+
: never
|
|
722
|
+
: Cases['ifNot'];
|
|
723
|
+
|
|
724
|
+
/**
|
|
725
|
+
The call signature of the given type, rebuilt with its `this` parameter, which `Parameters` leaves out, so the rebuilt signature does not accept any receiver. A function that declares no `this` is rebuilt without one, like `OmitThisParameter` does, because `this: unknown` would reject a function that declares a `this`. `unknown` for a type that is not callable, so it can be intersected with anything.
|
|
726
|
+
|
|
727
|
+
Readonly rest parameters are preserved.
|
|
728
|
+
|
|
729
|
+
Note: An overloaded function keeps only its last signature, and a generic one loses its type parameters.
|
|
730
|
+
*/
|
|
731
|
+
type CallSignatureOf<Type> = Type extends (this: infer Receiver, ...arguments_: infer Arguments extends UnknownArray) => infer Return
|
|
732
|
+
? unknown extends Receiver
|
|
733
|
+
? (...arguments_: Arguments) => Return
|
|
734
|
+
: (this: Receiver, ...arguments_: Arguments) => Return
|
|
735
|
+
: unknown;
|
|
736
|
+
|
|
737
|
+
// `Opaque` and `Tagged` are for `@link`.
|
|
738
|
+
|
|
739
|
+
/**
|
|
740
|
+
Remove brand properties from primitive types while preserving literal types.
|
|
741
|
+
|
|
742
|
+
Useful for recovering literal keys from branded types. Unlike {@link LiteralToPrimitive}, this does not widen literals. This distributes over unions. Non-primitive members are returned unchanged, including their brands and nested properties. `any`, `never`, and `unknown` are also returned unchanged.
|
|
743
|
+
|
|
744
|
+
@example
|
|
745
|
+
```
|
|
746
|
+
import type {Tagged, UnwrapBrandedPrimitive} from 'type-fest';
|
|
747
|
+
|
|
748
|
+
type Status = ('draft' | 'published') & {readonly __brand: 'Status'};
|
|
749
|
+
|
|
750
|
+
type StatusName = UnwrapBrandedPrimitive<Status>;
|
|
751
|
+
//=> 'draft' | 'published'
|
|
752
|
+
|
|
753
|
+
type StatusCounts = Record<UnwrapBrandedPrimitive<Status>, number>;
|
|
754
|
+
//=> {draft: number; published: number}
|
|
755
|
+
|
|
756
|
+
type UserId = UnwrapBrandedPrimitive<Tagged<string, 'UserId'>>;
|
|
757
|
+
//=> string
|
|
758
|
+
```
|
|
759
|
+
|
|
760
|
+
@example
|
|
761
|
+
```
|
|
762
|
+
import type {UnwrapBrandedPrimitive} from 'type-fest';
|
|
763
|
+
|
|
764
|
+
type Brand = {readonly __brand: unique symbol};
|
|
765
|
+
|
|
766
|
+
type A = UnwrapBrandedPrimitive<string & Brand>;
|
|
767
|
+
//=> string
|
|
768
|
+
|
|
769
|
+
type B = UnwrapBrandedPrimitive<number & Brand>;
|
|
770
|
+
//=> number
|
|
771
|
+
|
|
772
|
+
type C = UnwrapBrandedPrimitive<PropertyKey & Brand>;
|
|
773
|
+
//=> number | string | symbol
|
|
774
|
+
|
|
775
|
+
type D = UnwrapBrandedPrimitive<(1 | 200n | 'foo' | 'bar') & Brand>;
|
|
776
|
+
//=> 1 | 200n | 'foo' | 'bar'
|
|
777
|
+
```
|
|
778
|
+
|
|
779
|
+
Custom brands must use a single object with explicit marker properties, such as `string & {brand: 'Id'}`. Optional markers, including a single {@link Flavor}, are supported. Separate custom intersections, such as `string & BrandA & BrandB`, and marker keys shared with any built-in primitive properties are not supported. Index signatures and call or construct signatures are not supported as custom brands. All extra properties are treated as brands, including methods.
|
|
780
|
+
|
|
781
|
+
Nested {@link Tagged} types follow the limits described in {@link UnwrapTagged}. A single legacy {@link Opaque} layer is supported, except with a `never` token. Use {@link UnwrapTagged} to unwrap tagged objects too.
|
|
782
|
+
|
|
783
|
+
@see {@link UnwrapTagged}
|
|
784
|
+
@see {@link LiteralToPrimitive}
|
|
785
|
+
|
|
786
|
+
@category Type
|
|
787
|
+
*/
|
|
788
|
+
type UnwrapBrandedPrimitive<Value> = IfNotAnyOrNever<Value, {ifNot: UnwrapBrandedPrimitiveImplementation<Value, Primitive>}>;
|
|
789
|
+
|
|
790
|
+
type UnwrapBrandedPrimitiveImplementation<Value, Base> = Value extends Primitive
|
|
791
|
+
// Separate tag layers do not match a single object containing all brand properties.
|
|
792
|
+
// `CollapseLiterals` removes `& {}` first, because TypeScript defers `keyof` on types like `` `on${string}` & {} ``.
|
|
793
|
+
? UnwrapPrimitiveProperties<CollapseLiterals<Value extends TagContainer<unknown> ? UnwrapTagged<Value> : Value>, Base>
|
|
794
|
+
: Value;
|
|
795
|
+
|
|
796
|
+
type UnwrapPrimitiveProperties<Value, Base> = Value extends infer Unbranded & Pick<Value, Exclude<keyof Value, KeysOfUnion<Base>>>
|
|
797
|
+
? Unbranded
|
|
798
|
+
: Value;
|
|
799
|
+
|
|
800
|
+
/**
|
|
801
|
+
Collapse literal union members into broader types already present in the union.
|
|
802
|
+
|
|
803
|
+
Use-case: Normalize a {@link LiteralUnion} for type comparisons or conditional types while preserving unrelated union members. Complements {@link ExtractLiterals}, which keeps only the literals.
|
|
804
|
+
|
|
805
|
+
Unlike {@link LiteralToPrimitive}, this does not widen every literal: a literal changes only when a broader member of the union already covers it. Members that are not primitives are returned unchanged. It only removes the intersection with the empty object type (`& {}`) from primitive members, which lets TypeScript merge the union. This includes the `& Record<never, never>` of {@link LiteralUnion}, because `Record<never, never>` is `{}`. This is not recursive, and it does not merge the members of a branded or tagged type, because each member keeps its own brand or tag.
|
|
806
|
+
|
|
807
|
+
@example
|
|
808
|
+
```
|
|
809
|
+
import type {CollapseLiterals, LiteralUnion} from 'type-fest';
|
|
810
|
+
|
|
811
|
+
type Theme = LiteralUnion<'auto' | 'dark', string>;
|
|
812
|
+
|
|
813
|
+
type ThemeValue = CollapseLiterals<Theme>;
|
|
814
|
+
//=> string
|
|
815
|
+
|
|
816
|
+
type OptionalTheme = CollapseLiterals<Theme | null | undefined>;
|
|
817
|
+
//=> string | null | undefined
|
|
818
|
+
|
|
819
|
+
type EventName = CollapseLiterals<LiteralUnion<'click' | 'onChange', `on${string}`>>;
|
|
820
|
+
//=> 'click' | `on${string}`
|
|
821
|
+
|
|
822
|
+
type Size = CollapseLiterals<LiteralUnion<1 | 2 | 3, number>>;
|
|
823
|
+
//=> number
|
|
824
|
+
|
|
825
|
+
type KnownTheme = CollapseLiterals<'auto' | 'dark'>;
|
|
826
|
+
//=> 'auto' | 'dark'
|
|
827
|
+
```
|
|
828
|
+
|
|
829
|
+
@see {@link LiteralUnion}
|
|
830
|
+
@see {@link ExtractLiterals}
|
|
831
|
+
@see {@link LiteralToPrimitive}
|
|
832
|
+
@category Type
|
|
833
|
+
*/
|
|
834
|
+
// Distribute first, so an object member in the union cannot stop the other members from collapsing.
|
|
835
|
+
// The primitive check also keeps `{}`-like inputs away from the `infer`, which turns them into `unknown`.
|
|
836
|
+
type CollapseLiterals<Union> = Union extends Primitive
|
|
837
|
+
? Union extends infer Collapsed & {}
|
|
838
|
+
? Collapsed
|
|
839
|
+
: Union
|
|
840
|
+
: Union;
|
|
841
|
+
|
|
842
|
+
/**
|
|
843
|
+
Convert a string or number key to its template literal representation.
|
|
844
|
+
|
|
845
|
+
Note: This type is not the return type of the `.toString()` function.
|
|
846
|
+
|
|
847
|
+
Keep this separate from the public `ToString`: internal key and path matching relies on preserving branded template literal patterns and `${any}`.
|
|
848
|
+
*/
|
|
849
|
+
type KeyToString<Key> = Key extends string | number ? `${Key}` : never;
|
|
850
|
+
|
|
851
|
+
/**
|
|
852
|
+
Remove brands from property paths while preserving empty intersections used by `LiteralUnion`.
|
|
853
|
+
|
|
854
|
+
Distribute before normalization so a wide path cannot erase another member's known segments.
|
|
855
|
+
|
|
856
|
+
@example
|
|
857
|
+
```
|
|
858
|
+
type Path = UnwrapPathBrand<'users.name' & {readonly brand: unique symbol}>;
|
|
859
|
+
//=> 'users.name'
|
|
860
|
+
```
|
|
861
|
+
*/
|
|
862
|
+
type UnwrapPathBrand<Path> = Path extends unknown
|
|
863
|
+
? Exclude<keyof CollapseLiterals<Path>, keyof string | keyof number> extends never ? Path : UnwrapBrandedPrimitive<Path>
|
|
864
|
+
: never;
|
|
865
|
+
|
|
866
|
+
/**
|
|
867
|
+
Matches the hidden `Infinity` type.
|
|
868
|
+
|
|
869
|
+
Please upvote [this issue](https://github.com/microsoft/TypeScript/issues/32277) if you want to have this type as a built-in in TypeScript.
|
|
870
|
+
|
|
871
|
+
@see {@link NegativeInfinity}
|
|
872
|
+
|
|
873
|
+
@category Numeric
|
|
874
|
+
*/
|
|
875
|
+
// See https://github.com/microsoft/TypeScript/issues/31752
|
|
876
|
+
// eslint-disable-next-line no-loss-of-precision
|
|
877
|
+
type PositiveInfinity = 1e999;
|
|
878
|
+
|
|
879
|
+
/**
|
|
880
|
+
Matches the hidden `-Infinity` type.
|
|
881
|
+
|
|
882
|
+
Please upvote [this issue](https://github.com/microsoft/TypeScript/issues/32277) if you want to have this type as a built-in in TypeScript.
|
|
883
|
+
|
|
884
|
+
@see {@link PositiveInfinity}
|
|
885
|
+
|
|
886
|
+
@category Numeric
|
|
887
|
+
*/
|
|
888
|
+
// See https://github.com/microsoft/TypeScript/issues/31752
|
|
889
|
+
// eslint-disable-next-line no-loss-of-precision
|
|
890
|
+
type NegativeInfinity = -1e999;
|
|
891
|
+
|
|
892
|
+
// For `@link`
|
|
893
|
+
|
|
894
|
+
/**
|
|
895
|
+
Converts a numeric string to a number.
|
|
896
|
+
|
|
897
|
+
@example
|
|
898
|
+
```
|
|
899
|
+
import type {StringToNumber} from 'type-fest';
|
|
900
|
+
|
|
901
|
+
type PositiveInteger = StringToNumber<'1234'>;
|
|
902
|
+
//=> 1234
|
|
903
|
+
|
|
904
|
+
type NegativeInteger = StringToNumber<'-1234'>;
|
|
905
|
+
//=> -1234
|
|
906
|
+
|
|
907
|
+
type PositiveFloat = StringToNumber<'1234.56'>;
|
|
908
|
+
//=> 1234.56
|
|
909
|
+
|
|
910
|
+
type NegativeFloat = StringToNumber<'-1234.56'>;
|
|
911
|
+
//=> -1234.56
|
|
912
|
+
|
|
913
|
+
type PositiveInfinity = StringToNumber<'Infinity'>;
|
|
914
|
+
//=> Infinity
|
|
915
|
+
|
|
916
|
+
type NegativeInfinity = StringToNumber<'-Infinity'>;
|
|
917
|
+
//=> -Infinity
|
|
918
|
+
```
|
|
919
|
+
|
|
920
|
+
Note: Some strings, such as `'1.50'`, `'0b10'`, `'12_345'`, or an integer too large to be represented exactly like `'9007199254740993'`, may look like they can be converted to numbers, but they don't actually have corresponding numeric literals. So, in such cases, this type produces `never`. See [type-fest#1446](https://github.com/sindresorhus/type-fest/pull/1446) for more details.
|
|
921
|
+
|
|
922
|
+
@example
|
|
923
|
+
```
|
|
924
|
+
import type {StringToNumber} from 'type-fest';
|
|
925
|
+
|
|
926
|
+
type FractionalsEndingInZero = StringToNumber<'1.50'>;
|
|
927
|
+
//=> never
|
|
928
|
+
|
|
929
|
+
type NonDecimalBases = StringToNumber<'0b10' | '0o10' | '0x10'>;
|
|
930
|
+
//=> never
|
|
931
|
+
|
|
932
|
+
type NumericSeparators = StringToNumber<'12_345'>;
|
|
933
|
+
//=> never
|
|
934
|
+
|
|
935
|
+
type TooLarge = StringToNumber<'9007199254740993'>;
|
|
936
|
+
//=> never
|
|
937
|
+
```
|
|
938
|
+
|
|
939
|
+
@see {@link StringToBoolean} - For parsing a boolean string.
|
|
940
|
+
|
|
941
|
+
@category String
|
|
942
|
+
@category Numeric
|
|
943
|
+
@category Template literal
|
|
944
|
+
*/
|
|
945
|
+
// The parser already returns `number` for `any` and distributes `never` to `never`.
|
|
946
|
+
type StringToNumber<S extends string> = _StringToNumber<S extends object ? UnwrapBrandedPrimitive<S> : S>;
|
|
947
|
+
|
|
948
|
+
type _StringToNumber<S extends string> =
|
|
949
|
+
S extends `${infer N extends number}`
|
|
950
|
+
? number extends N
|
|
951
|
+
? `${number}` extends S
|
|
952
|
+
? N
|
|
953
|
+
: never
|
|
954
|
+
: N
|
|
955
|
+
: string extends S
|
|
956
|
+
? number
|
|
957
|
+
: S extends 'Infinity'
|
|
958
|
+
? PositiveInfinity
|
|
959
|
+
: S extends '-Infinity'
|
|
960
|
+
? NegativeInfinity
|
|
961
|
+
: never;
|
|
962
|
+
|
|
963
|
+
// For `@link`
|
|
964
|
+
|
|
965
|
+
/**
|
|
966
|
+
Resolve a property key to the matching key type in an object, converting between numeric and string forms when needed.
|
|
967
|
+
|
|
968
|
+
Useful when composing generic property access utilities that accept either `0` or `'0'` for the same property. Returns `never` if no key matches.
|
|
969
|
+
|
|
970
|
+
Keys assignable to `keyof ObjectType` are returned unchanged, including keys covered by index signatures. Otherwise, numeric keys are tried as strings, and numeric strings as numbers only if converting back preserves their spelling. For example, `'01'` does not match `1`.
|
|
971
|
+
|
|
972
|
+
Distributes over a union of keys. For a union of objects, only keys in `keyof ObjectType` are considered, so a key must be common to all members. Plain strings do not select string enum keys. Array and tuple indices are not bounds-checked.
|
|
973
|
+
|
|
974
|
+
@example
|
|
975
|
+
```
|
|
976
|
+
import type {MatchingKey} from 'type-fest';
|
|
977
|
+
|
|
978
|
+
type StatusMessages = {
|
|
979
|
+
200: 'OK';
|
|
980
|
+
'404': 'Not found';
|
|
981
|
+
};
|
|
982
|
+
|
|
983
|
+
type SuccessKey = MatchingKey<StatusMessages, '200'>;
|
|
984
|
+
//=> 200
|
|
985
|
+
|
|
986
|
+
type NotFoundKey = MatchingKey<StatusMessages, 404>;
|
|
987
|
+
//=> '404'
|
|
988
|
+
|
|
989
|
+
type PickByKey<ObjectType extends object, Key extends PropertyKey> = Pick<ObjectType, MatchingKey<ObjectType, Key>>;
|
|
990
|
+
|
|
991
|
+
type Success = PickByKey<StatusMessages, '200'>;
|
|
992
|
+
//=> {200: 'OK'}
|
|
993
|
+
```
|
|
994
|
+
|
|
995
|
+
@see {@link PropertyValue} to get the value of the matching property.
|
|
996
|
+
|
|
997
|
+
@category Object
|
|
998
|
+
*/
|
|
999
|
+
type MatchingKey<ObjectType extends object, Key extends PropertyKey> =
|
|
1000
|
+
Key extends keyof ObjectType
|
|
1001
|
+
? Key
|
|
1002
|
+
: KeyToString<Key> extends keyof ObjectType
|
|
1003
|
+
? KeyToString<Key>
|
|
1004
|
+
: Key extends `${infer NumberKey extends number}`
|
|
1005
|
+
// A numeric-looking string names a number key only when its spelling survives the conversion.
|
|
1006
|
+
? `${NumberKey}` extends Key
|
|
1007
|
+
? NumberKey extends keyof ObjectType
|
|
1008
|
+
? NumberKey
|
|
1009
|
+
: never
|
|
1010
|
+
: never
|
|
1011
|
+
: never;
|
|
1012
|
+
|
|
1013
|
+
/**
|
|
1014
|
+
Flatten an object type. This is the plain definition `Simplify` had before it started returning a function, a class constructor, or a branded primitive as is.
|
|
1015
|
+
|
|
1016
|
+
Internal types use this instead of `Simplify`, because they only flatten object types they built themselves, where any call signature is already dropped or handled separately and no branded primitive can appear, so they do not need that check. Use `Simplify` if the input can be a function, a class constructor, or a branded primitive. Keeping the check out of them avoids its cost in every type that flattens its result, and avoids the risk of "excessively deep" errors in user code, which a conditional in `Simplify` once caused for types like `SetRequired`. See https://github.com/sindresorhus/type-fest/issues/436.
|
|
1017
|
+
*/
|
|
1018
|
+
type SimplifyObject<Type> = {[KeyType in keyof Type]: Type[KeyType]} & {};
|
|
1019
|
+
|
|
1020
|
+
/**
|
|
1021
|
+
Normalize keys by including string and number representations wherever applicable.
|
|
1022
|
+
|
|
1023
|
+
@example
|
|
1024
|
+
```ts
|
|
1025
|
+
type A = NormalizedKeys<0 | '1'>;
|
|
1026
|
+
//=> 0 | '0' | 1 | '1'
|
|
1027
|
+
|
|
1028
|
+
type B = NormalizedKeys<string>;
|
|
1029
|
+
//=> string | number
|
|
1030
|
+
|
|
1031
|
+
type C = NormalizedKeys<number>;
|
|
1032
|
+
//=> number | `${number}`
|
|
1033
|
+
|
|
1034
|
+
type D = NormalizedKeys<symbol | 'foo'>;
|
|
1035
|
+
//=> symbol | 'foo'
|
|
1036
|
+
```
|
|
1037
|
+
*/
|
|
1038
|
+
type NormalizedKeys<Keys extends PropertyKey> =
|
|
1039
|
+
| Keys
|
|
1040
|
+
| (string extends Keys ? number : never)
|
|
1041
|
+
| StringToNumber<Keys & string>
|
|
1042
|
+
| KeyToString<Keys & number>;
|
|
1043
|
+
|
|
1044
|
+
/**
|
|
1045
|
+
Get the given keys with their numeric and string aliases, including the runtime string spelling of enum keys.
|
|
1046
|
+
|
|
1047
|
+
@example
|
|
1048
|
+
```ts
|
|
1049
|
+
enum Color {
|
|
1050
|
+
Red = 'red',
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1053
|
+
type A = KeyAliases<0 | Color.Red>;
|
|
1054
|
+
//=> 0 | '0' | Color.Red | 'red'
|
|
1055
|
+
```
|
|
1056
|
+
*/
|
|
1057
|
+
type KeyAliases<Keys extends PropertyKey> = NormalizedKeys<Keys | KeyToString<Keys>>;
|
|
1058
|
+
|
|
1059
|
+
/**
|
|
1060
|
+
Extract all required keys from the given type.
|
|
1061
|
+
|
|
1062
|
+
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...
|
|
1063
|
+
|
|
1064
|
+
@example
|
|
1065
|
+
```
|
|
1066
|
+
import type {RequiredKeysOf} from 'type-fest';
|
|
1067
|
+
|
|
1068
|
+
declare function createValidation<
|
|
1069
|
+
Entity extends object,
|
|
1070
|
+
Key extends RequiredKeysOf<Entity> = RequiredKeysOf<Entity>,
|
|
1071
|
+
>(field: Key, validator: (value: Entity[Key]) => boolean): (entity: Entity) => boolean;
|
|
1072
|
+
|
|
1073
|
+
type User = {
|
|
1074
|
+
name: string;
|
|
1075
|
+
surname: string;
|
|
1076
|
+
luckyNumber?: number;
|
|
1077
|
+
};
|
|
1078
|
+
|
|
1079
|
+
const validator1 = createValidation<User>('name', value => value.length < 25);
|
|
1080
|
+
const validator2 = createValidation<User>('surname', value => value.length < 25);
|
|
1081
|
+
|
|
1082
|
+
// @ts-expect-error
|
|
1083
|
+
const validator3 = createValidation<User>('luckyNumber', value => value > 0);
|
|
1084
|
+
// Error: Argument of type '"luckyNumber"' is not assignable to parameter of type '"name" | "surname"'.
|
|
1085
|
+
```
|
|
1086
|
+
|
|
1087
|
+
Known limitations:
|
|
1088
|
+
- An index signature is reported as a required key, so `RequiredKeysOf<Record<string, unknown>>` is `string` rather than `never`. The signature satisfies the required-property check against `Record<Key, Type[Key]>`, even though no particular property has to be present.
|
|
1089
|
+
- A union reports the keys of each of its members, so the result can name a key that is not a key of the union itself. `keyof` of a union is the intersection of its members' keys, so `RequiredKeysOf<{a: string} | {b: number}>` is `'a' | 'b'` while `keyof` of the same union is `never`. Read one member at a time if you need a key that is valid for the whole union.
|
|
1090
|
+
|
|
1091
|
+
@category Utilities
|
|
1092
|
+
*/
|
|
1093
|
+
type RequiredKeysOf<Type extends object> =
|
|
1094
|
+
IsAny<Type> extends true ? keyof Type
|
|
1095
|
+
: Type extends unknown // For distributing `Type`
|
|
1096
|
+
? (keyof {[Key in keyof Type as Type extends Record<Key, Type[Key]> ? Key : never]: never}) & keyof Type
|
|
1097
|
+
: never; // Should never happen
|
|
1098
|
+
|
|
1099
|
+
// For `@link`
|
|
1100
|
+
|
|
1101
|
+
/**
|
|
1102
|
+
Useful to flatten the type output to improve type hints shown in editors. And also to transform an interface into a type to aid with assignability.
|
|
1103
|
+
|
|
1104
|
+
@example
|
|
1105
|
+
```
|
|
1106
|
+
import type {Simplify} from 'type-fest';
|
|
1107
|
+
|
|
1108
|
+
type PositionProps = {
|
|
1109
|
+
top: number;
|
|
1110
|
+
left: number;
|
|
1111
|
+
};
|
|
487
1112
|
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
// Is `{}` assignable to `Record<KeyType, unknown>`?
|
|
492
|
-
as {} extends Record<KeyType, unknown>
|
|
493
|
-
? never // ✅ `{}` is assignable to `Record<KeyType, unknown>`
|
|
494
|
-
: KeyType // ❌ `{}` is NOT assignable to `Record<KeyType, unknown>`
|
|
495
|
-
]: ObjectType[KeyType];
|
|
1113
|
+
type SizeProps = {
|
|
1114
|
+
width: number;
|
|
1115
|
+
height: number;
|
|
496
1116
|
};
|
|
1117
|
+
|
|
1118
|
+
// In your editor, hovering over `Props` will show a flattened object with all the properties.
|
|
1119
|
+
type Props = Simplify<PositionProps & SizeProps>;
|
|
497
1120
|
```
|
|
498
1121
|
|
|
499
|
-
|
|
1122
|
+
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.
|
|
1123
|
+
|
|
1124
|
+
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`.
|
|
500
1125
|
|
|
501
1126
|
@example
|
|
502
1127
|
```
|
|
503
|
-
import type {
|
|
1128
|
+
import type {Simplify} from 'type-fest';
|
|
504
1129
|
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
[x: `head-${string}`]: string;
|
|
511
|
-
[x: `${string}-tail`]: string;
|
|
512
|
-
[x: `head-${string}-tail`]: string;
|
|
513
|
-
[x: `${bigint}`]: string;
|
|
514
|
-
[x: `embedded-${number}`]: string;
|
|
1130
|
+
interface SomeInterface {
|
|
1131
|
+
foo: number;
|
|
1132
|
+
bar?: string;
|
|
1133
|
+
baz: number | undefined;
|
|
1134
|
+
}
|
|
515
1135
|
|
|
516
|
-
|
|
517
|
-
foo:
|
|
518
|
-
|
|
1136
|
+
type SomeType = {
|
|
1137
|
+
foo: number;
|
|
1138
|
+
bar?: string;
|
|
1139
|
+
baz: number | undefined;
|
|
519
1140
|
};
|
|
520
1141
|
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
1142
|
+
const literal = {foo: 123, bar: 'hello', baz: 456};
|
|
1143
|
+
const someType: SomeType = literal;
|
|
1144
|
+
const someInterface: SomeInterface = literal;
|
|
524
1145
|
|
|
525
|
-
|
|
526
|
-
@category Object
|
|
527
|
-
*/
|
|
528
|
-
type OmitIndexSignature<ObjectType> = {
|
|
529
|
-
[KeyType in keyof ObjectType as {} extends Record<KeyType, unknown>
|
|
530
|
-
? never
|
|
531
|
-
: KeyType]: ObjectType[KeyType];
|
|
532
|
-
};
|
|
1146
|
+
declare function fn(object: Record<string, unknown>): void;
|
|
533
1147
|
|
|
534
|
-
|
|
535
|
-
|
|
1148
|
+
fn(literal); // Good: literal object type is sealed
|
|
1149
|
+
fn(someType); // Good: type is sealed
|
|
1150
|
+
// @ts-expect-error
|
|
1151
|
+
fn(someInterface); // Error: Index signature for type 'string' is missing in type 'someInterface'. Because `interface` can be re-opened
|
|
1152
|
+
fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface` into a `type`
|
|
1153
|
+
```
|
|
536
1154
|
|
|
537
|
-
|
|
1155
|
+
Only the top level is flattened. Property values are kept as is, and so are the elements of an array or a tuple, which keeps its shape. Use {@link SimplifyDeep} to flatten them too.
|
|
538
1156
|
|
|
539
1157
|
@example
|
|
540
1158
|
```
|
|
541
|
-
import type {
|
|
542
|
-
|
|
543
|
-
declare const symbolKey: unique symbol;
|
|
1159
|
+
import type {Simplify} from 'type-fest';
|
|
544
1160
|
|
|
545
|
-
type
|
|
546
|
-
// These index signatures will remain.
|
|
547
|
-
[x: string]: unknown;
|
|
548
|
-
[x: number]: unknown;
|
|
549
|
-
[x: symbol]: unknown;
|
|
550
|
-
[x: `head-${string}`]: string;
|
|
551
|
-
[x: `${string}-tail`]: string;
|
|
552
|
-
[x: `head-${string}-tail`]: string;
|
|
553
|
-
[x: `${bigint}`]: string;
|
|
554
|
-
[x: `embedded-${number}`]: string;
|
|
1161
|
+
type Point = {x: number} & {y: number};
|
|
555
1162
|
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
[symbolKey]: string;
|
|
559
|
-
foo: 'bar';
|
|
560
|
-
qux?: 'baz';
|
|
561
|
-
};
|
|
1163
|
+
type A = Simplify<{start: Point} & {end: Point}>;
|
|
1164
|
+
//=> {start: Point; end: Point}
|
|
562
1165
|
|
|
563
|
-
type
|
|
564
|
-
|
|
565
|
-
// [x: string]: unknown;
|
|
566
|
-
// [x: number]: unknown;
|
|
567
|
-
// [x: symbol]: unknown;
|
|
568
|
-
// [x: `head-${string}`]: string;
|
|
569
|
-
// [x: `${string}-tail`]: string;
|
|
570
|
-
// [x: `head-${string}-tail`]: string;
|
|
571
|
-
// [x: `${bigint}`]: string;
|
|
572
|
-
// [x: `embedded-${number}`]: string;
|
|
573
|
-
// }
|
|
1166
|
+
type B = Simplify<[label: string, point?: Point]>;
|
|
1167
|
+
//=> [label: string, point?: Point]
|
|
574
1168
|
```
|
|
575
1169
|
|
|
576
|
-
|
|
577
|
-
@category Object
|
|
578
|
-
*/
|
|
579
|
-
type PickIndexSignature<ObjectType> = {
|
|
580
|
-
[KeyType in keyof ObjectType as {} extends Record<KeyType, unknown>
|
|
581
|
-
? KeyType
|
|
582
|
-
: never]: ObjectType[KeyType];
|
|
583
|
-
};
|
|
584
|
-
|
|
585
|
-
// Merges two objects without worrying about index signatures.
|
|
586
|
-
type SimpleMerge<Destination, Source> = Simplify<{
|
|
587
|
-
[Key in keyof Destination as Key extends keyof Source ? never : Key]: Destination[Key];
|
|
588
|
-
} & Source>;
|
|
1170
|
+
A function or a class constructor is returned as is, because its call and construct signatures cannot be flattened into an object. To get only the properties of a function, use `Simplify<Omit<Type, never>>`.
|
|
589
1171
|
|
|
590
|
-
|
|
591
|
-
Merge two types into a new type. Keys of the second type overrides keys of the first type.
|
|
1172
|
+
A primitive is also returned as is. A branded primitive like `Tagged<string, 'UserId'>` or `string & {}` is returned as is too, because flattening it would turn it into an object and remove the primitive. A union that includes a function, a class constructor, or a branded primitive is returned as is, so its other members are not flattened. A plain primitive in a union does not stop its other members from being flattened.
|
|
592
1173
|
|
|
593
|
-
|
|
1174
|
+
TypeScript does not resolve a mapped type over a template literal type intersected with `{}`, so ``Simplify<`on${string}` & {}>`` stays unresolved and is not assignable to `string`. Use `Record<never, never>` instead of `{}`, like `LiteralUnion` does.
|
|
594
1175
|
|
|
595
1176
|
@example
|
|
596
1177
|
```
|
|
597
|
-
import type {
|
|
1178
|
+
import type {Simplify} from 'type-fest';
|
|
598
1179
|
|
|
599
|
-
type
|
|
600
|
-
a: string;
|
|
601
|
-
b: number;
|
|
602
|
-
};
|
|
1180
|
+
type Format = (value: string) => string;
|
|
603
1181
|
|
|
604
|
-
type
|
|
605
|
-
|
|
606
|
-
c: boolean;
|
|
607
|
-
};
|
|
1182
|
+
type A = Simplify<Format>;
|
|
1183
|
+
//=> (value: string) => string
|
|
608
1184
|
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
//=> never
|
|
1185
|
+
type B = Simplify<Format & {description: string}>;
|
|
1186
|
+
//=> Format & {description: string}
|
|
612
1187
|
|
|
613
|
-
//
|
|
614
|
-
type
|
|
615
|
-
//=>
|
|
616
|
-
```
|
|
1188
|
+
// `Omit` drops the call signature, so this gives only the properties.
|
|
1189
|
+
type C = Simplify<Omit<Format & {description: string}, never>>;
|
|
1190
|
+
//=> {description: string}
|
|
617
1191
|
|
|
618
|
-
|
|
619
|
-
```
|
|
620
|
-
import type {Merge} from 'type-fest';
|
|
1192
|
+
type UserId = string & {brand: 'UserId'};
|
|
621
1193
|
|
|
622
|
-
type
|
|
623
|
-
|
|
624
|
-
[x: number]: unknown;
|
|
625
|
-
foo: string;
|
|
626
|
-
bar: symbol;
|
|
627
|
-
};
|
|
1194
|
+
type D = Simplify<UserId>;
|
|
1195
|
+
//=> string & {brand: 'UserId'}
|
|
628
1196
|
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
bar: Date;
|
|
633
|
-
baz: boolean;
|
|
634
|
-
};
|
|
1197
|
+
// A plain primitive does not stop the other members from being flattened.
|
|
1198
|
+
type E = Simplify<'auto' | ({width: number} & {height: number})>;
|
|
1199
|
+
//=> 'auto' | {width: number; height: number}
|
|
635
1200
|
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
// [x: number]: number;
|
|
640
|
-
// [x: symbol]: unknown;
|
|
641
|
-
// foo: string;
|
|
642
|
-
// bar: Date;
|
|
643
|
-
// baz: boolean;
|
|
644
|
-
// }
|
|
1201
|
+
// A branded primitive does, so the union is returned as is.
|
|
1202
|
+
type F = Simplify<UserId | ({width: number} & {height: number})>;
|
|
1203
|
+
//=> UserId | ({width: number} & {height: number})
|
|
645
1204
|
```
|
|
646
1205
|
|
|
647
|
-
|
|
1206
|
+
A built-in object like `Date`, `Map`, or `Promise`, and an array or a tuple with extra properties like `string[] & {total: number}`, is flattened into an object of all its members. The result is still assignable to and from the original type, but it makes type hints long, so do not wrap these types in `Simplify`.
|
|
648
1207
|
|
|
649
|
-
@see
|
|
1208
|
+
@see https://github.com/microsoft/TypeScript/issues/15300
|
|
1209
|
+
@see {@link SimplifyDeep}
|
|
650
1210
|
@category Object
|
|
651
1211
|
*/
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
:
|
|
1212
|
+
// Internal types use `SimplifyObject` instead, which leaves out the check for functions, class constructors, and branded primitives. See its comment for why.
|
|
1213
|
+
type Simplify<T> =
|
|
1214
|
+
// The check is not distributive, so that a generic `T` stays assignable to `Simplify<T>`, because it is assignable to both branches.
|
|
1215
|
+
[BrandedPrimitive<T> | Extract<T, ((...arguments_: never) => unknown) | (abstract new (...arguments_: never) => unknown)>] extends [never]
|
|
1216
|
+
? {[KeyType in keyof T]: T[KeyType]} & {}
|
|
1217
|
+
: T;
|
|
1218
|
+
|
|
1219
|
+
// The members of `Type` that are a primitive intersected with an object type, like `Tagged<string, 'UserId'>` or `string & {}`. A homomorphic mapped type, like the one in `Simplify`, returns a plain primitive as is, but turns a branded primitive into an object of all its members, which removes the primitive.
|
|
1220
|
+
type BrandedPrimitive<Type> = Type extends Primitive
|
|
1221
|
+
? {[KeyType in keyof Type]: Type[KeyType]} extends Primitive ? never : Type
|
|
1222
|
+
: never;
|
|
658
1223
|
|
|
659
1224
|
type _Merge<Destination, Source> =
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
&
|
|
663
|
-
|
|
1225
|
+
// The mapped types in `MergeObjects` drop call signatures, so the source's call signature, or else the destination's, is added back. Each branch has its own intersection, so that tooltips show the result rather than `_Merge`.
|
|
1226
|
+
unknown extends CallSignatureOf<Source>
|
|
1227
|
+
? CallSignatureOf<Destination> & MergeObjects<Destination, Source>
|
|
1228
|
+
: CallSignatureOf<Source> & MergeObjects<Destination, Source>;
|
|
1229
|
+
|
|
1230
|
+
// Numeric properties, enum keys, and their string forms name the same property, so normalize the source's named keys before testing overrides.
|
|
1231
|
+
// Merges the properties and index signatures of two objects. A key of the destination is dropped when the source overrides it: an index signature only by an index signature, and a property only by a property. The destination is read only once, because each extra read multiplies the work of nested merges, such as in `MergeAll`. The source is rebuilt with key remapping instead of intersected as is, because an intersection with an `any` source is `any`, which loses the properties of the destination.
|
|
1232
|
+
type MergeObjects<Destination, Source> = SimplifyObject<{
|
|
1233
|
+
[Key in keyof Destination as {} extends Record<Key, never>
|
|
1234
|
+
? Key extends keyof PickIndexSignature<Source> ? never : Key
|
|
1235
|
+
: Key extends KeyAliases<keyof OmitIndexSignature<Source>> ? never : Key
|
|
1236
|
+
]: Destination[Key];
|
|
1237
|
+
} & {[Key in keyof Source as Key]: Source[Key]}>;
|
|
1238
|
+
|
|
1239
|
+
// For `@link`
|
|
664
1240
|
|
|
665
1241
|
/**
|
|
666
|
-
|
|
1242
|
+
Apply default options to specified options, preserving literal types.
|
|
667
1243
|
|
|
668
|
-
@
|
|
669
|
-
```
|
|
670
|
-
type PathsOptions = {maxRecursionDepth?: number; leavesOnly?: boolean};
|
|
671
|
-
type DefaultPathsOptions = {maxRecursionDepth: 10; leavesOnly: false};
|
|
672
|
-
type SpecifiedOptions = {leavesOnly: true};
|
|
1244
|
+
Useful for authors of configurable utility types. `Defaults` must give every optional option a default and must not give a default for a required option. Each default must be assignable to its option type. `SpecifiedOptions` must satisfy `Options`, including its required properties. Use {@link DefaultsFor} to define a defaults object.
|
|
673
1245
|
|
|
674
|
-
type
|
|
675
|
-
//=> {maxRecursionDepth: 10; leavesOnly: true}
|
|
676
|
-
```
|
|
1246
|
+
The resolution is shallow, so a nested object is replaced as a whole. A specified option overrides its default. An optional or `undefined`-including specified option uses the default when the declared type does not admit `undefined`, and still overrides when the declared type admits `undefined`, such as `unknown` or `string | undefined`. A numeric key can use either spelling, so `0` and `'0'` name the same option. Every option declared in `Options` is required, and its `readonly` modifier comes from the chosen default or override.
|
|
677
1247
|
|
|
678
1248
|
@example
|
|
679
1249
|
```
|
|
680
|
-
|
|
1250
|
+
import type {ApplyDefaultOptions} from 'type-fest';
|
|
681
1251
|
|
|
682
|
-
type
|
|
683
|
-
|
|
684
|
-
|
|
1252
|
+
type FormatOptions = {
|
|
1253
|
+
uppercase?: boolean;
|
|
1254
|
+
prefix?: string;
|
|
1255
|
+
};
|
|
685
1256
|
|
|
686
|
-
type
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
1257
|
+
type DefaultFormatOptions = {
|
|
1258
|
+
uppercase: false;
|
|
1259
|
+
prefix: '';
|
|
1260
|
+
};
|
|
690
1261
|
|
|
691
|
-
|
|
692
|
-
```
|
|
693
|
-
// Complains if an option's default type does not conform to the expected type
|
|
1262
|
+
type Format<Value extends string, Options extends FormatOptions = {}> = FormatWithOptions<Value, ApplyDefaultOptions<FormatOptions, DefaultFormatOptions, Options>>;
|
|
694
1263
|
|
|
695
|
-
type
|
|
696
|
-
type DefaultPathsOptions = {maxRecursionDepth: 10; leavesOnly: 'no'};
|
|
697
|
-
type SpecifiedOptions = {};
|
|
1264
|
+
type FormatWithOptions<Value extends string, Options extends Required<FormatOptions>> = `${Options['prefix']}${Options['uppercase'] extends true ? Uppercase<Value> : Value}`;
|
|
698
1265
|
|
|
699
|
-
type
|
|
700
|
-
|
|
701
|
-
// Types of property 'leavesOnly' are incompatible. Type 'string' is not assignable to type 'boolean'.
|
|
702
|
-
```
|
|
1266
|
+
type Plain = Format<'hello'>;
|
|
1267
|
+
//=> 'hello'
|
|
703
1268
|
|
|
704
|
-
|
|
1269
|
+
type Heading = Format<'hello', {uppercase: true; prefix: '# '}>;
|
|
1270
|
+
//=> '# HELLO'
|
|
1271
|
+
|
|
1272
|
+
type Resolved = ApplyDefaultOptions<FormatOptions, DefaultFormatOptions, {uppercase?: true}>;
|
|
1273
|
+
//=> {uppercase: false; prefix: ''}
|
|
705
1274
|
```
|
|
706
|
-
// Complains if an option's specified type does not conform to the expected type
|
|
707
1275
|
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
1276
|
+
Known limitations:
|
|
1277
|
+
- Intended for an object with named properties. Arrays, tuples, and functions are not supported. A string index signature on `Options` blocks defaults for its named options.
|
|
1278
|
+
- A union of option types or a union-valued option uses one resolution, usually the defaults. A `never` option value is not supported.
|
|
1279
|
+
- Extra properties are allowed: an extra specified property is kept unless it can be `undefined`, and extra `Defaults` keys are kept.
|
|
1280
|
+
- With `any` or `never` as `SpecifiedOptions`, the defaults are used, or `never` if `Options` has a required property.
|
|
1281
|
+
- This does not model runtime object spread, so TypeScript may require concrete specified options instead of unresolved generics.
|
|
711
1282
|
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
// Types of property 'leavesOnly' are incompatible. Type 'string' is not assignable to type 'boolean'.
|
|
715
|
-
```
|
|
1283
|
+
@see {@link DefaultsFor}
|
|
1284
|
+
@category Object
|
|
716
1285
|
*/
|
|
717
1286
|
type ApplyDefaultOptions<
|
|
718
1287
|
Options extends object,
|
|
719
|
-
Defaults extends
|
|
1288
|
+
Defaults extends SimplifyObject<Omit<Required<Options>, RequiredKeysOf<Options>> & Partial<Record<RequiredKeysOf<Options>, never>>>,
|
|
720
1289
|
SpecifiedOptions extends Options,
|
|
1290
|
+
> =
|
|
1291
|
+
// Keep the resolved type assignable to `Required<Options>` without inferring a result that can widen a specified generic value to its constraint.
|
|
1292
|
+
_ApplyDefaultOptions<Options, Defaults, SpecifiedOptions> extends Required<Options>
|
|
1293
|
+
? _ApplyDefaultOptions<Options, Defaults, SpecifiedOptions>
|
|
1294
|
+
: never;
|
|
1295
|
+
|
|
1296
|
+
type _ApplyDefaultOptions<
|
|
1297
|
+
Options extends object,
|
|
1298
|
+
Defaults,
|
|
1299
|
+
SpecifiedOptions,
|
|
721
1300
|
> =
|
|
722
1301
|
If<IsAny<SpecifiedOptions>, Defaults,
|
|
723
1302
|
If<IsNever<SpecifiedOptions>, Defaults,
|
|
724
|
-
|
|
1303
|
+
// The overrides are already an object map, so skip `Merge`'s array and equality dispatch.
|
|
1304
|
+
_Merge<Defaults, {
|
|
1305
|
+
// The first `as` branch keeps the key of an option whose declared type admits `undefined`, like `unknown`, because `undefined` is one of its valid values. `-?` then strips the optional modifier, so an unnarrowed options type still resolves instead of failing the `Required<Options>` guard above.
|
|
725
1306
|
[Key in keyof SpecifiedOptions
|
|
726
|
-
as
|
|
727
|
-
]
|
|
728
|
-
}
|
|
1307
|
+
as undefined extends Required<Options>[MatchingKey<Options, Key>] ? Key : undefined extends SpecifiedOptions[Key] ? never : Key
|
|
1308
|
+
]-?: SpecifiedOptions[Key]
|
|
1309
|
+
}>>>;
|
|
1310
|
+
|
|
1311
|
+
// For `@link`
|
|
729
1312
|
|
|
730
1313
|
type SetFieldTypeOptions = {
|
|
731
1314
|
/**
|
|
@@ -733,6 +1316,8 @@ type SetFieldTypeOptions = {
|
|
|
733
1316
|
|
|
734
1317
|
NOTE: Property modifiers will always be preserved for properties that are not being updated.
|
|
735
1318
|
|
|
1319
|
+
Known limitation: A numeric key that is selected in the other spelling (`'0'` for a key declared as `0`, or the reverse) gets the new type, but keeps its modifiers.
|
|
1320
|
+
|
|
736
1321
|
@default true
|
|
737
1322
|
*/
|
|
738
1323
|
preservePropertyModifiers?: boolean;
|
|
@@ -751,6 +1336,10 @@ Use-cases:
|
|
|
751
1336
|
|
|
752
1337
|
@see `Merge` if you need to change multiple properties to different types.
|
|
753
1338
|
|
|
1339
|
+
This type only changes the type of the given keys at the top level. For a deeply nested property, use {@link SetProperty} with a key path: `SetProperty<{a: {b: string}}, 'a.b', number>` is `{a: {b: number}}`.
|
|
1340
|
+
|
|
1341
|
+
@see {@link SetProperty}
|
|
1342
|
+
|
|
754
1343
|
@example
|
|
755
1344
|
```
|
|
756
1345
|
import type {SetFieldType} from 'type-fest';
|
|
@@ -779,16 +1368,28 @@ type MyModelApi2 = SetFieldType<MyModel, 'createdAt' | 'updatedAt', string, {pre
|
|
|
779
1368
|
|
|
780
1369
|
@category Object
|
|
781
1370
|
*/
|
|
782
|
-
type SetFieldType<BaseType, Keys extends
|
|
783
|
-
_SetFieldType<BaseType, Keys
|
|
784
|
-
|
|
785
|
-
type _SetFieldType<BaseType, Keys
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
1371
|
+
type SetFieldType<BaseType, Keys extends KeysOfUnion<BaseType>, NewType, Options extends SetFieldTypeOptions = {}> =
|
|
1372
|
+
_SetFieldType<BaseType, KeySelector<UnwrapPathBrand<Keys>>, NewType, ApplyDefaultOptions<SetFieldTypeOptions, DefaultSetFieldTypeOptions, Options>>;
|
|
1373
|
+
|
|
1374
|
+
type _SetFieldType<BaseType, Keys, NewType, Options extends Required<SetFieldTypeOptions>> =
|
|
1375
|
+
// The distribution comes first, so that a member the keys do not reach is left as it is. Otherwise the `Record` below hands it a key it never had, as a required one when the modifiers are not preserved.
|
|
1376
|
+
BaseType extends unknown
|
|
1377
|
+
? SimplifyObject<{
|
|
1378
|
+
// Tuple elements use string indices, so look up their canonical numeric aliases in the selector, which matches each union member by its own spelling. Other numeric-looking names, like '01', stay distinct.
|
|
1379
|
+
[P in keyof BaseType]: P extends SelectedKeys<BaseType, Keys>
|
|
1380
|
+
? NewType
|
|
1381
|
+
: [SelectedKeyAlias<Keys, P>] extends [never]
|
|
1382
|
+
? BaseType[P]
|
|
1383
|
+
: NewType;
|
|
1384
|
+
} & (
|
|
1385
|
+
// `Record` is used to remove property modifiers. Matching declared spellings are added without replacing the original selector, so autocomplete unions retain their known required members beside index signatures. A tuple is left out of it: `Record` over `number` answers with every member an array has, which is not a tuple.
|
|
1386
|
+
Options['preservePropertyModifiers'] extends false
|
|
1387
|
+
? BaseType extends readonly unknown[]
|
|
1388
|
+
? unknown
|
|
1389
|
+
: Record<SelectedKeys<BaseType, Keys> & PropertyKey, NewType>
|
|
1390
|
+
: unknown
|
|
1391
|
+
)>
|
|
1392
|
+
: never; // Should never happen
|
|
792
1393
|
|
|
793
1394
|
/**
|
|
794
1395
|
* A utility function to configure options based on a given schema or properties.
|
|
@@ -833,7 +1434,7 @@ type _SetFieldType<BaseType, Keys extends keyof BaseType, NewType, Options exten
|
|
|
833
1434
|
* ```
|
|
834
1435
|
*/
|
|
835
1436
|
declare function OptionsConfigurator<const DefaultKey extends keyof Static<TObject<P>>, P extends Record<string, TSchema>>(schemaOrProps: P | TObject<P>, defaultKeys?: DefaultKey[]): {
|
|
836
|
-
(callback: (builder: ReturnType<() => DataProp<Omit<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1437
|
+
(callback: (builder: ReturnType<() => Simplify<DataProp<Simplify<Omit<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
837
1438
|
params: unknown[] & [];
|
|
838
1439
|
})["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
|
|
839
1440
|
params: unknown[] & [];
|
|
@@ -849,7 +1450,7 @@ declare function OptionsConfigurator<const DefaultKey extends keyof Static<TObje
|
|
|
849
1450
|
params: unknown[] & [];
|
|
850
1451
|
})["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
|
|
851
1452
|
params: unknown[] & [];
|
|
852
|
-
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey
|
|
1453
|
+
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey>>>, Record<keyof Simplify<Omit<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
853
1454
|
params: unknown[] & [];
|
|
854
1455
|
})["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
|
|
855
1456
|
params: unknown[] & [];
|
|
@@ -857,7 +1458,15 @@ declare function OptionsConfigurator<const DefaultKey extends keyof Static<TObje
|
|
|
857
1458
|
params: unknown[] & [];
|
|
858
1459
|
})["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
|
|
859
1460
|
params: unknown[] & [];
|
|
860
|
-
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey
|
|
1461
|
+
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey> & Partial<Pick<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1462
|
+
params: unknown[] & [];
|
|
1463
|
+
})["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
|
|
1464
|
+
params: unknown[] & [];
|
|
1465
|
+
})["static"]; }, { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P]>> & Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1466
|
+
params: unknown[] & [];
|
|
1467
|
+
})["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
|
|
1468
|
+
params: unknown[] & [];
|
|
1469
|
+
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey>>>, undefined>> & AllAccessors<Simplify<Omit<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
861
1470
|
params: unknown[] & [];
|
|
862
1471
|
})["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
|
|
863
1472
|
params: unknown[] & [];
|
|
@@ -873,7 +1482,15 @@ declare function OptionsConfigurator<const DefaultKey extends keyof Static<TObje
|
|
|
873
1482
|
params: unknown[] & [];
|
|
874
1483
|
})["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
|
|
875
1484
|
params: unknown[] & [];
|
|
876
|
-
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey
|
|
1485
|
+
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey>>>, Record<keyof Simplify<Omit<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1486
|
+
params: unknown[] & [];
|
|
1487
|
+
})["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
|
|
1488
|
+
params: unknown[] & [];
|
|
1489
|
+
})["static"]; }, { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P]>> & Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1490
|
+
params: unknown[] & [];
|
|
1491
|
+
})["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
|
|
1492
|
+
params: unknown[] & [];
|
|
1493
|
+
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey> & Partial<Pick<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
877
1494
|
params: unknown[] & [];
|
|
878
1495
|
})["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
|
|
879
1496
|
params: unknown[] & [];
|
|
@@ -881,7 +1498,7 @@ declare function OptionsConfigurator<const DefaultKey extends keyof Static<TObje
|
|
|
881
1498
|
params: unknown[] & [];
|
|
882
1499
|
})["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
|
|
883
1500
|
params: unknown[] & [];
|
|
884
|
-
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey
|
|
1501
|
+
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey>>>, undefined>> & DoneMethod<Simplify<Omit<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
885
1502
|
params: unknown[] & [];
|
|
886
1503
|
})["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
|
|
887
1504
|
params: unknown[] & [];
|
|
@@ -897,7 +1514,7 @@ declare function OptionsConfigurator<const DefaultKey extends keyof Static<TObje
|
|
|
897
1514
|
params: unknown[] & [];
|
|
898
1515
|
})["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
|
|
899
1516
|
params: unknown[] & [];
|
|
900
|
-
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey
|
|
1517
|
+
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey>>>, Record<keyof Simplify<Omit<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
901
1518
|
params: unknown[] & [];
|
|
902
1519
|
})["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
|
|
903
1520
|
params: unknown[] & [];
|
|
@@ -905,7 +1522,15 @@ declare function OptionsConfigurator<const DefaultKey extends keyof Static<TObje
|
|
|
905
1522
|
params: unknown[] & [];
|
|
906
1523
|
})["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
|
|
907
1524
|
params: unknown[] & [];
|
|
908
|
-
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey
|
|
1525
|
+
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey> & Partial<Pick<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1526
|
+
params: unknown[] & [];
|
|
1527
|
+
})["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
|
|
1528
|
+
params: unknown[] & [];
|
|
1529
|
+
})["static"]; }, { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P]>> & Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1530
|
+
params: unknown[] & [];
|
|
1531
|
+
})["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
|
|
1532
|
+
params: unknown[] & [];
|
|
1533
|
+
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey>>>, undefined>>>>) => Simplify<Omit<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
909
1534
|
params: unknown[] & [];
|
|
910
1535
|
})["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
|
|
911
1536
|
params: unknown[] & [];
|
|
@@ -921,7 +1546,7 @@ declare function OptionsConfigurator<const DefaultKey extends keyof Static<TObje
|
|
|
921
1546
|
params: unknown[] & [];
|
|
922
1547
|
})["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
|
|
923
1548
|
params: unknown[] & [];
|
|
924
|
-
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey
|
|
1549
|
+
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey>>>): _sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
925
1550
|
params: unknown[] & [];
|
|
926
1551
|
})["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
|
|
927
1552
|
params: unknown[] & [];
|
|
@@ -932,7 +1557,15 @@ declare function OptionsConfigurator<const DefaultKey extends keyof Static<TObje
|
|
|
932
1557
|
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>;
|
|
933
1558
|
getSchemaProps(): P;
|
|
934
1559
|
getSchema(): TObject<P>;
|
|
935
|
-
getDefaults(): Partial<Record<
|
|
1560
|
+
getDefaults(): Partial<Record<keyof Simplify<Omit<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1561
|
+
params: unknown[] & [];
|
|
1562
|
+
})["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
|
|
1563
|
+
params: unknown[] & [];
|
|
1564
|
+
})["static"]; }, { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P]>> & Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1565
|
+
params: unknown[] & [];
|
|
1566
|
+
})["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
|
|
1567
|
+
params: unknown[] & [];
|
|
1568
|
+
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey> & Partial<Pick<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
936
1569
|
params: unknown[] & [];
|
|
937
1570
|
})["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
|
|
938
1571
|
params: unknown[] & [];
|
|
@@ -940,7 +1573,7 @@ declare function OptionsConfigurator<const DefaultKey extends keyof Static<TObje
|
|
|
940
1573
|
params: unknown[] & [];
|
|
941
1574
|
})["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
|
|
942
1575
|
params: unknown[] & [];
|
|
943
|
-
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey
|
|
1576
|
+
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey>>>, () => Simplify<Omit<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
944
1577
|
params: unknown[] & [];
|
|
945
1578
|
})["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
|
|
946
1579
|
params: unknown[] & [];
|
|
@@ -956,7 +1589,7 @@ declare function OptionsConfigurator<const DefaultKey extends keyof Static<TObje
|
|
|
956
1589
|
params: unknown[] & [];
|
|
957
1590
|
})["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
|
|
958
1591
|
params: unknown[] & [];
|
|
959
|
-
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey
|
|
1592
|
+
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey>>>[keyof Simplify<Omit<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
960
1593
|
params: unknown[] & [];
|
|
961
1594
|
})["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
|
|
962
1595
|
params: unknown[] & [];
|
|
@@ -964,7 +1597,15 @@ declare function OptionsConfigurator<const DefaultKey extends keyof Static<TObje
|
|
|
964
1597
|
params: unknown[] & [];
|
|
965
1598
|
})["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
|
|
966
1599
|
params: unknown[] & [];
|
|
967
|
-
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey>]
|
|
1600
|
+
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey> & Partial<Pick<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1601
|
+
params: unknown[] & [];
|
|
1602
|
+
})["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
|
|
1603
|
+
params: unknown[] & [];
|
|
1604
|
+
})["static"]; }, { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P]>> & Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1605
|
+
params: unknown[] & [];
|
|
1606
|
+
})["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
|
|
1607
|
+
params: unknown[] & [];
|
|
1608
|
+
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey>>>]>>;
|
|
968
1609
|
getDefaultKeys(): DefaultKey[] | undefined;
|
|
969
1610
|
cast(v?: unknown): _sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
970
1611
|
params: unknown[] & [];
|
|
@@ -975,7 +1616,7 @@ declare function OptionsConfigurator<const DefaultKey extends keyof Static<TObje
|
|
|
975
1616
|
})["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
|
|
976
1617
|
params: unknown[] & [];
|
|
977
1618
|
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>;
|
|
978
|
-
getCreate(): () => DataProp<Omit<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1619
|
+
getCreate(): () => Simplify<DataProp<Simplify<Omit<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
979
1620
|
params: unknown[] & [];
|
|
980
1621
|
})["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
|
|
981
1622
|
params: unknown[] & [];
|
|
@@ -991,7 +1632,15 @@ declare function OptionsConfigurator<const DefaultKey extends keyof Static<TObje
|
|
|
991
1632
|
params: unknown[] & [];
|
|
992
1633
|
})["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
|
|
993
1634
|
params: unknown[] & [];
|
|
994
|
-
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey
|
|
1635
|
+
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey>>>, Record<keyof Simplify<Omit<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1636
|
+
params: unknown[] & [];
|
|
1637
|
+
})["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
|
|
1638
|
+
params: unknown[] & [];
|
|
1639
|
+
})["static"]; }, { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P]>> & Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1640
|
+
params: unknown[] & [];
|
|
1641
|
+
})["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
|
|
1642
|
+
params: unknown[] & [];
|
|
1643
|
+
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey> & Partial<Pick<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
995
1644
|
params: unknown[] & [];
|
|
996
1645
|
})["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
|
|
997
1646
|
params: unknown[] & [];
|
|
@@ -999,7 +1648,7 @@ declare function OptionsConfigurator<const DefaultKey extends keyof Static<TObje
|
|
|
999
1648
|
params: unknown[] & [];
|
|
1000
1649
|
})["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
|
|
1001
1650
|
params: unknown[] & [];
|
|
1002
|
-
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey
|
|
1651
|
+
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey>>>, undefined>> & AllAccessors<Simplify<Omit<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1003
1652
|
params: unknown[] & [];
|
|
1004
1653
|
})["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
|
|
1005
1654
|
params: unknown[] & [];
|
|
@@ -1015,7 +1664,7 @@ declare function OptionsConfigurator<const DefaultKey extends keyof Static<TObje
|
|
|
1015
1664
|
params: unknown[] & [];
|
|
1016
1665
|
})["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
|
|
1017
1666
|
params: unknown[] & [];
|
|
1018
|
-
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey
|
|
1667
|
+
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey>>>, Record<keyof Simplify<Omit<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1019
1668
|
params: unknown[] & [];
|
|
1020
1669
|
})["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
|
|
1021
1670
|
params: unknown[] & [];
|
|
@@ -1023,7 +1672,15 @@ declare function OptionsConfigurator<const DefaultKey extends keyof Static<TObje
|
|
|
1023
1672
|
params: unknown[] & [];
|
|
1024
1673
|
})["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
|
|
1025
1674
|
params: unknown[] & [];
|
|
1026
|
-
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey
|
|
1675
|
+
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey> & Partial<Pick<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1676
|
+
params: unknown[] & [];
|
|
1677
|
+
})["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
|
|
1678
|
+
params: unknown[] & [];
|
|
1679
|
+
})["static"]; }, { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P]>> & Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1680
|
+
params: unknown[] & [];
|
|
1681
|
+
})["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
|
|
1682
|
+
params: unknown[] & [];
|
|
1683
|
+
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey>>>, undefined>> & DoneMethod<Simplify<Omit<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1027
1684
|
params: unknown[] & [];
|
|
1028
1685
|
})["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
|
|
1029
1686
|
params: unknown[] & [];
|
|
@@ -1039,7 +1696,15 @@ declare function OptionsConfigurator<const DefaultKey extends keyof Static<TObje
|
|
|
1039
1696
|
params: unknown[] & [];
|
|
1040
1697
|
})["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
|
|
1041
1698
|
params: unknown[] & [];
|
|
1042
|
-
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey
|
|
1699
|
+
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey>>>, Record<keyof Simplify<Omit<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1700
|
+
params: unknown[] & [];
|
|
1701
|
+
})["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
|
|
1702
|
+
params: unknown[] & [];
|
|
1703
|
+
})["static"]; }, { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P]>> & Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1704
|
+
params: unknown[] & [];
|
|
1705
|
+
})["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
|
|
1706
|
+
params: unknown[] & [];
|
|
1707
|
+
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey> & Partial<Pick<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1043
1708
|
params: unknown[] & [];
|
|
1044
1709
|
})["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
|
|
1045
1710
|
params: unknown[] & [];
|
|
@@ -1047,7 +1712,7 @@ declare function OptionsConfigurator<const DefaultKey extends keyof Static<TObje
|
|
|
1047
1712
|
params: unknown[] & [];
|
|
1048
1713
|
})["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
|
|
1049
1714
|
params: unknown[] & [];
|
|
1050
|
-
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey
|
|
1715
|
+
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey>>>, undefined>>>;
|
|
1051
1716
|
getBuild(): /*elided*/ any;
|
|
1052
1717
|
createFunction<Ret>(func: (options: _sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1053
1718
|
params: unknown[] & [];
|
|
@@ -1058,7 +1723,7 @@ declare function OptionsConfigurator<const DefaultKey extends keyof Static<TObje
|
|
|
1058
1723
|
})["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
|
|
1059
1724
|
params: unknown[] & [];
|
|
1060
1725
|
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>) => Ret): {
|
|
1061
|
-
(options: Omit<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1726
|
+
(options: Simplify<Omit<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1062
1727
|
params: unknown[] & [];
|
|
1063
1728
|
})["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
|
|
1064
1729
|
params: unknown[] & [];
|
|
@@ -1074,8 +1739,8 @@ declare function OptionsConfigurator<const DefaultKey extends keyof Static<TObje
|
|
|
1074
1739
|
params: unknown[] & [];
|
|
1075
1740
|
})["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
|
|
1076
1741
|
params: unknown[] & [];
|
|
1077
|
-
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey
|
|
1078
|
-
(builder: (builder: ReturnType<() => DataProp<Omit<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1742
|
+
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey>>>): Ret;
|
|
1743
|
+
(builder: (builder: ReturnType<() => Simplify<DataProp<Simplify<Omit<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1079
1744
|
params: unknown[] & [];
|
|
1080
1745
|
})["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
|
|
1081
1746
|
params: unknown[] & [];
|
|
@@ -1091,7 +1756,7 @@ declare function OptionsConfigurator<const DefaultKey extends keyof Static<TObje
|
|
|
1091
1756
|
params: unknown[] & [];
|
|
1092
1757
|
})["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
|
|
1093
1758
|
params: unknown[] & [];
|
|
1094
|
-
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey
|
|
1759
|
+
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey>>>, Record<keyof Simplify<Omit<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1095
1760
|
params: unknown[] & [];
|
|
1096
1761
|
})["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
|
|
1097
1762
|
params: unknown[] & [];
|
|
@@ -1099,7 +1764,15 @@ declare function OptionsConfigurator<const DefaultKey extends keyof Static<TObje
|
|
|
1099
1764
|
params: unknown[] & [];
|
|
1100
1765
|
})["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
|
|
1101
1766
|
params: unknown[] & [];
|
|
1102
|
-
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey
|
|
1767
|
+
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey> & Partial<Pick<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1768
|
+
params: unknown[] & [];
|
|
1769
|
+
})["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
|
|
1770
|
+
params: unknown[] & [];
|
|
1771
|
+
})["static"]; }, { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P]>> & Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1772
|
+
params: unknown[] & [];
|
|
1773
|
+
})["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
|
|
1774
|
+
params: unknown[] & [];
|
|
1775
|
+
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey>>>, undefined>> & AllAccessors<Simplify<Omit<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1103
1776
|
params: unknown[] & [];
|
|
1104
1777
|
})["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
|
|
1105
1778
|
params: unknown[] & [];
|
|
@@ -1115,7 +1788,15 @@ declare function OptionsConfigurator<const DefaultKey extends keyof Static<TObje
|
|
|
1115
1788
|
params: unknown[] & [];
|
|
1116
1789
|
})["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
|
|
1117
1790
|
params: unknown[] & [];
|
|
1118
|
-
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey
|
|
1791
|
+
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey>>>, Record<keyof Simplify<Omit<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1792
|
+
params: unknown[] & [];
|
|
1793
|
+
})["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
|
|
1794
|
+
params: unknown[] & [];
|
|
1795
|
+
})["static"]; }, { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P]>> & Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1796
|
+
params: unknown[] & [];
|
|
1797
|
+
})["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
|
|
1798
|
+
params: unknown[] & [];
|
|
1799
|
+
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey> & Partial<Pick<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1119
1800
|
params: unknown[] & [];
|
|
1120
1801
|
})["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
|
|
1121
1802
|
params: unknown[] & [];
|
|
@@ -1123,7 +1804,7 @@ declare function OptionsConfigurator<const DefaultKey extends keyof Static<TObje
|
|
|
1123
1804
|
params: unknown[] & [];
|
|
1124
1805
|
})["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
|
|
1125
1806
|
params: unknown[] & [];
|
|
1126
|
-
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey
|
|
1807
|
+
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey>>>, undefined>> & DoneMethod<Simplify<Omit<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1127
1808
|
params: unknown[] & [];
|
|
1128
1809
|
})["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
|
|
1129
1810
|
params: unknown[] & [];
|
|
@@ -1139,7 +1820,7 @@ declare function OptionsConfigurator<const DefaultKey extends keyof Static<TObje
|
|
|
1139
1820
|
params: unknown[] & [];
|
|
1140
1821
|
})["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
|
|
1141
1822
|
params: unknown[] & [];
|
|
1142
|
-
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey
|
|
1823
|
+
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey>>>, Record<keyof Simplify<Omit<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1143
1824
|
params: unknown[] & [];
|
|
1144
1825
|
})["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
|
|
1145
1826
|
params: unknown[] & [];
|
|
@@ -1147,7 +1828,15 @@ declare function OptionsConfigurator<const DefaultKey extends keyof Static<TObje
|
|
|
1147
1828
|
params: unknown[] & [];
|
|
1148
1829
|
})["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
|
|
1149
1830
|
params: unknown[] & [];
|
|
1150
|
-
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey
|
|
1831
|
+
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey> & Partial<Pick<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1832
|
+
params: unknown[] & [];
|
|
1833
|
+
})["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
|
|
1834
|
+
params: unknown[] & [];
|
|
1835
|
+
})["static"]; }, { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P]>> & Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1836
|
+
params: unknown[] & [];
|
|
1837
|
+
})["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
|
|
1838
|
+
params: unknown[] & [];
|
|
1839
|
+
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey>>>, undefined>>>>) => Simplify<Omit<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1151
1840
|
params: unknown[] & [];
|
|
1152
1841
|
})["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
|
|
1153
1842
|
params: unknown[] & [];
|
|
@@ -1163,12 +1852,12 @@ declare function OptionsConfigurator<const DefaultKey extends keyof Static<TObje
|
|
|
1163
1852
|
params: unknown[] & [];
|
|
1164
1853
|
})["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
|
|
1165
1854
|
params: unknown[] & [];
|
|
1166
|
-
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey
|
|
1855
|
+
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey>>>): Ret;
|
|
1167
1856
|
} & {
|
|
1168
1857
|
get OptionsConfigurator(): /*elided*/ any;
|
|
1169
1858
|
};
|
|
1170
1859
|
createBaseClass(): {
|
|
1171
|
-
new (options: Omit<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1860
|
+
new (options: Simplify<Omit<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1172
1861
|
params: unknown[] & [];
|
|
1173
1862
|
})["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
|
|
1174
1863
|
params: unknown[] & [];
|
|
@@ -1184,7 +1873,7 @@ declare function OptionsConfigurator<const DefaultKey extends keyof Static<TObje
|
|
|
1184
1873
|
params: unknown[] & [];
|
|
1185
1874
|
})["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
|
|
1186
1875
|
params: unknown[] & [];
|
|
1187
|
-
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey
|
|
1876
|
+
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey>>>): {
|
|
1188
1877
|
readonly options: _sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1189
1878
|
params: unknown[] & [];
|
|
1190
1879
|
})["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
|
|
@@ -1201,7 +1890,7 @@ declare function OptionsConfigurator<const DefaultKey extends keyof Static<TObje
|
|
|
1201
1890
|
isValidOptions(): boolean;
|
|
1202
1891
|
assertValidOptions(): void;
|
|
1203
1892
|
};
|
|
1204
|
-
new (builder: (builder: ReturnType<() => DataProp<Omit<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1893
|
+
new (builder: (builder: ReturnType<() => Simplify<DataProp<Simplify<Omit<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1205
1894
|
params: unknown[] & [];
|
|
1206
1895
|
})["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
|
|
1207
1896
|
params: unknown[] & [];
|
|
@@ -1217,7 +1906,15 @@ declare function OptionsConfigurator<const DefaultKey extends keyof Static<TObje
|
|
|
1217
1906
|
params: unknown[] & [];
|
|
1218
1907
|
})["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
|
|
1219
1908
|
params: unknown[] & [];
|
|
1220
|
-
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey
|
|
1909
|
+
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey>>>, Record<keyof Simplify<Omit<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1910
|
+
params: unknown[] & [];
|
|
1911
|
+
})["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
|
|
1912
|
+
params: unknown[] & [];
|
|
1913
|
+
})["static"]; }, { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P]>> & Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1914
|
+
params: unknown[] & [];
|
|
1915
|
+
})["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
|
|
1916
|
+
params: unknown[] & [];
|
|
1917
|
+
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey> & Partial<Pick<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1221
1918
|
params: unknown[] & [];
|
|
1222
1919
|
})["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
|
|
1223
1920
|
params: unknown[] & [];
|
|
@@ -1225,7 +1922,7 @@ declare function OptionsConfigurator<const DefaultKey extends keyof Static<TObje
|
|
|
1225
1922
|
params: unknown[] & [];
|
|
1226
1923
|
})["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
|
|
1227
1924
|
params: unknown[] & [];
|
|
1228
|
-
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey
|
|
1925
|
+
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey>>>, undefined>> & AllAccessors<Simplify<Omit<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1229
1926
|
params: unknown[] & [];
|
|
1230
1927
|
})["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
|
|
1231
1928
|
params: unknown[] & [];
|
|
@@ -1241,7 +1938,7 @@ declare function OptionsConfigurator<const DefaultKey extends keyof Static<TObje
|
|
|
1241
1938
|
params: unknown[] & [];
|
|
1242
1939
|
})["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
|
|
1243
1940
|
params: unknown[] & [];
|
|
1244
|
-
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey
|
|
1941
|
+
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey>>>, Record<keyof Simplify<Omit<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1245
1942
|
params: unknown[] & [];
|
|
1246
1943
|
})["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
|
|
1247
1944
|
params: unknown[] & [];
|
|
@@ -1249,7 +1946,15 @@ declare function OptionsConfigurator<const DefaultKey extends keyof Static<TObje
|
|
|
1249
1946
|
params: unknown[] & [];
|
|
1250
1947
|
})["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
|
|
1251
1948
|
params: unknown[] & [];
|
|
1252
|
-
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey
|
|
1949
|
+
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey> & Partial<Pick<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1950
|
+
params: unknown[] & [];
|
|
1951
|
+
})["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
|
|
1952
|
+
params: unknown[] & [];
|
|
1953
|
+
})["static"]; }, { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P]>> & Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1954
|
+
params: unknown[] & [];
|
|
1955
|
+
})["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
|
|
1956
|
+
params: unknown[] & [];
|
|
1957
|
+
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey>>>, undefined>> & DoneMethod<Simplify<Omit<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1253
1958
|
params: unknown[] & [];
|
|
1254
1959
|
})["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
|
|
1255
1960
|
params: unknown[] & [];
|
|
@@ -1265,7 +1970,15 @@ declare function OptionsConfigurator<const DefaultKey extends keyof Static<TObje
|
|
|
1265
1970
|
params: unknown[] & [];
|
|
1266
1971
|
})["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
|
|
1267
1972
|
params: unknown[] & [];
|
|
1268
|
-
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey
|
|
1973
|
+
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey>>>, Record<keyof Simplify<Omit<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1974
|
+
params: unknown[] & [];
|
|
1975
|
+
})["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
|
|
1976
|
+
params: unknown[] & [];
|
|
1977
|
+
})["static"]; }, { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P]>> & Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1978
|
+
params: unknown[] & [];
|
|
1979
|
+
})["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
|
|
1980
|
+
params: unknown[] & [];
|
|
1981
|
+
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey> & Partial<Pick<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1269
1982
|
params: unknown[] & [];
|
|
1270
1983
|
})["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
|
|
1271
1984
|
params: unknown[] & [];
|
|
@@ -1273,7 +1986,7 @@ declare function OptionsConfigurator<const DefaultKey extends keyof Static<TObje
|
|
|
1273
1986
|
params: unknown[] & [];
|
|
1274
1987
|
})["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
|
|
1275
1988
|
params: unknown[] & [];
|
|
1276
|
-
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey
|
|
1989
|
+
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey>>>, undefined>>>>) => Simplify<Omit<_sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1277
1990
|
params: unknown[] & [];
|
|
1278
1991
|
})["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
|
|
1279
1992
|
params: unknown[] & [];
|
|
@@ -1289,7 +2002,7 @@ declare function OptionsConfigurator<const DefaultKey extends keyof Static<TObje
|
|
|
1289
2002
|
params: unknown[] & [];
|
|
1290
2003
|
})["static"]; }, { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>> & Required<Pick<{ [K in keyof P]: (P[K] & {
|
|
1291
2004
|
params: unknown[] & [];
|
|
1292
|
-
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey
|
|
2005
|
+
})["static"]; }, Exclude<keyof P, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P] | { [K_2 in keyof P]: P[K_2] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_2] extends _sinclair_typebox.TOptional<P[K_2]> ? never : K_2 : never; }[keyof P] | { [K_3 in keyof P]: P[K_3] extends _sinclair_typebox.TOptional<TSchema> ? P[K_3] extends _sinclair_typebox.TReadonly<P[K_3]> ? never : K_3 : never; }[keyof P]>>>>, DefaultKey>>>): {
|
|
1293
2006
|
readonly options: _sinclair_typebox.Evaluate<Readonly<Partial<Pick<{ [K in keyof P]: (P[K] & {
|
|
1294
2007
|
params: unknown[] & [];
|
|
1295
2008
|
})["static"]; }, { [K_1 in keyof P]: P[K_1] extends _sinclair_typebox.TReadonly<TSchema> ? P[K_1] extends _sinclair_typebox.TOptional<P[K_1]> ? K_1 : never : never; }[keyof P]>>> & Readonly<Pick<{ [K in keyof P]: (P[K] & {
|