@agntn/tools 0.0.0 → 0.1.1
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/README.md +5 -3
- package/dist/_chunks/libs/typebox.d.mts +888 -558
- package/dist/_chunks/libs/typebox.d.mts.map +1 -1
- package/dist/_chunks/libs/typebox.mjs +234 -3
- package/dist/_chunks/libs/typebox.mjs.map +1 -1
- package/dist/_chunks/src.mjs +158 -0
- package/dist/_chunks/src.mjs.map +1 -0
- package/dist/ai.d.mts +3 -4
- package/dist/ai.d.mts.map +1 -1
- package/dist/ai.mjs +1 -1
- package/dist/cli.d.mts +65 -0
- package/dist/cli.d.mts.map +1 -0
- package/dist/cli.mjs +393 -0
- package/dist/cli.mjs.map +1 -0
- package/dist/index.d.mts +38 -20
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +2 -90
- package/dist/mcp.d.mts +11 -8
- package/dist/mcp.d.mts.map +1 -1
- package/dist/mcp.mjs +8 -4
- package/dist/mcp.mjs.map +1 -1
- package/dist/omp.d.mts +4 -5
- package/dist/omp.d.mts.map +1 -1
- package/dist/omp.mjs +1 -1
- package/dist/pi.d.mts +3 -4
- package/dist/pi.d.mts.map +1 -1
- package/dist/pi.mjs +1 -1
- package/package.json +22 -18
- package/dist/index.mjs.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
interface TSchema {}
|
|
2
|
-
declare function IsKind<Kind extends string>(value: unknown, kind: Kind): value is {
|
|
1
|
+
export interface TSchema {}
|
|
2
|
+
export declare function IsKind<Kind extends string>(value: unknown, kind: Kind): value is {
|
|
3
3
|
['~kind']: Kind;
|
|
4
4
|
};
|
|
5
|
-
declare function IsSchema(value: unknown): value is TSchema;
|
|
6
|
-
interface TSchemaOptions {
|
|
5
|
+
export declare function IsSchema(value: unknown): value is TSchema;
|
|
6
|
+
export interface TSchemaOptions {
|
|
7
7
|
/**
|
|
8
8
|
* Allows for additional, unlisted properties to be included, typically for extensibility.
|
|
9
9
|
*/
|
|
@@ -53,7 +53,7 @@ interface TSchemaOptions {
|
|
|
53
53
|
*/
|
|
54
54
|
else?: TSchema;
|
|
55
55
|
}
|
|
56
|
-
interface TObjectOptions extends TSchemaOptions {
|
|
56
|
+
export interface TObjectOptions extends TSchemaOptions {
|
|
57
57
|
/**
|
|
58
58
|
* Defines whether additional properties are allowed beyond those explicitly defined in `properties`.
|
|
59
59
|
*/
|
|
@@ -87,7 +87,7 @@ interface TObjectOptions extends TSchemaOptions {
|
|
|
87
87
|
*/
|
|
88
88
|
propertyNames?: TSchema;
|
|
89
89
|
}
|
|
90
|
-
interface TArrayOptions extends TSchemaOptions {
|
|
90
|
+
export interface TArrayOptions extends TSchemaOptions {
|
|
91
91
|
/**
|
|
92
92
|
* The minimum number of items allowed in the array.
|
|
93
93
|
*/
|
|
@@ -117,19 +117,19 @@ interface TArrayOptions extends TSchemaOptions {
|
|
|
117
117
|
*/
|
|
118
118
|
uniqueItems?: boolean;
|
|
119
119
|
}
|
|
120
|
-
interface TTupleOptions extends TArrayOptions {
|
|
120
|
+
export interface TTupleOptions extends TArrayOptions {
|
|
121
121
|
/**
|
|
122
122
|
* A schema to apply to any items in the array that were not validated by `prefixItems` or `items`. If `false`, no additional items are allowed.
|
|
123
123
|
*/
|
|
124
124
|
unevaluatedItems?: TSchema | boolean;
|
|
125
125
|
}
|
|
126
|
-
interface TIntersectOptions extends TSchemaOptions {
|
|
126
|
+
export interface TIntersectOptions extends TSchemaOptions {
|
|
127
127
|
/**
|
|
128
128
|
* A schema to apply to any properties in the object that were not validated by other keywords like `properties`, `patternProperties`, or `additionalProperties`. If `false`, no additional properties are allowed.
|
|
129
129
|
*/
|
|
130
130
|
unevaluatedProperties?: TSchema | boolean;
|
|
131
131
|
}
|
|
132
|
-
interface TNumberOptions extends TSchemaOptions {
|
|
132
|
+
export interface TNumberOptions extends TSchemaOptions {
|
|
133
133
|
/**
|
|
134
134
|
* Specifies an exclusive upper limit for the number (number must be less than this value).
|
|
135
135
|
*/
|
|
@@ -151,8 +151,8 @@ interface TNumberOptions extends TSchemaOptions {
|
|
|
151
151
|
*/
|
|
152
152
|
multipleOf?: number | bigint;
|
|
153
153
|
}
|
|
154
|
-
type TFormat = 'date-time' | 'date' | 'duration' | 'email' | 'hostname' | 'idn-email' | 'idn-hostname' | 'ipv4' | 'ipv6' | 'iri-reference' | 'iri' | 'json-pointer-uri-fragment' | 'json-pointer' | 'json-string' | 'regex' | 'relative-json-pointer' | 'time' | 'uri-reference' | 'uri-template' | 'uri' | 'url' | 'uuid' | ({} & string);
|
|
155
|
-
interface TStringOptions extends TSchemaOptions {
|
|
154
|
+
export type TFormat = 'date-time' | 'date' | 'duration' | 'email' | 'hostname' | 'idn-email' | 'idn-hostname' | 'ipv4' | 'ipv6' | 'iri-reference' | 'iri' | 'json-pointer-uri-fragment' | 'json-pointer' | 'json-string' | 'regex' | 'relative-json-pointer' | 'time' | 'uri-reference' | 'uri-template' | 'uri' | 'url' | 'uuid' | ({} & string);
|
|
155
|
+
export interface TStringOptions extends TSchemaOptions {
|
|
156
156
|
/**
|
|
157
157
|
* Specifies the expected string format. May also be a custom format string.
|
|
158
158
|
*/
|
|
@@ -174,7 +174,7 @@ interface TStringOptions extends TSchemaOptions {
|
|
|
174
174
|
pattern?: string | RegExp;
|
|
175
175
|
}
|
|
176
176
|
/** Represents a deferred action. */
|
|
177
|
-
interface TDeferred<Action extends string = string, Types extends TSchema[] = TSchema[]> extends TSchema {
|
|
177
|
+
export interface TDeferred<Action extends string = string, Types extends TSchema[] = TSchema[]> extends TSchema {
|
|
178
178
|
'~kind': 'Deferred';
|
|
179
179
|
type: 'deferred';
|
|
180
180
|
action: Action;
|
|
@@ -182,113 +182,113 @@ interface TDeferred<Action extends string = string, Types extends TSchema[] = TS
|
|
|
182
182
|
options: TSchemaOptions;
|
|
183
183
|
}
|
|
184
184
|
/** Creates a Deferred action. */
|
|
185
|
-
declare function Deferred<Action extends string, Types extends TSchema[]>(action: Action, parameters: [...Types], options: TSchemaOptions): TDeferred<Action, Types>;
|
|
185
|
+
export declare function Deferred<Action extends string, Types extends TSchema[]>(action: Action, parameters: [...Types], options: TSchemaOptions): TDeferred<Action, Types>;
|
|
186
186
|
/** Returns true if the given value is a TDeferred. */
|
|
187
|
-
declare function IsDeferred(value: unknown): value is TDeferred;
|
|
188
|
-
type StaticCodec<Stack extends string[], Direction extends StaticDirection, Context extends TProperties, This extends TProperties, Type extends TSchema, Decoded extends unknown> = (Direction extends 'Decode' ? Decoded : StaticType<Stack, Direction, Context, This, Omit<Type, '~codec'>>);
|
|
189
|
-
type TDecodeCallback<Encoded extends unknown, Decoded = unknown> = (input: Encoded) => Decoded;
|
|
190
|
-
type TEncodeCallback<Encoded extends unknown, Decoded = unknown> = (input: Decoded) => Encoded;
|
|
191
|
-
type TCodec<Type extends TSchema = TSchema, Decoded extends unknown = unknown> = Type & {
|
|
187
|
+
export declare function IsDeferred(value: unknown): value is TDeferred;
|
|
188
|
+
export type StaticCodec<Stack extends string[], Direction extends StaticDirection, Context extends TProperties, This extends TProperties, Type extends TSchema, Decoded extends unknown> = (Direction extends 'Decode' ? Decoded : StaticType<Stack, Direction, Context, This, Omit<Type, '~codec'>>);
|
|
189
|
+
export type TDecodeCallback<Encoded extends unknown, Decoded = unknown> = (input: Encoded) => Decoded;
|
|
190
|
+
export type TEncodeCallback<Encoded extends unknown, Decoded = unknown> = (input: Decoded) => Encoded;
|
|
191
|
+
export type TCodec<Type extends TSchema = TSchema, Decoded extends unknown = unknown> = Type & {
|
|
192
192
|
'~codec': {
|
|
193
193
|
encode: TDecodeCallback<unknown, Decoded>;
|
|
194
194
|
decode: TEncodeCallback<unknown, Decoded>;
|
|
195
195
|
};
|
|
196
196
|
};
|
|
197
|
-
declare class EncodeBuilder<Type extends TSchema, Encoded extends unknown, Decoded extends unknown> {
|
|
197
|
+
export declare class EncodeBuilder<Type extends TSchema, Encoded extends unknown, Decoded extends unknown> {
|
|
198
198
|
private readonly type;
|
|
199
199
|
private readonly decode;
|
|
200
200
|
constructor(type: Type, decode: globalThis.Function);
|
|
201
201
|
Encode(callback: TEncodeCallback<Encoded, Decoded>): TCodec<Type, Decoded>;
|
|
202
202
|
}
|
|
203
|
-
declare class DecodeBuilder<Type extends TSchema, Encoded extends unknown> {
|
|
203
|
+
export declare class DecodeBuilder<Type extends TSchema, Encoded extends unknown> {
|
|
204
204
|
private readonly type;
|
|
205
205
|
constructor(type: Type);
|
|
206
206
|
Decode<Callback extends TDecodeCallback<Encoded, unknown>>(callback: Callback): EncodeBuilder<Type, Encoded, ReturnType<Callback>>;
|
|
207
207
|
}
|
|
208
208
|
/** Creates a bi-directional Codec. Codec functions are called on Value.Decode and Value.Encode. */
|
|
209
|
-
declare function Codec<Type extends TSchema>(type: Type): DecodeBuilder<Type, StaticDecode<Type>>;
|
|
209
|
+
export declare function Codec<Type extends TSchema>(type: Type): DecodeBuilder<Type, StaticDecode<Type>>;
|
|
210
210
|
/** Createsa uni-directional Codec with Decode only. The Decode function is called on Value.Decode */
|
|
211
|
-
declare function Decode<Type extends TSchema, Callback extends TDecodeCallback<StaticDecode<Type>, unknown>>(type: Type, callback: Callback): TCodec<Type, ReturnType<Callback>>;
|
|
211
|
+
export declare function Decode<Type extends TSchema, Callback extends TDecodeCallback<StaticDecode<Type>, unknown>>(type: Type, callback: Callback): TCodec<Type, ReturnType<Callback>>;
|
|
212
212
|
/** Creates a uni-directional Codec with Encode only. The Encode function is called on Value.Encode */
|
|
213
|
-
declare function Encode<Type extends TSchema>(type: Type, callback: TEncodeCallback<StaticDecode<Type>, unknown>): TCodec<Type, unknown>;
|
|
214
|
-
declare function IsCodec(value: unknown): value is TCodec;
|
|
215
|
-
type StaticAny = any;
|
|
213
|
+
export declare function Encode<Type extends TSchema>(type: Type, callback: TEncodeCallback<StaticDecode<Type>, unknown>): TCodec<Type, unknown>;
|
|
214
|
+
export declare function IsCodec(value: unknown): value is TCodec;
|
|
215
|
+
export type StaticAny = any;
|
|
216
216
|
/** Represents a Any type. */
|
|
217
|
-
interface TAny extends TSchema {
|
|
217
|
+
export interface TAny extends TSchema {
|
|
218
218
|
'~kind': 'Any';
|
|
219
219
|
}
|
|
220
220
|
/** Creates a Any type. */
|
|
221
|
-
declare function Any(options?: TSchemaOptions): TAny;
|
|
221
|
+
export declare function Any(options?: TSchemaOptions): TAny;
|
|
222
222
|
/** Returns true if the given value is a TAny. */
|
|
223
|
-
declare function IsAny(value: unknown): value is TAny;
|
|
224
|
-
type TImmutable<Type extends TSchema = TSchema> = (Type & {
|
|
223
|
+
export declare function IsAny(value: unknown): value is TAny;
|
|
224
|
+
export type TImmutable<Type extends TSchema = TSchema> = (Type & {
|
|
225
225
|
'~immutable': true;
|
|
226
226
|
});
|
|
227
227
|
/** Applies an Immutable modifier to the given type. */
|
|
228
|
-
declare function Immutable<Type extends TSchema>(type: Type): TAddImmutable<Type>;
|
|
228
|
+
export declare function Immutable<Type extends TSchema>(type: Type): TAddImmutable<Type>;
|
|
229
229
|
/** Returns true if the given value is a TImmutable */
|
|
230
|
-
declare function IsImmutable(value: unknown): value is TImmutable<TSchema>;
|
|
231
|
-
type StaticArray<Stack extends string[], Direction extends StaticDirection, Context extends TProperties, This extends TProperties, Array extends TSchema, Item extends TSchema, Result extends readonly unknown[] = Array extends TImmutable ? readonly StaticType<Stack, Direction, Context, This, Item>[] : StaticType<Stack, Direction, Context, This, Item>[]> = Result;
|
|
230
|
+
export declare function IsImmutable(value: unknown): value is TImmutable<TSchema>;
|
|
231
|
+
export type StaticArray<Stack extends string[], Direction extends StaticDirection, Context extends TProperties, This extends TProperties, Array extends TSchema, Item extends TSchema, Result extends readonly unknown[] = Array extends TImmutable ? readonly StaticType<Stack, Direction, Context, This, Item>[] : StaticType<Stack, Direction, Context, This, Item>[]> = Result;
|
|
232
232
|
/** Represents an Array type. */
|
|
233
|
-
interface TArray<Type extends TSchema = TSchema> extends TSchema {
|
|
233
|
+
export interface TArray<Type extends TSchema = TSchema> extends TSchema {
|
|
234
234
|
'~kind': 'Array';
|
|
235
235
|
type: 'array';
|
|
236
236
|
items: Type;
|
|
237
237
|
}
|
|
238
238
|
/** Creates an Array type. */
|
|
239
|
-
declare function _Array_<Type extends TSchema>(items: Type, options?: TArrayOptions): TArray<Type>;
|
|
239
|
+
export declare function _Array_<Type extends TSchema>(items: Type, options?: TArrayOptions): TArray<Type>;
|
|
240
240
|
/** Returns true if the given value is a TArray. */
|
|
241
|
-
declare function IsArray(value: unknown): value is TArray;
|
|
241
|
+
export declare function IsArray(value: unknown): value is TArray;
|
|
242
242
|
/** Extracts options from a TArray. */
|
|
243
|
-
declare function ArrayOptions(type: TArray): TArrayOptions;
|
|
244
|
-
declare const BigIntPattern = "-?(?:0|[1-9][0-9]*)n";
|
|
245
|
-
type StaticBigInt = bigint;
|
|
243
|
+
export declare function ArrayOptions(type: TArray): TArrayOptions;
|
|
244
|
+
export declare const BigIntPattern = "-?(?:0|[1-9][0-9]*)n";
|
|
245
|
+
export type StaticBigInt = bigint;
|
|
246
246
|
/** Represents a BigInt type. */
|
|
247
247
|
interface TBigInt$1 extends TSchema {
|
|
248
248
|
'~kind': 'BigInt';
|
|
249
249
|
type: 'bigint';
|
|
250
250
|
}
|
|
251
251
|
/** Creates a BigInt type. */
|
|
252
|
-
declare function BigInt(options?: TNumberOptions): TBigInt$1;
|
|
252
|
+
declare function BigInt$1(options?: TNumberOptions): TBigInt$1;
|
|
253
253
|
/** Returns true if the given value is a TBigInt. */
|
|
254
|
-
declare function IsBigInt(value: unknown): value is TBigInt$1;
|
|
255
|
-
type StaticBoolean = boolean;
|
|
254
|
+
export declare function IsBigInt(value: unknown): value is TBigInt$1;
|
|
255
|
+
export type StaticBoolean = boolean;
|
|
256
256
|
/** Represents a Boolean type. */
|
|
257
|
-
interface TBoolean extends TSchema {
|
|
257
|
+
export interface TBoolean extends TSchema {
|
|
258
258
|
'~kind': 'Boolean';
|
|
259
259
|
type: 'boolean';
|
|
260
260
|
}
|
|
261
261
|
/** Creates a Boolean type. */
|
|
262
|
-
declare function Boolean(options?: TSchemaOptions): TBoolean;
|
|
262
|
+
export declare function Boolean(options?: TSchemaOptions): TBoolean;
|
|
263
263
|
/** Returns true if the given value is a TBoolean. */
|
|
264
|
-
declare function IsBoolean(value: unknown): value is TBoolean;
|
|
264
|
+
export declare function IsBoolean(value: unknown): value is TBoolean;
|
|
265
265
|
/** Creates a deferred AddReadonly action. */
|
|
266
|
-
type TAddReadonlyDeferred<Type extends TSchema> = (TDeferred<'AddReadonly', [Type]>);
|
|
266
|
+
export type TAddReadonlyDeferred<Type extends TSchema> = (TDeferred<'AddReadonly', [Type]>);
|
|
267
267
|
/** Creates a deferred AddReadonly action. */
|
|
268
|
-
declare function AddReadonlyDeferred<Type extends TSchema>(type: Type, options?: TSchemaOptions): TAddReadonlyDeferred<Type>;
|
|
268
|
+
export declare function AddReadonlyDeferred<Type extends TSchema>(type: Type, options?: TSchemaOptions): TAddReadonlyDeferred<Type>;
|
|
269
269
|
/** Applies an AddReadonly action to a type. */
|
|
270
|
-
type TAddReadonly<Type extends TSchema> = (TAddReadonlyAction<Type>);
|
|
270
|
+
export type TAddReadonly<Type extends TSchema> = (TAddReadonlyAction<Type>);
|
|
271
271
|
/** Applies an AddReadonly action to a type. */
|
|
272
|
-
declare function AddReadonly<Type extends TSchema>(type: Type, options?: TSchemaOptions): TAddReadonly<Type>;
|
|
272
|
+
export declare function AddReadonly<Type extends TSchema>(type: Type, options?: TSchemaOptions): TAddReadonly<Type>;
|
|
273
273
|
type TReadonly$1<Type extends TSchema = TSchema> = (Type & {
|
|
274
274
|
'~readonly': true;
|
|
275
275
|
});
|
|
276
276
|
/** Applies an Readonly property modifier to the given type. */
|
|
277
|
-
declare function Readonly$
|
|
277
|
+
declare function Readonly$2<Type extends TSchema>(type: Type): TAddReadonly<Type>;
|
|
278
278
|
/** Returns true if the given value is a TReadonly */
|
|
279
|
-
declare function IsReadonly
|
|
279
|
+
export declare function IsReadonly(value: unknown): value is TReadonly$1<TSchema>;
|
|
280
280
|
type TAddReadonlyOperation<Type extends TSchema, Result extends TSchema = `~readonly` extends keyof Type ? Type : TReadonly$1<Type>> = Result;
|
|
281
281
|
type TAddReadonlyAction<Type extends TSchema, Result extends TSchema = TAddReadonlyOperation<Type>> = Result;
|
|
282
282
|
type TAddReadonlyInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, InstantiateType extends TSchema = TInstantiateType<Context, State, Type>> = TAddReadonlyAction<InstantiateType>;
|
|
283
|
-
type StaticUnknown = unknown;
|
|
283
|
+
export type StaticUnknown = unknown;
|
|
284
284
|
/** Represents an Unknown type. */
|
|
285
|
-
interface TUnknown extends TSchema {
|
|
285
|
+
export interface TUnknown extends TSchema {
|
|
286
286
|
'~kind': 'Unknown';
|
|
287
287
|
}
|
|
288
288
|
/** Creates an Unknown type. */
|
|
289
|
-
declare function Unknown(options?: TSchemaOptions): TUnknown;
|
|
289
|
+
export declare function Unknown(options?: TSchemaOptions): TUnknown;
|
|
290
290
|
/** Returns true if the given value is TUnknown. */
|
|
291
|
-
declare function IsUnknown(value: unknown): value is TUnknown;
|
|
291
|
+
export declare function IsUnknown(value: unknown): value is TUnknown;
|
|
292
292
|
/** Represents a Generic parameter. */
|
|
293
293
|
interface TParameter$1<Name extends string = string, Extends extends TSchema = TSchema, Equals extends TSchema = TSchema> extends TSchema {
|
|
294
294
|
'~kind': 'Parameter';
|
|
@@ -297,133 +297,133 @@ interface TParameter$1<Name extends string = string, Extends extends TSchema = T
|
|
|
297
297
|
equals: Equals;
|
|
298
298
|
}
|
|
299
299
|
/** Creates a Parameter type. */
|
|
300
|
-
declare function Parameter<Name extends string, Extends extends TSchema, Equals extends TSchema>(name: Name, extends_: Extends, equals: Equals): TParameter$1<Name, Extends, Equals>;
|
|
300
|
+
declare function Parameter$1<Name extends string, Extends extends TSchema, Equals extends TSchema>(name: Name, extends_: Extends, equals: Equals): TParameter$1<Name, Extends, Equals>;
|
|
301
301
|
/** Creates a Parameter type. */
|
|
302
|
-
declare function Parameter<Name extends string, Extends extends TSchema, Equals extends TSchema>(name: Name, extends_: Extends): TParameter$1<Name, Extends, Extends>;
|
|
302
|
+
declare function Parameter$1<Name extends string, Extends extends TSchema, Equals extends TSchema>(name: Name, extends_: Extends): TParameter$1<Name, Extends, Extends>;
|
|
303
303
|
/** Creates a Parameter type. */
|
|
304
|
-
declare function Parameter<Name extends string>(name: Name): TParameter$1<Name, TUnknown, TUnknown>;
|
|
304
|
+
declare function Parameter$1<Name extends string>(name: Name): TParameter$1<Name, TUnknown, TUnknown>;
|
|
305
305
|
/** Returns true if the given value is TParameter. */
|
|
306
|
-
declare function IsParameter(value: unknown): value is TParameter$1;
|
|
307
|
-
type StaticObject<Stack extends string[], Direction extends StaticDirection, Context extends TProperties, _This extends TProperties, Properties extends TProperties, Result = keyof Properties extends never ? object : StaticProperties<Stack, Direction, Context, Properties, Properties>> = Result;
|
|
306
|
+
export declare function IsParameter(value: unknown): value is TParameter$1;
|
|
307
|
+
export type StaticObject<Stack extends string[], Direction extends StaticDirection, Context extends TProperties, _This extends TProperties, Properties extends TProperties, Result = keyof Properties extends never ? object : StaticProperties<Stack, Direction, Context, Properties, Properties>> = Result;
|
|
308
308
|
/** Represents an Object type. */
|
|
309
|
-
interface TObject<Properties extends TProperties = TProperties> extends TSchema {
|
|
309
|
+
export interface TObject<Properties extends TProperties = TProperties> extends TSchema {
|
|
310
310
|
'~kind': 'Object';
|
|
311
311
|
type: 'object';
|
|
312
312
|
properties: Properties;
|
|
313
313
|
required: TRequiredArray<Properties>;
|
|
314
314
|
}
|
|
315
315
|
/** Creates an Object type. */
|
|
316
|
-
declare function _Object_<Properties extends TProperties>(properties: Properties, options?: TObjectOptions): TObject<Properties>;
|
|
316
|
+
declare function _Object_$1<Properties extends TProperties>(properties: Properties, options?: TObjectOptions): TObject<Properties>;
|
|
317
317
|
/** Returns true if the given value is TObject. */
|
|
318
|
-
declare function IsObject(value: unknown): value is TObject;
|
|
318
|
+
export declare function IsObject(value: unknown): value is TObject;
|
|
319
319
|
/** Extracts options from a TObject. */
|
|
320
|
-
declare function ObjectOptions(type: TObject): TObjectOptions;
|
|
320
|
+
export declare function ObjectOptions(type: TObject): TObjectOptions;
|
|
321
321
|
type CyclicStackLength<Stack extends unknown[], MaxLength extends number, Buffer extends unknown[] = []> = (Stack extends [infer Left, ...infer Right] ? Buffer['length'] extends MaxLength ? false : CyclicStackLength<Right, MaxLength, [...Buffer, Left]> : true);
|
|
322
322
|
type CyclicGuard<Stack extends unknown[], Ref extends string> = (Ref extends Stack[number] ? CyclicStackLength<Stack, 2> : true);
|
|
323
323
|
type StaticGuardedRef<Stack extends string[], Direction extends StaticDirection, Context extends TProperties, This extends TProperties, Ref extends string, Type extends TSchema> = (CyclicGuard<Stack, Ref> extends true ? StaticType<[...Stack, Ref], Direction, Context, This, Type> : any);
|
|
324
|
-
type StaticRef<Stack extends string[], Direction extends StaticDirection, Context extends TProperties, This extends TProperties, Ref extends string, Target extends TSchema = Ref extends keyof Context ? Context[Ref] : TUnknown, Result extends unknown = Target extends TObject ? StaticType<[], Direction, Context, This, Target> : StaticGuardedRef<Stack, Direction, Context, This, Ref, Target>> = Result;
|
|
324
|
+
export type StaticRef<Stack extends string[], Direction extends StaticDirection, Context extends TProperties, This extends TProperties, Ref extends string, Target extends TSchema = Ref extends keyof Context ? Context[Ref] : TUnknown, Result extends unknown = Target extends TObject ? StaticType<[], Direction, Context, This, Target> : StaticGuardedRef<Stack, Direction, Context, This, Ref, Target>> = Result;
|
|
325
325
|
/** Represents a type reference. */
|
|
326
|
-
interface TRef<Ref extends string = string> extends TSchema {
|
|
326
|
+
export interface TRef<Ref extends string = string> extends TSchema {
|
|
327
327
|
'~kind': 'Ref';
|
|
328
328
|
$ref: Ref;
|
|
329
329
|
}
|
|
330
330
|
/** Creates a Ref type. */
|
|
331
|
-
declare function Ref
|
|
331
|
+
export declare function Ref<Ref extends string>(ref: Ref, options?: TSchemaOptions): TRef<Ref>;
|
|
332
332
|
/** Returns true if the given value is TRef. */
|
|
333
|
-
declare function IsRef(value: unknown): value is TRef;
|
|
333
|
+
export declare function IsRef(value: unknown): value is TRef;
|
|
334
334
|
/** Represents a callable Generic type. */
|
|
335
|
-
interface TGeneric<Parameters extends TParameter$1[] = TParameter$1[], Expression extends TSchema = TSchema> extends TSchema {
|
|
335
|
+
export interface TGeneric<Parameters extends TParameter$1[] = TParameter$1[], Expression extends TSchema = TSchema> extends TSchema {
|
|
336
336
|
'~kind': 'Generic';
|
|
337
337
|
type: 'generic';
|
|
338
338
|
parameters: Parameters;
|
|
339
339
|
expression: Expression;
|
|
340
340
|
}
|
|
341
341
|
/** Creates a Generic type. */
|
|
342
|
-
declare function Generic<Parameters extends TParameter$1[], Expression extends TSchema>(parameters: [...Parameters], expression: Expression): TGeneric<Parameters, Expression>;
|
|
342
|
+
export declare function Generic<Parameters extends TParameter$1[], Expression extends TSchema>(parameters: [...Parameters], expression: Expression): TGeneric<Parameters, Expression>;
|
|
343
343
|
/** Returns true if the given value is a TGeneric. */
|
|
344
|
-
declare function IsGeneric(value: unknown): value is TGeneric;
|
|
345
|
-
declare const NeverPattern = "(?!)";
|
|
346
|
-
type StaticNever = never;
|
|
344
|
+
export declare function IsGeneric(value: unknown): value is TGeneric;
|
|
345
|
+
export declare const NeverPattern = "(?!)";
|
|
346
|
+
export type StaticNever = never;
|
|
347
347
|
/** Represents a Never type. */
|
|
348
|
-
interface TNever extends TSchema {
|
|
348
|
+
export interface TNever extends TSchema {
|
|
349
349
|
'~kind': 'Never';
|
|
350
350
|
not: {};
|
|
351
351
|
}
|
|
352
352
|
/** Creates a Never type. */
|
|
353
|
-
declare function Never(options?: TSchemaOptions): TNever;
|
|
353
|
+
export declare function Never(options?: TSchemaOptions): TNever;
|
|
354
354
|
/** Returns true if the given value is TNever. */
|
|
355
|
-
declare function IsNever(value: unknown): value is TNever;
|
|
355
|
+
export declare function IsNever(value: unknown): value is TNever;
|
|
356
356
|
/** Applies a Refine check to the given type. */
|
|
357
|
-
type TRefineAdd<Type extends TSchema = TSchema> = ('~refine' extends keyof Type ? Type : TRefine<Type>);
|
|
357
|
+
export type TRefineAdd<Type extends TSchema = TSchema> = ('~refine' extends keyof Type ? Type : TRefine<Type>);
|
|
358
358
|
/** Applies a Refine check to the given type. */
|
|
359
|
-
declare function RefineAdd<Type extends TSchema>(type: Type, refinement: TRefinement<Type>): TRefineAdd<Type>;
|
|
359
|
+
export declare function RefineAdd<Type extends TSchema>(type: Type, refinement: TRefinement<Type>): TRefineAdd<Type>;
|
|
360
360
|
/** Represents a type with embedded Refine check. */
|
|
361
|
-
type TRefine<Type extends TSchema = TSchema> = (Type & {
|
|
361
|
+
export type TRefine<Type extends TSchema = TSchema> = (Type & {
|
|
362
362
|
'~refine': TRefinement<unknown>[];
|
|
363
363
|
});
|
|
364
|
-
type TRefineCheckCallback<Value extends unknown = unknown> = (value: Value) => boolean;
|
|
365
|
-
type TRefineErrorCallback<Value extends unknown = unknown> = (value: Value) => string;
|
|
366
|
-
interface TRefinement<Value extends unknown = unknown> {
|
|
364
|
+
export type TRefineCheckCallback<Value extends unknown = unknown> = (value: Value) => boolean;
|
|
365
|
+
export type TRefineErrorCallback<Value extends unknown = unknown> = (value: Value) => string;
|
|
366
|
+
export interface TRefinement<Value extends unknown = unknown> {
|
|
367
367
|
check: TRefineCheckCallback<Value>;
|
|
368
368
|
error: TRefineErrorCallback<Value>;
|
|
369
369
|
}
|
|
370
370
|
/** Refines a type with an explicit check */
|
|
371
|
-
declare function Refine<Type extends TSchema, Value = Static<Type>>(type: Type, check: TRefineCheckCallback<Value>, error: TRefineErrorCallback<Value>): TRefineAdd<Type>;
|
|
371
|
+
export declare function Refine<Type extends TSchema, Value = Static<Type>>(type: Type, check: TRefineCheckCallback<Value>, error: TRefineErrorCallback<Value>): TRefineAdd<Type>;
|
|
372
372
|
/** Refines a type with an explicit check */
|
|
373
|
-
declare function Refine<Type extends TSchema, Value = Static<Type>>(type: Type, check: TRefineCheckCallback<Value>): TRefineAdd<Type>;
|
|
373
|
+
export declare function Refine<Type extends TSchema, Value = Static<Type>>(type: Type, check: TRefineCheckCallback<Value>): TRefineAdd<Type>;
|
|
374
374
|
/** Returns true if the given value is a TRefinement. */
|
|
375
|
-
declare function IsRefinement(value: unknown): value is TRefinement;
|
|
375
|
+
export declare function IsRefinement(value: unknown): value is TRefinement;
|
|
376
376
|
/** Returns true if the given value is a TRefine. */
|
|
377
|
-
declare function IsRefine(value: unknown): value is TRefine;
|
|
378
|
-
type StaticCyclic<Stack extends string[], Direction extends StaticDirection, Context extends TProperties, This extends TProperties, Defs extends TProperties, Ref extends string, Result extends unknown = (Ref extends keyof Defs ? StaticType<[...Stack, Ref], Direction, Defs, This, Defs[Ref]> : never)> = Result;
|
|
377
|
+
export declare function IsRefine(value: unknown): value is TRefine;
|
|
378
|
+
export type StaticCyclic<Stack extends string[], Direction extends StaticDirection, Context extends TProperties, This extends TProperties, Defs extends TProperties, Ref extends string, Result extends unknown = (Ref extends keyof Defs ? StaticType<[...Stack, Ref], Direction, Defs, This, Defs[Ref]> : never)> = Result;
|
|
379
379
|
/** Represents a Cyclic type. */
|
|
380
|
-
interface TCyclic<Defs extends TProperties = TProperties, Ref extends string = string> extends TSchema {
|
|
380
|
+
export interface TCyclic<Defs extends TProperties = TProperties, Ref extends string = string> extends TSchema {
|
|
381
381
|
'~kind': 'Cyclic';
|
|
382
382
|
$defs: Defs;
|
|
383
383
|
$ref: Ref;
|
|
384
384
|
}
|
|
385
385
|
/** Creates a Cyclic type. */
|
|
386
|
-
declare function Cyclic<Defs extends TProperties, Ref extends string>($defs: Defs, $ref: Ref, options?: TSchemaOptions): TCyclic<Defs, Ref>;
|
|
386
|
+
export declare function Cyclic<Defs extends TProperties, Ref extends string>($defs: Defs, $ref: Ref, options?: TSchemaOptions): TCyclic<Defs, Ref>;
|
|
387
387
|
/** Returns true if the given value is a TCyclic. */
|
|
388
|
-
declare function IsCyclic(value: unknown): value is TCyclic;
|
|
388
|
+
export declare function IsCyclic(value: unknown): value is TCyclic;
|
|
389
389
|
/** Extracts options from a TCyclic. */
|
|
390
|
-
declare function CyclicOptions(type: TCyclic): TSchemaOptions;
|
|
391
|
-
type TTupleToIntersect<T extends any[]> = T extends [infer I] ? I : T extends [infer I, ...infer R] ? I & TTupleToIntersect<R> : never;
|
|
392
|
-
type TTupleToUnion<T extends any[]> = { [K in keyof T]: T[K]; }[number];
|
|
393
|
-
type TUnionToIntersect<U> = (U extends unknown ? (arg: U) => 0 : never) extends ((arg: infer I) => 0) ? I : never;
|
|
394
|
-
type TUnionLast<U> = TUnionToIntersect<U extends unknown ? (x: U) => 0 : never> extends ((x: infer L) => 0) ? L : never;
|
|
395
|
-
type TUnionToTuple<U, Result extends unknown[] = [], R = TUnionLast<U>> = [U] extends [never] ? Result : TUnionToTuple<Exclude<U, R>, [Extract<U, R>, ...Result]>;
|
|
396
|
-
type TTypeScriptEnumLike = Record<PropertyKey, TEnumValue>;
|
|
397
|
-
declare function IsTypeScriptEnumLike(value: unknown): value is TTypeScriptEnumLike;
|
|
390
|
+
export declare function CyclicOptions(type: TCyclic): TSchemaOptions;
|
|
391
|
+
export type TTupleToIntersect<T extends any[]> = T extends [infer I] ? I : T extends [infer I, ...infer R] ? I & TTupleToIntersect<R> : never;
|
|
392
|
+
export type TTupleToUnion<T extends any[]> = { [K in keyof T]: T[K]; }[number];
|
|
393
|
+
export type TUnionToIntersect<U> = (U extends unknown ? (arg: U) => 0 : never) extends ((arg: infer I) => 0) ? I : never;
|
|
394
|
+
export type TUnionLast<U> = TUnionToIntersect<U extends unknown ? (x: U) => 0 : never> extends ((x: infer L) => 0) ? L : never;
|
|
395
|
+
export type TUnionToTuple<U, Result extends unknown[] = [], R = TUnionLast<U>> = [U] extends [never] ? Result : TUnionToTuple<Exclude<U, R>, [Extract<U, R>, ...Result]>;
|
|
396
|
+
export type TTypeScriptEnumLike = Record<PropertyKey, TEnumValue>;
|
|
397
|
+
export declare function IsTypeScriptEnumLike(value: unknown): value is TTypeScriptEnumLike;
|
|
398
398
|
type TReduceEnumValues<Keys extends string[], Type extends TTypeScriptEnumLike, Result extends TEnumValue[] = []> = (Keys extends [infer Left extends string, ...infer Right extends string[]] ? TReduceEnumValues<Right, Type, [...Result, Type[Left]]> : Result);
|
|
399
|
-
type TTypeScriptEnumToEnumValues<Type extends TTypeScriptEnumLike, EnumKeys extends string[] = TUnionToTuple<Extract<keyof Type, string>>, Elements extends TEnumValue[] = TReduceEnumValues<EnumKeys, Type>> = Elements;
|
|
400
|
-
declare function TypeScriptEnumToEnumValues<Type extends TTypeScriptEnumLike>(type: Type): TTypeScriptEnumToEnumValues<Type>;
|
|
401
|
-
type StaticEnum<Values extends TEnumValue[]> = (Values[number]);
|
|
402
|
-
type TEnumValue = string | number;
|
|
399
|
+
export type TTypeScriptEnumToEnumValues<Type extends TTypeScriptEnumLike, EnumKeys extends string[] = TUnionToTuple<Extract<keyof Type, string>>, Elements extends TEnumValue[] = TReduceEnumValues<EnumKeys, Type>> = Elements;
|
|
400
|
+
export declare function TypeScriptEnumToEnumValues<Type extends TTypeScriptEnumLike>(type: Type): TTypeScriptEnumToEnumValues<Type>;
|
|
401
|
+
export type StaticEnum<Values extends TEnumValue[]> = (Values[number]);
|
|
402
|
+
export type TEnumValue = string | number;
|
|
403
403
|
/** Returns true if the given value is a EnumValue */
|
|
404
|
-
declare function IsEnumValue(value: unknown): value is TEnumValue;
|
|
404
|
+
export declare function IsEnumValue(value: unknown): value is TEnumValue;
|
|
405
405
|
/** Represents an Enum type. */
|
|
406
|
-
interface TEnum<Values extends TEnumValue[] = TEnumValue[]> extends TSchema {
|
|
406
|
+
export interface TEnum<Values extends TEnumValue[] = TEnumValue[]> extends TSchema {
|
|
407
407
|
'~kind': 'Enum';
|
|
408
408
|
enum: Values;
|
|
409
409
|
}
|
|
410
410
|
/** Creates an Enum type. */
|
|
411
|
-
declare function Enum<Values extends TEnumValue[]>(values: readonly [...Values], options?: TSchemaOptions): TEnum<Values>;
|
|
411
|
+
export declare function Enum<Values extends TEnumValue[]>(values: readonly [...Values], options?: TSchemaOptions): TEnum<Values>;
|
|
412
412
|
/** Creates an Enum type from a TypeScript enum declaration. */
|
|
413
|
-
declare function Enum<Enum extends TTypeScriptEnumLike>(value: Enum, options?: TSchemaOptions): TEnum<TTypeScriptEnumToEnumValues<Enum>>;
|
|
413
|
+
export declare function Enum<Enum extends TTypeScriptEnumLike>(value: Enum, options?: TSchemaOptions): TEnum<TTypeScriptEnumToEnumValues<Enum>>;
|
|
414
414
|
/** Returns true if the given value is a TEnum. */
|
|
415
|
-
declare function IsEnum(value: unknown): value is TEnum;
|
|
415
|
+
export declare function IsEnum(value: unknown): value is TEnum;
|
|
416
416
|
/** Represents a Identifier. */
|
|
417
|
-
interface TIdentifier<Name extends string = string> extends TSchema {
|
|
417
|
+
export interface TIdentifier<Name extends string = string> extends TSchema {
|
|
418
418
|
'~kind': 'Identifier';
|
|
419
419
|
type: 'identifier';
|
|
420
420
|
name: Name;
|
|
421
421
|
}
|
|
422
422
|
/** Creates an Identifier. */
|
|
423
|
-
declare function Identifier<Name extends string>(name: Name): TIdentifier<Name>;
|
|
423
|
+
export declare function Identifier<Name extends string>(name: Name): TIdentifier<Name>;
|
|
424
424
|
/** Returns true if the given value is a TIdentifier. */
|
|
425
|
-
declare function IsIdentifier(value: unknown): value is TIdentifier;
|
|
426
|
-
type StaticDependent<Stack extends string[], Direction extends StaticDirection, Context extends TProperties, This extends TProperties, If extends TSchema, Then extends TSchema, Else extends TSchema, StaticIf extends unknown = StaticType<Stack, Direction, Context, This, If>, StaticThen extends unknown = StaticType<Stack, Direction, Context, This, Then>, StaticElse extends unknown = StaticType<Stack, Direction, Context, This, Else>, Result extends unknown = (StaticIf & StaticThen) | Exclude<StaticElse, StaticIf>> = Result;
|
|
425
|
+
export declare function IsIdentifier(value: unknown): value is TIdentifier;
|
|
426
|
+
export type StaticDependent<Stack extends string[], Direction extends StaticDirection, Context extends TProperties, This extends TProperties, If extends TSchema, Then extends TSchema, Else extends TSchema, StaticIf extends unknown = StaticType<Stack, Direction, Context, This, If>, StaticThen extends unknown = StaticType<Stack, Direction, Context, This, Then>, StaticElse extends unknown = StaticType<Stack, Direction, Context, This, Else>, Result extends unknown = (StaticIf & StaticThen) | Exclude<StaticElse, StaticIf>> = Result;
|
|
427
427
|
/** Represents a Dependent Type */
|
|
428
428
|
interface TDependent$1<If extends TSchema = TSchema, Then extends TSchema = TSchema, Else extends TSchema = TSchema> extends TSchema {
|
|
429
429
|
'~kind': 'Dependent';
|
|
@@ -432,26 +432,26 @@ interface TDependent$1<If extends TSchema = TSchema, Then extends TSchema = TSch
|
|
|
432
432
|
else: Else;
|
|
433
433
|
}
|
|
434
434
|
/** Creates a Dependent type */
|
|
435
|
-
declare function Dependent<If extends TSchema, Then extends TSchema, Else extends TSchema>(if_: If, then_: Then, else_: Else, options?: TSchemaOptions): TDependent$1<If, Then, Else>;
|
|
435
|
+
declare function Dependent$1<If extends TSchema, Then extends TSchema, Else extends TSchema>(if_: If, then_: Then, else_: Else, options?: TSchemaOptions): TDependent$1<If, Then, Else>;
|
|
436
436
|
/** Returns true if the given value is TDependent. */
|
|
437
|
-
declare function IsDependent(value: unknown): value is TDependent$1;
|
|
437
|
+
export declare function IsDependent(value: unknown): value is TDependent$1;
|
|
438
438
|
/** Extracts options from a IsDependent. */
|
|
439
|
-
declare function DependentOptions(type: TDependent$1): TSchemaOptions;
|
|
439
|
+
export declare function DependentOptions(type: TDependent$1): TSchemaOptions;
|
|
440
440
|
/** Represents an Infer instruction. */
|
|
441
|
-
interface TInfer<Name extends string = string, Extends extends TSchema = TSchema> extends TSchema {
|
|
441
|
+
export interface TInfer<Name extends string = string, Extends extends TSchema = TSchema> extends TSchema {
|
|
442
442
|
'~kind': 'Infer';
|
|
443
443
|
type: 'infer';
|
|
444
444
|
name: Name;
|
|
445
445
|
extends: Extends;
|
|
446
446
|
}
|
|
447
447
|
/** Creates an Infer instruction. */
|
|
448
|
-
declare function Infer<Name extends string, Extends extends TSchema>(name: Name, extends_: Extends): TInfer<Name, Extends>;
|
|
448
|
+
export declare function Infer<Name extends string, Extends extends TSchema>(name: Name, extends_: Extends): TInfer<Name, Extends>;
|
|
449
449
|
/** Creates an Infer instruction. */
|
|
450
|
-
declare function Infer<Name extends string>(name: Name): TInfer<Name, TUnknown>;
|
|
450
|
+
export declare function Infer<Name extends string>(name: Name): TInfer<Name, TUnknown>;
|
|
451
451
|
/** Returns true if the given value is TInfer. */
|
|
452
|
-
declare function IsInfer(value: unknown): value is TInfer;
|
|
453
|
-
declare const IntegerPattern = "-?(?:0|[1-9][0-9]*)";
|
|
454
|
-
type StaticInteger = number;
|
|
452
|
+
export declare function IsInfer(value: unknown): value is TInfer;
|
|
453
|
+
export declare const IntegerPattern = "-?(?:0|[1-9][0-9]*)";
|
|
454
|
+
export type StaticInteger = number;
|
|
455
455
|
/** Represents an integer type. */
|
|
456
456
|
interface TInteger$1 extends TSchema {
|
|
457
457
|
'~kind': 'Integer';
|
|
@@ -460,251 +460,418 @@ interface TInteger$1 extends TSchema {
|
|
|
460
460
|
/** Creates a Integer type. */
|
|
461
461
|
declare function Integer$1(options?: TNumberOptions): TInteger$1;
|
|
462
462
|
/** Returns true if the given value is TInteger. */
|
|
463
|
-
declare function IsInteger(value: unknown): value is TInteger$1;
|
|
464
|
-
type StaticIntersect<Stack extends string[], Direction extends StaticDirection, Context extends TProperties, This extends TProperties, Types extends TSchema[], Result extends unknown = unknown> = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? StaticIntersect<Stack, Direction, Context, This, Right, Result & StaticType<Stack, Direction, Context, This, Left>> : Result);
|
|
463
|
+
export declare function IsInteger(value: unknown): value is TInteger$1;
|
|
464
|
+
export type StaticIntersect<Stack extends string[], Direction extends StaticDirection, Context extends TProperties, This extends TProperties, Types extends TSchema[], Result extends unknown = unknown> = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? StaticIntersect<Stack, Direction, Context, This, Right, Result & StaticType<Stack, Direction, Context, This, Left>> : Result);
|
|
465
465
|
/** Represents a logical Intersect type. */
|
|
466
|
-
interface TIntersect<Types extends TSchema[] = TSchema[]> extends TSchema {
|
|
466
|
+
export interface TIntersect<Types extends TSchema[] = TSchema[]> extends TSchema {
|
|
467
467
|
'~kind': 'Intersect';
|
|
468
468
|
allOf: Types;
|
|
469
469
|
}
|
|
470
470
|
/** Creates a Intersect type. */
|
|
471
|
-
declare function Intersect<Types extends TSchema[]>(types: [...Types], options?: TIntersectOptions): TIntersect<Types>;
|
|
471
|
+
export declare function Intersect<Types extends TSchema[]>(types: [...Types], options?: TIntersectOptions): TIntersect<Types>;
|
|
472
472
|
/** Returns true if the given value is TIntersect. */
|
|
473
|
-
declare function IsIntersect(value: unknown): value is TIntersect;
|
|
473
|
+
export declare function IsIntersect(value: unknown): value is TIntersect;
|
|
474
474
|
/** Extracts options from a TIntersect. */
|
|
475
|
-
declare function IntersectOptions(type: TIntersect): TIntersectOptions;
|
|
476
|
-
declare class InvalidLiteralValue extends Error {
|
|
475
|
+
export declare function IntersectOptions(type: TIntersect): TIntersectOptions;
|
|
476
|
+
export declare class InvalidLiteralValue extends Error {
|
|
477
477
|
readonly cause: {
|
|
478
478
|
value: unknown;
|
|
479
479
|
};
|
|
480
480
|
constructor(value: unknown);
|
|
481
481
|
}
|
|
482
|
-
type StaticLiteral<Value extends TLiteralValue> = (Value);
|
|
483
|
-
type TLiteralTypeName<Value extends TLiteralValue> = (Value extends bigint ? 'bigint' : Value extends boolean ? 'boolean' : Value extends number ? 'number' : Value extends string ? 'string' : never);
|
|
484
|
-
declare function LiteralTypeName<Value extends TLiteralValue>(value: Value): TLiteralTypeName<Value>;
|
|
485
|
-
type TLiteralValue = string | number | boolean | bigint;
|
|
482
|
+
export type StaticLiteral<Value extends TLiteralValue> = (Value);
|
|
483
|
+
export type TLiteralTypeName<Value extends TLiteralValue> = (Value extends bigint ? 'bigint' : Value extends boolean ? 'boolean' : Value extends number ? 'number' : Value extends string ? 'string' : never);
|
|
484
|
+
export declare function LiteralTypeName<Value extends TLiteralValue>(value: Value): TLiteralTypeName<Value>;
|
|
485
|
+
export type TLiteralValue = string | number | boolean | bigint;
|
|
486
486
|
/** Represents a Literal type. */
|
|
487
|
-
interface TLiteral<Value extends TLiteralValue = TLiteralValue> extends TSchema {
|
|
487
|
+
export interface TLiteral<Value extends TLiteralValue = TLiteralValue> extends TSchema {
|
|
488
488
|
'~kind': 'Literal';
|
|
489
489
|
type: TLiteralTypeName<Value>;
|
|
490
490
|
const: Value;
|
|
491
491
|
}
|
|
492
492
|
/** Creates a Literal type. */
|
|
493
|
-
declare function Literal<Value extends TLiteralValue>(value: Value, options?: TSchemaOptions): TLiteral<Value>;
|
|
493
|
+
export declare function Literal<Value extends TLiteralValue>(value: Value, options?: TSchemaOptions): TLiteral<Value>;
|
|
494
494
|
/** Returns true if the given value is a TLiteralValue. */
|
|
495
|
-
declare function IsLiteralValue(value: unknown): value is TLiteralValue;
|
|
495
|
+
export declare function IsLiteralValue(value: unknown): value is TLiteralValue;
|
|
496
496
|
/** Returns true if the given value is TLiteral<bigint>. */
|
|
497
|
-
declare function IsLiteralBigInt(value: unknown): value is TLiteral<bigint>;
|
|
497
|
+
export declare function IsLiteralBigInt(value: unknown): value is TLiteral<bigint>;
|
|
498
498
|
/** Returns true if the given value is TLiteral<boolean>. */
|
|
499
|
-
declare function IsLiteralBoolean(value: unknown): value is TLiteral<boolean>;
|
|
499
|
+
export declare function IsLiteralBoolean(value: unknown): value is TLiteral<boolean>;
|
|
500
500
|
/** Returns true if the given value is TLiteral<number>. */
|
|
501
|
-
declare function IsLiteralNumber(value: unknown): value is TLiteral<number>;
|
|
501
|
+
export declare function IsLiteralNumber(value: unknown): value is TLiteral<number>;
|
|
502
502
|
/** Returns true if the given value is TLiteral<string>. */
|
|
503
|
-
declare function IsLiteralString(value: unknown): value is TLiteral<string>;
|
|
503
|
+
export declare function IsLiteralString(value: unknown): value is TLiteral<string>;
|
|
504
504
|
/** Returns true if the given value is TLiteral. */
|
|
505
|
-
declare function IsLiteral(value: unknown): value is TLiteral;
|
|
506
|
-
type StaticNull = null;
|
|
505
|
+
export declare function IsLiteral(value: unknown): value is TLiteral;
|
|
506
|
+
export type StaticNull = null;
|
|
507
507
|
/** Represents a Null type. */
|
|
508
|
-
interface TNull extends TSchema {
|
|
508
|
+
export interface TNull extends TSchema {
|
|
509
509
|
'~kind': 'Null';
|
|
510
510
|
type: 'null';
|
|
511
511
|
}
|
|
512
512
|
/** Creates a Null type. */
|
|
513
|
-
declare function Null(options?: TSchemaOptions): TNull;
|
|
513
|
+
export declare function Null(options?: TSchemaOptions): TNull;
|
|
514
514
|
/** Returns true if the given value is TNull. */
|
|
515
|
-
declare function IsNull(value: unknown): value is TNull;
|
|
516
|
-
declare const NumberPattern = "-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?";
|
|
517
|
-
type StaticNumber = number;
|
|
515
|
+
export declare function IsNull(value: unknown): value is TNull;
|
|
516
|
+
export declare const NumberPattern = "-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?";
|
|
517
|
+
export type StaticNumber = number;
|
|
518
518
|
/** Represents a Number type. */
|
|
519
519
|
interface TNumber$1 extends TSchema {
|
|
520
520
|
'~kind': 'Number';
|
|
521
521
|
type: 'number';
|
|
522
522
|
}
|
|
523
523
|
/** Creates a Number type. */
|
|
524
|
-
declare function Number(options?: TNumberOptions): TNumber$1;
|
|
524
|
+
declare function Number$1(options?: TNumberOptions): TNumber$1;
|
|
525
525
|
/** Returns true if the given value is a TNumber. */
|
|
526
|
-
declare function IsNumber(value: unknown): value is TNumber$1;
|
|
527
|
-
type StaticSymbol = symbol;
|
|
526
|
+
export declare function IsNumber(value: unknown): value is TNumber$1;
|
|
527
|
+
export type StaticSymbol = symbol;
|
|
528
528
|
/** Represents a Symbol type. */
|
|
529
|
-
interface TSymbol extends TSchema {
|
|
529
|
+
export interface TSymbol extends TSchema {
|
|
530
530
|
'~kind': 'Symbol';
|
|
531
531
|
type: 'symbol';
|
|
532
532
|
}
|
|
533
533
|
/** Creates a Symbol type. */
|
|
534
|
-
declare function Symbol(options?: TSchemaOptions): TSymbol;
|
|
534
|
+
export declare function Symbol(options?: TSchemaOptions): TSymbol;
|
|
535
535
|
/** Returns true if the given value is TSymbol. */
|
|
536
|
-
declare function IsSymbol(value: unknown): value is TSymbol;
|
|
537
|
-
declare const StringPattern = ".*";
|
|
538
|
-
type StaticString = string;
|
|
536
|
+
export declare function IsSymbol(value: unknown): value is TSymbol;
|
|
537
|
+
export declare const StringPattern = ".*";
|
|
538
|
+
export type StaticString = string;
|
|
539
539
|
/** Represents a String type. */
|
|
540
540
|
interface TString$1 extends TSchema {
|
|
541
541
|
'~kind': 'String';
|
|
542
542
|
type: 'string';
|
|
543
543
|
}
|
|
544
544
|
/** Creates a String type. */
|
|
545
|
-
declare function String(options?: TStringOptions): TString$1;
|
|
545
|
+
declare function String$1(options?: TStringOptions): TString$1;
|
|
546
546
|
/** Returns true if the given value is TString. */
|
|
547
|
-
declare function IsString(value: unknown): value is TString$1;
|
|
548
|
-
declare function TemplateLiteralCreate<Pattern extends string>(pattern: Pattern): never;
|
|
547
|
+
export declare function IsString(value: unknown): value is TString$1;
|
|
548
|
+
export declare function TemplateLiteralCreate<Pattern extends string>(pattern: Pattern): never;
|
|
549
549
|
type TUnreachable = never;
|
|
550
|
-
type ObjectLike = Record<PropertyKey, any>;
|
|
550
|
+
type ObjectLike$3 = Record<PropertyKey, any>;
|
|
551
|
+
/**
|
|
552
|
+
* Performs an Object assign using the Left and Right object types. We track this operation as it
|
|
553
|
+
* creates a new GC handle per assignment.
|
|
554
|
+
*/
|
|
555
|
+
type TAssign<Left extends ObjectLike$3, Right extends ObjectLike$3, Assigned extends ObjectLike$3 = Omit<Left, keyof Right> & Right> = { [Key in keyof Assigned]: Assigned[Key]; } & {};
|
|
551
556
|
/**
|
|
552
557
|
* Performs an Object assign using the Left and Right object types. We track this operation as it
|
|
553
558
|
* creates a new GC handle per assignment.
|
|
554
559
|
*/
|
|
555
|
-
|
|
560
|
+
declare function Assign<Left extends ObjectLike$3, Right extends ObjectLike$3>(left: Left, right: Right): TAssign<Left, Right>;
|
|
561
|
+
/**
|
|
562
|
+
* Returns a Clone of the given value. This function is similar to structuredClone()
|
|
563
|
+
* but also supports deep cloning instances of Map, Set and TypeArray.
|
|
564
|
+
*/
|
|
565
|
+
declare function Clone<Value extends unknown = unknown>(value: Value): Value;
|
|
566
|
+
type ObjectLike$2 = Record<PropertyKey, any>;
|
|
567
|
+
/**
|
|
568
|
+
* Creates an object with hidden, enumerable, and optional property sets. This function
|
|
569
|
+
* ensures types are instantiated according to configuration rules for enumerable and
|
|
570
|
+
* non-enumerable properties.
|
|
571
|
+
*/
|
|
572
|
+
declare function Create(hidden: ObjectLike$2, enumerable: ObjectLike$2, options?: ObjectLike$2): ObjectLike$2;
|
|
573
|
+
type ObjectLike$1 = Record<PropertyKey, any>;
|
|
574
|
+
/** Discards multiple property keys from the given object value */
|
|
575
|
+
declare function Discard(value: ObjectLike$1, propertyKeys: PropertyKey[]): ObjectLike$1;
|
|
576
|
+
interface TMetrics {
|
|
577
|
+
/** The number of times Assign() was called */
|
|
578
|
+
assign: number;
|
|
579
|
+
/** The number of times Create() was called */
|
|
580
|
+
create: number;
|
|
581
|
+
/** The number of times Clone() was called */
|
|
582
|
+
clone: number;
|
|
583
|
+
/** The number of times Discard() was called */
|
|
584
|
+
discard: number;
|
|
585
|
+
/** The number of times Update() was called */
|
|
586
|
+
update: number;
|
|
587
|
+
}
|
|
588
|
+
/** TypeBox instantiation metrics */
|
|
589
|
+
declare const Metrics: TMetrics;
|
|
590
|
+
type ObjectLike = Record<PropertyKey, any>;
|
|
591
|
+
/**
|
|
592
|
+
* Updates a value with new properties while preserving property enumerability. Use this function to modify
|
|
593
|
+
* existing types without altering their configuration.
|
|
594
|
+
*/
|
|
595
|
+
declare function Update(current: ObjectLike, hidden: ObjectLike, enumerable: ObjectLike): ObjectLike;
|
|
596
|
+
declare namespace memory_d_exports {
|
|
597
|
+
export { Assign, Clone, Create, Discard, Metrics, TAssign, TMetrics, Update };
|
|
598
|
+
}
|
|
599
|
+
declare namespace mapping_d_exports {
|
|
600
|
+
export { BaseMapping, DependentMapping, ElementBaseMapping, ElementListMapping, ElementMapping, ElementNamedMapping, ExportKeywordMapping, ExprMapping, ExprPipeMapping, ExprReadonlyMapping, ExprTailMapping, ExprTermMapping, ExprTermTailMapping, ExtendsMapping, FactorMapping, GenericCallArgumentListMapping, GenericCallArgumentsMapping, GenericCallMapping, GenericParameterEqualsMapping, GenericParameterExtendsEqualsMapping, GenericParameterExtendsMapping, GenericParameterIdentifierMapping, GenericParameterListMapping, GenericParameterMapping, GenericParametersMapping, GenericTypeMapping, IndexArrayMapping, InferTypeMapping, InterfaceDeclarationGenericMapping, InterfaceDeclarationHeritageListMapping, InterfaceDeclarationHeritageMapping, InterfaceDeclarationMapping, KeyOfMapping, KeywordAnyMapping, KeywordBigIntMapping, KeywordBooleanMapping, KeywordIntegerMapping, KeywordNeverMapping, KeywordNullMapping, KeywordNumberMapping, KeywordObjectMapping, KeywordStringMapping, KeywordSymbolMapping, KeywordThisMapping, KeywordUndefinedMapping, KeywordUnknownMapping, KeywordVoidMapping, LiteralBigIntMapping, LiteralBooleanMapping, LiteralNumberMapping, LiteralStringMapping, MappedAsMapping, MappedOptionalMapping, MappedReadonlyMapping, ModuleDeclarationDelimiterMapping, ModuleDeclarationListMapping, ModuleDeclarationMapping, ModuleMapping, OptionalMapping, OptionalSemiColonMapping, ParameterBaseMapping, ParameterListMapping, ParameterMapping, ParameterOptionalMapping, ParameterReadonlyMapping, ParameterReadonlyOptionalMapping, ParameterTypeMapping, PatternBaseMapping, PatternBigIntMapping, PatternBodyMapping, PatternGroupMapping, PatternIntegerMapping, PatternMapping, PatternNeverMapping, PatternNumberMapping, PatternStringMapping, PatternTermMapping, PatternTextMapping, PatternUnionMapping, PropertiesMapping, PropertyDelimiterMapping, PropertyKeyIdentMapping, PropertyKeyIndexMapping, PropertyKeyMapping, PropertyKeyNumberMapping, PropertyKeyQuotedMapping, PropertyListMapping, PropertyMapping, ReadonlyMapping, ReferenceMapping, ScriptMapping, TBaseMapping, TDependentMapping, TElementBaseMapping, TElementListMapping, TElementMapping, TElementNamedMapping, TExportKeywordMapping, TExprMapping, TExprPipeMapping, TExprReadonlyMapping, TExprTailMapping, TExprTermMapping, TExprTermTailMapping, TExtendsMapping, TFactorMapping, TGenericCallArgumentListMapping, TGenericCallArgumentsMapping, TGenericCallMapping, TGenericParameterEqualsMapping, TGenericParameterExtendsEqualsMapping, TGenericParameterExtendsMapping, TGenericParameterIdentifierMapping, TGenericParameterListMapping, TGenericParameterMapping, TGenericParametersMapping, TGenericTypeMapping, TIndexArrayMapping, TInferTypeMapping, TInterfaceDeclarationGenericMapping, TInterfaceDeclarationHeritageListMapping, TInterfaceDeclarationHeritageMapping, TInterfaceDeclarationMapping, TKeyOfMapping, TKeywordAnyMapping, TKeywordBigIntMapping, TKeywordBooleanMapping, TKeywordIntegerMapping, TKeywordNeverMapping, TKeywordNullMapping, TKeywordNumberMapping, TKeywordObjectMapping, TKeywordStringMapping, TKeywordSymbolMapping, TKeywordThisMapping, TKeywordUndefinedMapping, TKeywordUnknownMapping, TKeywordVoidMapping, TLiteralBigIntMapping, TLiteralBooleanMapping, TLiteralNumberMapping, TLiteralStringMapping, TMappedAsMapping, TMappedOptionalMapping, TMappedReadonlyMapping, TModuleDeclarationDelimiterMapping, TModuleDeclarationListMapping, TModuleDeclarationMapping, TModuleMapping, TOptionalMapping, TOptionalSemiColonMapping, TParameterBaseMapping, TParameterListMapping, TParameterMapping, TParameterOptionalMapping, TParameterReadonlyMapping, TParameterReadonlyOptionalMapping, TParameterTypeMapping, TPatternBaseMapping, TPatternBigIntMapping, TPatternBodyMapping, TPatternGroupMapping, TPatternIntegerMapping, TPatternMapping, TPatternNeverMapping, TPatternNumberMapping, TPatternStringMapping, TPatternTermMapping, TPatternTextMapping, TPatternUnionMapping, TPropertiesMapping, TPropertyDelimiterMapping, TPropertyKeyIdentMapping, TPropertyKeyIndexMapping, TPropertyKeyMapping, TPropertyKeyNumberMapping, TPropertyKeyQuotedMapping, TPropertyListMapping, TPropertyMapping, TReadonlyMapping, TReferenceMapping, TScriptMapping, TTemplateBodyMapping, TTemplateInterpolateMapping, TTemplateLiteralMapping, TTemplateLiteralTypesMapping, TTemplateSpanMapping, TTypeAliasDeclarationGenericMapping, TTypeAliasDeclarationMapping, TTypeMapping, TWithArrayMapping, TWithBigIntMapping, TWithBooleanMapping, TWithElementListMapping, TWithMapping, TWithNullMapping, TWithNumberMapping, TWithObjectMapping, TWithPropertyListMapping, TWithPropertyMapping, TWithStringMapping, TWithUndefinedMapping, TWithValueMapping, T_Constructor_Mapping, T_Function_Mapping, T_Mapped_Mapping, T_Object_Mapping, T_Tuple_Mapping, TemplateBodyMapping, TemplateInterpolateMapping, TemplateLiteralMapping, TemplateLiteralTypesMapping, TemplateSpanMapping, TypeAliasDeclarationGenericMapping, TypeAliasDeclarationMapping, TypeMapping, WithArrayMapping, WithBigIntMapping, WithBooleanMapping, WithElementListMapping, WithMapping, WithNullMapping, WithNumberMapping, WithObjectMapping, WithPropertyListMapping, WithPropertyMapping, WithStringMapping, WithUndefinedMapping, WithValueMapping, _Constructor_Mapping, _Function_Mapping, _Mapped_Mapping, _Object_Mapping, _Tuple_Mapping };
|
|
601
|
+
}
|
|
556
602
|
type TIntrinsicOrCall<Target extends string, Parameters extends TSchema[]> = ([Target, Parameters] extends ['Array', [infer Type extends TSchema]] ? TArray<Type> : [Target, Parameters] extends ['Capitalize', [infer Type extends TSchema]] ? TCapitalizeDeferred<Type> : [Target, Parameters] extends ['ConstructorParameters', [infer Type extends TSchema]] ? TConstructorParametersDeferred<Type> : [Target, Parameters] extends ['Evaluate', [infer Type extends TSchema]] ? TEvaluateDeferred<Type> : [Target, Parameters] extends ['Exclude', [infer Left extends TSchema, infer Right extends TSchema]] ? TExcludeDeferred<Left, Right> : [Target, Parameters] extends ['Extract', [infer Left extends TSchema, infer Right extends TSchema]] ? TExtractDeferred<Left, Right> : [Target, Parameters] extends ['Index', [infer Type extends TSchema, infer Indexer extends TSchema]] ? TIndexDeferred<Type, Indexer> : [Target, Parameters] extends ['InstanceType', [infer Type extends TSchema]] ? TInstanceTypeDeferred<Type> : [Target, Parameters] extends ['KeyOf', [infer Type extends TSchema]] ? TKeyOfDeferred<Type> : [Target, Parameters] extends ['Lowercase', [infer Type extends TSchema]] ? TLowercaseDeferred<Type> : [Target, Parameters] extends ['NonNullable', [infer Type extends TSchema]] ? TNonNullableDeferred<Type> : [Target, Parameters] extends ['Omit', [infer Type extends TSchema, infer Indexer extends TSchema]] ? TOmitDeferred<Type, Indexer> : [Target, Parameters] extends ['Parameters', [infer Type extends TSchema]] ? TParametersDeferred<Type> : [Target, Parameters] extends ['Partial', [infer Type extends TSchema]] ? TPartialDeferred<Type> : [Target, Parameters] extends ['Pick', [infer Type extends TSchema, infer Indexer extends TSchema]] ? TPickDeferred<Type, Indexer> : [Target, Parameters] extends ['Readonly', [infer Type extends TSchema]] ? TReadonlyObjectDeferred<Type> : [Target, Parameters] extends ['Record', [infer Key extends TSchema, infer Value extends TSchema]] ? TRecordDeferred<Key, Value> : [Target, Parameters] extends ['Required', [infer Type extends TSchema]] ? TRequiredDeferred<Type> : [Target, Parameters] extends ['ReturnType', [infer Type extends TSchema]] ? TReturnTypeDeferred<Type> : [Target, Parameters] extends ['Uncapitalize', [infer Type extends TSchema]] ? TUncapitalizeDeferred<Type> : [Target, Parameters] extends ['Uppercase', [infer Type extends TSchema]] ? TUppercaseDeferred<Type> : TCallConstruct<TRef<Target>, Parameters>);
|
|
557
603
|
type TDelimitedDecode<Input extends [unknown, unknown][], Result extends unknown[] = []> = (Input extends [infer Left extends [unknown, unknown], ...infer Right extends [unknown, unknown][]] ? TDelimitedDecode<Right, [...Result, Left[1]]> : Result);
|
|
558
604
|
type TDelimited<Input extends [unknown, unknown, unknown] | []> = (Input extends [infer Left extends unknown, infer Right extends [unknown, unknown][], infer _ extends unknown[]] ? [Left, ...TDelimitedDecode<Right>] : []);
|
|
559
605
|
type TGenericParameterExtendsEqualsMapping<Input extends [unknown, unknown, unknown, unknown, unknown]> = (Input extends [infer Name extends string, 'extends', infer Extends extends TSchema, '=', infer Equals extends TSchema] ? TParameter$1<Name, Extends, Equals> : never);
|
|
606
|
+
declare function GenericParameterExtendsEqualsMapping(input: [unknown, unknown, unknown, unknown, unknown]): unknown;
|
|
560
607
|
type TGenericParameterExtendsMapping<Input extends [unknown, unknown, unknown]> = (Input extends [infer Name extends string, 'extends', infer Extends extends TSchema] ? TParameter$1<Name, Extends, Extends> : never);
|
|
608
|
+
declare function GenericParameterExtendsMapping(input: [unknown, unknown, unknown]): unknown;
|
|
561
609
|
type TGenericParameterEqualsMapping<Input extends [unknown, unknown, unknown]> = (Input extends [infer Name extends string, '=', infer Equals extends TSchema] ? TParameter$1<Name, TUnknown, Equals> : never);
|
|
610
|
+
declare function GenericParameterEqualsMapping(input: [unknown, unknown, unknown]): unknown;
|
|
562
611
|
type TGenericParameterIdentifierMapping<Input extends string, Result extends TSchema = TParameter$1<Input, TUnknown, TUnknown>> = Result;
|
|
612
|
+
declare function GenericParameterIdentifierMapping(input: string): unknown;
|
|
563
613
|
type TGenericParameterMapping<Input extends unknown> = (Input);
|
|
614
|
+
declare function GenericParameterMapping(input: unknown): unknown;
|
|
564
615
|
type TGenericParameterListMapping<Input extends [unknown, unknown, unknown] | []> = (TDelimited<Input>);
|
|
616
|
+
declare function GenericParameterListMapping(input: [unknown, unknown, unknown] | []): unknown;
|
|
565
617
|
type TGenericParametersMapping<Input extends [unknown, unknown, unknown]> = (Input extends ['<', infer Parameters extends TParameter$1[], '>'] ? Parameters : never);
|
|
618
|
+
declare function GenericParametersMapping(input: [unknown, unknown, unknown]): unknown;
|
|
566
619
|
type TGenericCallArgumentListMapping<Input extends [unknown, unknown, unknown] | []> = (TDelimited<Input>);
|
|
620
|
+
declare function GenericCallArgumentListMapping(input: [unknown, unknown, unknown] | []): unknown;
|
|
567
621
|
type TGenericCallArgumentsMapping<Input extends [unknown, unknown, unknown]> = (Input extends ['<', infer Arguments extends TSchema[], '>'] ? Arguments : never);
|
|
622
|
+
declare function GenericCallArgumentsMapping(input: [unknown, unknown, unknown]): unknown;
|
|
568
623
|
type TGenericCallMapping<Input extends [unknown, unknown], Result = Input extends [infer Ref extends string, infer Arguments extends TSchema[]] ? TIntrinsicOrCall<Ref, Arguments> : never> = Result;
|
|
624
|
+
declare function GenericCallMapping(input: [unknown, unknown]): unknown;
|
|
569
625
|
type TOptionalSemiColonMapping<Input extends [unknown] | []> = null;
|
|
626
|
+
declare function OptionalSemiColonMapping(input: [unknown] | []): unknown;
|
|
570
627
|
type TKeywordStringMapping<Input extends 'string'> = (TString$1);
|
|
628
|
+
declare function KeywordStringMapping(input: 'string'): unknown;
|
|
571
629
|
type TKeywordNumberMapping<Input extends 'number'> = (TNumber$1);
|
|
630
|
+
declare function KeywordNumberMapping(input: 'number'): unknown;
|
|
572
631
|
type TKeywordBooleanMapping<Input extends 'boolean'> = (TBoolean);
|
|
632
|
+
declare function KeywordBooleanMapping(input: 'boolean'): unknown;
|
|
573
633
|
type TKeywordUndefinedMapping<Input extends 'undefined'> = (TUndefined);
|
|
634
|
+
declare function KeywordUndefinedMapping(input: 'undefined'): unknown;
|
|
574
635
|
type TKeywordNullMapping<Input extends 'null'> = (TNull);
|
|
636
|
+
declare function KeywordNullMapping(input: 'null'): unknown;
|
|
575
637
|
type TKeywordIntegerMapping<Input extends 'integer'> = (TInteger$1);
|
|
638
|
+
declare function KeywordIntegerMapping(input: 'integer'): unknown;
|
|
576
639
|
type TKeywordBigIntMapping<Input extends 'bigint'> = (TBigInt$1);
|
|
640
|
+
declare function KeywordBigIntMapping(input: 'bigint'): unknown;
|
|
577
641
|
type TKeywordUnknownMapping<Input extends 'unknown'> = (TUnknown);
|
|
642
|
+
declare function KeywordUnknownMapping(input: 'unknown'): unknown;
|
|
578
643
|
type TKeywordAnyMapping<Input extends 'any'> = (TAny);
|
|
644
|
+
declare function KeywordAnyMapping(input: 'any'): unknown;
|
|
579
645
|
type TKeywordObjectMapping<Input extends 'object'> = (TObject<{}>);
|
|
646
|
+
declare function KeywordObjectMapping(input: 'object'): unknown;
|
|
580
647
|
type TKeywordNeverMapping<Input extends 'never'> = (TNever);
|
|
648
|
+
declare function KeywordNeverMapping(input: 'never'): unknown;
|
|
581
649
|
type TKeywordSymbolMapping<Input extends 'symbol'> = (TSymbol);
|
|
650
|
+
declare function KeywordSymbolMapping(input: 'symbol'): unknown;
|
|
582
651
|
type TKeywordVoidMapping<Input extends 'void'> = (TVoid);
|
|
652
|
+
declare function KeywordVoidMapping(input: 'void'): unknown;
|
|
583
653
|
type TKeywordThisMapping<Input extends 'this'> = (TThis);
|
|
654
|
+
declare function KeywordThisMapping(input: 'this'): unknown;
|
|
584
655
|
type TLiteralBigIntMapping<Input extends string> = (Input extends `${infer Value extends bigint}` ? TLiteral<Value> : never);
|
|
656
|
+
declare function LiteralBigIntMapping(input: string): unknown;
|
|
585
657
|
type TLiteralBooleanMapping<Input extends 'true' | 'false'> = (Input extends 'true' ? TLiteral<true> : TLiteral<false>);
|
|
658
|
+
declare function LiteralBooleanMapping(input: 'true' | 'false'): unknown;
|
|
586
659
|
type TLiteralNumberMapping<Input extends string> = (Input extends `${infer Value extends number}` ? TLiteral<Value> : never);
|
|
660
|
+
declare function LiteralNumberMapping(input: string): unknown;
|
|
587
661
|
type TLiteralStringMapping<Input extends string> = (Input extends TLiteralValue ? TLiteral<Input> : never);
|
|
662
|
+
declare function LiteralStringMapping(input: string): unknown;
|
|
588
663
|
type TTemplateInterpolateMapping<Input extends [unknown, unknown, unknown]> = Input extends ['${', infer Type extends TSchema, '}'] ? Type : never;
|
|
664
|
+
declare function TemplateInterpolateMapping(input: [unknown, unknown, unknown]): unknown;
|
|
589
665
|
type TTemplateSpanMapping<Input extends string, Result extends TSchema = TLiteral<Input>> = Result;
|
|
666
|
+
declare function TemplateSpanMapping(input: string): unknown;
|
|
590
667
|
type TTemplateBodyMapping<Input extends [unknown, unknown, unknown] | [unknown]> = (Input extends [infer Text extends TSchema, infer Type extends TSchema, infer Rest extends TSchema[]] ? [Text, Type, ...Rest] : Input extends [infer Text extends TSchema] ? [Text] : []);
|
|
668
|
+
declare function TemplateBodyMapping(input: [unknown, unknown, unknown] | [unknown]): unknown;
|
|
591
669
|
type TTemplateLiteralTypesMapping<Input extends [unknown, unknown, unknown], Result extends TSchema = Input extends ['`', infer Types extends TSchema[], '`'] ? Types : []> = Result;
|
|
670
|
+
declare function TemplateLiteralTypesMapping(input: [unknown, unknown, unknown]): unknown;
|
|
592
671
|
type TTemplateLiteralMapping<Input extends unknown> = (Input extends (infer Types extends TSchema[]) ? TTemplateLiteralDeferred<Types> : never);
|
|
672
|
+
declare function TemplateLiteralMapping(input: unknown): unknown;
|
|
593
673
|
type TDependentMapping<Input extends [unknown, unknown, unknown, unknown, unknown, unknown] | [unknown, unknown, unknown, unknown]> = (Input extends ['if', infer If extends TSchema, 'then', infer Then extends TSchema, 'else', infer Else extends TSchema] ? TDependent$1<If, Then, Else> : Input extends ['if', infer If extends TSchema, 'then', infer Then extends TSchema] ? TDependent$1<If, Then, TUnknown> : never);
|
|
674
|
+
declare function DependentMapping(input: [unknown, unknown, unknown, unknown, unknown, unknown] | [unknown, unknown, unknown, unknown]): unknown;
|
|
594
675
|
type TKeyOfMapping<Input extends [unknown] | []> = (Input extends [unknown] ? true : false);
|
|
676
|
+
declare function KeyOfMapping(input: [unknown] | []): unknown;
|
|
595
677
|
type TIndexArrayMappingReduce<Input extends unknown[], Result extends unknown[] = []> = (Input extends [infer Left extends unknown, ...infer Right extends unknown[]] ? Left extends ['[', infer Type extends TSchema, ']'] ? TIndexArrayMappingReduce<Right, [...Result, [Type]]> : TIndexArrayMappingReduce<Right, [...Result, []]> : Result);
|
|
596
678
|
type TIndexArrayMapping<Input extends ([unknown, unknown, unknown] | [unknown, unknown])[]> = (Input extends unknown[] ? TIndexArrayMappingReduce<Input> : []);
|
|
679
|
+
declare function IndexArrayMapping(input: ([unknown, unknown, unknown] | [unknown, unknown])[]): unknown;
|
|
597
680
|
type TExtendsMapping<Input extends [unknown, unknown, unknown, unknown, unknown, unknown] | []> = (Input extends ['extends', infer Type extends TSchema, '?', infer True extends TSchema, ':', infer False extends TSchema] ? [Type, True, False] : []);
|
|
681
|
+
declare function ExtendsMapping(input: [unknown, unknown, unknown, unknown, unknown, unknown] | []): unknown;
|
|
598
682
|
type TBaseMapping<Input extends [unknown, unknown, unknown] | unknown> = (Input extends ['(', infer Type extends TSchema, ')'] ? Type : Input extends (infer Type extends TSchema) ? Type : never);
|
|
683
|
+
declare function BaseMapping(input: [unknown, unknown, unknown] | unknown): unknown;
|
|
599
684
|
type TWithMapping<Input extends [unknown, unknown] | []> = (Input extends ['with', infer WithObject extends Record<PropertyKey, unknown>] ? WithObject : []);
|
|
685
|
+
declare function WithMapping(input: [unknown, unknown] | []): unknown;
|
|
600
686
|
type TFactorIndexArray<Type extends TSchema, IndexArray extends unknown[]> = (IndexArray extends [infer Left extends TSchema[], ...infer Right extends unknown[]] ? (Left extends [infer Indexer extends TSchema] ? TFactorIndexArray<TIndexDeferred<Type, Indexer>, Right> : Left extends [] ? TFactorIndexArray<TArray<Type>, Right> : TNever) : Type);
|
|
601
687
|
type TFactorExtends<Type extends TSchema, Extends extends unknown[]> = (Extends extends [infer Right extends TSchema, infer True extends TSchema, infer False extends TSchema] ? TConditionalDeferred<Type, Right, True, False> : Type);
|
|
602
688
|
type TFactorWith<Type extends TSchema, With extends unknown> = (With extends Record<PropertyKey, unknown> ? TWithDeferred<Type, With> : Type);
|
|
603
689
|
type TFactorMapping<Input extends [unknown, unknown, unknown, unknown, unknown]> = (Input extends [infer KeyOf extends boolean, infer Type extends TSchema, infer IndexArray extends unknown[], infer Extend extends unknown[], infer WithClause extends unknown] ? TFactorWith<KeyOf extends true ? TFactorExtends<TKeyOfDeferred<TFactorIndexArray<Type, IndexArray>>, Extend> : TFactorExtends<TFactorIndexArray<Type, IndexArray>, Extend>, WithClause> : never);
|
|
690
|
+
declare function FactorMapping(input: [unknown, unknown, unknown, unknown, unknown]): unknown;
|
|
604
691
|
type TExprBinaryMapping<Left extends TSchema, Rest extends unknown[]> = (Rest extends [infer Operator extends unknown, infer Right extends TSchema, infer Next extends unknown[]] ? (TExprBinaryMapping<Right, Next> extends (infer Schema extends TSchema) ? (Operator extends '&' ? (Schema extends TIntersect<infer Types extends TSchema[]> ? TIntersect<[Left, ...Types]> : TIntersect<[Left, Schema]>) : Operator extends '|' ? (Schema extends TUnion<infer Types extends TSchema[]> ? TUnion<[Left, ...Types]> : TUnion<[Left, Schema]>) : never) : never) : Left);
|
|
605
692
|
type TExprTermTailMapping<Input extends [unknown, unknown, unknown] | []> = (Input);
|
|
693
|
+
declare function ExprTermTailMapping(input: [unknown, unknown, unknown] | []): unknown;
|
|
606
694
|
type TExprTermMapping<Input extends [unknown, unknown]> = (Input extends [infer Left extends TSchema, infer Rest extends unknown[]] ? TExprBinaryMapping<Left, Rest> : []);
|
|
695
|
+
declare function ExprTermMapping(input: [unknown, unknown]): unknown;
|
|
607
696
|
type TExprTailMapping<Input extends [unknown, unknown, unknown] | []> = (Input);
|
|
697
|
+
declare function ExprTailMapping(input: [unknown, unknown, unknown] | []): unknown;
|
|
608
698
|
type TExprMapping<Input extends [unknown, unknown]> = (Input extends [infer Left extends TSchema, infer Rest extends unknown[]] ? TExprBinaryMapping<Left, Rest> : []);
|
|
699
|
+
declare function ExprMapping(input: [unknown, unknown]): unknown;
|
|
609
700
|
type TExprReadonlyMapping<Input extends [unknown, unknown]> = (Input extends ['readonly', infer Type extends TSchema] ? TAddImmutableDeferred<Type> : never);
|
|
701
|
+
declare function ExprReadonlyMapping(input: [unknown, unknown]): unknown;
|
|
610
702
|
type TExprPipeMapping<Input extends [unknown, unknown]> = (Input extends ['|', infer Type extends TSchema] ? Type : never);
|
|
703
|
+
declare function ExprPipeMapping(input: [unknown, unknown]): unknown;
|
|
611
704
|
type TGenericTypeMapping<Input extends [unknown, unknown, unknown]> = (Input extends [infer Arguments extends TParameter$1[], '=', infer Type extends TSchema] ? TGeneric<Arguments, Type> : never);
|
|
705
|
+
declare function GenericTypeMapping(input: [unknown, unknown, unknown]): unknown;
|
|
612
706
|
type TInferTypeMapping<Input extends [unknown, unknown, unknown, unknown] | [unknown, unknown]> = (Input extends ['infer', infer Name extends string, 'extends', infer Type extends TSchema] ? TInfer<Name, Type> : Input extends ['infer', infer Name extends string] ? TInfer<Name, TUnknown> : never);
|
|
707
|
+
declare function InferTypeMapping(input: [unknown, unknown, unknown, unknown] | [unknown, unknown]): unknown;
|
|
613
708
|
type TTypeMapping<Input extends unknown> = (Input);
|
|
709
|
+
declare function TypeMapping(input: unknown): unknown;
|
|
614
710
|
type TPropertyKeyNumberMapping<Input extends string> = (`${Input}`);
|
|
711
|
+
declare function PropertyKeyNumberMapping(input: string): unknown;
|
|
615
712
|
type TPropertyKeyIdentMapping<Input extends string> = (Input);
|
|
713
|
+
declare function PropertyKeyIdentMapping(input: string): unknown;
|
|
616
714
|
type TPropertyKeyQuotedMapping<Input extends string> = (Input);
|
|
715
|
+
declare function PropertyKeyQuotedMapping(input: string): unknown;
|
|
617
716
|
type TPropertyKeyIndexMapping<Input extends [unknown, unknown, unknown, unknown, unknown]> = (Input extends ['[', string, ':', TInteger$1, ']'] ? TIntegerKey : Input extends ['[', string, ':', TNumber$1, ']'] ? TNumberKey : Input extends ['[', string, ':', TString$1, ']'] ? TStringKey : Input extends ['[', string, ':', TSymbol, ']'] ? TStringKey : never);
|
|
717
|
+
declare function PropertyKeyIndexMapping(input: [unknown, unknown, unknown, unknown, unknown]): unknown;
|
|
618
718
|
type TPropertyKeyMapping<Input extends unknown> = (Input);
|
|
719
|
+
declare function PropertyKeyMapping(input: unknown): unknown;
|
|
619
720
|
type TReadonlyMapping<Input extends [unknown] | []> = (Input extends [unknown] ? true : false);
|
|
721
|
+
declare function ReadonlyMapping(input: [unknown] | []): unknown;
|
|
620
722
|
type TOptionalMapping<Input extends [unknown] | []> = (Input extends [unknown] ? true : false);
|
|
723
|
+
declare function OptionalMapping(input: [unknown] | []): unknown;
|
|
621
724
|
type TPropertyMapping<Input extends [unknown, unknown, unknown, unknown, unknown]> = (Input extends [infer IsReadonly extends boolean, infer Key extends string, infer IsOptional extends boolean, string, infer Type extends TSchema] ? { [_ in Key]: ([IsReadonly, IsOptional] extends [true, true] ? TAddReadonlyDeferred<TAddOptionalDeferred<Type>> : [IsReadonly, IsOptional] extends [true, false] ? TAddReadonlyDeferred<Type> : [IsReadonly, IsOptional] extends [false, true] ? TAddOptionalDeferred<Type> : Type); } : never);
|
|
725
|
+
declare function PropertyMapping(input: [unknown, unknown, unknown, unknown, unknown]): unknown;
|
|
622
726
|
type TPropertyDelimiterMapping<Input extends [unknown, unknown] | [unknown]> = (Input);
|
|
727
|
+
declare function PropertyDelimiterMapping(input: [unknown, unknown] | [unknown]): unknown;
|
|
623
728
|
type TPropertyListMapping<Input extends [unknown, unknown, unknown] | []> = (TDelimited<Input>);
|
|
729
|
+
declare function PropertyListMapping(input: [unknown, unknown, unknown] | []): unknown;
|
|
624
730
|
type TPropertiesReduce<PropertiesList extends TProperties[], Result extends [properties: TProperties, patternProperties: TProperties] = [{}, {}]> = (PropertiesList extends [infer Left extends TProperties, ...infer Right extends TProperties[]] ? (Left extends { [_ in TIntegerKey]: TSchema; } ? TPropertiesReduce<Right, [Result[0], TAssign<Result[1], Left>]> : Left extends { [_ in TNumberKey]: TSchema; } ? TPropertiesReduce<Right, [Result[0], TAssign<Result[1], Left>]> : Left extends { [_ in TStringKey]: TSchema; } ? TPropertiesReduce<Right, [Result[0], TAssign<Result[1], Left>]> : TPropertiesReduce<Right, [TAssign<Result[0], Left>, Result[1]]>) : { [Key in keyof Result]: Result[Key]; });
|
|
625
731
|
type TPropertiesMapping<Input extends [unknown, unknown, unknown], Result extends [TProperties, TProperties] = Input extends ['{', infer PropertyList extends TProperties[], '}'] ? TPropertiesReduce<PropertyList> : [{}, {}]> = Result;
|
|
732
|
+
declare function PropertiesMapping(input: [unknown, unknown, unknown]): unknown;
|
|
626
733
|
type T_Object_Mapping<Input extends unknown> = (Input extends [infer Properties extends TProperties, infer _PatternProperties extends TProperties] ? TObject<Properties> : never);
|
|
734
|
+
declare function _Object_Mapping(input: unknown): unknown;
|
|
627
735
|
type TElementNamedMapping<Input extends [unknown, unknown, unknown, unknown, unknown] | [unknown, unknown, unknown, unknown] | [unknown, unknown, unknown]> = (Input extends [string, '?', ':', 'readonly', infer Type extends TSchema] ? TAddReadonlyDeferred<TAddOptionalDeferred<Type>> : Input extends [string, /**/ ':', 'readonly', infer Type extends TSchema] ? TAddReadonlyDeferred<Type> : Input extends [string, '?', ':', /* */ infer Type extends TSchema] ? TAddOptionalDeferred<Type> : Input extends [string, /**/ ':', /* */ infer Type extends TSchema] ? Type : never);
|
|
736
|
+
declare function ElementNamedMapping(input: [unknown, unknown, unknown, unknown, unknown] | [unknown, unknown, unknown, unknown] | [unknown, unknown, unknown]): unknown;
|
|
628
737
|
type TElementBaseMapping<Input extends unknown | [unknown, unknown, unknown]> = (Input extends [infer IsReadonly extends boolean, infer Type extends TSchema, infer IsOptional extends boolean] ? ([IsReadonly, IsOptional] extends [true, true] ? TAddReadonlyDeferred<TAddOptionalDeferred<Type>> : [IsReadonly, IsOptional] extends [true, false] ? TAddReadonlyDeferred<Type> : [IsReadonly, IsOptional] extends [false, true] ? TAddOptionalDeferred<Type> : Type) : Input);
|
|
738
|
+
declare function ElementBaseMapping(input: unknown | [unknown, unknown, unknown]): unknown;
|
|
629
739
|
type TElementMapping<Input extends [unknown, unknown] | [unknown]> = (Input extends ['...', infer Type extends TSchema] ? TRest<Type> : Input extends [infer Type extends TSchema] ? Type : never);
|
|
740
|
+
declare function ElementMapping(input: [unknown, unknown] | [unknown]): unknown;
|
|
630
741
|
type TElementListMapping<Input extends [unknown, unknown, unknown] | []> = (TDelimited<Input>);
|
|
742
|
+
declare function ElementListMapping(input: [unknown, unknown, unknown] | []): unknown;
|
|
631
743
|
type T_Tuple_Mapping<Input extends [unknown, unknown, unknown]> = (Input extends ['[', infer Types extends TSchema[], ']'] ? TTuple<Types> : never);
|
|
744
|
+
declare function _Tuple_Mapping(input: [unknown, unknown, unknown]): unknown;
|
|
632
745
|
type TParameterReadonlyOptionalMapping<Input extends [unknown, unknown, unknown, unknown, unknown]> = (Input extends [string, '?', ':', 'readonly', infer Type extends TSchema] ? TAddReadonlyDeferred<TAddOptionalDeferred<Type>> : never);
|
|
746
|
+
declare function ParameterReadonlyOptionalMapping(input: [unknown, unknown, unknown, unknown, unknown]): unknown;
|
|
633
747
|
type TParameterReadonlyMapping<Input extends [unknown, unknown, unknown, unknown]> = (Input extends [string, ':', 'readonly', infer Type extends TSchema] ? TAddReadonlyDeferred<Type> : never);
|
|
748
|
+
declare function ParameterReadonlyMapping(input: [unknown, unknown, unknown, unknown]): unknown;
|
|
634
749
|
type TParameterOptionalMapping<Input extends [unknown, unknown, unknown, unknown]> = (Input extends [string, '?', ':', infer Type extends TSchema] ? TAddOptionalDeferred<Type> : never);
|
|
750
|
+
declare function ParameterOptionalMapping(input: [unknown, unknown, unknown, unknown]): unknown;
|
|
635
751
|
type TParameterTypeMapping<Input extends [unknown, unknown, unknown]> = (Input extends [string, ':', infer Type extends TSchema] ? Type : never);
|
|
752
|
+
declare function ParameterTypeMapping(input: [unknown, unknown, unknown]): unknown;
|
|
636
753
|
type TParameterBaseMapping<Input extends unknown> = (Input);
|
|
754
|
+
declare function ParameterBaseMapping(input: unknown): unknown;
|
|
637
755
|
type TParameterMapping<Input extends [unknown, unknown] | [unknown]> = (Input extends ['...', infer Type extends TSchema] ? TRest<Type> : Input extends [infer Type extends TSchema] ? Type : never);
|
|
756
|
+
declare function ParameterMapping(input: [unknown, unknown] | [unknown]): unknown;
|
|
638
757
|
type TParameterListMapping<Input extends [unknown, unknown, unknown] | []> = (TDelimited<Input>);
|
|
758
|
+
declare function ParameterListMapping(input: [unknown, unknown, unknown] | []): unknown;
|
|
639
759
|
type T_Function_Mapping<Input extends [unknown, unknown, unknown, unknown, unknown]> = (Input extends ['(', infer ParameterList extends TSchema[], ')', '=>', infer ReturnType extends TSchema] ? TFunction<ParameterList, ReturnType> : never);
|
|
760
|
+
declare function _Function_Mapping(input: [unknown, unknown, unknown, unknown, unknown]): unknown;
|
|
640
761
|
type T_Constructor_Mapping<Input extends [unknown, unknown, unknown, unknown, unknown, unknown]> = (Input extends ['new', '(', infer ParameterList extends TSchema[], ')', '=>', infer InstanceType extends TSchema] ? TConstructor<ParameterList, InstanceType> : never);
|
|
762
|
+
declare function _Constructor_Mapping(input: [unknown, unknown, unknown, unknown, unknown, unknown]): unknown;
|
|
641
763
|
type TModifierOperation = 'add' | 'remove' | 'none';
|
|
642
764
|
type TApplyReadonly<Readonly extends TModifierOperation, Type extends TSchema> = (Readonly extends 'remove' ? TRemoveReadonlyDeferred<Type> : Readonly extends 'add' ? TAddReadonlyDeferred<Type> : Type);
|
|
643
765
|
type TMappedReadonlyMapping<Input extends [unknown, unknown] | [unknown] | []> = (Input extends ['-', 'readonly'] ? 'remove' : Input extends ['+', 'readonly'] ? 'add' : Input extends ['readonly'] ? 'add' : 'none');
|
|
766
|
+
declare function MappedReadonlyMapping(input: [unknown, unknown] | [unknown] | []): unknown;
|
|
644
767
|
type TApplyOptional<Optional extends TModifierOperation, Type extends TSchema> = (Optional extends 'remove' ? TRemoveOptionalDeferred<Type> : Optional extends 'add' ? TAddOptionalDeferred<Type> : Type);
|
|
645
768
|
type TMappedOptionalMapping<Input extends [unknown, unknown] | [unknown] | []> = (Input extends ['-', '?'] ? 'remove' : Input extends ['+', '?'] ? 'add' : Input extends ['?'] ? 'add' : 'none');
|
|
769
|
+
declare function MappedOptionalMapping(input: [unknown, unknown] | [unknown] | []): unknown;
|
|
646
770
|
type TMappedAsMapping<Input extends [unknown, unknown] | []> = (Input extends ['as', infer Type extends TSchema] ? [Type] : []);
|
|
771
|
+
declare function MappedAsMapping(input: [unknown, unknown] | []): unknown;
|
|
647
772
|
type T_Mapped_Mapping<Input extends [unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown]> = (Input extends ['{', infer Readonly extends TModifierOperation, '[', infer Key extends string, 'in', infer Type extends TSchema, infer As extends TSchema[], ']', infer Optional extends TModifierOperation, ':', infer Property extends TSchema, null, '}'] ? (As extends [infer As extends TSchema] ? TMappedDeferred<TIdentifier<Key>, Type, As, TApplyReadonly<Readonly, TApplyOptional<Optional, Property>>> : TMappedDeferred<TIdentifier<Key>, Type, TRef<Key>, TApplyReadonly<Readonly, TApplyOptional<Optional, Property>>>) : never);
|
|
773
|
+
declare function _Mapped_Mapping(input: [unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown]): unknown;
|
|
648
774
|
type TReferenceMapping<Input extends string, Result extends TSchema = TRef<Input>> = Result;
|
|
775
|
+
declare function ReferenceMapping(input: string): unknown;
|
|
649
776
|
type TWithBigIntMapping<Input extends string> = (Input extends `${infer Value extends bigint}` ? Value : never);
|
|
777
|
+
declare function WithBigIntMapping(input: string): unknown;
|
|
650
778
|
type TWithNumberMapping<Input extends string> = (Input extends `${infer Value extends number}` ? Value : never);
|
|
779
|
+
declare function WithNumberMapping(input: string): unknown;
|
|
651
780
|
type TWithBooleanMapping<Input extends 'true' | 'false'> = (Input extends 'true' ? true : false);
|
|
781
|
+
declare function WithBooleanMapping(input: 'true' | 'false'): unknown;
|
|
652
782
|
type TWithStringMapping<Input extends string> = (Input);
|
|
783
|
+
declare function WithStringMapping(input: string): unknown;
|
|
653
784
|
type TWithNullMapping<Input extends 'null'> = (null);
|
|
785
|
+
declare function WithNullMapping(input: 'null'): unknown;
|
|
654
786
|
type TWithUndefinedMapping<Input extends 'undefined'> = undefined;
|
|
787
|
+
declare function WithUndefinedMapping(input: 'undefined'): unknown;
|
|
655
788
|
type TWithPropertyMapping<Input extends [unknown, unknown, unknown]> = (Input extends [infer Key extends string, ':', infer Value extends unknown] ? { [_ in Key]: Value; } : never);
|
|
789
|
+
declare function WithPropertyMapping(input: [unknown, unknown, unknown]): unknown;
|
|
656
790
|
type TWithPropertyListMapping<Input extends [unknown, unknown, unknown] | []> = (TDelimited<Input>);
|
|
791
|
+
declare function WithPropertyListMapping(input: [unknown, unknown, unknown] | []): unknown;
|
|
657
792
|
type TWithObjectMappingReduce<PropertyList extends Record<PropertyKey, unknown>[], Result extends Record<PropertyKey, unknown> = {}> = (PropertyList extends [infer Left extends Record<PropertyKey, unknown>, ...infer Right extends Record<PropertyKey, unknown>[]] ? TWithObjectMappingReduce<Right, TAssign<Result, Left>> : { [Key in keyof Result]: Result[Key]; });
|
|
658
793
|
type TWithObjectMapping<Input extends [unknown, unknown, unknown]> = (Input extends ['{', infer PropertyList extends Record<PropertyKey, unknown>[], '}'] ? TWithObjectMappingReduce<PropertyList> : {});
|
|
794
|
+
declare function WithObjectMapping(input: [unknown, unknown, unknown]): unknown;
|
|
659
795
|
type TWithElementListMapping<Input extends [unknown, unknown, unknown] | []> = (TDelimited<Input>);
|
|
796
|
+
declare function WithElementListMapping(input: [unknown, unknown, unknown] | []): unknown;
|
|
660
797
|
type TWithArrayMapping<Input extends [unknown, unknown, unknown]> = (Input extends ['[', infer Elements extends unknown[], ']'] ? Elements : never);
|
|
798
|
+
declare function WithArrayMapping(input: [unknown, unknown, unknown]): unknown;
|
|
661
799
|
type TWithValueMapping<Input extends unknown> = (Input);
|
|
800
|
+
declare function WithValueMapping(input: unknown): unknown;
|
|
662
801
|
type TPatternBigIntMapping<Input extends '-?(?:0|[1-9][0-9]*)n'> = (TBigInt$1);
|
|
802
|
+
declare function PatternBigIntMapping(input: '-?(?:0|[1-9][0-9]*)n'): unknown;
|
|
663
803
|
type TPatternStringMapping<Input extends '.*'> = (TString$1);
|
|
804
|
+
declare function PatternStringMapping(input: '.*'): unknown;
|
|
664
805
|
type TPatternNumberMapping<Input extends '-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?'> = (TNumber$1);
|
|
806
|
+
declare function PatternNumberMapping(input: '-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?'): unknown;
|
|
665
807
|
type TPatternIntegerMapping<Input extends '-?(?:0|[1-9][0-9]*)'> = (TInteger$1);
|
|
808
|
+
declare function PatternIntegerMapping(input: '-?(?:0|[1-9][0-9]*)'): unknown;
|
|
666
809
|
type TPatternNeverMapping<Input extends '(?!)'> = (TNever);
|
|
810
|
+
declare function PatternNeverMapping(input: '(?!)'): unknown;
|
|
667
811
|
type TPatternTextMapping<Input extends string, Result extends TSchema = TLiteral<Input>> = Result;
|
|
812
|
+
declare function PatternTextMapping(input: string): unknown;
|
|
668
813
|
type TPatternBaseMapping<Input extends unknown> = (Input);
|
|
814
|
+
declare function PatternBaseMapping(input: unknown): unknown;
|
|
669
815
|
type TPatternGroupMapping<Input extends [unknown, unknown, unknown]> = (Input extends ['(', infer Body extends TSchema[], ')'] ? TUnion<Body> : never);
|
|
816
|
+
declare function PatternGroupMapping(input: [unknown, unknown, unknown]): unknown;
|
|
670
817
|
type TPatternUnionMapping<Input extends [unknown, unknown, unknown] | [unknown] | []> = (Input extends [infer Term extends TSchema[], '|', infer Union extends TSchema[]] ? [...Term, ...Union] : Input extends [infer Term extends TSchema[]] ? [...Term] : []);
|
|
818
|
+
declare function PatternUnionMapping(input: [unknown, unknown, unknown] | [unknown] | []): unknown;
|
|
671
819
|
type TPatternTermMapping<Input extends [unknown, unknown]> = (Input extends [infer Left extends TSchema, infer Right extends TSchema[]] ? [Left, ...Right] : never);
|
|
820
|
+
declare function PatternTermMapping(input: [unknown, unknown]): unknown;
|
|
672
821
|
type TPatternBodyMapping<Input extends unknown> = (Input);
|
|
822
|
+
declare function PatternBodyMapping(input: unknown): unknown;
|
|
673
823
|
type TPatternMapping<Input extends [unknown, unknown, unknown]> = (Input extends ['^', infer Body extends TSchema[], '$'] ? Body : never);
|
|
824
|
+
declare function PatternMapping(input: [unknown, unknown, unknown]): unknown;
|
|
674
825
|
type TInterfaceDeclarationHeritageListMapping<Input extends [unknown, unknown, unknown] | []> = (TDelimited<Input>);
|
|
826
|
+
declare function InterfaceDeclarationHeritageListMapping(input: [unknown, unknown, unknown] | []): unknown;
|
|
675
827
|
type TInterfaceDeclarationHeritageMapping<Input extends [unknown, unknown] | []> = (Input extends ['extends', infer Heritage extends TSchema[]] ? Heritage : []);
|
|
828
|
+
declare function InterfaceDeclarationHeritageMapping(input: [unknown, unknown] | []): unknown;
|
|
676
829
|
type TInterfaceDeclarationGenericMapping<Input extends [unknown, unknown, unknown, unknown, unknown]> = (Input extends ['interface', infer Name extends string, infer Parameters extends TParameter$1[], infer Heritage extends TSchema[], infer Properties extends [TProperties, TProperties]] ? { [_ in Name]: TGeneric<Parameters, TInterfaceDeferred<Heritage, Properties[0]>>; } : never);
|
|
830
|
+
declare function InterfaceDeclarationGenericMapping(input: [unknown, unknown, unknown, unknown, unknown]): unknown;
|
|
677
831
|
type TInterfaceDeclarationMapping<Input extends [unknown, unknown, unknown, unknown]> = (Input extends ['interface', infer Name extends string, infer Heritage extends TSchema[], infer Properties extends [TProperties, TProperties]] ? { [_ in Name]: TInterfaceDeferred<Heritage, Properties[0]>; } : never);
|
|
832
|
+
declare function InterfaceDeclarationMapping(input: [unknown, unknown, unknown, unknown]): unknown;
|
|
678
833
|
type TTypeAliasDeclarationGenericMapping<Input extends [unknown, unknown, unknown, unknown, unknown]> = (Input extends ['type', infer Name extends string, infer Parameters extends TParameter$1[], '=', infer Type extends TSchema] ? { [_ in Name]: TGeneric<Parameters, Type>; } : never);
|
|
834
|
+
declare function TypeAliasDeclarationGenericMapping(input: [unknown, unknown, unknown, unknown, unknown]): unknown;
|
|
679
835
|
type TTypeAliasDeclarationMapping<Input extends [unknown, unknown, unknown, unknown]> = (Input extends ['type', infer Name extends string, '=', infer Type extends TSchema] ? { [_ in Name]: Type; } : never);
|
|
836
|
+
declare function TypeAliasDeclarationMapping(input: [unknown, unknown, unknown, unknown]): unknown;
|
|
680
837
|
type TExportKeywordMapping<Input extends [unknown] | []> = (null);
|
|
838
|
+
declare function ExportKeywordMapping(input: [unknown] | []): unknown;
|
|
681
839
|
type TModuleDeclarationDelimiterMapping<Input extends [unknown, unknown] | [unknown]> = (Input);
|
|
840
|
+
declare function ModuleDeclarationDelimiterMapping(input: [unknown, unknown] | [unknown]): unknown;
|
|
682
841
|
type TModuleDeclarationListMapping<Input extends [unknown, unknown, unknown] | []> = (TDelimited<Input>);
|
|
842
|
+
declare function ModuleDeclarationListMapping(input: [unknown, unknown, unknown] | []): unknown;
|
|
683
843
|
type TModuleDeclarationMapping<Input extends [unknown, unknown, unknown]> = (Input extends [null, infer ModuleDeclaration extends TProperties, null] ? ModuleDeclaration : never);
|
|
844
|
+
declare function ModuleDeclarationMapping(input: [unknown, unknown, unknown]): unknown;
|
|
684
845
|
type TModuleMapping<Input extends [unknown, unknown]> = (Input extends [infer ModuleDeclaration extends TProperties, infer ModuleDeclarationList extends TProperties[]] ? TModuleDeferred<TAssign<ModuleDeclaration, TPropertiesReduce<ModuleDeclarationList>[0]>> : never);
|
|
846
|
+
declare function ModuleMapping(input: [unknown, unknown]): unknown;
|
|
685
847
|
type TScriptMapping<Input extends unknown> = (Input);
|
|
848
|
+
declare function ScriptMapping(input: unknown): unknown;
|
|
686
849
|
type TTakeVariant<Variant extends string, Input extends string> = (Input extends `${Variant}${infer Rest extends string}` ? [Variant, Rest] : []);
|
|
687
850
|
/** Takes one of the given variants or fail */
|
|
688
851
|
type TTake<Variants extends string[], Input extends string> = (Variants extends [infer ValueLeft extends string, ...infer ValueRight extends string[]] ? TTakeVariant<ValueLeft, Input> extends [infer Take extends string, infer Rest extends string] ? [Take, Rest] : TTake<ValueRight, Input> : []);
|
|
689
|
-
|
|
690
|
-
|
|
852
|
+
declare namespace char_d_exports {
|
|
853
|
+
export { Alpha, Digit, DollarSign, Dot, Hyphen, NewLine, NonZero, TAlpha, TDigit, TDollarSign, TDot, THyphen, TNewLine, TNonZero, TTabSpace, TUnderScore, TWhiteSpace, TZero, TabSpace, UnderScore, WhiteSpace, Zero };
|
|
854
|
+
}
|
|
691
855
|
type TAlpha = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'];
|
|
692
|
-
|
|
856
|
+
declare const Alpha: TAlpha;
|
|
857
|
+
type TZero = typeof Zero;
|
|
693
858
|
type TNonZero = ['1', '2', '3', '4', '5', '6', '7', '8', '9'];
|
|
694
859
|
type TDigit = [TZero, ...TNonZero];
|
|
695
|
-
declare const Zero
|
|
860
|
+
declare const Zero = "0";
|
|
861
|
+
declare const NonZero: TNonZero;
|
|
862
|
+
declare const Digit: TDigit;
|
|
696
863
|
declare const WhiteSpace = " ";
|
|
697
864
|
declare const NewLine = "\n";
|
|
698
865
|
declare const TabSpace = "\t";
|
|
699
866
|
declare const UnderScore = "_";
|
|
700
|
-
declare const Dot
|
|
867
|
+
declare const Dot = ".";
|
|
701
868
|
declare const DollarSign = "$";
|
|
702
869
|
declare const Hyphen = "-";
|
|
703
870
|
type TWhiteSpace = typeof WhiteSpace;
|
|
704
871
|
type TNewLine = typeof NewLine;
|
|
705
872
|
type TTabSpace = typeof TabSpace;
|
|
706
873
|
type TUnderScore = typeof UnderScore;
|
|
707
|
-
type TDot = typeof Dot
|
|
874
|
+
type TDot = typeof Dot;
|
|
708
875
|
type TDollarSign = typeof DollarSign;
|
|
709
876
|
type THyphen = typeof Hyphen;
|
|
710
877
|
type LineComment = typeof LineComment;
|
|
@@ -723,9 +890,7 @@ type W0 = ` `;
|
|
|
723
890
|
type TTrimWhitespace<Input extends string> = (Input extends `${OpenComment}${infer Rest extends string}` ? TTrimWhitespace<TDiscardMultiLineComment<Rest>> : Input extends `${LineComment}${infer Rest extends string}` ? TTrimWhitespace<TDiscardLineComment<Rest>> : Input extends `${W4}${infer Rest extends string}` ? TTrimWhitespace<Rest> : Input extends `${W3}${infer Rest extends string}` ? TTrimWhitespace<Rest> : Input extends `${W1}${infer Rest extends string}` ? TTrimWhitespace<Rest> : Input extends `${W0}${infer Rest extends string}` ? TTrimWhitespace<Rest> : Input);
|
|
724
891
|
type TTrim<Input extends string> = (Input extends `${OpenComment}${infer Rest extends string}` ? TTrim<TDiscardMultiLineComment<Rest>> : Input extends `${LineComment}${infer Rest extends string}` ? TTrim<TDiscardLineComment<Rest>> : Input extends `${TNewLine}${infer Rest extends string}` ? TTrim<Rest> : Input extends `${TTabSpace}${infer Rest extends string}` ? TTrim<Rest> : Input extends `${W4}${infer Rest extends string}` ? TTrim<Rest> : Input extends `${W3}${infer Rest extends string}` ? TTrim<Rest> : Input extends `${W1}${infer Rest extends string}` ? TTrim<Rest> : Input extends `${W0}${infer Rest extends string}` ? TTrim<Rest> : Input);
|
|
725
892
|
/** Matches the given Value or empty string if no match. This function never fails */
|
|
726
|
-
type TOptional$2<Value extends string, Input extends string> = (TTake<[Value], Input> extends [infer Optional extends string, infer Rest extends string] ? [Optional
|
|
727
|
-
/** Matches the given Value or empty string if no match. This function never fails */
|
|
728
|
-
declare function Optional$2<Value extends string, Input extends string>(value: Value, input: Input): TOptional$2<Value, Value>;
|
|
893
|
+
type TOptional$2<Value extends string, Input extends string> = (TTake<[Value], Input> extends [infer Optional extends string, infer Rest extends string] ? [Optional, Rest] : ['', Input]);
|
|
729
894
|
type TIsDiscard<Discard extends string[], Input extends string> = (Discard extends [infer Left extends string, ...infer Right extends string[]] ? Input extends Left ? true : TIsDiscard<Right, Input> : false);
|
|
730
895
|
/** Takes characters from the Input until no-match. The Discard set is used to omit characters from the match */
|
|
731
896
|
type TMany<Allowed extends string[], Discard extends string[], Input extends string, Result extends string = ''> = (TTake<Allowed, Input> extends [infer Char extends string, infer Rest extends string] ? TIsDiscard<Discard, Char> extends true ? TMany<Allowed, Discard, Rest, Result> : TMany<Allowed, Discard, Rest, `${Result}${Char}`> : [Result, Input]);
|
|
@@ -735,16 +900,24 @@ type TTakeDigits<Input extends string> = (TMany<TAllowedDigits$1, [TUnderScore],
|
|
|
735
900
|
type TTakeUnsignedInteger<Input extends string> = (TTake<[TZero], Input> extends [infer Zero extends string, infer ZeroRest extends string] ? [Zero, ZeroRest] : TTakeNonZero<Input> extends [infer NonZero extends string, infer NonZeroRest extends string] ? TTakeDigits<NonZeroRest> extends [infer Digits extends string, infer DigitsRest extends string] ? [`${NonZero}${Digits}`, DigitsRest] : [] : []);
|
|
736
901
|
/** Matches if next is a UnsignedInteger */
|
|
737
902
|
type TUnsignedInteger<Input extends string> = (TTakeUnsignedInteger<TTrim<Input>>);
|
|
903
|
+
/** Matches if next is a UnsignedInteger */
|
|
904
|
+
declare function UnsignedInteger<Input extends string>(input: Input): TUnsignedInteger<Input>;
|
|
738
905
|
type TTakeSign$1<Input extends string> = (TOptional$2<THyphen, Input>);
|
|
739
906
|
type TTakeSignedInteger<Input extends string> = (TTakeSign$1<Input> extends [infer Sign extends string, infer SignRest extends string] ? TUnsignedInteger<SignRest> extends [infer UnsignedInteger extends string, infer UnsignedIntegerRest extends string] ? [`${Sign}${UnsignedInteger}`, UnsignedIntegerRest] : [] : []);
|
|
740
907
|
/** Matches if next is a signed or unsigned Integer */
|
|
741
908
|
type TInteger<Input extends string> = (TTakeSignedInteger<TTrim<Input>>);
|
|
909
|
+
/** Matches if next is a signed or unsigned Integer */
|
|
910
|
+
declare function Integer<Input extends string>(input: Input): TInteger<Input>;
|
|
742
911
|
type TTakeBigInt<Input extends string> = (TInteger<Input> extends [infer Integer extends string, infer IntegerRest extends string] ? TTake<['n'], IntegerRest> extends [infer _N extends string, infer NRest extends string] ? [`${Integer}`, NRest] : [] : []);
|
|
743
912
|
/** Matches if next is a Integer literal with trailing 'n'. Trailing 'n' is omitted in result. */
|
|
744
913
|
type TBigInt<Input extends string> = (TTakeBigInt<Input>);
|
|
914
|
+
/** Matches if next is a Integer literal with trailing 'n'. Trailing 'n' is omitted in result. */
|
|
915
|
+
declare function BigInt<Input extends string>(input: Input): TBigInt<Input>;
|
|
745
916
|
type TTakeConst<Const extends string, Input extends string> = (TTake<[Const], Input>);
|
|
746
917
|
/** Matches if next is the given Const value */
|
|
747
918
|
type TConst<Const extends string, Input extends string> = (Const extends '' ? ['', Input] : Const extends `${infer First extends string}${string}` ? (First extends TNewLine ? TTakeConst<Const, TTrimWhitespace<Input>> : First extends TWhiteSpace ? TTakeConst<Const, Input> : TTakeConst<Const, TTrim<Input>>) : never);
|
|
919
|
+
/** Matches if next is the given Const value */
|
|
920
|
+
declare function Const<Const extends string, Input extends string>(const_: Const, input: Input): TConst<Const, Input>;
|
|
748
921
|
type TInitial = [...TAlpha, TUnderScore, TDollarSign];
|
|
749
922
|
type TTakeInitial$1<Input extends string> = (TTake<TInitial, Input>);
|
|
750
923
|
type TRemaining = [...TInitial, ...TDigit];
|
|
@@ -752,6 +925,8 @@ type TTakeRemaining<Input extends string, Result extends string = ''> = (TTake<T
|
|
|
752
925
|
type TTakeIdent<Input extends string> = (TTakeInitial$1<Input> extends [infer Initial extends string, infer InitialRest extends string] ? TTakeRemaining<InitialRest> extends [infer Remaining extends string, infer RemainingRest extends string] ? [`${Initial}${Remaining}`, RemainingRest] : [] : []);
|
|
753
926
|
/** Matches if next is an Ident */
|
|
754
927
|
type TIdent<Input extends string> = (TTakeIdent<TTrim<Input>>);
|
|
928
|
+
/** Matches if next is an Ident */
|
|
929
|
+
declare function Ident<Input extends string>(input: Input): TIdent<Input>;
|
|
755
930
|
type TAllowedDigits = [...TDigit, TUnderScore];
|
|
756
931
|
type TIsLeadingDot<Input extends string> = (TTake<[TDot], Input> extends [string, string] ? true : false);
|
|
757
932
|
type TTakeFractional<Input extends string> = (TMany<TAllowedDigits, [TUnderScore], Input> extends [infer Digits extends string, infer DigitsRest extends string] ? Digits extends '' ? [] : [Digits, DigitsRest] : []);
|
|
@@ -760,25 +935,47 @@ type TLeadingInteger<Input extends string> = (TUnsignedInteger<Input> extends [i
|
|
|
760
935
|
type TTakeUnsignedNumber<Input extends string> = (TIsLeadingDot<Input> extends true ? TLeadingDot<Input> : TLeadingInteger<Input>);
|
|
761
936
|
/** Matches if next is a UnsignedNumber */
|
|
762
937
|
type TUnsignedNumber<Input extends string> = (TTakeUnsignedNumber<TTrim<Input>>);
|
|
938
|
+
/** Matches if next is a UnsignedNumber */
|
|
939
|
+
declare function UnsignedNumber<Input extends string>(input: Input): TUnsignedNumber<Input>;
|
|
763
940
|
type TTakeSign<Input extends string> = (TOptional$2<THyphen, Input>);
|
|
764
941
|
type TTakeSignedNumber<Input extends string> = (TTakeSign<Input> extends [infer Sign extends string, infer SignRest extends string] ? TUnsignedNumber<SignRest> extends [infer UnsignedInteger extends string, infer UnsignedIntegerRest extends string] ? [`${Sign}${UnsignedInteger}`, UnsignedIntegerRest] : [] : []);
|
|
765
942
|
/** Matches if next is a signed or unsigned Number */
|
|
766
943
|
type TNumber<Input extends string> = (TTakeSignedNumber<TTrim<Input>>);
|
|
944
|
+
/** Matches if next is a signed or unsigned Number */
|
|
945
|
+
declare function Number<Input extends string>(input: Input): TNumber<Input>;
|
|
946
|
+
/** Match remaining characters in the buffer until end. If no characters are in buffer, no match */
|
|
947
|
+
type TRest$1<Input extends string> = (Input extends '' ? [] : [Input, '']);
|
|
948
|
+
/** Match remaining characters in the buffer until end. If no characters are in buffer, no match */
|
|
949
|
+
declare function Rest$1<Input extends string>(input: Input): TRest$1<Input>;
|
|
767
950
|
type TTakeOne<Input extends string> = (Input extends `${infer Left extends string}${infer Right extends string}` ? [Left, Right] : []);
|
|
768
951
|
type TIsInputMatchSentinal<End extends string[], Input extends string> = (End extends [infer Left extends string, ...infer Right extends string[]] ? Input extends `${Left}${string}` ? true : TIsInputMatchSentinal<Right, Input> : false);
|
|
769
952
|
/** Match Input until but not including End. No match if End not found. */
|
|
770
953
|
type TUntil<End extends string[], Input extends string, Result extends string = ''> = (TTakeOne<Input> extends [infer One extends string, infer Rest extends string] ? TIsInputMatchSentinal<End, Input> extends true ? [Result, Input] : TUntil<End, Rest, `${Result}${One}`> : []);
|
|
954
|
+
/** Match Input until but not including End. No match if End not found. */
|
|
955
|
+
declare function Until<End extends string[], Input extends string>(end: [...End], input: Input, result?: string): TUntil<End, Input>;
|
|
771
956
|
type TMultiLine<Start extends string, End extends string, Input extends string> = (TTake<[Start], Input> extends [infer _, infer Rest extends string] ? TUntil<[End], Rest> extends [infer Until extends string, infer UntilRest extends string] ? TTake<[End], UntilRest> extends [infer _ extends string, infer Rest extends string] ? [`${Until}`, Rest] : [] : [] : []);
|
|
772
957
|
type TSingleLine<Start extends string, End extends string, Input extends string> = (TTake<[Start], Input> extends [infer _ extends string, infer Rest extends string] ? TUntil<[TNewLine, End], Rest> extends [infer Until extends string, infer UntilRest extends string] ? TTake<[End], UntilRest> extends [infer _ extends string, infer EndRest extends string] ? [`${Until}`, EndRest] : [] : [] : []);
|
|
773
958
|
/** Matches from Start and End capturing everything in-between. Start and End are consumed. */
|
|
774
959
|
type TSpan<Start extends string, End extends string, MultiLine extends boolean, Input extends string> = (MultiLine extends true ? TMultiLine<Start, End, TTrim<Input>> : TSingleLine<Start, End, TTrim<Input>>);
|
|
960
|
+
/** Matches from Start and End capturing everything in-between. Start and End are consumed. */
|
|
961
|
+
declare function Span<Start extends string, End extends string, MultiLine extends boolean, Input extends string>(start: Start, end: End, multiLine: MultiLine, input: Input): TSpan<Start, End, MultiLine, Input>;
|
|
775
962
|
type TTakeInitial<Quotes extends string[], Input extends string> = (TTake<Quotes, Input>);
|
|
776
963
|
type TTakeSpan<Quote extends string, Input extends string> = (TSpan<Quote, Quote, false, Input>);
|
|
777
964
|
type TTakeString<Quotes extends string[], Input extends string> = (TTakeInitial<Quotes, Input> extends [infer Initial extends string, infer InitialRest extends string] ? TTakeSpan<Initial, `${Initial}${InitialRest}`> : []);
|
|
778
965
|
/** Matches a literal String with the given quotes */
|
|
779
966
|
type TString<Quotes extends string[], Input extends string> = (TTakeString<Quotes, TTrim<Input>>);
|
|
967
|
+
/** Matches a literal String with the given quotes */
|
|
968
|
+
declare function String<Quotes extends string[], Input extends string>(quotes: [...Quotes], input: Input): TString<Quotes, Input>;
|
|
780
969
|
/** Match Input until but not including End. No match if End not found or match is zero-length. */
|
|
781
970
|
type TUntil_1<End extends string[], Input extends string> = (TUntil<End, Input> extends [infer Until extends string, infer UntilRest extends string] ? Until extends '' ? [] : [Until, UntilRest] : []);
|
|
971
|
+
/** Match Input until but not including End. No match if End not found or match is zero-length. */
|
|
972
|
+
declare function Until_1<End extends string[], Input extends string>(end: [...End], input: Input): TUntil_1<End, Input>;
|
|
973
|
+
declare namespace index_d_exports$3 {
|
|
974
|
+
export { BigInt, Const, Ident, Integer, Number, Rest$1 as Rest, Span, String, TBigInt, TConst, TIdent, TInteger, TNumber, TRest$1 as TRest, TSpan, TString, TUnsignedInteger, TUnsignedNumber, TUntil, TUntil_1, UnsignedInteger, UnsignedNumber, Until, Until_1 };
|
|
975
|
+
}
|
|
976
|
+
declare namespace parser_d_exports {
|
|
977
|
+
export { Base, Dependent, Element, ElementBase, ElementList, ElementList_0, ElementNamed, ExportKeyword, Expr, ExprPipe, ExprReadonly, ExprTail, ExprTerm, ExprTermTail, Extends$1 as Extends, Factor, GenericCall, GenericCallArgumentList, GenericCallArgumentList_0, GenericCallArguments, GenericParameter, GenericParameterEquals, GenericParameterExtends, GenericParameterExtendsEquals, GenericParameterIdentifier, GenericParameterList, GenericParameterList_0, GenericParameters, GenericType, IndexArray, IndexArray_0, InferType, InterfaceDeclaration, InterfaceDeclarationGeneric, InterfaceDeclarationHeritage, InterfaceDeclarationHeritageList, InterfaceDeclarationHeritageList_0, KeyOf$1 as KeyOf, KeywordAny, KeywordBigInt, KeywordBoolean, KeywordInteger, KeywordNever, KeywordNull, KeywordNumber, KeywordObject, KeywordString, KeywordSymbol, KeywordThis, KeywordUndefined, KeywordUnknown, KeywordVoid, LiteralBigInt, LiteralBoolean, LiteralNumber, LiteralString, MappedAs, MappedOptional, MappedReadonly, Module$1 as Module, ModuleDeclaration, ModuleDeclarationDelimiter, ModuleDeclarationList, ModuleDeclarationList_0, Optional$1 as Optional, OptionalSemiColon, Parameter, ParameterBase, ParameterList, ParameterList_0, ParameterOptional, ParameterReadonly, ParameterReadonlyOptional, ParameterType, Pattern, PatternBase, PatternBigInt, PatternBody, PatternGroup, PatternInteger, PatternNever, PatternNumber, PatternString, PatternTerm, PatternText, PatternUnion, Properties, Property, PropertyDelimiter, PropertyKey$1 as PropertyKey, PropertyKeyIdent, PropertyKeyIndex, PropertyKeyNumber, PropertyKeyQuoted, PropertyList, PropertyList_0, Readonly$1 as Readonly, Reference, Script$1 as Script, TBase, TDependent, TElement, TElementBase, TElementList, TElementList_0, TElementNamed, TExportKeyword, TExpr, TExprPipe, TExprReadonly, TExprTail, TExprTerm, TExprTermTail, TExtends$1 as TExtends, TFactor, TGenericCall, TGenericCallArgumentList, TGenericCallArgumentList_0, TGenericCallArguments, TGenericParameter, TGenericParameterEquals, TGenericParameterExtends, TGenericParameterExtendsEquals, TGenericParameterIdentifier, TGenericParameterList, TGenericParameterList_0, TGenericParameters, TGenericType, TIndexArray, TIndexArray_0, TInferType, TInterfaceDeclaration, TInterfaceDeclarationGeneric, TInterfaceDeclarationHeritage, TInterfaceDeclarationHeritageList, TInterfaceDeclarationHeritageList_0, TKeyOf$1 as TKeyOf, TKeywordAny, TKeywordBigInt, TKeywordBoolean, TKeywordInteger, TKeywordNever, TKeywordNull, TKeywordNumber, TKeywordObject, TKeywordString, TKeywordSymbol, TKeywordThis, TKeywordUndefined, TKeywordUnknown, TKeywordVoid, TLiteralBigInt, TLiteralBoolean, TLiteralNumber, TLiteralString, TMappedAs, TMappedOptional, TMappedReadonly, TModule$1 as TModule, TModuleDeclaration, TModuleDeclarationDelimiter, TModuleDeclarationList, TModuleDeclarationList_0, TOptional$1 as TOptional, TOptionalSemiColon, TParameter, TParameterBase, TParameterList, TParameterList_0, TParameterOptional, TParameterReadonly, TParameterReadonlyOptional, TParameterType, TPattern, TPatternBase, TPatternBigInt, TPatternBody, TPatternGroup, TPatternInteger, TPatternNever, TPatternNumber, TPatternString, TPatternTerm, TPatternText, TPatternUnion, TProperties$1 as TProperties, TProperty, TPropertyDelimiter, TPropertyKey, TPropertyKeyIdent, TPropertyKeyIndex, TPropertyKeyNumber, TPropertyKeyQuoted, TPropertyList, TPropertyList_0, TReadonly, TReference, TScript$1 as TScript, TTemplateBody, TTemplateInterpolate, TTemplateLiteral$1 as TTemplateLiteral, TTemplateLiteralTypes, TTemplateSpan, TType, TTypeAliasDeclaration, TTypeAliasDeclarationGeneric, TWith$1 as TWith, TWithArray, TWithBigInt, TWithBoolean, TWithElementList, TWithElementList_0, TWithNull, TWithNumber, TWithObject, TWithProperty, TWithPropertyList, TWithPropertyList_0, TWithString, TWithUndefined, TWithValue, T_Constructor_, T_Function_, T_Mapped_, T_Object_, T_Tuple_, TemplateBody, TemplateInterpolate, TemplateLiteral$1 as TemplateLiteral, TemplateLiteralTypes, TemplateSpan, Type, TypeAliasDeclaration, TypeAliasDeclarationGeneric, With$1 as With, WithArray, WithBigInt, WithBoolean, WithElementList, WithElementList_0, WithNull, WithNumber, WithObject, WithProperty, WithPropertyList, WithPropertyList_0, WithString, WithUndefined, WithValue, _Constructor_, _Function_$1 as _Function_, _Mapped_, _Object_, _Tuple_ };
|
|
978
|
+
}
|
|
782
979
|
type TGenericParameterExtendsEquals<Input extends string> = (TIdent<Input> extends [infer _0, infer Input extends string] ? (TConst<'extends', Input> extends [infer _1, infer Input extends string] ? (TType<Input> extends [infer _2, infer Input extends string] ? (TConst<'=', Input> extends [infer _3, infer Input extends string] ? (TType<Input> extends [infer _4, infer Input extends string] ? [[_0, _1, _2, _3, _4], Input] : []) : []) : []) : []) : []) extends [infer _0 extends [unknown, unknown, unknown, unknown, unknown], infer Input extends string] ? [TGenericParameterExtendsEqualsMapping<_0>, Input] : [];
|
|
783
980
|
type TGenericParameterExtends<Input extends string> = (TIdent<Input> extends [infer _0, infer Input extends string] ? (TConst<'extends', Input> extends [infer _1, infer Input extends string] ? (TType<Input> extends [infer _2, infer Input extends string] ? [[_0, _1, _2], Input] : []) : []) : []) extends [infer _0 extends [unknown, unknown, unknown], infer Input extends string] ? [TGenericParameterExtendsMapping<_0>, Input] : [];
|
|
784
981
|
type TGenericParameterEquals<Input extends string> = (TIdent<Input> extends [infer _0, infer Input extends string] ? (TConst<'=', Input> extends [infer _1, infer Input extends string] ? (TType<Input> extends [infer _2, infer Input extends string] ? [[_0, _1, _2], Input] : []) : []) : []) extends [infer _0 extends [unknown, unknown, unknown], infer Input extends string] ? [TGenericParameterEqualsMapping<_0>, Input] : [];
|
|
@@ -906,26 +1103,153 @@ type TModuleDeclarationList<Input extends string> = ((TModuleDeclaration<Input>
|
|
|
906
1103
|
type TModuleDeclaration<Input extends string> = (TExportKeyword<Input> extends [infer _0, infer Input extends string] ? ((TInterfaceDeclarationGeneric<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : TInterfaceDeclaration<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : TTypeAliasDeclarationGeneric<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : TTypeAliasDeclaration<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _1, infer Input extends string] ? (TOptionalSemiColon<Input> extends [infer _2, infer Input extends string] ? [[_0, _1, _2], Input] : []) : []) : []) extends [infer _0 extends [unknown, unknown, unknown], infer Input extends string] ? [TModuleDeclarationMapping<_0>, Input] : [];
|
|
907
1104
|
type TModule$1<Input extends string> = (TModuleDeclaration<Input> extends [infer _0, infer Input extends string] ? (TModuleDeclarationList<Input> extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : []) : []) extends [infer _0 extends [unknown, unknown], infer Input extends string] ? [TModuleMapping<_0>, Input] : [];
|
|
908
1105
|
type TScript$1<Input extends string> = (TModule$1<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : TGenericType<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : TType<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends unknown, infer Input extends string] ? [TScriptMapping<_0>, Input] : [];
|
|
1106
|
+
declare const GenericParameterExtendsEquals: (input: string) => [unknown, string] | [];
|
|
1107
|
+
declare const GenericParameterExtends: (input: string) => [unknown, string] | [];
|
|
1108
|
+
declare const GenericParameterEquals: (input: string) => [unknown, string] | [];
|
|
1109
|
+
declare const GenericParameterIdentifier: (input: string) => [unknown, string] | [];
|
|
1110
|
+
declare const GenericParameter: (input: string) => [unknown, string] | [];
|
|
1111
|
+
declare const GenericParameterList_0: (input: string, result?: unknown[]) => [unknown[], string];
|
|
1112
|
+
declare const GenericParameterList: (input: string) => [unknown, string] | [];
|
|
1113
|
+
declare const GenericParameters: (input: string) => [unknown, string] | [];
|
|
1114
|
+
declare const GenericCallArgumentList_0: (input: string, result?: unknown[]) => [unknown[], string];
|
|
1115
|
+
declare const GenericCallArgumentList: (input: string) => [unknown, string] | [];
|
|
1116
|
+
declare const GenericCallArguments: (input: string) => [unknown, string] | [];
|
|
1117
|
+
declare const GenericCall: (input: string) => [unknown, string] | [];
|
|
1118
|
+
declare const OptionalSemiColon: (input: string) => [unknown, string] | [];
|
|
1119
|
+
declare const KeywordString: (input: string) => [unknown, string] | [];
|
|
1120
|
+
declare const KeywordNumber: (input: string) => [unknown, string] | [];
|
|
1121
|
+
declare const KeywordBoolean: (input: string) => [unknown, string] | [];
|
|
1122
|
+
declare const KeywordUndefined: (input: string) => [unknown, string] | [];
|
|
1123
|
+
declare const KeywordNull: (input: string) => [unknown, string] | [];
|
|
1124
|
+
declare const KeywordInteger: (input: string) => [unknown, string] | [];
|
|
1125
|
+
declare const KeywordBigInt: (input: string) => [unknown, string] | [];
|
|
1126
|
+
declare const KeywordUnknown: (input: string) => [unknown, string] | [];
|
|
1127
|
+
declare const KeywordAny: (input: string) => [unknown, string] | [];
|
|
1128
|
+
declare const KeywordObject: (input: string) => [unknown, string] | [];
|
|
1129
|
+
declare const KeywordNever: (input: string) => [unknown, string] | [];
|
|
1130
|
+
declare const KeywordSymbol: (input: string) => [unknown, string] | [];
|
|
1131
|
+
declare const KeywordVoid: (input: string) => [unknown, string] | [];
|
|
1132
|
+
declare const KeywordThis: (input: string) => [unknown, string] | [];
|
|
1133
|
+
declare const TemplateInterpolate: (input: string) => [unknown, string] | [];
|
|
1134
|
+
declare const TemplateSpan: (input: string) => [unknown, string] | [];
|
|
1135
|
+
declare const TemplateBody: (input: string) => [unknown, string] | [];
|
|
1136
|
+
declare const TemplateLiteralTypes: (input: string) => [unknown, string] | [];
|
|
1137
|
+
declare const TemplateLiteral$1: (input: string) => [unknown, string] | [];
|
|
1138
|
+
declare const Dependent: (input: string) => [unknown, string] | [];
|
|
1139
|
+
declare const LiteralBigInt: (input: string) => [unknown, string] | [];
|
|
1140
|
+
declare const LiteralBoolean: (input: string) => [unknown, string] | [];
|
|
1141
|
+
declare const LiteralNumber: (input: string) => [unknown, string] | [];
|
|
1142
|
+
declare const LiteralString: (input: string) => [unknown, string] | [];
|
|
1143
|
+
declare const KeyOf$1: (input: string) => [unknown, string] | [];
|
|
1144
|
+
declare const IndexArray_0: (input: string, result?: unknown[]) => [unknown[], string];
|
|
1145
|
+
declare const IndexArray: (input: string) => [unknown, string] | [];
|
|
1146
|
+
declare const Extends$1: (input: string) => [unknown, string] | [];
|
|
1147
|
+
declare const Base: (input: string) => [unknown, string] | [];
|
|
1148
|
+
declare const With$1: (input: string) => [unknown, string] | [];
|
|
1149
|
+
declare const Factor: (input: string) => [unknown, string] | [];
|
|
1150
|
+
declare const ExprTermTail: (input: string) => [unknown, string] | [];
|
|
1151
|
+
declare const ExprTerm: (input: string) => [unknown, string] | [];
|
|
1152
|
+
declare const ExprTail: (input: string) => [unknown, string] | [];
|
|
1153
|
+
declare const Expr: (input: string) => [unknown, string] | [];
|
|
1154
|
+
declare const ExprReadonly: (input: string) => [unknown, string] | [];
|
|
1155
|
+
declare const ExprPipe: (input: string) => [unknown, string] | [];
|
|
1156
|
+
declare const GenericType: (input: string) => [unknown, string] | [];
|
|
1157
|
+
declare const InferType: (input: string) => [unknown, string] | [];
|
|
1158
|
+
declare const Type: (input: string) => [unknown, string] | [];
|
|
1159
|
+
declare const PropertyKeyNumber: (input: string) => [unknown, string] | [];
|
|
1160
|
+
declare const PropertyKeyIdent: (input: string) => [unknown, string] | [];
|
|
1161
|
+
declare const PropertyKeyQuoted: (input: string) => [unknown, string] | [];
|
|
1162
|
+
declare const PropertyKeyIndex: (input: string) => [unknown, string] | [];
|
|
1163
|
+
declare const PropertyKey$1: (input: string) => [unknown, string] | [];
|
|
1164
|
+
declare const Readonly$1: (input: string) => [unknown, string] | [];
|
|
1165
|
+
declare const Optional$1: (input: string) => [unknown, string] | [];
|
|
1166
|
+
declare const Property: (input: string) => [unknown, string] | [];
|
|
1167
|
+
declare const PropertyDelimiter: (input: string) => [unknown, string] | [];
|
|
1168
|
+
declare const PropertyList_0: (input: string, result?: unknown[]) => [unknown[], string];
|
|
1169
|
+
declare const PropertyList: (input: string) => [unknown, string] | [];
|
|
1170
|
+
declare const Properties: (input: string) => [unknown, string] | [];
|
|
1171
|
+
declare const _Object_: (input: string) => [unknown, string] | [];
|
|
1172
|
+
declare const ElementNamed: (input: string) => [unknown, string] | [];
|
|
1173
|
+
declare const ElementBase: (input: string) => [unknown, string] | [];
|
|
1174
|
+
declare const Element: (input: string) => [unknown, string] | [];
|
|
1175
|
+
declare const ElementList_0: (input: string, result?: unknown[]) => [unknown[], string];
|
|
1176
|
+
declare const ElementList: (input: string) => [unknown, string] | [];
|
|
1177
|
+
declare const _Tuple_: (input: string) => [unknown, string] | [];
|
|
1178
|
+
declare const ParameterReadonlyOptional: (input: string) => [unknown, string] | [];
|
|
1179
|
+
declare const ParameterReadonly: (input: string) => [unknown, string] | [];
|
|
1180
|
+
declare const ParameterOptional: (input: string) => [unknown, string] | [];
|
|
1181
|
+
declare const ParameterType: (input: string) => [unknown, string] | [];
|
|
1182
|
+
declare const ParameterBase: (input: string) => [unknown, string] | [];
|
|
1183
|
+
declare const Parameter: (input: string) => [unknown, string] | [];
|
|
1184
|
+
declare const ParameterList_0: (input: string, result?: unknown[]) => [unknown[], string];
|
|
1185
|
+
declare const ParameterList: (input: string) => [unknown, string] | [];
|
|
1186
|
+
declare const _Function_$1: (input: string) => [unknown, string] | [];
|
|
1187
|
+
declare const _Constructor_: (input: string) => [unknown, string] | [];
|
|
1188
|
+
declare const MappedReadonly: (input: string) => [unknown, string] | [];
|
|
1189
|
+
declare const MappedOptional: (input: string) => [unknown, string] | [];
|
|
1190
|
+
declare const MappedAs: (input: string) => [unknown, string] | [];
|
|
1191
|
+
declare const _Mapped_: (input: string) => [unknown, string] | [];
|
|
1192
|
+
declare const Reference: (input: string) => [unknown, string] | [];
|
|
1193
|
+
declare const WithBigInt: (input: string) => [unknown, string] | [];
|
|
1194
|
+
declare const WithNumber: (input: string) => [unknown, string] | [];
|
|
1195
|
+
declare const WithBoolean: (input: string) => [unknown, string] | [];
|
|
1196
|
+
declare const WithString: (input: string) => [unknown, string] | [];
|
|
1197
|
+
declare const WithNull: (input: string) => [unknown, string] | [];
|
|
1198
|
+
declare const WithUndefined: (input: string) => [unknown, string] | [];
|
|
1199
|
+
declare const WithProperty: (input: string) => [unknown, string] | [];
|
|
1200
|
+
declare const WithPropertyList_0: (input: string, result?: unknown[]) => [unknown[], string];
|
|
1201
|
+
declare const WithPropertyList: (input: string) => [unknown, string] | [];
|
|
1202
|
+
declare const WithObject: (input: string) => [unknown, string] | [];
|
|
1203
|
+
declare const WithElementList_0: (input: string, result?: unknown[]) => [unknown[], string];
|
|
1204
|
+
declare const WithElementList: (input: string) => [unknown, string] | [];
|
|
1205
|
+
declare const WithArray: (input: string) => [unknown, string] | [];
|
|
1206
|
+
declare const WithValue: (input: string) => [unknown, string] | [];
|
|
1207
|
+
declare const PatternBigInt: (input: string) => [unknown, string] | [];
|
|
1208
|
+
declare const PatternString: (input: string) => [unknown, string] | [];
|
|
1209
|
+
declare const PatternNumber: (input: string) => [unknown, string] | [];
|
|
1210
|
+
declare const PatternInteger: (input: string) => [unknown, string] | [];
|
|
1211
|
+
declare const PatternNever: (input: string) => [unknown, string] | [];
|
|
1212
|
+
declare const PatternText: (input: string) => [unknown, string] | [];
|
|
1213
|
+
declare const PatternBase: (input: string) => [unknown, string] | [];
|
|
1214
|
+
declare const PatternGroup: (input: string) => [unknown, string] | [];
|
|
1215
|
+
declare const PatternUnion: (input: string) => [unknown, string] | [];
|
|
1216
|
+
declare const PatternTerm: (input: string) => [unknown, string] | [];
|
|
1217
|
+
declare const PatternBody: (input: string) => [unknown, string] | [];
|
|
1218
|
+
declare const Pattern: (input: string) => [unknown, string] | [];
|
|
1219
|
+
declare const InterfaceDeclarationHeritageList_0: (input: string, result?: unknown[]) => [unknown[], string];
|
|
1220
|
+
declare const InterfaceDeclarationHeritageList: (input: string) => [unknown, string] | [];
|
|
1221
|
+
declare const InterfaceDeclarationHeritage: (input: string) => [unknown, string] | [];
|
|
1222
|
+
declare const InterfaceDeclarationGeneric: (input: string) => [unknown, string] | [];
|
|
1223
|
+
declare const InterfaceDeclaration: (input: string) => [unknown, string] | [];
|
|
1224
|
+
declare const TypeAliasDeclarationGeneric: (input: string) => [unknown, string] | [];
|
|
1225
|
+
declare const TypeAliasDeclaration: (input: string) => [unknown, string] | [];
|
|
1226
|
+
declare const ExportKeyword: (input: string) => [unknown, string] | [];
|
|
1227
|
+
declare const ModuleDeclarationDelimiter: (input: string) => [unknown, string] | [];
|
|
1228
|
+
declare const ModuleDeclarationList_0: (input: string, result?: unknown[]) => [unknown[], string];
|
|
1229
|
+
declare const ModuleDeclarationList: (input: string) => [unknown, string] | [];
|
|
1230
|
+
declare const ModuleDeclaration: (input: string) => [unknown, string] | [];
|
|
1231
|
+
declare const Module$1: (input: string) => [unknown, string] | [];
|
|
1232
|
+
declare const Script$1: (input: string) => [unknown, string] | [];
|
|
909
1233
|
/** Parses a Template into TemplateLiteral types */
|
|
910
|
-
type TParseTemplateIntoTypes<Template extends string, Parsed extends [TSchema[], string] | [] = TTemplateLiteralTypes<`\`${Template}\``>, Result extends TSchema = Parsed extends [infer Types extends TSchema[], string] ? Types : TUnreachable> = Result;
|
|
1234
|
+
export type TParseTemplateIntoTypes<Template extends string, Parsed extends [TSchema[], string] | [] = TTemplateLiteralTypes<`\`${Template}\``>, Result extends TSchema = Parsed extends [infer Types extends TSchema[], string] ? Types : TUnreachable> = Result;
|
|
911
1235
|
/** Parses a Template into a TemplateLiteral types */
|
|
912
|
-
declare function ParseTemplateIntoTypes<Template extends string>(template: Template): TParseTemplateIntoTypes<Template>;
|
|
913
|
-
type StaticUnion<Stack extends string[], Direction extends StaticDirection, Context extends TProperties, This extends TProperties, Types extends TSchema[], Result extends unknown = never> = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? StaticUnion<Stack, Direction, Context, This, Right, Result | StaticType<Stack, Direction, Context, This, Left>> : Result);
|
|
1236
|
+
export declare function ParseTemplateIntoTypes<Template extends string>(template: Template): TParseTemplateIntoTypes<Template>;
|
|
1237
|
+
export type StaticUnion<Stack extends string[], Direction extends StaticDirection, Context extends TProperties, This extends TProperties, Types extends TSchema[], Result extends unknown = never> = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? StaticUnion<Stack, Direction, Context, This, Right, Result | StaticType<Stack, Direction, Context, This, Left>> : Result);
|
|
914
1238
|
/** Represents a logical Union type. */
|
|
915
|
-
interface TUnion<Types extends TSchema[] = TSchema[]> extends TSchema {
|
|
1239
|
+
export interface TUnion<Types extends TSchema[] = TSchema[]> extends TSchema {
|
|
916
1240
|
'~kind': 'Union';
|
|
917
1241
|
anyOf: Types;
|
|
918
1242
|
}
|
|
919
1243
|
/** Creates a Union type. */
|
|
920
|
-
declare function Union
|
|
1244
|
+
export declare function Union<Types extends TSchema[]>(anyOf: [...Types], options?: TSchemaOptions): TUnion<Types>;
|
|
921
1245
|
/** Returns true if the given value is TUnion. */
|
|
922
|
-
declare function IsUnion(value: unknown): value is TUnion;
|
|
1246
|
+
export declare function IsUnion(value: unknown): value is TUnion;
|
|
923
1247
|
/** Extracts options from a TUnion. */
|
|
924
|
-
declare function UnionOptions(type: TUnion): TSchemaOptions;
|
|
1248
|
+
export declare function UnionOptions(type: TUnion): TSchemaOptions;
|
|
925
1249
|
/** Parses a Pattern into a sequence of TemplateLiteral types. A result of [] indicates failure to parse. */
|
|
926
|
-
type TParsePatternIntoTypes<Pattern extends string, Parsed extends [TSchema[], string] | [] = TPattern<Pattern>, Result extends TSchema[] = Parsed extends [infer Types extends TSchema[], string] ? Types : []> = Result;
|
|
1250
|
+
export type TParsePatternIntoTypes<Pattern extends string, Parsed extends [TSchema[], string] | [] = TPattern<Pattern>, Result extends TSchema[] = Parsed extends [infer Types extends TSchema[], string] ? Types : []> = Result;
|
|
927
1251
|
/** Parses a Pattern into a sequence of TemplateLiteral types. A result of [] indicates failure to parse. */
|
|
928
|
-
declare function ParsePatternIntoTypes<Pattern extends string>(pattern: Pattern): TParsePatternIntoTypes<Pattern>;
|
|
1252
|
+
export declare function ParsePatternIntoTypes<Pattern extends string>(pattern: Pattern): TParsePatternIntoTypes<Pattern>;
|
|
929
1253
|
type TFromLiteral$5<Template extends string, Value extends TLiteralValue> = `${Template}${Value}`;
|
|
930
1254
|
type TFromBigInt<Template extends string> = `${Template}${bigint}`;
|
|
931
1255
|
type TFromString<Template extends string> = `${Template}${string}`;
|
|
@@ -934,62 +1258,62 @@ type TFromInteger<Template extends string> = `${Template}${number}`;
|
|
|
934
1258
|
type TFromUnion$8<Template extends string, Types extends TSchema[], Result extends string = never> = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? TFromUnion$8<Template, Right, Result | TFromType$18<'', Left>> : `${Template}${Result}`);
|
|
935
1259
|
type TFromType$18<Template extends string, Type extends TSchema, Result extends string = (Type extends TUnion<infer Types extends TSchema[]> ? TFromUnion$8<Template, Types> : Type extends TLiteral<infer Value extends TLiteralValue> ? TFromLiteral$5<Template, Value> : Type extends TBigInt$1 ? TFromBigInt<Template> : Type extends TString$1 ? TFromString<Template> : Type extends TNumber$1 ? TFromNumber<Template> : Type extends TInteger$1 ? TFromInteger<Template> : never)> = Result;
|
|
936
1260
|
type TFromSpan<Template extends string, Types extends TSchema[]> = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? TFromSpan<TFromType$18<Template, Left>, Right> : Template);
|
|
937
|
-
type TTemplateLiteralStatic<Pattern extends string, Types extends TSchema[] = TParsePatternIntoTypes<Pattern>> = TFromSpan<'', Types>;
|
|
1261
|
+
export type TTemplateLiteralStatic<Pattern extends string, Types extends TSchema[] = TParsePatternIntoTypes<Pattern>> = TFromSpan<'', Types>;
|
|
938
1262
|
type TRemoveReadonlyOperation<Type extends TSchema, Result extends TSchema = Type extends TReadonly$1<infer Type extends TSchema> ? TRemoveReadonlyOperation<Type> : Type> = Result;
|
|
939
1263
|
type TRemoveReadonlyAction<Type extends TSchema, Result extends TSchema = TRemoveReadonlyOperation<Type>> = Result;
|
|
940
1264
|
type TRemoveReadonlyInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, InstantiateType extends TSchema = TInstantiateType<Context, State, Type>> = TRemoveReadonlyAction<InstantiateType>;
|
|
941
1265
|
/** Creates a deferred RemoveReadonly action. */
|
|
942
|
-
type TRemoveReadonlyDeferred<Type extends TSchema> = (TDeferred<'RemoveReadonly', [Type]>);
|
|
1266
|
+
export type TRemoveReadonlyDeferred<Type extends TSchema> = (TDeferred<'RemoveReadonly', [Type]>);
|
|
943
1267
|
/** Creates a deferred RemoveReadonly action. */
|
|
944
|
-
declare function RemoveReadonlyDeferred<Type extends TSchema>(type: Type, options?: TSchemaOptions): TRemoveReadonlyDeferred<Type>;
|
|
1268
|
+
export declare function RemoveReadonlyDeferred<Type extends TSchema>(type: Type, options?: TSchemaOptions): TRemoveReadonlyDeferred<Type>;
|
|
945
1269
|
/** Applies an RemoveReadonly action to a type. */
|
|
946
|
-
type TRemoveReadonly<Type extends TSchema> = (TRemoveReadonlyAction<Type>);
|
|
1270
|
+
export type TRemoveReadonly<Type extends TSchema> = (TRemoveReadonlyAction<Type>);
|
|
947
1271
|
/** Applies an RemoveReadonly action to a type. */
|
|
948
|
-
declare function RemoveReadonly<Type extends TSchema>(type: Type, options?: TSchemaOptions): TRemoveReadonly<Type>;
|
|
1272
|
+
export declare function RemoveReadonly<Type extends TSchema>(type: Type, options?: TSchemaOptions): TRemoveReadonly<Type>;
|
|
949
1273
|
type TRemoveOptionalOperation<Type extends TSchema, Result extends TSchema = Type extends TOptional<infer Type extends TSchema> ? TRemoveOptionalOperation<Type> : Type> = Result;
|
|
950
1274
|
type TRemoveOptionalAction<Type extends TSchema, Result extends TSchema = TRemoveOptionalOperation<Type>> = Result;
|
|
951
1275
|
type TRemoveOptionalInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, InstantiateType extends TSchema = TInstantiateType<Context, State, Type>> = TRemoveOptionalAction<InstantiateType>;
|
|
952
1276
|
/** Creates a deferred RemoveOptional action. */
|
|
953
|
-
type TRemoveOptionalDeferred<Type extends TSchema> = (TDeferred<'RemoveOptional', [Type]>);
|
|
1277
|
+
export type TRemoveOptionalDeferred<Type extends TSchema> = (TDeferred<'RemoveOptional', [Type]>);
|
|
954
1278
|
/** Creates a deferred RemoveOptional action. */
|
|
955
|
-
declare function RemoveOptionalDeferred<Type extends TSchema>(type: Type, options?: TSchemaOptions): TRemoveOptionalDeferred<Type>;
|
|
1279
|
+
export declare function RemoveOptionalDeferred<Type extends TSchema>(type: Type, options?: TSchemaOptions): TRemoveOptionalDeferred<Type>;
|
|
956
1280
|
/** Applies an RemoveOptional action to a type. */
|
|
957
|
-
type TRemoveOptional<Type extends TSchema> = (TRemoveOptionalAction<Type>);
|
|
1281
|
+
export type TRemoveOptional<Type extends TSchema> = (TRemoveOptionalAction<Type>);
|
|
958
1282
|
/** Applies an RemoveOptional action to a type. */
|
|
959
|
-
declare function RemoveOptional<Type extends TSchema>(type: Type, options?: TSchemaOptions): TRemoveOptional<Type>;
|
|
1283
|
+
export declare function RemoveOptional<Type extends TSchema>(type: Type, options?: TSchemaOptions): TRemoveOptional<Type>;
|
|
960
1284
|
type TTupleElementsToProperties<Types extends TSchema[], Result extends TProperties = {}> = (Types extends [...infer Left extends TSchema[], infer Right extends TSchema] ? TTupleElementsToProperties<Left, { [_ in Left['length']]: Right; } & Result> : { [Key in keyof Result]: Result[Key]; });
|
|
961
1285
|
type TTupleToObject<Type extends TTuple, Properties extends TProperties = TTupleElementsToProperties<Type['items']>, Result extends TSchema = TObject<Properties>> = Result;
|
|
962
1286
|
/** Returns true if the type is a valid operand to Composite. */
|
|
963
|
-
type TCanComposite<Type extends TSchema> = (Type extends TObject<infer _ extends TProperties> ? true : Type extends TTuple<infer _ extends TSchema[]> ? true : false);
|
|
1287
|
+
export type TCanComposite<Type extends TSchema> = (Type extends TObject<infer _ extends TProperties> ? true : Type extends TTuple<infer _ extends TSchema[]> ? true : false);
|
|
964
1288
|
/** Returns true if the type is a valid operand to Composite. */
|
|
965
|
-
declare function CanComposite<Type extends TSchema>(type: Type): TCanComposite<Type>;
|
|
1289
|
+
export declare function CanComposite<Type extends TSchema>(type: Type): TCanComposite<Type>;
|
|
966
1290
|
type TIsReadonlyProperty<Left extends TSchema, Right extends TSchema> = (Left extends TReadonly$1<Left> ? Right extends TReadonly$1<Right> ? true : false : false);
|
|
967
1291
|
type TIsOptionalProperty<Left extends TSchema, Right extends TSchema> = (Left extends TOptional<Left> ? Right extends TOptional<Right> ? true : false : false);
|
|
968
1292
|
type TCompositeProperty<Left extends TSchema, Right extends TSchema, IsReadonly extends boolean = TIsReadonlyProperty<Left, Right>, IsOptional extends boolean = TIsOptionalProperty<Left, Right>, Evaluated extends TSchema = TEvaluateIntersect<[Left, Right]>, Property extends TSchema = TRemoveReadonly<TRemoveOptional<Evaluated>>> = ([IsReadonly, IsOptional] extends [true, true] ? TAddReadonly<TAddOptional<Property>> : [IsReadonly, IsOptional] extends [true, false] ? TAddReadonly<Property> : [IsReadonly, IsOptional] extends [false, true] ? TAddOptional<Property> : Property);
|
|
969
1293
|
type TCompositePropertyKey<Left extends TProperties, Right extends TProperties, Key extends PropertyKey, Result extends TSchema = (Key extends keyof Left ? Key extends keyof Right ? TCompositeProperty<Left[Key], Right[Key]> : Left[Key] : Key extends keyof Right ? Right[Key] : TNever)> = Result;
|
|
970
1294
|
type TCompositeProperties<Left extends TProperties, Right extends TProperties, Keys extends PropertyKey = keyof (Left & Right), Result extends TProperties = { [Key in Keys]: TCompositePropertyKey<Left, Right, Key>; }> = Result;
|
|
971
1295
|
type TGetProperties<Type extends TSchema, Result extends TProperties = (Type extends TObject<infer Properties extends TProperties> ? Properties : Type extends TTuple<infer Types extends TSchema[]> ? TTupleElementsToProperties<Types> : {})> = Result;
|
|
972
|
-
type TComposite<Left extends TSchema, Right extends TSchema, LeftProperties extends TProperties = TGetProperties<Left>, RightProperties extends TProperties = TGetProperties<Right>, Properties extends TProperties = TCompositeProperties<LeftProperties, RightProperties>, Result extends TSchema = TObject<Properties>> = Result;
|
|
973
|
-
declare function Composite<Left extends TSchema, Right extends TSchema>(left: Left, right: Right): TComposite<Left, Right>;
|
|
1296
|
+
export type TComposite<Left extends TSchema, Right extends TSchema, LeftProperties extends TProperties = TGetProperties<Left>, RightProperties extends TProperties = TGetProperties<Right>, Properties extends TProperties = TCompositeProperties<LeftProperties, RightProperties>, Result extends TSchema = TObject<Properties>> = Result;
|
|
1297
|
+
export declare function Composite<Left extends TSchema, Right extends TSchema>(left: Left, right: Right): TComposite<Left, Right>;
|
|
974
1298
|
type TNarrowCompareRule<Left extends TSchema, Right extends TSchema, Result extends TCompareResult = TCompare<Left, Right>> = (Result extends typeof CompareResultLeftInside ? Left : Result extends typeof CompareResultRightInside ? Right : Result extends typeof CompareResultEqual ? Right : TNever);
|
|
975
1299
|
type TNarrowCompositeRule<Left extends TSchema, Right extends TSchema, CanCompositeLeft extends boolean = TCanComposite<Left>, CanCompositeRight extends boolean = TCanComposite<Right>> = ([CanCompositeLeft, CanCompositeRight] extends [true, true] ? TComposite<Left, Right> : [CanCompositeLeft, CanCompositeRight] extends [true, false] ? Left : [CanCompositeLeft, CanCompositeRight] extends [false, true] ? Right : TNarrowCompareRule<Left, Right>);
|
|
976
|
-
type TNarrow<Left extends TSchema, Right extends TSchema> = (Left extends TNever ? TNever : Left extends TAny ? TAny : Left extends TUnknown ? Right : Right extends TNever ? TNever : Right extends TAny ? TAny : Right extends TUnknown ? Left : TNarrowCompositeRule<Left, Right>);
|
|
977
|
-
declare function Narrow<Left extends TSchema, Right extends TSchema>(left: Left, right: Right): TNarrow<Left, Right>;
|
|
1300
|
+
export type TNarrow<Left extends TSchema, Right extends TSchema> = (Left extends TNever ? TNever : Left extends TAny ? TAny : Left extends TUnknown ? Right : Right extends TNever ? TNever : Right extends TAny ? TAny : Right extends TUnknown ? Left : TNarrowCompositeRule<Left, Right>);
|
|
1301
|
+
export declare function Narrow<Left extends TSchema, Right extends TSchema>(left: Left, right: Right): TNarrow<Left, Right>;
|
|
978
1302
|
type TShouldEvaluate<Left extends TSchema, Right extends TSchema, IsUnionLeft extends boolean = Left extends TUnion ? true : false, IsUnionRight extends boolean = Right extends TUnion ? true : false, Result extends boolean = IsUnionLeft extends true ? true : IsUnionRight extends true ? true : false> = Result;
|
|
979
1303
|
type TDistributeOperation<Left extends TSchema, Right extends TSchema, EvaluatedLeft extends TSchema = TEvaluateType<Left>, EvaluatedRight extends TSchema = TEvaluateType<Right>, ShouldEvaluate extends boolean = TShouldEvaluate<EvaluatedLeft, EvaluatedRight>, Result extends TSchema = [ShouldEvaluate] extends [true] ? TEvaluateIntersect<[EvaluatedLeft, EvaluatedRight]> : TNarrow<EvaluatedLeft, EvaluatedRight>> = Result;
|
|
980
1304
|
type TDistributeType<Type extends TSchema, Distribution extends TSchema[], Result extends TSchema[] = []> = (Distribution extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? TDistributeType<Type, Right, [...Result, TDistributeOperation<Left, Type>]> : Result extends [] ? [Type] : Result);
|
|
981
1305
|
type TDistributeUnion<Types extends TSchema[], Distribution extends TSchema[], Result extends TSchema[] = []> = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? TDistributeUnion<Right, Distribution, [...Result, ...TDistribute$1<[Left], Distribution>]> : Result);
|
|
982
1306
|
type TDistribute$1<Types extends TSchema[], Result extends TSchema[] = []> = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? Left extends TUnion<infer UnionTypes extends TSchema[]> ? TDistribute$1<Right, TDistributeUnion<UnionTypes, Result>> : TDistribute$1<Right, TDistributeType<Left, Result>> : Result);
|
|
983
|
-
declare function Distribute<Types extends TSchema[]>(types: [...Types], result?: TSchema[]): TDistribute$1<Types>;
|
|
984
|
-
type StaticUnsafe<Type extends unknown> = Type;
|
|
1307
|
+
export declare function Distribute<Types extends TSchema[]>(types: [...Types], result?: TSchema[]): TDistribute$1<Types>;
|
|
1308
|
+
export type StaticUnsafe<Type extends unknown> = Type;
|
|
985
1309
|
/** Represents an Unsafe type. */
|
|
986
|
-
interface TUnsafe<Type extends unknown = unknown> extends TSchema {
|
|
1310
|
+
export interface TUnsafe<Type extends unknown = unknown> extends TSchema {
|
|
987
1311
|
'~unsafe': Type;
|
|
988
1312
|
}
|
|
989
1313
|
/** Creates a Unsafe type. */
|
|
990
|
-
declare function Unsafe<Type extends unknown>(schema: TSchema): TUnsafe<Type>;
|
|
1314
|
+
export declare function Unsafe<Type extends unknown>(schema: TSchema): TUnsafe<Type>;
|
|
991
1315
|
/** Returns true if the given value is TUnsafe. */
|
|
992
|
-
declare function IsUnsafe(value: unknown): value is TUnsafe;
|
|
1316
|
+
export declare function IsUnsafe(value: unknown): value is TUnsafe;
|
|
993
1317
|
declare namespace result_d_exports {
|
|
994
1318
|
export { ExtendsFalse, ExtendsTrue, ExtendsUnion, IsExtendsFalse, IsExtendsTrue, IsExtendsTrueLike, IsExtendsUnion, Match, MatchFalse, MatchTrueLike, TExtendsFalse, TExtendsTrue, TExtendsTrueLike, TExtendsUnion$1 as TExtendsUnion, TResult };
|
|
995
1319
|
}
|
|
@@ -1016,9 +1340,9 @@ declare function IsExtendsTrueLike(value: unknown): value is TExtendsTrueLike;
|
|
|
1016
1340
|
type MatchTrueLike = (inferred: TProperties) => unknown;
|
|
1017
1341
|
type MatchFalse = () => unknown;
|
|
1018
1342
|
declare function Match(result: TResult, true_: MatchTrueLike, false_: MatchFalse): unknown;
|
|
1019
|
-
type TExtendsRightInfer<Inferred extends TProperties, Name extends string, Left extends TSchema, Right extends TSchema, Result extends
|
|
1020
|
-
type TExtendsRightAny<Inferred extends TProperties, _Left extends TSchema, Result extends
|
|
1021
|
-
type TExtendsRightDependent<Inferred extends TProperties, Left extends TSchema, If extends TSchema, Then extends TSchema, Else extends TSchema, Result extends
|
|
1343
|
+
type TExtendsRightInfer<Inferred extends TProperties, Name extends string, Left extends TSchema, Right extends TSchema, Result extends TResult = (TExtendsLeft<Inferred, Left, Right> extends TExtendsTrueLike<infer CheckInferred extends TProperties> ? TExtendsTrue<TAssign<TAssign<Inferred, CheckInferred>, { [_ in Name]: Left; }>> : TExtendsFalse)> = Result;
|
|
1344
|
+
type TExtendsRightAny<Inferred extends TProperties, _Left extends TSchema, Result extends TResult = TExtendsTrue<Inferred>> = Result;
|
|
1345
|
+
type TExtendsRightDependent<Inferred extends TProperties, Left extends TSchema, If extends TSchema, Then extends TSchema, Else extends TSchema, Result extends TResult = TExtendsLeft<Inferred, Left, If> extends TExtendsTrueLike<infer Inferred extends TProperties> ? (TExtendsLeft<Inferred, Left, Then> extends TExtendsTrueLike<infer Inferred extends TProperties> ? TExtendsTrue<Inferred> : TExtendsFalse) : (TExtendsLeft<Inferred, Left, Else> extends TExtendsTrueLike<infer Inferred extends TProperties> ? TExtendsTrue<Inferred> : TExtendsFalse)> = Result;
|
|
1022
1346
|
type TExtendsRightEnum<Inferred extends TProperties, Left extends TSchema, Right extends TEnumValue[], Evaluated extends TSchema = TEvaluateEnum<Right>> = TExtendsLeft<Inferred, Left, Evaluated>;
|
|
1023
1347
|
type TExtendsRightIntersect<Inferred extends TProperties, Left extends TSchema, Right extends TSchema[]> = (Right extends [infer Head extends TSchema, ...infer Tail extends TSchema[]] ? TExtendsLeft<Inferred, Left, Head> extends TExtendsTrueLike<infer Inferred extends TProperties> ? TExtendsRightIntersect<Inferred, Left, Tail> : TExtendsFalse : TExtendsTrue<Inferred>);
|
|
1024
1348
|
type TExtendsRightTemplateLiteral<Inferred extends TProperties, Left extends TSchema, Right extends string, Evaluated extends TSchema = TEvaluateTemplateLiteral<Right>> = TExtendsLeft<Inferred, Left, Evaluated>;
|
|
@@ -1033,16 +1357,16 @@ type TParameterCompare<Inferred extends TProperties, Left extends TSchema, LeftR
|
|
|
1033
1357
|
type TParameterRight<Inferred extends TProperties, Left extends TSchema, LeftRest extends TSchema[], RightRest extends TSchema[]> = (RightRest extends [infer Head extends TSchema, ...infer Tail extends TSchema[]] ? TParameterCompare<Inferred, Left, LeftRest, Head, Tail> : Left extends TOptional ? TExtendsTrue<Inferred> : TExtendsFalse);
|
|
1034
1358
|
type TParameterLeft<Inferred extends TProperties, LeftRest extends TSchema[], RightRest extends TSchema[]> = (LeftRest extends [infer Head extends TSchema, ...infer Tail extends TSchema[]] ? TParameterRight<Inferred, Head, Tail, RightRest> : TExtendsTrue<Inferred>);
|
|
1035
1359
|
type TExtendsParameters<Inferred extends TProperties, Left extends TSchema[], Right extends TSchema[]> = TParameterLeft<Inferred, Left, Right>;
|
|
1036
|
-
type StaticVoid = void;
|
|
1360
|
+
export type StaticVoid = void;
|
|
1037
1361
|
/** Represents a Void type. */
|
|
1038
|
-
interface TVoid extends TSchema {
|
|
1362
|
+
export interface TVoid extends TSchema {
|
|
1039
1363
|
'~kind': 'Void';
|
|
1040
1364
|
type: 'void';
|
|
1041
1365
|
}
|
|
1042
1366
|
/** Creates a Void type. */
|
|
1043
|
-
declare function Void(options?: TSchemaOptions): TVoid;
|
|
1367
|
+
export declare function Void(options?: TSchemaOptions): TVoid;
|
|
1044
1368
|
/** Returns true if the given value is TVoid. */
|
|
1045
|
-
declare function IsVoid(value: unknown): value is TVoid;
|
|
1369
|
+
export declare function IsVoid(value: unknown): value is TVoid;
|
|
1046
1370
|
type TExtendsReturnType<Inferred extends TProperties, Left extends TSchema, Right extends TSchema> = (Right extends TVoid ? TExtendsTrue<Inferred> : TExtendsLeft<Inferred, Left, Right>);
|
|
1047
1371
|
type TExtendsConstructor<Inferred extends TProperties, Parameters extends TSchema[], InstanceType extends TSchema, Right extends TSchema> = (Right extends TAny ? TExtendsTrue<Inferred> : Right extends TUnknown ? TExtendsTrue<Inferred> : Right extends TConstructor ? TExtendsParameters<Inferred, Parameters, Right['parameters']> extends TExtendsTrueLike<infer Inferred extends TProperties> ? TExtendsReturnType<Inferred, InstanceType, Right['instanceType']> : TExtendsFalse : TExtendsFalse);
|
|
1048
1372
|
type TExtendsDependent<Inferred extends TProperties, If extends TSchema, Then extends TSchema, Else extends TSchema, Right extends TSchema> = (TExtendsLeft<Inferred, If, Right> extends TExtendsTrueLike<infer Inferred extends TProperties> ? TExtendsLeft<Inferred, Then, Right> : TExtendsLeft<Inferred, Else, Right>);
|
|
@@ -1061,13 +1385,13 @@ type TExtendsNull<Inferred extends TProperties, Left extends TNull, Right extend
|
|
|
1061
1385
|
type TExtendsNumber<Inferred extends TProperties, Left extends TNumber$1, Right extends TSchema> = (Right extends TNumber$1 ? TExtendsTrue<Inferred> : TExtendsRight<Inferred, Left, Right>);
|
|
1062
1386
|
type TExtendsPropertyOptional<Inferred extends TProperties, Left extends TSchema, Right extends TSchema> = (Left extends TOptional<Left> ? Right extends TOptional<Right> ? TExtendsTrue<Inferred> : TExtendsFalse : TExtendsTrue<Inferred>);
|
|
1063
1387
|
type TExtendsProperty<Inferred extends TProperties, Left extends TSchema, Right extends TSchema> = (Right extends TInfer<string, TNever> ? TExtendsFalse : TExtendsLeft<Inferred, Left, Right> extends TExtendsTrueLike<infer Inferred extends TProperties> ? TExtendsPropertyOptional<Inferred, Left, Right> : TExtendsFalse);
|
|
1064
|
-
type TExtractInferredProperties<Keys extends PropertyKey[], Properties extends Record<PropertyKey,
|
|
1388
|
+
type TExtractInferredProperties<Keys extends PropertyKey[], Properties extends Record<PropertyKey, TResult>, Result extends TProperties = {}> = (Keys extends [infer Left extends PropertyKey, ...infer Right extends PropertyKey[]] ? Left extends keyof Properties ? Properties[Left] extends TExtendsTrueLike<infer Inferred extends TProperties> ? TExtractInferredProperties<Right, Properties, Result & Inferred> : TExtractInferredProperties<Right, Properties, Result> : TUnreachable : Result);
|
|
1065
1389
|
type TExtendsPropertiesComparer<Inferred extends TProperties, Left extends TProperties, Right extends TProperties, Properties extends Record<PropertyKey, TExtendsTrue | TExtendsFalse> = { [RightKey in keyof Right]: (RightKey extends keyof Left ? TExtendsProperty<{}, Left[RightKey], Right[RightKey]> : Right[RightKey] extends TOptional<Right[RightKey]> ? Right[RightKey] extends TInfer ? TExtendsTrue<TAssign<Inferred, { [_ in Right[RightKey]['name']]: Right[RightKey]['extends']; }>> : TExtendsTrue<Inferred> : TExtendsFalse); }, Checked extends boolean = Properties[keyof Right] extends TExtendsTrueLike ? true : false, Extracted extends TProperties = Checked extends true ? TExtractInferredProperties<TUnionToTuple<keyof Properties>, Properties> : {}> = (Checked extends true ? TExtendsTrue<Extracted> : TExtendsFalse);
|
|
1066
1390
|
type TExtendsProperties<Inferred extends TProperties, Left extends TProperties, Right extends TProperties, Compared extends TResult = TExtendsPropertiesComparer<Inferred, Left, Right>> = (Compared extends TExtendsTrueLike<infer ComparedInferred extends TProperties> ? TExtendsTrue<TAssign<Inferred, ComparedInferred>> : TExtendsFalse);
|
|
1067
1391
|
type TExtendsObjectToObject<Inferred extends TProperties, Left extends TProperties, Right extends TProperties> = (TExtendsProperties<Inferred, Left, Right>);
|
|
1068
1392
|
type TRecordMergeInferred<Left extends TProperties, Right extends TProperties, Result extends TProperties = { [Key in keyof Right]: Key extends keyof Left ? Left[Key] extends TUnion<infer Types extends TSchema[]> ? TUnion<[...Types, Right[Key]]> : TUnion<[Left[Key], Right[Key]]> : Right[Key]; }> = Result;
|
|
1069
|
-
type TExtendsRecordComparer<Properties extends TProperties, Keys extends (keyof Properties)[], Type extends TSchema, Result extends TProperties> = (Keys extends [infer Left extends (keyof Properties), ...infer Right extends (keyof Properties)[]] ? TExtendsLeft<{}, Properties[Left], Type> extends
|
|
1070
|
-
type TExtendsObjectToRecord<Inferred extends TProperties, Properties extends TProperties, _Pattern extends string, Value extends TSchema, Keys extends (keyof Properties)[] = TUnionToTuple<keyof Properties>, Result extends
|
|
1393
|
+
type TExtendsRecordComparer<Properties extends TProperties, Keys extends (keyof Properties)[], Type extends TSchema, Result extends TProperties> = (Keys extends [infer Left extends (keyof Properties), ...infer Right extends (keyof Properties)[]] ? TExtendsLeft<{}, Properties[Left], Type> extends TExtendsTrueLike<infer Inferred extends TProperties> ? TExtendsRecordComparer<Properties, Right, Type, TRecordMergeInferred<Result, Inferred>> : TExtendsFalse : TExtendsTrue<Result>);
|
|
1394
|
+
type TExtendsObjectToRecord<Inferred extends TProperties, Properties extends TProperties, _Pattern extends string, Value extends TSchema, Keys extends (keyof Properties)[] = TUnionToTuple<keyof Properties>, Result extends TResult = TExtendsRecordComparer<Properties, Keys, Value, Inferred>> = Result;
|
|
1071
1395
|
type TExtendsObject<Inferred extends TProperties, Left extends TProperties, Right extends TSchema> = (Right extends TRecord<infer Pattern extends string, infer Value extends TSchema> ? TExtendsObjectToRecord<Inferred, Left, Pattern, Value> : Right extends TObject<infer Properties extends TProperties> ? TExtendsObjectToObject<Inferred, Left, Properties> : TExtendsRight<Inferred, TObject<Left>, Right>);
|
|
1072
1396
|
type TFromObject$6<Inferred extends TProperties, Properties extends TProperties> = keyof Properties extends never ? TExtendsTrue<Inferred> : TExtendsFalse;
|
|
1073
1397
|
type TFromRecord$1<Inferred extends TProperties, _LeftKey extends TSchema, LeftValue extends TSchema, _RightKey extends TSchema, RightValue extends TSchema> = (TExtendsLeft<Inferred, LeftValue, RightValue>);
|
|
@@ -1076,15 +1400,15 @@ type TExtendsString<Inferred extends TProperties, Left extends TString$1, Right
|
|
|
1076
1400
|
type TExtendsSymbol<Inferred extends TProperties, Left extends TSymbol, Right extends TSchema> = (Right extends TSymbol ? TExtendsTrue<Inferred> : TExtendsRight<Inferred, Left, Right>);
|
|
1077
1401
|
type TExtendsTemplateLiteral<Inferred extends TProperties, Pattern extends string, Right extends TSchema, Evaluated extends TSchema = TEvaluateTemplateLiteral<Pattern>> = TExtendsLeft<Inferred, Evaluated, Right>;
|
|
1078
1402
|
/** Represents a Rest instruction. */
|
|
1079
|
-
interface TRest<Type extends TSchema = TSchema> extends TSchema {
|
|
1403
|
+
export interface TRest<Type extends TSchema = TSchema> extends TSchema {
|
|
1080
1404
|
'~kind': 'Rest';
|
|
1081
1405
|
type: 'rest';
|
|
1082
1406
|
items: Type;
|
|
1083
1407
|
}
|
|
1084
1408
|
/** Creates a Rest instruction type. */
|
|
1085
|
-
declare function Rest
|
|
1409
|
+
export declare function Rest<Type extends TSchema>(type: Type): TRest<Type>;
|
|
1086
1410
|
/** Returns true if the given value is TRest. */
|
|
1087
|
-
declare function IsRest(value: unknown): value is TRest;
|
|
1411
|
+
export declare function IsRest(value: unknown): value is TRest;
|
|
1088
1412
|
interface TInferable<Name extends string = string, Type extends TSchema = TSchema> {
|
|
1089
1413
|
'~kind': 'Inferrable';
|
|
1090
1414
|
name: Name;
|
|
@@ -1092,7 +1416,7 @@ interface TInferable<Name extends string = string, Type extends TSchema = TSchem
|
|
|
1092
1416
|
}
|
|
1093
1417
|
type TTryRestInferable<Type extends TSchema, Result extends TInferable | undefined = (Type extends TRest<infer RestType extends TSchema> ? RestType extends TInfer<infer Name extends string, infer Type extends TSchema> ? Type extends TArray<infer Type extends TSchema> ? TInferable<Name, Type> : Type extends TUnknown ? TInferable<Name, Type> : undefined : TUnreachable : undefined)> = Result;
|
|
1094
1418
|
type TTryInferable<Type extends TSchema, Result extends TInferable | undefined = (Type extends TInfer<infer Name extends string, infer Type extends TSchema> ? TInferable<Name, Type> : undefined)> = Result;
|
|
1095
|
-
type TryInferResults<Rest extends TSchema[], Right extends TSchema, Result extends TSchema[] = []> = (Rest extends [infer Head extends TSchema, ...infer Tail extends TSchema[]] ? TExtendsLeft<{}, Head, Right> extends
|
|
1419
|
+
type TryInferResults<Rest extends TSchema[], Right extends TSchema, Result extends TSchema[] = []> = (Rest extends [infer Head extends TSchema, ...infer Tail extends TSchema[]] ? TExtendsLeft<{}, Head, Right> extends TExtendsTrueLike ? TryInferResults<Tail, Right, [...Result, Head]> : undefined : Result);
|
|
1096
1420
|
declare function TryInferResults<Rest extends TSchema[], Right extends TSchema>(rest: [...Rest], right: Right): TryInferResults<Rest, Right>;
|
|
1097
1421
|
type TInferTupleResult<Inferred extends TProperties, Name extends string, Left extends TSchema[], Right extends TSchema, Results extends TSchema[] | undefined = TryInferResults<Left, Right>> = (Results extends [...infer Results extends TSchema[]] ? TExtendsTrue<TAssign<Inferred, { [_ in Name]: TTuple<Results>; }>> : TExtendsFalse);
|
|
1098
1422
|
type TInferUnionResult<Inferred extends TProperties, Name extends string, Left extends TSchema[], Right extends TSchema, Results extends TSchema[] | undefined = TryInferResults<Left, Right>> = (Results extends [...infer Results extends TSchema[]] ? TExtendsTrue<TAssign<Inferred, { [_ in Name]: TUnion<Results>; }>> : TExtendsFalse);
|
|
@@ -1107,16 +1431,16 @@ type TExtendsTupleToTuple<Inferred extends TProperties, Left extends TSchema[],
|
|
|
1107
1431
|
type TExtendsTupleToArrayReduce<Inferred extends TProperties, Left extends TSchema[], Right extends TSchema> = (Left extends [infer Head extends TSchema, ...infer Tail extends TSchema[]] ? TExtendsLeft<Inferred, Head, Right> extends TExtendsTrueLike<infer Inferred extends TProperties> ? TExtendsTupleToArrayReduce<Inferred, Tail, Right> : TExtendsFalse : TExtendsTrue<Inferred>);
|
|
1108
1432
|
type TExtendsTupleToArray<Inferred extends TProperties, Left extends TSchema[], Right extends TSchema, Inferrable extends TInferable | undefined = TTryInferable<Right>> = (Inferrable extends TInferable ? TInferUnionResult<Inferred, Inferrable['name'], Left, Inferrable['type']> : TExtendsTupleToArrayReduce<Inferred, Left, Right>);
|
|
1109
1433
|
type TExtendsTuple<Inferred extends TProperties, Left extends TSchema[], Right extends TSchema, InstantiatedLeft extends TSchema[] = TInstantiateElements<Inferred, TState<[], []>, Left>> = (Right extends TTuple<infer Types extends TSchema[]> ? TExtendsTupleToTuple<Inferred, InstantiatedLeft, Types> : Right extends TArray<infer Type extends TSchema> ? TExtendsTupleToArray<Inferred, InstantiatedLeft, Type> : TExtendsRight<Inferred, TTuple<InstantiatedLeft>, Right>);
|
|
1110
|
-
type StaticUndefined = undefined;
|
|
1434
|
+
export type StaticUndefined = undefined;
|
|
1111
1435
|
/** Represents a Undefined type. */
|
|
1112
|
-
interface TUndefined extends TSchema {
|
|
1436
|
+
export interface TUndefined extends TSchema {
|
|
1113
1437
|
'~kind': 'Undefined';
|
|
1114
1438
|
type: 'undefined';
|
|
1115
1439
|
}
|
|
1116
1440
|
/** Creates a Undefined type. */
|
|
1117
|
-
declare function Undefined(options?: TSchemaOptions): TUndefined;
|
|
1441
|
+
export declare function Undefined(options?: TSchemaOptions): TUndefined;
|
|
1118
1442
|
/** Returns true if the given value is TUndefined. */
|
|
1119
|
-
declare function IsUndefined(value: unknown): value is TUndefined;
|
|
1443
|
+
export declare function IsUndefined(value: unknown): value is TUndefined;
|
|
1120
1444
|
type TExtendsUndefined<Inferred extends TProperties, Left extends TUndefined, Right extends TSchema> = (Right extends TVoid ? TExtendsTrue<Inferred> : Right extends TUndefined ? TExtendsTrue<Inferred> : TExtendsRight<Inferred, Left, Right>);
|
|
1121
1445
|
type TExtendsUnionSome<Inferred extends TProperties, Type extends TSchema, UnionTypes extends TSchema[]> = (UnionTypes extends [infer Head extends TSchema, ...infer Tail extends TSchema[]] ? TExtendsLeft<Inferred, Type, Head> extends TExtendsTrueLike<infer Inferred extends TProperties> ? TExtendsTrue<Inferred> : TExtendsUnionSome<Inferred, Type, Tail> : TExtendsFalse);
|
|
1122
1446
|
type TExtendsUnionLeft<Inferred extends TProperties, Left extends TSchema[], Right extends TSchema[]> = (Left extends [infer Head extends TSchema, ...infer Tail extends TSchema[]] ? TExtendsUnionSome<Inferred, Head, Right> extends TExtendsTrueLike<infer Inferred extends TProperties> ? TExtendsUnionLeft<Inferred, Tail, Right> : TExtendsFalse : TExtendsTrue<Inferred>);
|
|
@@ -1125,81 +1449,81 @@ type TExtendsUnknown<Inferred extends TProperties, Left extends TUnknown, Right
|
|
|
1125
1449
|
type TExtendsVoid<Inferred extends TProperties, Left extends TVoid, Right extends TSchema> = (Right extends TVoid ? TExtendsTrue<Inferred> : TExtendsRight<Inferred, Left, Right>);
|
|
1126
1450
|
type TExtendsLeft<Inferred extends TProperties, Left extends TSchema, Right extends TSchema> = (Left extends TAny ? TExtendsAny<Inferred, Left, Right> : Left extends TArray<infer Items extends TSchema> ? TExtendsArray<Inferred, Left, Items, Right> : Left extends TBigInt$1 ? TExtendsBigInt<Inferred, Left, Right> : Left extends TBoolean ? TExtendsBoolean<Inferred, Left, Right> : Left extends TConstructor<infer Parameters extends TSchema[], infer InstanceType extends TSchema> ? TExtendsConstructor<Inferred, Parameters, InstanceType, Right> : Left extends TDependent$1<infer If extends TSchema, infer Then extends TSchema, infer Else extends TSchema> ? TExtendsDependent<Inferred, If, Then, Else, Right> : Left extends TEnum<infer Values extends TEnumValue[]> ? TExtendsEnum<Inferred, Values, Right> : Left extends TFunction<infer Parameters extends TSchema[], infer ReturnType extends TSchema> ? TExtendsFunction<Inferred, Parameters, ReturnType, Right> : Left extends TInteger$1 ? TExtendsInteger<Inferred, Left, Right> : Left extends TIntersect<infer Types extends TSchema[]> ? TExtendsIntersect<Inferred, Types, Right> : Left extends TLiteral ? TExtendsLiteral<Inferred, Left, Right> : Left extends TNever ? TExtendsNever<Inferred, Left, Right> : Left extends TNull ? TExtendsNull<Inferred, Left, Right> : Left extends TNumber$1 ? TExtendsNumber<Inferred, Left, Right> : Left extends TObject<infer Properties extends TProperties> ? TExtendsObject<Inferred, Properties, Right> : Left extends TRecord<infer Pattern extends string, infer Value extends TSchema> ? TExtendsRecord<Inferred, Pattern, Value, Right> : Left extends TString$1 ? TExtendsString<Inferred, Left, Right> : Left extends TSymbol ? TExtendsSymbol<Inferred, Left, Right> : Left extends TTemplateLiteral<infer Pattern extends string> ? TExtendsTemplateLiteral<Inferred, Pattern, Right> : Left extends TTuple<infer Types extends TSchema[]> ? TExtendsTuple<Inferred, Types, Right> : Left extends TUndefined ? TExtendsUndefined<Inferred, Left, Right> : Left extends TUnion<infer Types extends TSchema[]> ? TExtendsUnion<Inferred, Types, Right> : Left extends TUnknown ? TExtendsUnknown<Inferred, Left, Right> : Left extends TVoid ? TExtendsVoid<Inferred, Left, Right> : TExtendsFalse);
|
|
1127
1451
|
type TInterfaceOperation<Heritage extends TSchema[], Properties extends TProperties, Result extends TSchema = TEvaluateIntersect<[...Heritage, TObject<Properties>]>> = Result;
|
|
1128
|
-
type TInterfaceAction<Heritage extends TSchema[], Properties extends TProperties, Result extends TSchema = TCanInstantiate<Heritage> extends true ? TInterfaceOperation<Heritage, Properties> : TInterfaceDeferred<Heritage, Properties>> = Result;
|
|
1129
|
-
declare function InterfaceAction<Heritage extends TSchema[], Properties extends TProperties>(heritage: [...Heritage], properties: Properties, options: TSchemaOptions): TInterfaceAction<Heritage, Properties>;
|
|
1130
|
-
type TInterfaceInstantiate<Context extends TProperties, State extends TState, Heritage extends TSchema[], Properties extends TProperties, InstantiatedHeritage extends TSchema[] = TInstantiateTypes<Context, State, Heritage>, InstantiatedProperties extends TProperties = TInstantiateProperties<Context, State, Properties>> = TInterfaceAction<InstantiatedHeritage, InstantiatedProperties>;
|
|
1131
|
-
declare function InterfaceInstantiate<Context extends TProperties, State extends TState, Heritage extends TSchema[], Properties extends TProperties>(context: Context, state: State, heritage: [...Heritage], properties: Properties, options: TSchemaOptions): TInterfaceInstantiate<Context, State, Heritage, Properties>;
|
|
1452
|
+
export type TInterfaceAction<Heritage extends TSchema[], Properties extends TProperties, Result extends TSchema = TCanInstantiate<Heritage> extends true ? TInterfaceOperation<Heritage, Properties> : TInterfaceDeferred<Heritage, Properties>> = Result;
|
|
1453
|
+
export declare function InterfaceAction<Heritage extends TSchema[], Properties extends TProperties>(heritage: [...Heritage], properties: Properties, options: TSchemaOptions): TInterfaceAction<Heritage, Properties>;
|
|
1454
|
+
export type TInterfaceInstantiate<Context extends TProperties, State extends TState, Heritage extends TSchema[], Properties extends TProperties, InstantiatedHeritage extends TSchema[] = TInstantiateTypes<Context, State, Heritage>, InstantiatedProperties extends TProperties = TInstantiateProperties<Context, State, Properties>> = TInterfaceAction<InstantiatedHeritage, InstantiatedProperties>;
|
|
1455
|
+
export declare function InterfaceInstantiate<Context extends TProperties, State extends TState, Heritage extends TSchema[], Properties extends TProperties>(context: Context, state: State, heritage: [...Heritage], properties: Properties, options: TSchemaOptions): TInterfaceInstantiate<Context, State, Heritage, Properties>;
|
|
1132
1456
|
/** Creates a deferred Interface action. */
|
|
1133
|
-
type TInterfaceDeferred<Heritage extends TSchema[] = TSchema[], Properties extends TProperties = TProperties> = (TDeferred<'Interface', [Heritage, Properties]>);
|
|
1457
|
+
export type TInterfaceDeferred<Heritage extends TSchema[] = TSchema[], Properties extends TProperties = TProperties> = (TDeferred<'Interface', [Heritage, Properties]>);
|
|
1134
1458
|
/** Creates a deferred Interface action. */
|
|
1135
|
-
declare function InterfaceDeferred<Heritage extends TSchema[], Properties extends TProperties>(heritage: [...Heritage], properties: Properties, options?: TSchemaOptions): TInterfaceDeferred<Heritage, Properties>;
|
|
1459
|
+
export declare function InterfaceDeferred<Heritage extends TSchema[], Properties extends TProperties>(heritage: [...Heritage], properties: Properties, options?: TSchemaOptions): TInterfaceDeferred<Heritage, Properties>;
|
|
1136
1460
|
/** Returns true if this value is a deferred Interface action. */
|
|
1137
|
-
declare function IsInterfaceDeferred(value: unknown): value is TInterfaceDeferred;
|
|
1461
|
+
export declare function IsInterfaceDeferred(value: unknown): value is TInterfaceDeferred;
|
|
1138
1462
|
/** Creates an Interface using the given heritage and properties. */
|
|
1139
|
-
type TInterface<Heritage extends TSchema[], Properties extends TProperties> = (TInterfaceAction<Heritage, Properties>);
|
|
1463
|
+
export type TInterface<Heritage extends TSchema[], Properties extends TProperties> = (TInterfaceAction<Heritage, Properties>);
|
|
1140
1464
|
/** Creates an Interface using the given heritage and properties. */
|
|
1141
|
-
declare function Interface<Heritage extends TSchema[], Properties extends TProperties>(heritage: [...Heritage], properties: Properties, options?: TSchemaOptions): TInterface<Heritage, Properties>;
|
|
1465
|
+
export declare function Interface<Heritage extends TSchema[], Properties extends TProperties>(heritage: [...Heritage], properties: Properties, options?: TSchemaOptions): TInterface<Heritage, Properties>;
|
|
1142
1466
|
type TFromRef$3<Stack extends (keyof Context)[], Context extends TProperties, Ref extends (keyof Context)> = Ref extends Stack[number] ? true : TFromType$17<[...Stack, Ref], Context, Context[Ref]>;
|
|
1143
1467
|
type TFromProperties$2<Stack extends (keyof Context)[], Context extends TProperties, Properties extends TProperties, Types extends TSchema[] = TPropertyValues<Properties>> = TFromTypes$4<Stack, Context, Types>;
|
|
1144
1468
|
type TFromTypes$4<Stack extends (keyof Context)[], Context extends TProperties, Types extends TSchema[]> = Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? TFromType$17<Stack, Context, Left> extends true ? true : TFromTypes$4<Stack, Context, Right> : false;
|
|
1145
1469
|
type TFromType$17<Stack extends (keyof Context)[], Context extends TProperties, Type extends TSchema> = (Type extends TRef<infer Ref extends string> ? TFromRef$3<Stack, Context, Ref> : Type extends TArray<infer Type extends TSchema> ? TFromType$17<Stack, Context, Type> : Type extends TConstructor<infer Parameters extends TSchema[], infer InstanceType extends TSchema> ? TFromTypes$4<Stack, Context, [...Parameters, InstanceType]> : Type extends TFunction<infer Parameters extends TSchema[], infer ReturnType extends TSchema> ? TFromTypes$4<Stack, Context, [...Parameters, ReturnType]> : Type extends TInterfaceDeferred<TSchema[], infer Properties extends TProperties> ? TFromProperties$2<Stack, Context, Properties> : Type extends TIntersect<infer Types extends TSchema[]> ? TFromTypes$4<Stack, Context, Types> : Type extends TObject<infer Properties extends TProperties> ? TFromProperties$2<Stack, Context, Properties> : Type extends TUnion<infer Types extends TSchema[]> ? TFromTypes$4<Stack, Context, Types> : Type extends TTuple<infer Types extends TSchema[]> ? TFromTypes$4<Stack, Context, Types> : Type extends TRecord<string, infer Type extends TSchema> ? TFromType$17<Stack, Context, Type> : false);
|
|
1146
1470
|
/** Performs a cyclic check on the given type. Initial key stack can be empty, but faster if specified */
|
|
1147
|
-
type TCyclicCheck<Stack extends (keyof Context)[], Context extends TProperties, Type extends TSchema, Result extends boolean = TFromType$17<Stack, Context, Type>> = Result;
|
|
1471
|
+
export type TCyclicCheck<Stack extends (keyof Context)[], Context extends TProperties, Type extends TSchema, Result extends boolean = TFromType$17<Stack, Context, Type>> = Result;
|
|
1148
1472
|
/** Performs a cyclic check on the given type. Initial key stack can be empty, but faster if specified */
|
|
1149
|
-
declare function CyclicCheck<Stack extends (keyof Context)[], Context extends TProperties, Type extends TSchema>(stack: [...Stack], context: Context, type: Type): TCyclicCheck<Stack, Context, Type>;
|
|
1473
|
+
export declare function CyclicCheck<Stack extends (keyof Context)[], Context extends TProperties, Type extends TSchema>(stack: [...Stack], context: Context, type: Type): TCyclicCheck<Stack, Context, Type>;
|
|
1150
1474
|
type TResolveCandidateKeys<Context extends TProperties, Keys extends (keyof Context)[], Result extends (keyof Context)[] = []> = (Keys extends [infer Left extends keyof Context, ...infer Right extends (keyof Context)[]] ? TCyclicCheck<[Left], Context, Context[Left]> extends true ? TResolveCandidateKeys<Context, Right, [...Result, Left]> : TResolveCandidateKeys<Context, Right, Result> : Result);
|
|
1151
1475
|
/** Returns keys for context types that need to be transformed to TCyclic. */
|
|
1152
|
-
type TCyclicCandidates<Context extends TProperties, Keys extends (keyof Context)[] = TPropertyKeys<Context>, Result extends (keyof Context)[] = TResolveCandidateKeys<Context, Keys>> = Result;
|
|
1476
|
+
export type TCyclicCandidates<Context extends TProperties, Keys extends (keyof Context)[] = TPropertyKeys<Context>, Result extends (keyof Context)[] = TResolveCandidateKeys<Context, Keys>> = Result;
|
|
1153
1477
|
/** Returns keys for context types that need to be transformed to TCyclic. */
|
|
1154
|
-
declare function CyclicCandidates<Context extends TProperties>(context: Context): TCyclicCandidates<Context>;
|
|
1478
|
+
export declare function CyclicCandidates<Context extends TProperties>(context: Context): TCyclicCandidates<Context>;
|
|
1155
1479
|
type TFromRef$2<Context extends TProperties, Ref extends string, Dependencies extends string[]> = Ref extends Dependencies[number] ? Dependencies : Ref extends keyof Context ? TFromType$16<Context, Context[Ref], [...Dependencies, Ref]> : TUnreachable;
|
|
1156
1480
|
type TFromProperties$1<Context extends TProperties, Properties extends TProperties, Dependencies extends string[], Types extends TSchema[] = TPropertyValues<Properties>> = TFromTypes$3<Context, Types, Dependencies>;
|
|
1157
1481
|
type TFromTypes$3<Context extends TProperties, Types extends TSchema[], Dependencies extends string[]> = Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? TFromTypes$3<Context, Right, TFromType$16<Context, Left, Dependencies>> : Dependencies;
|
|
1158
1482
|
type TFromType$16<Context extends TProperties, Type extends TSchema, Result extends string[]> = (Type extends TRef<infer Ref extends string> ? TFromRef$2<Context, Ref, Result> : Type extends TArray<infer Type extends TSchema> ? TFromType$16<Context, Type, Result> : Type extends TConstructor<infer Parameters extends TSchema[], infer InstanceType extends TSchema> ? TFromTypes$3<Context, [...Parameters, InstanceType], Result> : Type extends TFunction<infer Parameters extends TSchema[], infer ReturnType extends TSchema> ? TFromTypes$3<Context, [...Parameters, ReturnType], Result> : Type extends TInterfaceDeferred<TSchema[], infer Properties extends TProperties> ? TFromProperties$1<Context, Properties, Result> : Type extends TIntersect<infer Types extends TSchema[]> ? TFromTypes$3<Context, Types, Result> : Type extends TObject<infer Properties extends TProperties> ? TFromProperties$1<Context, Properties, Result> : Type extends TUnion<infer Types extends TSchema[]> ? TFromTypes$3<Context, Types, Result> : Type extends TTuple<infer Types extends TSchema[]> ? TFromTypes$3<Context, Types, Result> : Type extends TRecord<string, infer Type extends TSchema> ? TFromType$16<Context, Type, Result> : Result);
|
|
1159
1483
|
/** Returns dependent cyclic keys for the given type. This function is used to dead-type-eliminate (DTE) for initializing TCyclic types. */
|
|
1160
|
-
type TCyclicDependencies<Context extends TProperties, Key extends string, Type extends TSchema, Result extends string[] = TFromType$16<Context, Type, [Key]>> = Result;
|
|
1484
|
+
export type TCyclicDependencies<Context extends TProperties, Key extends string, Type extends TSchema, Result extends string[] = TFromType$16<Context, Type, [Key]>> = Result;
|
|
1161
1485
|
/** Returns dependent cyclic keys for the given type. This function is used to dead-type-eliminate (DTE) for initializing TCyclic types. */
|
|
1162
|
-
declare function CyclicDependencies<Context extends TProperties, Key extends string, Type extends TSchema>(context: Context, key: Key, type: Type): TCyclicDependencies<Context, Key, Type>;
|
|
1486
|
+
export declare function CyclicDependencies<Context extends TProperties, Key extends string, Type extends TSchema>(context: Context, key: Key, type: Type): TCyclicDependencies<Context, Key, Type>;
|
|
1163
1487
|
type TFromRef$1<_Ref extends string> = (TAny);
|
|
1164
1488
|
type TFromProperties<Properties extends TProperties, Result extends TProperties = { [Key in keyof Properties]: TFromType$15<Properties[Key]>; }> = { [Key in keyof Result]: Result[Key]; };
|
|
1165
1489
|
type TFromTypes$2<Types extends TSchema[], Result extends TSchema[] = []> = Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? TFromTypes$2<Right, [...Result, TFromType$15<Left>]> : Result;
|
|
1166
1490
|
type TFromType$15<Type extends TSchema> = (Type extends TRef<infer Ref extends string> ? TFromRef$1<Ref> : Type extends TArray<infer Type extends TSchema> ? TArray<TFromType$15<Type>> : Type extends TConstructor<infer Parameters extends TSchema[], infer InstanceType extends TSchema> ? TFunction<TFromTypes$2<Parameters>, TFromType$15<InstanceType>> : Type extends TFunction<infer Parameters extends TSchema[], infer ReturnType extends TSchema> ? TFunction<TFromTypes$2<Parameters>, TFromType$15<ReturnType>> : Type extends TIntersect<infer Types extends TSchema[]> ? TIntersect<TFromTypes$2<Types>> : Type extends TObject<infer Properties extends TProperties> ? TObject<TFromProperties<Properties>> : Type extends TRecord<infer Pattern extends string, infer Value extends TSchema> ? TRecord<Pattern, TFromType$15<Value>> : Type extends TUnion<infer Types extends TSchema[]> ? TUnion<TFromTypes$2<Types>> : Type extends TTuple<infer Types extends TSchema[]> ? TTuple<TFromTypes$2<Types>> : Type);
|
|
1167
1491
|
type TCyclicAnyFromParameters<Defs extends TProperties, Ref extends string> = (Ref extends keyof Defs ? TFromType$15<Defs[Ref]> : TUnknown);
|
|
1168
1492
|
/** Transforms TCyclic TRef's into TAny's. This function is used prior to TExtends checks to enable cyclics to be structurally checked and terminated (with TAny) at first point of recursion, what would otherwise be a recursive TRef.*/
|
|
1169
|
-
type TCyclicExtends<Type extends TCyclic, Result extends TSchema = TCyclicAnyFromParameters<Type['$defs'], Type['$ref']>> = Result;
|
|
1493
|
+
export type TCyclicExtends<Type extends TCyclic, Result extends TSchema = TCyclicAnyFromParameters<Type['$defs'], Type['$ref']>> = Result;
|
|
1170
1494
|
/** Transforms TCyclic TRef's into TAny's. This function is used prior to TExtends checks to enable cyclics to be structurally checked and terminated (with TAny) at first point of recursion, what would otherwise be a recursive TRef.*/
|
|
1171
|
-
declare function CyclicExtends<Type extends TCyclic>(type: Type): TCyclicExtends<Type>;
|
|
1495
|
+
export declare function CyclicExtends<Type extends TCyclic>(type: Type): TCyclicExtends<Type>;
|
|
1172
1496
|
type TCyclicInterface<Context extends TProperties, Heritage extends TSchema[], Properties extends TProperties, InstantiatedHeritage extends TSchema[] = TInstantiateTypes<Context, TState<[], []>, Heritage>, instantiatedProperties extends TProperties = TInstantiateProperties<{}, TState<[], []>, Properties>, EvaluatedInterface extends TSchema = TEvaluateIntersect<[...InstantiatedHeritage, TObject<instantiatedProperties>]>> = EvaluatedInterface;
|
|
1173
1497
|
type TCyclicDefinitions<Context extends TProperties, Dependencies extends string[], Result extends TProperties = { [Key in Extract<keyof Context, Dependencies[number]>]: Context[Key] extends TInterfaceDeferred<infer Heritage extends TSchema[], infer Properties extends TProperties> ? TCyclicInterface<Context, Heritage, Properties> : Context[Key]; }> = Result;
|
|
1174
|
-
type TInstantiateCyclic<Context extends TProperties, Ref extends string, Type extends TSchema, Dependencies extends string[] = TCyclicDependencies<Context, Ref, Type>, Definitions extends TProperties = TCyclicDefinitions<Context, Dependencies>, Result extends TSchema = TCyclic<Definitions, Ref>> = Result;
|
|
1175
|
-
declare function InstantiateCyclic<Context extends TProperties, Ref extends string, Type extends TSchema>(context: Context, ref: Ref, type: Type): TInstantiateCyclic<Context, Ref, Type>;
|
|
1498
|
+
export type TInstantiateCyclic<Context extends TProperties, Ref extends string, Type extends TSchema, Dependencies extends string[] = TCyclicDependencies<Context, Ref, Type>, Definitions extends TProperties = TCyclicDefinitions<Context, Dependencies>, Result extends TSchema = TCyclic<Definitions, Ref>> = Result;
|
|
1499
|
+
export declare function InstantiateCyclic<Context extends TProperties, Ref extends string, Type extends TSchema>(context: Context, ref: Ref, type: Type): TInstantiateCyclic<Context, Ref, Type>;
|
|
1176
1500
|
type TResolve$1<Defs extends TProperties, Ref extends string> = (Ref extends keyof Defs ? Defs[Ref] extends TRef<infer Ref extends string> ? TResolve$1<Defs, Ref> : Defs[Ref] : TNever);
|
|
1177
1501
|
/** Returns the target Type from the Defs or Never if target is non-resolvable */
|
|
1178
|
-
type TCyclicTarget<Defs extends TProperties, Ref extends string, Result extends TSchema = TResolve$1<Defs, Ref>> = Result;
|
|
1502
|
+
export type TCyclicTarget<Defs extends TProperties, Ref extends string, Result extends TSchema = TResolve$1<Defs, Ref>> = Result;
|
|
1179
1503
|
/** Returns the target Type from the Defs or Never if target is non-resolvable */
|
|
1180
|
-
declare function CyclicTarget<Defs extends TProperties, Ref extends string>(defs: Defs, ref: Ref): TCyclicTarget<Defs, Ref>;
|
|
1504
|
+
export declare function CyclicTarget<Defs extends TProperties, Ref extends string>(defs: Defs, ref: Ref): TCyclicTarget<Defs, Ref>;
|
|
1181
1505
|
type TCanonical<Type extends TSchema> = (Type extends TCyclic ? TCyclicExtends<Type> : Type extends TUnsafe ? TUnknown : Type);
|
|
1182
1506
|
/** Performs a structural extends check on left and right types and yields inferred types on right if specified. */
|
|
1183
|
-
type TExtends<Inferred extends TProperties, Left extends TSchema, Right extends TSchema, CanonicalLeft extends TSchema = TCanonical<Left>, CanonicalRight extends TSchema = TCanonical<Right>> = TExtendsLeft<Inferred, CanonicalLeft, CanonicalRight>;
|
|
1507
|
+
export type TExtends<Inferred extends TProperties, Left extends TSchema, Right extends TSchema, CanonicalLeft extends TSchema = TCanonical<Left>, CanonicalRight extends TSchema = TCanonical<Right>> = TExtendsLeft<Inferred, CanonicalLeft, CanonicalRight>;
|
|
1184
1508
|
/** Performs a structural extends check on left and right types and yields inferred types on right if specified. */
|
|
1185
|
-
declare function Extends
|
|
1509
|
+
export declare function Extends<Inferred extends TProperties, Left extends TSchema, Right extends TSchema>(inferred: Inferred, left: Left, right: Right): TExtends<Inferred, Left, Right>;
|
|
1186
1510
|
type TExcludeType<Left extends TSchema, Right extends TSchema, Check extends TResult = TExtends<{}, Left, Right>, Result extends TSchema[] = Check extends TExtendsTrueLike ? [] : [Left]> = Result;
|
|
1187
1511
|
type TExcludeUnion<Left extends TSchema[], Right extends TSchema, Result extends TSchema[] = []> = (Left extends [infer Head extends TSchema, ...infer Tail extends TSchema[]] ? TExcludeUnion<Tail, Right, [...Result, ...TExcludeType<Head, Right>]> : Result);
|
|
1188
1512
|
type TExcludeOperation<Left extends TSchema, Right extends TSchema, Evaluated extends TSchema = TEvaluateType<Left>, Canonical extends TSchema[] = Evaluated extends TUnion<infer Types extends TSchema[]> ? Types : [Evaluated], Remaining extends TSchema[] = TExcludeUnion<Canonical, Right>, Result extends TSchema = TEvaluateUnion<Remaining>> = Result;
|
|
1189
|
-
type TEvaluateDependent<If extends TSchema, Then extends TSchema, Else extends TSchema, Intersected extends TSchema = TEvaluateIntersect<[If, Then]>, Excluded extends TSchema = TExcludeOperation<Else, If>, Result extends TSchema = TEvaluateUnion<[Intersected, Excluded]>> = Result;
|
|
1190
|
-
declare function EvaluateDependent<If extends TSchema, Then extends TSchema, Else extends TSchema>(if_: If, then_: Then, else_: Else): TEvaluateDependent<If, Then, Else>;
|
|
1191
|
-
type TEvaluateEnum<Values extends TEnumValue[], Result extends TSchema[] = []> = (Values extends [infer Left extends TEnumValue, ...infer Right extends TEnumValue[]] ? TEvaluateEnum<Right, [...Result, TLiteral<Left>]> : TEvaluateUnion<Result>);
|
|
1192
|
-
declare function EvaluateEnum<Values extends TEnumValue[]>(values: [...Values], result?: TSchema[]): TEvaluateEnum<Values>;
|
|
1193
|
-
type TEvaluateIntersect<Types extends TSchema[], Distribution extends TSchema[] = TDistribute$1<Types>, Broadend extends TSchema[] = TBroaden<Distribution>, Result extends TSchema = TEvaluateUnion<Broadend>> = Result;
|
|
1194
|
-
declare function EvaluateIntersect<Types extends TSchema[]>(types: [...Types]): TEvaluateIntersect<Types>;
|
|
1195
|
-
type TEvaluateTemplateLiteral<Pattern extends string, Evaluated extends TSchema = TTemplateLiteralDecode<Pattern>, Result extends TSchema = TEvaluateType<Evaluated>> = Result;
|
|
1196
|
-
declare function EvaluateTemplateLiteral<Pattern extends string>(pattern: Pattern): TEvaluateTemplateLiteral<Pattern>;
|
|
1197
|
-
type TEvaluateUnion<Types extends TSchema[], Broadend extends TSchema[] = TBroaden<Types>, Result extends TSchema = TEvaluateUnionFast<Broadend>> = Result;
|
|
1198
|
-
declare function EvaluateUnion<Types extends TSchema[]>(types: [...Types]): TEvaluateUnion<Types>;
|
|
1199
|
-
type TEvaluateType<Type extends TSchema, Result extends TSchema = (Type extends TDependent$1<infer If extends TSchema, infer Then extends TSchema, infer Else extends TSchema> ? TEvaluateDependent<If, Then, Else> : Type extends TEnum<infer Values extends TEnumValue[]> ? TEvaluateEnum<Values> : Type extends TIntersect<infer Types extends TSchema[]> ? TEvaluateIntersect<Types> : Type extends TTemplateLiteral<infer Pattern extends string> ? TEvaluateTemplateLiteral<Pattern> : Type extends TUnion<infer Types extends TSchema[]> ? TEvaluateUnion<Types> : Type)> = Result;
|
|
1200
|
-
declare function EvaluateType<Type extends TSchema>(type: Type): TEvaluateType<Type>;
|
|
1201
|
-
type TEvaluateUnionFast<Types extends TSchema[], Result extends TSchema = (Types extends [infer Type extends TSchema] ? Type : Types extends [] ? TNever : TUnion<Types>)> = Result;
|
|
1202
|
-
declare function EvaluateUnionFast<Types extends TSchema[]>(types: [...Types]): TEvaluateUnionFast<Types>;
|
|
1513
|
+
export type TEvaluateDependent<If extends TSchema, Then extends TSchema, Else extends TSchema, Intersected extends TSchema = TEvaluateIntersect<[If, Then]>, Excluded extends TSchema = TExcludeOperation<Else, If>, Result extends TSchema = TEvaluateUnion<[Intersected, Excluded]>> = Result;
|
|
1514
|
+
export declare function EvaluateDependent<If extends TSchema, Then extends TSchema, Else extends TSchema>(if_: If, then_: Then, else_: Else): TEvaluateDependent<If, Then, Else>;
|
|
1515
|
+
export type TEvaluateEnum<Values extends TEnumValue[], Result extends TSchema[] = []> = (Values extends [infer Left extends TEnumValue, ...infer Right extends TEnumValue[]] ? TEvaluateEnum<Right, [...Result, TLiteral<Left>]> : TEvaluateUnion<Result>);
|
|
1516
|
+
export declare function EvaluateEnum<Values extends TEnumValue[]>(values: [...Values], result?: TSchema[]): TEvaluateEnum<Values>;
|
|
1517
|
+
export type TEvaluateIntersect<Types extends TSchema[], Distribution extends TSchema[] = TDistribute$1<Types>, Broadend extends TSchema[] = TBroaden<Distribution>, Result extends TSchema = TEvaluateUnion<Broadend>> = Result;
|
|
1518
|
+
export declare function EvaluateIntersect<Types extends TSchema[]>(types: [...Types]): TEvaluateIntersect<Types>;
|
|
1519
|
+
export type TEvaluateTemplateLiteral<Pattern extends string, Evaluated extends TSchema = TTemplateLiteralDecode<Pattern>, Result extends TSchema = TEvaluateType<Evaluated>> = Result;
|
|
1520
|
+
export declare function EvaluateTemplateLiteral<Pattern extends string>(pattern: Pattern): TEvaluateTemplateLiteral<Pattern>;
|
|
1521
|
+
export type TEvaluateUnion<Types extends TSchema[], Broadend extends TSchema[] = TBroaden<Types>, Result extends TSchema = TEvaluateUnionFast<Broadend>> = Result;
|
|
1522
|
+
export declare function EvaluateUnion<Types extends TSchema[]>(types: [...Types]): TEvaluateUnion<Types>;
|
|
1523
|
+
export type TEvaluateType<Type extends TSchema, Result extends TSchema = (Type extends TDependent$1<infer If extends TSchema, infer Then extends TSchema, infer Else extends TSchema> ? TEvaluateDependent<If, Then, Else> : Type extends TEnum<infer Values extends TEnumValue[]> ? TEvaluateEnum<Values> : Type extends TIntersect<infer Types extends TSchema[]> ? TEvaluateIntersect<Types> : Type extends TTemplateLiteral<infer Pattern extends string> ? TEvaluateTemplateLiteral<Pattern> : Type extends TUnion<infer Types extends TSchema[]> ? TEvaluateUnion<Types> : Type)> = Result;
|
|
1524
|
+
export declare function EvaluateType<Type extends TSchema>(type: Type): TEvaluateType<Type>;
|
|
1525
|
+
export type TEvaluateUnionFast<Types extends TSchema[], Result extends TSchema = (Types extends [infer Type extends TSchema] ? Type : Types extends [] ? TNever : TUnion<Types>)> = Result;
|
|
1526
|
+
export declare function EvaluateUnionFast<Types extends TSchema[]>(types: [...Types]): TEvaluateUnionFast<Types>;
|
|
1203
1527
|
type TJoinString<Input extends string[], Result extends string = ''> = (Input extends [infer Left extends string, ...infer Right extends string[]] ? Result extends '' ? TJoinString<Right, Left> : TJoinString<Right, `${Result}|${Left}`> : Result);
|
|
1204
1528
|
type TUnwrapTemplateLiteralPattern<Pattern extends string> = (Pattern extends `^${infer Pattern extends string}$` ? Pattern : never);
|
|
1205
1529
|
type TEncodeLiteral<Value extends TLiteralValue, Right extends TSchema[], Pattern extends string> = (TEncodeTypes<Right, `${Pattern}${Value}`>);
|
|
@@ -1216,42 +1540,42 @@ type TEncodeType<Type extends TSchema, Right extends TSchema[], Pattern extends
|
|
|
1216
1540
|
type TEncodeTypes<Types extends TSchema[], Pattern extends string> = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? TEncodeType<Left, Right, Pattern> : Pattern);
|
|
1217
1541
|
type TEncodePattern<Types extends TSchema[], Encoded extends string = TEncodeTypes<Types, ''>, Result extends string = `^${Encoded}$`> = Result;
|
|
1218
1542
|
/** Encodes a TemplateLiteral type sequence into a TemplateLiteral */
|
|
1219
|
-
type TTemplateLiteralEncode<Types extends TSchema[], Pattern extends string = TEncodePattern<Types>, Result extends TSchema = TTemplateLiteral<Pattern>> = Result;
|
|
1543
|
+
export type TTemplateLiteralEncode<Types extends TSchema[], Pattern extends string = TEncodePattern<Types>, Result extends TSchema = TTemplateLiteral<Pattern>> = Result;
|
|
1220
1544
|
/** Encodes a TemplateLiteral type sequence into a TemplateLiteral */
|
|
1221
|
-
declare function TemplateLiteralEncode<Types extends TSchema[]>(types: [...Types]): TTemplateLiteralEncode<Types>;
|
|
1545
|
+
export declare function TemplateLiteralEncode<Types extends TSchema[]>(types: [...Types]): TTemplateLiteralEncode<Types>;
|
|
1222
1546
|
type TTemplateLiteralAction<Types extends TSchema[], Result extends TSchema = TCanInstantiate<Types> extends true ? TTemplateLiteralEncode<Types> : TTemplateLiteralDeferred<Types>> = Result;
|
|
1223
1547
|
type TTemplateLiteralInstantiate<Context extends TProperties, State extends TState, Types extends TSchema[], InstantiatedTypes extends TSchema[] = TInstantiateTypes<Context, State, Types>> = TTemplateLiteralAction<InstantiatedTypes>;
|
|
1224
|
-
type StaticTemplateLiteral<Pattern extends string> = (TTemplateLiteralStatic<Pattern>);
|
|
1548
|
+
export type StaticTemplateLiteral<Pattern extends string> = (TTemplateLiteralStatic<Pattern>);
|
|
1225
1549
|
/** Represents a TemplateLiteral type. */
|
|
1226
|
-
interface TTemplateLiteral<Pattern extends string = string> extends TSchema {
|
|
1550
|
+
export interface TTemplateLiteral<Pattern extends string = string> extends TSchema {
|
|
1227
1551
|
'~kind': 'TemplateLiteral';
|
|
1228
1552
|
type: 'string';
|
|
1229
1553
|
pattern: Pattern;
|
|
1230
1554
|
}
|
|
1231
1555
|
/** Creates a deferred TemplateLiteral action. */
|
|
1232
|
-
type TTemplateLiteralDeferred<Types extends TSchema[] = TSchema[]> = (TDeferred<'TemplateLiteral', [Types]>);
|
|
1556
|
+
export type TTemplateLiteralDeferred<Types extends TSchema[] = TSchema[]> = (TDeferred<'TemplateLiteral', [Types]>);
|
|
1233
1557
|
/** Creates a deferred TemplateLiteral action. */
|
|
1234
|
-
declare function TemplateLiteralDeferred<Types extends TSchema[]>(types: [...Types], options?: TSchemaOptions): TTemplateLiteralDeferred<Types>;
|
|
1558
|
+
export declare function TemplateLiteralDeferred<Types extends TSchema[]>(types: [...Types], options?: TSchemaOptions): TTemplateLiteralDeferred<Types>;
|
|
1235
1559
|
/** Returns true if this value is a deferred Interface action. */
|
|
1236
|
-
declare function IsTemplateLiteralDeferred(value: unknown): value is TTemplateLiteralDeferred;
|
|
1237
|
-
type TTemplateLiteralFromTypes<Types extends TSchema[], Result extends TSchema = TTemplateLiteralAction<Types>> = Result;
|
|
1238
|
-
declare function TemplateLiteralFromTypes<Types extends TSchema[]>(types: [...Types]): TTemplateLiteralFromTypes<Types>;
|
|
1239
|
-
type TTemplateLiteralFromString<Template extends string, Types extends TSchema[] = TParseTemplateIntoTypes<Template>, Result extends TSchema = TTemplateLiteralFromTypes<Types>> = Result;
|
|
1240
|
-
declare function TemplateLiteralFromString<Template extends string>(template: Template): TTemplateLiteralFromString<Template>;
|
|
1560
|
+
export declare function IsTemplateLiteralDeferred(value: unknown): value is TTemplateLiteralDeferred;
|
|
1561
|
+
export type TTemplateLiteralFromTypes<Types extends TSchema[], Result extends TSchema = TTemplateLiteralAction<Types>> = Result;
|
|
1562
|
+
export declare function TemplateLiteralFromTypes<Types extends TSchema[]>(types: [...Types]): TTemplateLiteralFromTypes<Types>;
|
|
1563
|
+
export type TTemplateLiteralFromString<Template extends string, Types extends TSchema[] = TParseTemplateIntoTypes<Template>, Result extends TSchema = TTemplateLiteralFromTypes<Types>> = Result;
|
|
1564
|
+
export declare function TemplateLiteralFromString<Template extends string>(template: Template): TTemplateLiteralFromString<Template>;
|
|
1241
1565
|
/** Creates a TemplateLiteral type. */
|
|
1242
|
-
declare function TemplateLiteral<Template extends string>(template: Template, options?: TSchemaOptions): TTemplateLiteralFromString<Template>;
|
|
1566
|
+
export declare function TemplateLiteral<Template extends string>(template: Template, options?: TSchemaOptions): TTemplateLiteralFromString<Template>;
|
|
1243
1567
|
/** Creates a TemplateLiteral type. */
|
|
1244
|
-
declare function TemplateLiteral<Types extends TSchema[]>(types: [...Types], options?: TSchemaOptions): TTemplateLiteralFromTypes<Types>;
|
|
1568
|
+
export declare function TemplateLiteral<Types extends TSchema[]>(types: [...Types], options?: TSchemaOptions): TTemplateLiteralFromTypes<Types>;
|
|
1245
1569
|
/** Returns true if the given value is TTemplateLiteral. */
|
|
1246
|
-
declare function IsTemplateLiteral(value: unknown): value is TTemplateLiteral;
|
|
1570
|
+
export declare function IsTemplateLiteral(value: unknown): value is TTemplateLiteral;
|
|
1247
1571
|
type TFromLiteral$4<_Value extends TLiteralValue> = true;
|
|
1248
1572
|
type TFromTypesReduce<Types extends TSchema[]> = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? TFromType$14<Left> extends true ? TFromTypesReduce<Right> : false : true);
|
|
1249
1573
|
type TFromTypes$1<Types extends TSchema[], Result extends boolean = Types extends [] ? false : TFromTypesReduce<Types>> = Result;
|
|
1250
1574
|
type TFromType$14<Type extends TSchema> = Type extends TUnion<infer Types extends TSchema[]> ? TFromTypes$1<Types> : Type extends TLiteral<infer Value extends TLiteralValue> ? TFromLiteral$4<Value> : false;
|
|
1251
1575
|
/** Returns true if the given TemplateLiteral types yields a finite variant set */
|
|
1252
|
-
type TIsTemplateLiteralFinite<Types extends TSchema[], Result extends boolean = TFromTypes$1<Types>> = Result;
|
|
1576
|
+
export type TIsTemplateLiteralFinite<Types extends TSchema[], Result extends boolean = TFromTypes$1<Types>> = Result;
|
|
1253
1577
|
/** Returns true if the given TemplateLiteral types yields a finite variant set */
|
|
1254
|
-
declare function IsTemplateLiteralFinite<Types extends TSchema[]>(types: [...Types]): TIsTemplateLiteralFinite<Types>;
|
|
1578
|
+
export declare function IsTemplateLiteralFinite<Types extends TSchema[]>(types: [...Types]): TIsTemplateLiteralFinite<Types>;
|
|
1255
1579
|
type TFromLiteralPush<Variants extends string[], Value extends TLiteralValue, Result extends string[] = []> = Variants extends [infer Left extends string, ...infer Right extends string[]] ? TFromLiteralPush<Right, Value, [...Result, `${Left}${Value}`]> : Result;
|
|
1256
1580
|
type TFromLiteral$3<Variants extends string[], Value extends TLiteralValue> = Variants extends [] ? [`${Value}`] : TFromLiteralPush<Variants, Value>;
|
|
1257
1581
|
type TFromUnion$7<Variants extends string[], Types extends TSchema[], Result extends string[] = []> = Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? TFromUnion$7<Variants, Right, [...Result, ...TFromType$13<Variants, Left>]> : Result;
|
|
@@ -1261,22 +1585,22 @@ type TVariantsToLiterals<Variants extends string[], Result extends TSchema[] = [
|
|
|
1261
1585
|
type TDecodeTypesAsUnion<Types extends TSchema[], Variants extends string[] = TDecodeFromSpan<[], Types>, Literals extends TSchema[] = TVariantsToLiterals<Variants>, Result extends TSchema = TUnion<Literals>> = Result;
|
|
1262
1586
|
type TDecodeTypes<Types extends TSchema[], Result extends TSchema = (Types extends [] ? TUnreachable : Types extends [infer Type extends TLiteral] ? Type : TDecodeTypesAsUnion<Types>)> = Result;
|
|
1263
1587
|
/** Decodes a TemplateLiteral into a Type. */
|
|
1264
|
-
type TTemplateLiteralDecodeUnsafe<Pattern extends string, Types extends TSchema[] = TParsePatternIntoTypes<Pattern>, Result extends TSchema = (Types extends [] ? TString$1 : TIsTemplateLiteralFinite<Types> extends true ? TDecodeTypes<Types> : TTemplateLiteral<Pattern>)> = Result;
|
|
1588
|
+
export type TTemplateLiteralDecodeUnsafe<Pattern extends string, Types extends TSchema[] = TParsePatternIntoTypes<Pattern>, Result extends TSchema = (Types extends [] ? TString$1 : TIsTemplateLiteralFinite<Types> extends true ? TDecodeTypes<Types> : TTemplateLiteral<Pattern>)> = Result;
|
|
1265
1589
|
/**
|
|
1266
1590
|
* (Internal) Decodes a TemplateLiteral pattern into a Type. This function is unsafe. Decoding a non-finite
|
|
1267
1591
|
* TemplateLiteral pattern may produce another TemplateLiteral pattern. During enumeration, this
|
|
1268
1592
|
* TemplateLiteral -> TemplateLiteral behavior can cause a StackOverflow. A better in-flight template-literal
|
|
1269
1593
|
* decoding algorithm is needed. (for review)
|
|
1270
1594
|
*/
|
|
1271
|
-
declare function TemplateLiteralDecodeUnsafe<Pattern extends string>(pattern: Pattern): TTemplateLiteralDecodeUnsafe<Pattern>;
|
|
1595
|
+
export declare function TemplateLiteralDecodeUnsafe<Pattern extends string>(pattern: Pattern): TTemplateLiteralDecodeUnsafe<Pattern>;
|
|
1272
1596
|
/** Decodes a TemplateLiteral pattern but returns TString if the pattern in non-finite. */
|
|
1273
|
-
type TTemplateLiteralDecode<Pattern extends string, Decoded extends TSchema = TTemplateLiteralDecodeUnsafe<Pattern>, Result extends TSchema = Decoded extends TTemplateLiteral ? TString$1 : Decoded> = Result;
|
|
1597
|
+
export type TTemplateLiteralDecode<Pattern extends string, Decoded extends TSchema = TTemplateLiteralDecodeUnsafe<Pattern>, Result extends TSchema = Decoded extends TTemplateLiteral ? TString$1 : Decoded> = Result;
|
|
1274
1598
|
/** Decodes a TemplateLiteral pattern but returns TString if the pattern in non-finite. */
|
|
1275
|
-
declare function TemplateLiteralDecode<Pattern extends string>(pattern: Pattern): TTemplateLiteralDecode<Pattern>;
|
|
1599
|
+
export declare function TemplateLiteralDecode<Pattern extends string>(pattern: Pattern): TTemplateLiteralDecode<Pattern>;
|
|
1276
1600
|
/** Returns true if this pattern is a valid Template Literal regular expression */
|
|
1277
|
-
type TIsTemplateLiteralPattern<Pattern extends string, Types extends TSchema[] = TParsePatternIntoTypes<Pattern>, Result extends boolean = Types extends [] ? false : true> = Result;
|
|
1601
|
+
export type TIsTemplateLiteralPattern<Pattern extends string, Types extends TSchema[] = TParsePatternIntoTypes<Pattern>, Result extends boolean = Types extends [] ? false : true> = Result;
|
|
1278
1602
|
/** Returns true if this pattern is a valid Template Literal regular expression */
|
|
1279
|
-
declare function IsTemplateLiteralPattern<Pattern extends string>(pattern: Pattern): TIsTemplateLiteralPattern<Pattern>;
|
|
1603
|
+
export declare function IsTemplateLiteralPattern<Pattern extends string>(pattern: Pattern): TIsTemplateLiteralPattern<Pattern>;
|
|
1280
1604
|
type TFromAnyKey<Value extends TSchema, Result extends TSchema = TRecord<typeof StringKey, Value>> = Result;
|
|
1281
1605
|
type TFromBooleanKey<Value extends TSchema, Result extends TSchema = TObject<{
|
|
1282
1606
|
true: Value;
|
|
@@ -1294,86 +1618,89 @@ type TFromNumberKey<Key extends TNumber$1, Value extends TSchema, Result extends
|
|
|
1294
1618
|
type TFromStringKey<_Key extends TSchema, Value extends TSchema, Result extends TSchema = TRecord<typeof StringKey, Value>> = Result;
|
|
1295
1619
|
type TFromTemplateKey<Pattern extends string, Value extends TSchema, Types extends TSchema[] = TParsePatternIntoTypes<Pattern>, Finite extends boolean = TIsTemplateLiteralFinite<Types>, Result extends TSchema = Finite extends true ? TFromKey<TEvaluateTemplateLiteral<Pattern>, Value> : TRecord<Pattern, Value>> = Result;
|
|
1296
1620
|
type TFlattenType<Type extends TSchema, Result extends TSchema[] = Type extends TUnion<infer Types extends TSchema[]> ? TFlatten<Types> : [Type]> = Result;
|
|
1297
|
-
type TFlatten<Types extends TSchema[], Result extends TSchema[] = []> = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? TFlatten<Right, [...Result, ...TFlattenType<Left>]> : Result);
|
|
1298
|
-
declare function Flatten<Types extends TSchema[]>(types: [...Types], result?: TSchema[]): TFlatten<Types>;
|
|
1621
|
+
export type TFlatten<Types extends TSchema[], Result extends TSchema[] = []> = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? TFlatten<Right, [...Result, ...TFlattenType<Left>]> : Result);
|
|
1622
|
+
export declare function Flatten<Types extends TSchema[]>(types: [...Types], result?: TSchema[]): TFlatten<Types>;
|
|
1299
1623
|
type TStringOrNumberCheck<Types extends TSchema[]> = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? Left extends TString$1 | TNumber$1 | TInteger$1 ? true : TStringOrNumberCheck<Right> : false);
|
|
1300
1624
|
type TTryBuildRecord<Types extends TSchema[], Value extends TSchema, Result extends TSchema | undefined = (TStringOrNumberCheck<Types> extends true ? TRecord<typeof StringKey, Value> : undefined)> = Result;
|
|
1301
1625
|
type TCreateProperties<Variants extends TSchema[], Value extends TSchema, Result extends TProperties = {}> = (Variants extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? Left extends TLiteral<string | number> ? TCreateProperties<Right, Value, Result & { [_ in Left['const']]: Value; }> : TCreateProperties<Right, Value, Result> : { [Key in keyof Result]: Result[Key]; });
|
|
1302
1626
|
type TCreateObject<Variants extends TSchema[], Value extends TSchema, Properties extends TProperties = TCreateProperties<Variants, Value>, Result extends TSchema = TObject<Properties>> = Result;
|
|
1303
1627
|
type TFromUnionKey<Types extends TSchema[], Value extends TSchema, Flattened extends TSchema[] = TFlatten<Types>, Record extends TSchema | undefined = TTryBuildRecord<Flattened, Value>, Result extends TSchema = (Record extends TSchema ? Record : TCreateObject<Flattened, Value>)> = Result;
|
|
1304
1628
|
type TFromKey<Key extends TSchema, Value extends TSchema, Result extends TSchema = (Key extends TAny ? TFromAnyKey<Value> : Key extends TBoolean ? TFromBooleanKey<Value> : Key extends TEnum<infer Values extends TEnumValue[]> ? TFromEnumKey<Values, Value> : Key extends TInteger$1 ? TFromIntegerKey<Key, Value> : Key extends TIntersect<infer Types extends TSchema[]> ? TFromIntersectKey<Types, Value> : Key extends TLiteral<infer LiteralValue extends TLiteralValue> ? TFromLiteralKey<LiteralValue, Value> : Key extends TNumber$1 ? TFromNumberKey<Key, Value> : Key extends TString$1 ? TFromStringKey<Key, Value> : Key extends TTemplateLiteral<infer Pattern extends string> ? TFromTemplateKey<Pattern, Value> : Key extends TUnion<infer Types extends TSchema[]> ? TFromUnionKey<Types, Value> : TObject<{}>)> = Result;
|
|
1305
|
-
type TRecordAction<Key extends TSchema, Value extends TSchema, Result extends TSchema = TCanInstantiate<[Key]> extends true ? TFromKey<Key, Value> : TRecordDeferred<Key, Value>> = Result;
|
|
1306
|
-
declare function RecordAction<Key extends TSchema, Value extends TSchema>(key: Key, value: Value, options: TSchemaOptions): TRecordAction<Key, Value>;
|
|
1307
|
-
type TRecordInstantiate<Context extends TProperties, State extends TState, Key extends TSchema, Value extends TSchema, InstantiatedKey extends TSchema = TInstantiateType<Context, State, Key>, InstantiatedValue extends TSchema = TInstantiateType<Context, State, Value>> = TRecordAction<InstantiatedKey, InstantiatedValue>;
|
|
1308
|
-
declare function RecordInstantiate<Context extends TProperties, State extends TState, Key extends TSchema, Value extends TSchema>(context: Context, state: State, key: Key, value: Value, options: TSchemaOptions): TRecordInstantiate<Context, State, Key, Value>;
|
|
1629
|
+
export type TRecordAction<Key extends TSchema, Value extends TSchema, Result extends TSchema = TCanInstantiate<[Key]> extends true ? TFromKey<Key, Value> : TRecordDeferred<Key, Value>> = Result;
|
|
1630
|
+
export declare function RecordAction<Key extends TSchema, Value extends TSchema>(key: Key, value: Value, options: TSchemaOptions): TRecordAction<Key, Value>;
|
|
1631
|
+
export type TRecordInstantiate<Context extends TProperties, State extends TState, Key extends TSchema, Value extends TSchema, InstantiatedKey extends TSchema = TInstantiateType<Context, State, Key>, InstantiatedValue extends TSchema = TInstantiateType<Context, State, Value>> = TRecordAction<InstantiatedKey, InstantiatedValue>;
|
|
1632
|
+
export declare function RecordInstantiate<Context extends TProperties, State extends TState, Key extends TSchema, Value extends TSchema>(context: Context, state: State, key: Key, value: Value, options: TSchemaOptions): TRecordInstantiate<Context, State, Key, Value>;
|
|
1309
1633
|
type StaticPropertyKey<Key extends string, Result extends PropertyKey = (Key extends TStringKey ? string : Key extends TIntegerKey ? number : Key extends TNumberKey ? number : Key extends `^${string}$` ? TTemplateLiteralStatic<Key> : string)> = Result;
|
|
1310
|
-
type StaticRecord<Stack extends string[], Direction extends StaticDirection, Context extends TProperties, This extends TProperties, Key extends string, Value extends TSchema, StaticKey extends PropertyKey = StaticPropertyKey<Key>, StaticValue extends unknown = StaticType<Stack, Direction, Context, This, Value>, Result extends Record
|
|
1311
|
-
type TStringKey = typeof StringKey;
|
|
1312
|
-
type TIntegerKey = typeof IntegerKey;
|
|
1313
|
-
type TNumberKey = typeof NumberKey;
|
|
1314
|
-
declare const IntegerKey = "^-?(?:0|[1-9][0-9]*)$";
|
|
1315
|
-
declare const NumberKey = "^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?$";
|
|
1316
|
-
declare const StringKey = "^.*$";
|
|
1317
|
-
interface TRecord<Key extends string = string, Value extends TSchema = TSchema> extends TSchema {
|
|
1634
|
+
export type StaticRecord<Stack extends string[], Direction extends StaticDirection, Context extends TProperties, This extends TProperties, Key extends string, Value extends TSchema, StaticKey extends PropertyKey = StaticPropertyKey<Key>, StaticValue extends unknown = StaticType<Stack, Direction, Context, This, Value>, Result extends Record<PropertyKey, unknown> = Record<StaticKey, StaticValue>> = Result;
|
|
1635
|
+
export type TStringKey = typeof StringKey;
|
|
1636
|
+
export type TIntegerKey = typeof IntegerKey;
|
|
1637
|
+
export type TNumberKey = typeof NumberKey;
|
|
1638
|
+
export declare const IntegerKey = "^-?(?:0|[1-9][0-9]*)$";
|
|
1639
|
+
export declare const NumberKey = "^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?$";
|
|
1640
|
+
export declare const StringKey = "^.*$";
|
|
1641
|
+
export interface TRecord<Key extends string = string, Value extends TSchema = TSchema> extends TSchema {
|
|
1318
1642
|
'~kind': 'Record';
|
|
1319
1643
|
type: 'object';
|
|
1320
1644
|
patternProperties: { [_ in Key]: Value; };
|
|
1321
1645
|
}
|
|
1322
1646
|
/** Represents a deferred Record action. */
|
|
1323
|
-
type TRecordDeferred<Key extends TSchema = TSchema, Value extends TSchema = TSchema> = (TDeferred<'Record', [Key, Value]>);
|
|
1647
|
+
export type TRecordDeferred<Key extends TSchema = TSchema, Value extends TSchema = TSchema> = (TDeferred<'Record', [Key, Value]>);
|
|
1324
1648
|
/** Represents a deferred Record action. */
|
|
1325
|
-
declare function RecordDeferred<Key extends TSchema, Value extends TSchema>(key: Key, value: Value, options?: TObjectOptions): TRecordDeferred<Key, Value>;
|
|
1649
|
+
export declare function RecordDeferred<Key extends TSchema, Value extends TSchema>(key: Key, value: Value, options?: TObjectOptions): TRecordDeferred<Key, Value>;
|
|
1326
1650
|
/** Creates a Record type. */
|
|
1327
1651
|
declare function Record$1<Key extends TSchema, Value extends TSchema>(key: Key, value: Value, options?: TObjectOptions): TRecordAction<Key, Value>;
|
|
1328
1652
|
/** Creates a Record type from regular expression pattern. */
|
|
1329
|
-
declare function RecordFromPattern<Pattern extends string, Value extends TSchema>(pattern: Pattern, value: Value): TRecord<Pattern, Value>;
|
|
1653
|
+
export declare function RecordFromPattern<Pattern extends string, Value extends TSchema>(pattern: Pattern, value: Value): TRecord<Pattern, Value>;
|
|
1330
1654
|
/** Transforms a Record Pattern to a Type */
|
|
1331
|
-
type TRecordPatternToType<Pattern extends string, Result extends TSchema = (Pattern extends typeof StringKey ? TString$1 : Pattern extends typeof IntegerKey ? TInteger$1 : Pattern extends typeof NumberKey ? TNumber$1 : TTemplateLiteralDecodeUnsafe<Pattern>)> = Result;
|
|
1655
|
+
export type TRecordPatternToType<Pattern extends string, Result extends TSchema = (Pattern extends typeof StringKey ? TString$1 : Pattern extends typeof IntegerKey ? TInteger$1 : Pattern extends typeof NumberKey ? TNumber$1 : TTemplateLiteralDecodeUnsafe<Pattern>)> = Result;
|
|
1332
1656
|
/** Transforms a Record Pattern to a Type */
|
|
1333
|
-
declare function RecordPatternToType<Pattern extends string>(pattern: Pattern): TRecordPatternToType<Pattern>;
|
|
1657
|
+
export declare function RecordPatternToType<Pattern extends string>(pattern: Pattern): TRecordPatternToType<Pattern>;
|
|
1334
1658
|
/** Extracts the Pattern from a Record type */
|
|
1335
|
-
type TRecordPattern<Type extends TRecord, Result extends string = Extract<keyof Type['patternProperties'], string>> = Result;
|
|
1659
|
+
export type TRecordPattern<Type extends TRecord, Result extends string = Extract<keyof Type['patternProperties'], string>> = Result;
|
|
1336
1660
|
/** Extracts the Pattern from a Record type */
|
|
1337
|
-
declare function RecordPattern<Type extends TRecord>(type: Type): TRecordPattern<Type>;
|
|
1661
|
+
export declare function RecordPattern<Type extends TRecord>(type: Type): TRecordPattern<Type>;
|
|
1338
1662
|
/** Extracts the Key from a Record type */
|
|
1339
|
-
type TRecordKey<Type extends TRecord, Pattern extends string = TRecordPattern<Type>, Result extends TSchema = TRecordPatternToType<Pattern>> = Result;
|
|
1663
|
+
export type TRecordKey<Type extends TRecord, Pattern extends string = TRecordPattern<Type>, Result extends TSchema = TRecordPatternToType<Pattern>> = Result;
|
|
1340
1664
|
/** Extracts the Key from a Record type */
|
|
1341
|
-
declare function RecordKey<Type extends TRecord>(type: Type): TRecordKey<Type>;
|
|
1665
|
+
export declare function RecordKey<Type extends TRecord>(type: Type): TRecordKey<Type>;
|
|
1342
1666
|
/** Extracts the Value from a Record type */
|
|
1343
|
-
type TRecordValue<Type extends TRecord, Result extends TSchema = Type['patternProperties'][TRecordPattern<Type>]> = Result;
|
|
1667
|
+
export type TRecordValue<Type extends TRecord, Result extends TSchema = Type['patternProperties'][TRecordPattern<Type>]> = Result;
|
|
1344
1668
|
/** Extracts the Value from a Record type */
|
|
1345
|
-
declare function RecordValue<Type extends TRecord>(type: Type): TRecordValue<Type>;
|
|
1346
|
-
declare function IsRecord(value: unknown): value is TRecord;
|
|
1347
|
-
declare function RecordOptions(type: TRecord): TObjectOptions;
|
|
1348
|
-
type StaticThis<Stack extends string[], Direction extends StaticDirection, Context extends TProperties, This extends TProperties> = (StaticType<Stack, Direction, Context, This, TObject<This>>);
|
|
1669
|
+
export declare function RecordValue<Type extends TRecord>(type: Type): TRecordValue<Type>;
|
|
1670
|
+
export declare function IsRecord(value: unknown): value is TRecord;
|
|
1671
|
+
export declare function RecordOptions(type: TRecord): TObjectOptions;
|
|
1672
|
+
export type StaticThis<Stack extends string[], Direction extends StaticDirection, Context extends TProperties, This extends TProperties> = (StaticType<Stack, Direction, Context, This, TObject<This>>);
|
|
1349
1673
|
/** Represents a This type. */
|
|
1350
|
-
interface TThis extends TSchema {
|
|
1674
|
+
export interface TThis extends TSchema {
|
|
1351
1675
|
'~kind': 'This';
|
|
1352
1676
|
$ref: '#';
|
|
1353
1677
|
}
|
|
1354
1678
|
/** Creates a This type. */
|
|
1355
|
-
declare function This(options?: TSchemaOptions): TThis;
|
|
1679
|
+
export declare function This(options?: TSchemaOptions): TThis;
|
|
1356
1680
|
/** Returns true if the given value is TThis. */
|
|
1357
|
-
declare function IsThis(value: unknown): value is TThis;
|
|
1358
|
-
declare
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
declare const
|
|
1362
|
-
|
|
1681
|
+
export declare function IsThis(value: unknown): value is TThis;
|
|
1682
|
+
declare namespace index_d_exports$2 {
|
|
1683
|
+
export { Any, _Array_ as Array, ArrayOptions, BigInt$1 as BigInt, BigIntPattern, Boolean, Call, CallConstruct, Codec, Constructor, ConstructorOptions, Cyclic, CyclicOptions, Decode, DecodeBuilder, Deferred, Dependent$1 as Dependent, DependentOptions, Encode, EncodeBuilder, Enum, _Function_ as Function, FunctionOptions, Generic, Identifier, Immutable, Infer, Integer$1 as Integer, IntegerKey, IntegerPattern, Intersect, IntersectOptions, InvalidLiteralValue, IsAny, IsArray, IsBigInt, IsBoolean, IsCall, IsCodec, IsConstructor, IsCyclic, IsDeferred, IsDependent, IsEnum, IsEnumValue, IsFunction, IsGeneric, IsIdentifier, IsImmutable, IsInfer, IsInteger, IsIntersect, IsKind, IsLiteral, IsLiteralBigInt, IsLiteralBoolean, IsLiteralNumber, IsLiteralString, IsLiteralValue, IsNever, IsNull, IsNumber, IsObject, IsOptional, IsParameter, IsReadonly, IsRecord, IsRef, IsRefine, IsRefinement, IsRest, IsSchema, IsString, IsSymbol, IsTemplateLiteral, IsTemplateLiteralDeferred, IsThis, IsTuple, IsUndefined, IsUnion, IsUnknown, IsUnsafe, IsVoid, Literal, LiteralTypeName, Never, NeverPattern, Null, Number$1 as Number, NumberKey, NumberPattern, _Object_$1 as Object, ObjectOptions, Optional, Parameter$1 as Parameter, PropertyKeys, PropertyValues, Readonly$2 as Readonly, Record$1 as Record, RecordDeferred, RecordFromPattern, RecordKey, RecordOptions, RecordPattern, RecordPatternToType, RecordValue, Ref, Refine, RefineAdd, RequiredArray, Rest, Static, StaticAny, StaticArray, StaticBigInt, StaticBoolean, StaticCodec, StaticConstructor, StaticCyclic, StaticDecode, StaticDependent, StaticDirection, StaticEncode, StaticEnum, StaticEvaluate, StaticFunction, StaticInstantiatedParameters, StaticInteger, StaticIntersect, StaticLiteral, StaticNever, StaticNull, StaticNumber, StaticObject, StaticParse, StaticProperties, StaticRecord, StaticRef, StaticString, StaticSymbol, StaticTemplateLiteral, StaticThis, StaticTuple, StaticType, StaticUndefined, StaticUnion, StaticUnknown, StaticUnsafe, StaticVoid, String$1 as String, StringKey, StringPattern, Symbol, TAny, TArray, TArrayOptions, TBigInt$1 as TBigInt, TBoolean, TCall, TCallConstruct, TCodec, TConstructor, TCyclic, TDecodeCallback, TDeferred, TDependent$1 as TDependent, TEncodeCallback, TEnum, TEnumValue, TFormat, TFunction, TGeneric, TIdentifier, TImmutable, TInfer, TInteger$1 as TInteger, TIntegerKey, TIntersect, TIntersectOptions, TLiteral, TLiteralTypeName, TLiteralValue, TNever, TNull, TNumber$1 as TNumber, TNumberKey, TNumberOptions, TObject, TObjectOptions, TOptional, TParameter$1 as TParameter, TProperties, TPropertyKeys, TPropertyValues, TReadonly$1 as TReadonly, TRecord, TRecordDeferred, TRecordKey, TRecordPattern, TRecordPatternToType, TRecordValue, TRef, TRefine, TRefineAdd, TRefineCheckCallback, TRefineErrorCallback, TRefinement, TRequiredArray, TRest, TSchema, TSchemaOptions, TStaticElements, TString$1 as TString, TStringKey, TStringOptions, TSymbol, TTemplateLiteral, TTemplateLiteralDeferred, TTemplateLiteralFromString, TTemplateLiteralFromTypes, TThis, TTuple, TTupleOptions, TUndefined, TUnion, TUnknown, TUnsafe, TVoid, TemplateLiteral, TemplateLiteralDeferred, TemplateLiteralFromString, TemplateLiteralFromTypes, This, Tuple, TupleOptions, Undefined, Union, UnionOptions, Unknown, Unsafe, Void, _Array_, _Function_, _Object_$1 as _Object_ };
|
|
1684
|
+
}
|
|
1685
|
+
export declare const CompareResultEqual = 0;
|
|
1686
|
+
export declare const CompareResultDisjoint = 1;
|
|
1687
|
+
export declare const CompareResultLeftInside = 2;
|
|
1688
|
+
export declare const CompareResultRightInside = 3;
|
|
1689
|
+
export type TCompareResult = (typeof CompareResultEqual | typeof CompareResultDisjoint | typeof CompareResultLeftInside | typeof CompareResultRightInside);
|
|
1363
1690
|
/** Compares left and right types and determines their set relationship */
|
|
1364
|
-
type TCompare<Left extends TSchema, Right extends TSchema, Extends extends [TResult, TResult] = [TExtends<{}, Left, Right>, TExtends<{}, Right, Left>]> = (Extends extends [TExtendsTrueLike, TExtendsTrueLike] ? typeof CompareResultEqual : Extends extends [TExtendsTrueLike, TExtendsFalse] ? typeof CompareResultLeftInside : Extends extends [TExtendsFalse, TExtendsTrueLike] ? typeof CompareResultRightInside : typeof CompareResultDisjoint);
|
|
1691
|
+
export type TCompare<Left extends TSchema, Right extends TSchema, Extends extends [TResult, TResult] = [TExtends<{}, Left, Right>, TExtends<{}, Right, Left>]> = (Extends extends [TExtendsTrueLike, TExtendsTrueLike] ? typeof CompareResultEqual : Extends extends [TExtendsTrueLike, TExtendsFalse] ? typeof CompareResultLeftInside : Extends extends [TExtendsFalse, TExtendsTrueLike] ? typeof CompareResultRightInside : typeof CompareResultDisjoint);
|
|
1365
1692
|
/** Compares left and right types and determines their set relationship. */
|
|
1366
|
-
declare function Compare<Left extends TSchema, Right extends TSchema>(left: Left, right: Right): TCompare<Left, Right>;
|
|
1693
|
+
export declare function Compare<Left extends TSchema, Right extends TSchema>(left: Left, right: Right): TCompare<Left, Right>;
|
|
1367
1694
|
type TBroadenFilter<Type extends TSchema, Types extends TSchema[], Result extends TSchema[] = [], All extends TSchema[] = Types> = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? TCompare<Type, Left> extends typeof CompareResultLeftInside | typeof CompareResultEqual ? All : TCompare<Type, Left> extends typeof CompareResultDisjoint ? TBroadenFilter<Type, Right, [...Result, Left], All> : TBroadenFilter<Type, Right, Result, All> : [...Result, Type]);
|
|
1368
1695
|
type TBroadenType<Type extends TSchema, Types extends TSchema[], Result extends TSchema[], Evaluated extends TSchema = TEvaluateType<Type>> = (Evaluated extends TAny ? [Evaluated] : Evaluated extends TUnknown ? [Evaluated] : Evaluated extends TNever ? TBroadenTypes<Types, Result> : Evaluated extends TObject ? TBroadenTypes<Types, [...Result, Evaluated]> : TBroadenTypes<Types, TBroadenFilter<Evaluated, Result>>);
|
|
1369
1696
|
type TBroadenTypes<Types extends TSchema[], Result extends TSchema[] = []> = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? TBroadenType<Left, Right, Result> : Result);
|
|
1370
|
-
type TBroaden<Types extends TSchema[], Broadened extends TSchema[] = TBroadenTypes<Types>, Flattened extends TSchema[] = TFlatten<Broadened>> = Flattened;
|
|
1697
|
+
export type TBroaden<Types extends TSchema[], Broadened extends TSchema[] = TBroadenTypes<Types>, Flattened extends TSchema[] = TFlatten<Broadened>> = Flattened;
|
|
1371
1698
|
/** Broadens a set of types and returns either the most broad type, or union or disjoint types. */
|
|
1372
|
-
declare function Broaden<Types extends TSchema[]>(types: [...Types]): TBroaden<Types>;
|
|
1373
|
-
type TEvaluateAction<Type extends TSchema, Result extends TSchema = TEvaluateType<Type>> = Result;
|
|
1374
|
-
declare function EvaluateAction<Type extends TSchema>(type: Type, options: TSchemaOptions): TEvaluateAction<Type>;
|
|
1375
|
-
type TEvaluateInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, InstantiatedType extends TSchema = TInstantiateType<Context, State, Type>> = TEvaluateAction<InstantiatedType>;
|
|
1376
|
-
declare function EvaluateInstantiate<Context extends TProperties, State extends TState, Type extends TSchema>(context: Context, state: State, type: Type, options: TSchemaOptions): TEvaluateInstantiate<Context, State, Type>;
|
|
1699
|
+
export declare function Broaden<Types extends TSchema[]>(types: [...Types]): TBroaden<Types>;
|
|
1700
|
+
export type TEvaluateAction<Type extends TSchema, Result extends TSchema = TEvaluateType<Type>> = Result;
|
|
1701
|
+
export declare function EvaluateAction<Type extends TSchema>(type: Type, options: TSchemaOptions): TEvaluateAction<Type>;
|
|
1702
|
+
export type TEvaluateInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, InstantiatedType extends TSchema = TInstantiateType<Context, State, Type>> = TEvaluateAction<InstantiatedType>;
|
|
1703
|
+
export declare function EvaluateInstantiate<Context extends TProperties, State extends TState, Type extends TSchema>(context: Context, state: State, type: Type, options: TSchemaOptions): TEvaluateInstantiate<Context, State, Type>;
|
|
1377
1704
|
type TCollectDistributionNames<Expression extends TSchema, Result extends string[] = []> = (Expression extends TDeferred<'Conditional', [infer Left extends TSchema, infer _Right extends TSchema, infer True extends TSchema, infer False extends TSchema]> ? Left extends TRef ? TCollectDistributionNames<True, TCollectDistributionNames<False, [...Result, Left['$ref']]>> : TCollectDistributionNames<True, TCollectDistributionNames<False, Result>> : Expression extends TDeferred<'Mapped', [infer _Identifier extends TSchema, infer Type extends TSchema, infer _As extends TSchema, infer _Property extends TSchema]> ? (Type extends TDeferred<'KeyOf', [infer Ref extends TRef]> ? [...Result, Ref['$ref']] : Result) : Result);
|
|
1378
1705
|
type TBuildDistributionArray<Parameters extends TParameter$1[], Names extends string[], Result extends boolean[] = []> = (Parameters extends [infer Left extends TParameter$1, ...infer Right extends TParameter$1[]] ? Left['name'] extends Names[number] ? TBuildDistributionArray<Right, Names, [...Result, true]> : TBuildDistributionArray<Right, Names, [...Result, false]> : Result);
|
|
1379
1706
|
type TZipDistributionArray<Arguments extends TSchema[], DistributionArray extends boolean[], Result extends [boolean, TSchema][] = []> = (Arguments extends [infer ArgumentLeft extends TSchema, ...infer ArgumentRight extends TSchema[]] ? DistributionArray extends [infer BooleanLeft extends boolean, ...infer BooleanRight extends boolean[]] ? TZipDistributionArray<ArgumentRight, BooleanRight, [...Result, [BooleanLeft, ArgumentLeft]]> : Result : Result);
|
|
@@ -1401,18 +1728,18 @@ type TCallDistributed<Context extends TProperties, State extends TState, Target
|
|
|
1401
1728
|
type TCallImmediate<Context extends TProperties, State extends TState, Target extends TRef, Parameters extends TParameter$1[], Expression extends TSchema, InstantiatedArguments extends TSchema[], DistributedArguments extends TSchema[][] = TDistributeArguments<Parameters, InstantiatedArguments, Expression>, ReturnTypes extends TSchema[] = TCallDistributed<Context, State, Target, Parameters, Expression, DistributedArguments>, Result extends TSchema = ReturnTypes['length'] extends 1 ? ReturnTypes[0] : TEvaluateUnion<ReturnTypes>> = Result;
|
|
1402
1729
|
type TCallInstantiate<Context extends TProperties, State extends TState, Target extends TSchema, Arguments extends TSchema[], InstantiatedArguments extends TSchema[] = TInstantiateTypes<Context, State, Arguments>, Resolved extends [string, TSchema] = TResolveTarget<Context, Target, Arguments>, Name extends string = Resolved[0], Type extends TSchema = Resolved[1], Result extends TSchema = (Type extends TGeneric<infer Parameters extends TParameter$1[], infer Expression extends TSchema> ? TIsTailCall<State, Name> extends true ? TCallConstruct<TRef<Name>, InstantiatedArguments> : TCallImmediate<Context, State, TRef<Name>, Parameters, Expression, InstantiatedArguments> : TCallConstruct<Target, InstantiatedArguments>)> = Result;
|
|
1403
1730
|
/** Represents a deferred generic Call */
|
|
1404
|
-
interface TCall<Target extends TSchema = TSchema, Arguments extends TSchema[] = TSchema[]> extends TSchema {
|
|
1731
|
+
export interface TCall<Target extends TSchema = TSchema, Arguments extends TSchema[] = TSchema[]> extends TSchema {
|
|
1405
1732
|
'~kind': 'Call';
|
|
1406
1733
|
type: 'call';
|
|
1407
1734
|
target: Target;
|
|
1408
1735
|
arguments: Arguments;
|
|
1409
1736
|
}
|
|
1410
|
-
type TCallConstruct<Target extends TSchema, Arguments extends TSchema[], Result extends TSchema = TCall<Target, Arguments>> = Result;
|
|
1411
|
-
declare function CallConstruct<Target extends TSchema, Arguments extends TSchema[]>(target: Target, arguments_: [...Arguments]): TCallConstruct<Target, Arguments>;
|
|
1737
|
+
export type TCallConstruct<Target extends TSchema, Arguments extends TSchema[], Result extends TSchema = TCall<Target, Arguments>> = Result;
|
|
1738
|
+
export declare function CallConstruct<Target extends TSchema, Arguments extends TSchema[]>(target: Target, arguments_: [...Arguments]): TCallConstruct<Target, Arguments>;
|
|
1412
1739
|
/** Creates a Call type. */
|
|
1413
|
-
declare function Call<Target extends TSchema, Arguments extends TSchema[]>(target: Target, arguments_: [...Arguments]): TCallInstantiate<{}, TState<[], []>, Target, Arguments>;
|
|
1740
|
+
export declare function Call<Target extends TSchema, Arguments extends TSchema[]>(target: Target, arguments_: [...Arguments]): TCallInstantiate<{}, TState<[], []>, Target, Arguments>;
|
|
1414
1741
|
/** Returns true if the given type is a TCall. */
|
|
1415
|
-
declare function IsCall(value: unknown): value is TCall;
|
|
1742
|
+
export declare function IsCall(value: unknown): value is TCall;
|
|
1416
1743
|
type TRemoveImmutableOperation<Type extends TSchema, Result extends TSchema = Type extends TImmutable<infer Type extends TSchema> ? TRemoveImmutableOperation<Type> : Type> = Result;
|
|
1417
1744
|
type TRemoveImmutableAction<Type extends TSchema, Result extends TSchema = TRemoveImmutableOperation<Type>> = Result;
|
|
1418
1745
|
type TRemoveImmutableInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, InstantiateType extends TSchema = TInstantiateType<Context, State, Type>> = TRemoveImmutableAction<InstantiateType>;
|
|
@@ -1428,35 +1755,35 @@ type TFromTemplateLiteral$2<Mapping extends TMappingType, Pattern extends string
|
|
|
1428
1755
|
type TFromUnion$6<Mapping extends TMappingType, Types extends TSchema[], Result extends TSchema[] = []> = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? TFromUnion$6<Mapping, Right, [...Result, TFromType$11<Mapping, Left>]> : TUnion<Result>);
|
|
1429
1756
|
type TFromType$11<Mapping extends TMappingType, Type extends TSchema> = (Type extends TLiteral<infer Value extends TLiteralValue> ? TFromLiteral$2<Mapping, Value> : Type extends TTemplateLiteral<infer Pattern extends string> ? TFromTemplateLiteral$2<Mapping, Pattern> : Type extends TUnion<infer Types extends TSchema[]> ? TFromUnion$6<Mapping, Types> : Type);
|
|
1430
1757
|
/** Creates a deferred Capitalize action. */
|
|
1431
|
-
type TCapitalizeDeferred<Type extends TSchema> = (TDeferred<'Capitalize', [Type]>);
|
|
1758
|
+
export type TCapitalizeDeferred<Type extends TSchema> = (TDeferred<'Capitalize', [Type]>);
|
|
1432
1759
|
/** Creates a deferred Capitalize action. */
|
|
1433
|
-
declare function CapitalizeDeferred<Type extends TSchema>(type: Type, options?: TSchemaOptions): TCapitalizeDeferred<Type>;
|
|
1760
|
+
export declare function CapitalizeDeferred<Type extends TSchema>(type: Type, options?: TSchemaOptions): TCapitalizeDeferred<Type>;
|
|
1434
1761
|
/** Applies a Capitalize action to the given type. */
|
|
1435
|
-
type TCapitalize<Type extends TSchema> = (TCapitalizeAction<Type>);
|
|
1762
|
+
export type TCapitalize<Type extends TSchema> = (TCapitalizeAction<Type>);
|
|
1436
1763
|
/** Applies a Capitalize action to the given type. */
|
|
1437
1764
|
declare function Capitalize$1<Type extends TSchema>(type: Type, options?: TSchemaOptions): TCapitalize<Type>;
|
|
1438
1765
|
/** Creates a deferred Lowercase action. */
|
|
1439
|
-
type TLowercaseDeferred<Type extends TSchema> = (TDeferred<'Lowercase', [Type]>);
|
|
1766
|
+
export type TLowercaseDeferred<Type extends TSchema> = (TDeferred<'Lowercase', [Type]>);
|
|
1440
1767
|
/** Creates a deferred Lowercase action. */
|
|
1441
|
-
declare function LowercaseDeferred<Type extends TSchema>(type: Type, options?: TSchemaOptions): TLowercaseDeferred<Type>;
|
|
1768
|
+
export declare function LowercaseDeferred<Type extends TSchema>(type: Type, options?: TSchemaOptions): TLowercaseDeferred<Type>;
|
|
1442
1769
|
/** Applies a Lowercase action to the given type. */
|
|
1443
|
-
type TLowercase<Type extends TSchema> = (TLowercaseAction<Type>);
|
|
1770
|
+
export type TLowercase<Type extends TSchema> = (TLowercaseAction<Type>);
|
|
1444
1771
|
/** Applies a Lowercase action to the given type. */
|
|
1445
1772
|
declare function Lowercase$1<Type extends TSchema>(type: Type, options?: TSchemaOptions): TLowercase<Type>;
|
|
1446
1773
|
/** Creates a deferred Uncapitalize action. */
|
|
1447
|
-
type TUncapitalizeDeferred<Type extends TSchema> = (TDeferred<'Uncapitalize', [Type]>);
|
|
1774
|
+
export type TUncapitalizeDeferred<Type extends TSchema> = (TDeferred<'Uncapitalize', [Type]>);
|
|
1448
1775
|
/** Creates a deferred Uncapitalize action. */
|
|
1449
|
-
declare function UncapitalizeDeferred<Type extends TSchema>(type: Type, options?: TSchemaOptions): TUncapitalizeDeferred<Type>;
|
|
1776
|
+
export declare function UncapitalizeDeferred<Type extends TSchema>(type: Type, options?: TSchemaOptions): TUncapitalizeDeferred<Type>;
|
|
1450
1777
|
/** Applies a Uncapitalize action to the given type. */
|
|
1451
|
-
type TUncapitalize<Type extends TSchema> = (TUncapitalizeAction<Type>);
|
|
1778
|
+
export type TUncapitalize<Type extends TSchema> = (TUncapitalizeAction<Type>);
|
|
1452
1779
|
/** Applies a Uncapitalize action to the given type. */
|
|
1453
1780
|
declare function Uncapitalize$1<Type extends TSchema>(type: Type, options?: TSchemaOptions): TUncapitalize<Type>;
|
|
1454
1781
|
/** Creates a deferred Uppercase action. */
|
|
1455
|
-
type TUppercaseDeferred<Type extends TSchema> = (TDeferred<'Uppercase', [Type]>);
|
|
1782
|
+
export type TUppercaseDeferred<Type extends TSchema> = (TDeferred<'Uppercase', [Type]>);
|
|
1456
1783
|
/** Creates a deferred Uppercase action. */
|
|
1457
|
-
declare function UppercaseDeferred<Type extends TSchema>(type: Type, options?: TSchemaOptions): TUppercaseDeferred<Type>;
|
|
1784
|
+
export declare function UppercaseDeferred<Type extends TSchema>(type: Type, options?: TSchemaOptions): TUppercaseDeferred<Type>;
|
|
1458
1785
|
/** Applies a Uppercase action to the given type. */
|
|
1459
|
-
type TUppercase<Type extends TSchema> = (TUppercaseAction<Type>);
|
|
1786
|
+
export type TUppercase<Type extends TSchema> = (TUppercaseAction<Type>);
|
|
1460
1787
|
/** Applies a Uppercase action to the given type. */
|
|
1461
1788
|
declare function Uppercase$1<Type extends TSchema>(type: Type, options?: TSchemaOptions): TUppercase<Type>;
|
|
1462
1789
|
interface TCapitalizeMapping extends TMappingType {
|
|
@@ -1471,88 +1798,88 @@ interface TUncapitalizeMapping extends TMappingType {
|
|
|
1471
1798
|
interface TUppercaseMapping extends TMappingType {
|
|
1472
1799
|
output: Uppercase<this['input']>;
|
|
1473
1800
|
}
|
|
1474
|
-
type TCapitalizeAction<Type extends TSchema, Result extends TSchema = TCanInstantiate<[Type]> extends true ? TFromType$11<TCapitalizeMapping, Type> : TCapitalizeDeferred<Type>> = Result;
|
|
1475
|
-
declare function CapitalizeAction<Type extends TSchema>(type: Type, options: TSchemaOptions): TCapitalizeAction<Type>;
|
|
1476
|
-
type TLowercaseAction<Type extends TSchema, Result extends TSchema = TCanInstantiate<[Type]> extends true ? TFromType$11<TLowercaseMapping, Type> : TLowercaseDeferred<Type>> = Result;
|
|
1477
|
-
declare function LowercaseAction<Type extends TSchema>(type: Type, options: TSchemaOptions): TLowercaseAction<Type>;
|
|
1478
|
-
type TUncapitalizeAction<Type extends TSchema, Result extends TSchema = TCanInstantiate<[Type]> extends true ? TFromType$11<TUncapitalizeMapping, Type> : TUncapitalizeDeferred<Type>> = Result;
|
|
1479
|
-
declare function UncapitalizeAction<Type extends TSchema>(type: Type, options: TSchemaOptions): TUncapitalizeAction<Type>;
|
|
1480
|
-
type TUppercaseAction<Type extends TSchema, Result extends TSchema = TCanInstantiate<[Type]> extends true ? TFromType$11<TUppercaseMapping, Type> : TUppercaseDeferred<Type>> = Result;
|
|
1481
|
-
declare function UppercaseAction<Type extends TSchema>(type: Type, options: TSchemaOptions): TUppercaseAction<Type>;
|
|
1482
|
-
type TCapitalizeInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, InstantiatedType extends TSchema = TInstantiateType<Context, State, Type>> = TCapitalizeAction<InstantiatedType>;
|
|
1483
|
-
declare function CapitalizeInstantiate<Context extends TProperties, State extends TState, Type extends TSchema>(context: Context, state: State, type: Type, options: TSchemaOptions): TCapitalizeInstantiate<Context, State, Type>;
|
|
1484
|
-
type TLowercaseInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, InstantiatedType extends TSchema = TInstantiateType<Context, State, Type>> = TLowercaseAction<InstantiatedType>;
|
|
1485
|
-
declare function LowercaseInstantiate<Context extends TProperties, State extends TState, Type extends TSchema>(context: Context, state: State, type: Type, options: TSchemaOptions): TLowercaseInstantiate<Context, State, Type>;
|
|
1486
|
-
type TUncapitalizeInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, InstantiatedType extends TSchema = TInstantiateType<Context, State, Type>> = TUncapitalizeAction<InstantiatedType>;
|
|
1487
|
-
declare function UncapitalizeInstantiate<Context extends TProperties, State extends TState, Type extends TSchema>(context: Context, state: State, type: Type, options: TSchemaOptions): TUncapitalizeInstantiate<Context, State, Type>;
|
|
1488
|
-
type TUppercaseInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, InstantiatedType extends TSchema = TInstantiateType<Context, State, Type>> = TUppercaseAction<InstantiatedType>;
|
|
1489
|
-
declare function UppercaseInstantiate<Context extends TProperties, State extends TState, Type extends TSchema>(context: Context, state: State, type: Type, options: TSchemaOptions): TUppercaseInstantiate<Context, State, Type>;
|
|
1801
|
+
export type TCapitalizeAction<Type extends TSchema, Result extends TSchema = TCanInstantiate<[Type]> extends true ? TFromType$11<TCapitalizeMapping, Type> : TCapitalizeDeferred<Type>> = Result;
|
|
1802
|
+
export declare function CapitalizeAction<Type extends TSchema>(type: Type, options: TSchemaOptions): TCapitalizeAction<Type>;
|
|
1803
|
+
export type TLowercaseAction<Type extends TSchema, Result extends TSchema = TCanInstantiate<[Type]> extends true ? TFromType$11<TLowercaseMapping, Type> : TLowercaseDeferred<Type>> = Result;
|
|
1804
|
+
export declare function LowercaseAction<Type extends TSchema>(type: Type, options: TSchemaOptions): TLowercaseAction<Type>;
|
|
1805
|
+
export type TUncapitalizeAction<Type extends TSchema, Result extends TSchema = TCanInstantiate<[Type]> extends true ? TFromType$11<TUncapitalizeMapping, Type> : TUncapitalizeDeferred<Type>> = Result;
|
|
1806
|
+
export declare function UncapitalizeAction<Type extends TSchema>(type: Type, options: TSchemaOptions): TUncapitalizeAction<Type>;
|
|
1807
|
+
export type TUppercaseAction<Type extends TSchema, Result extends TSchema = TCanInstantiate<[Type]> extends true ? TFromType$11<TUppercaseMapping, Type> : TUppercaseDeferred<Type>> = Result;
|
|
1808
|
+
export declare function UppercaseAction<Type extends TSchema>(type: Type, options: TSchemaOptions): TUppercaseAction<Type>;
|
|
1809
|
+
export type TCapitalizeInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, InstantiatedType extends TSchema = TInstantiateType<Context, State, Type>> = TCapitalizeAction<InstantiatedType>;
|
|
1810
|
+
export declare function CapitalizeInstantiate<Context extends TProperties, State extends TState, Type extends TSchema>(context: Context, state: State, type: Type, options: TSchemaOptions): TCapitalizeInstantiate<Context, State, Type>;
|
|
1811
|
+
export type TLowercaseInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, InstantiatedType extends TSchema = TInstantiateType<Context, State, Type>> = TLowercaseAction<InstantiatedType>;
|
|
1812
|
+
export declare function LowercaseInstantiate<Context extends TProperties, State extends TState, Type extends TSchema>(context: Context, state: State, type: Type, options: TSchemaOptions): TLowercaseInstantiate<Context, State, Type>;
|
|
1813
|
+
export type TUncapitalizeInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, InstantiatedType extends TSchema = TInstantiateType<Context, State, Type>> = TUncapitalizeAction<InstantiatedType>;
|
|
1814
|
+
export declare function UncapitalizeInstantiate<Context extends TProperties, State extends TState, Type extends TSchema>(context: Context, state: State, type: Type, options: TSchemaOptions): TUncapitalizeInstantiate<Context, State, Type>;
|
|
1815
|
+
export type TUppercaseInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, InstantiatedType extends TSchema = TInstantiateType<Context, State, Type>> = TUppercaseAction<InstantiatedType>;
|
|
1816
|
+
export declare function UppercaseInstantiate<Context extends TProperties, State extends TState, Type extends TSchema>(context: Context, state: State, type: Type, options: TSchemaOptions): TUppercaseInstantiate<Context, State, Type>;
|
|
1490
1817
|
/** Creates a deferred Conditional action. */
|
|
1491
|
-
type TConditionalDeferred<Left extends TSchema, Right extends TSchema, True extends TSchema, False extends TSchema> = (TDeferred<'Conditional', [Left, Right, True, False]>);
|
|
1818
|
+
export type TConditionalDeferred<Left extends TSchema, Right extends TSchema, True extends TSchema, False extends TSchema> = (TDeferred<'Conditional', [Left, Right, True, False]>);
|
|
1492
1819
|
/** Creates a deferred Conditional action. */
|
|
1493
|
-
declare function ConditionalDeferred<Left extends TSchema, Right extends TSchema, True extends TSchema, False extends TSchema>(left: Left, right: Right, true_: True, false_: False, options?: TSchemaOptions): TConditionalDeferred<Left, Right, True, False>;
|
|
1820
|
+
export declare function ConditionalDeferred<Left extends TSchema, Right extends TSchema, True extends TSchema, False extends TSchema>(left: Left, right: Right, true_: True, false_: False, options?: TSchemaOptions): TConditionalDeferred<Left, Right, True, False>;
|
|
1494
1821
|
/** Applies a Conditional action to the given types. */
|
|
1495
|
-
type TConditional<Left extends TSchema, Right extends TSchema, True extends TSchema, False extends TSchema> = (TConditionalAction<{}, TState<[], []>, Left, Right, True, False>);
|
|
1822
|
+
export type TConditional<Left extends TSchema, Right extends TSchema, True extends TSchema, False extends TSchema> = (TConditionalAction<{}, TState<[], []>, Left, Right, True, False>);
|
|
1496
1823
|
/** Applies a Conditional action to the given types. */
|
|
1497
|
-
declare function Conditional<Left extends TSchema, Right extends TSchema, True extends TSchema, False extends TSchema>(left: Left, right: Right, true_: True, false_: False, options?: TSchemaOptions): TConditional<Left, Right, True, False>;
|
|
1498
|
-
type TConditionalOperation<Context extends TProperties, State extends TState, Left extends TSchema, Right extends TSchema, True extends TSchema, False extends TSchema, ExtendsResult extends
|
|
1499
|
-
type TConditionalAction<Context extends TProperties, State extends TState, Left extends TSchema, Right extends TSchema, True extends TSchema, False extends TSchema, Result extends TSchema = TCanInstantiate<[Left, Right]> extends true ? TConditionalOperation<Context, State, Left, Right, True, False> : TConditionalDeferred<Left, Right, True, False>> = Result;
|
|
1500
|
-
declare function ConditionalAction<Context extends TProperties, State extends TState, Left extends TSchema, Right extends TSchema, True extends TSchema, False extends TSchema>(context: Context, state: State, left: Left, right: Right, true_: True, false_: False, options: TSchemaOptions): TConditionalAction<Context, State, Left, Right, True, False>;
|
|
1501
|
-
type TConditionalInstantiate<Context extends TProperties, State extends TState, Left extends TSchema, Right extends TSchema, True extends TSchema, False extends TSchema, InstaniatedLeft extends TSchema = TInstantiateType<Context, State, Left>, InstaniatedRight extends TSchema = TInstantiateType<Context, State, Right>> = TConditionalAction<Context, State, InstaniatedLeft, InstaniatedRight, True, False>;
|
|
1502
|
-
declare function ConditionalInstantiate<Context extends TProperties, State extends TState, Left extends TSchema, Right extends TSchema, True extends TSchema, False extends TSchema>(context: Context, state: State, left: Left, right: Right, true_: True, false_: False, options: TSchemaOptions): TConditionalInstantiate<Context, State, Left, Right, True, False>;
|
|
1824
|
+
export declare function Conditional<Left extends TSchema, Right extends TSchema, True extends TSchema, False extends TSchema>(left: Left, right: Right, true_: True, false_: False, options?: TSchemaOptions): TConditional<Left, Right, True, False>;
|
|
1825
|
+
type TConditionalOperation<Context extends TProperties, State extends TState, Left extends TSchema, Right extends TSchema, True extends TSchema, False extends TSchema, ExtendsResult extends TResult = TExtends<Context, Left, Right>> = (ExtendsResult extends TExtendsUnion$1<infer InferredContext extends TProperties> ? TUnion<[TInstantiateType<InferredContext, State, True>, TInstantiateType<Context, State, False>]> : ExtendsResult extends TExtendsTrue<infer InferredContext extends TProperties> ? TInstantiateType<InferredContext, State, True> : TInstantiateType<Context, State, False>);
|
|
1826
|
+
export type TConditionalAction<Context extends TProperties, State extends TState, Left extends TSchema, Right extends TSchema, True extends TSchema, False extends TSchema, Result extends TSchema = TCanInstantiate<[Left, Right]> extends true ? TConditionalOperation<Context, State, Left, Right, True, False> : TConditionalDeferred<Left, Right, True, False>> = Result;
|
|
1827
|
+
export declare function ConditionalAction<Context extends TProperties, State extends TState, Left extends TSchema, Right extends TSchema, True extends TSchema, False extends TSchema>(context: Context, state: State, left: Left, right: Right, true_: True, false_: False, options: TSchemaOptions): TConditionalAction<Context, State, Left, Right, True, False>;
|
|
1828
|
+
export type TConditionalInstantiate<Context extends TProperties, State extends TState, Left extends TSchema, Right extends TSchema, True extends TSchema, False extends TSchema, InstaniatedLeft extends TSchema = TInstantiateType<Context, State, Left>, InstaniatedRight extends TSchema = TInstantiateType<Context, State, Right>> = TConditionalAction<Context, State, InstaniatedLeft, InstaniatedRight, True, False>;
|
|
1829
|
+
export declare function ConditionalInstantiate<Context extends TProperties, State extends TState, Left extends TSchema, Right extends TSchema, True extends TSchema, False extends TSchema>(context: Context, state: State, left: Left, right: Right, true_: True, false_: False, options: TSchemaOptions): TConditionalInstantiate<Context, State, Left, Right, True, False>;
|
|
1503
1830
|
/** Creates a deferred ConstructorParameters action. */
|
|
1504
|
-
type TConstructorParametersDeferred<Type extends TSchema> = (TDeferred<'ConstructorParameters', [Type]>);
|
|
1831
|
+
export type TConstructorParametersDeferred<Type extends TSchema> = (TDeferred<'ConstructorParameters', [Type]>);
|
|
1505
1832
|
/** Creates a deferred ConstructorParameters action. */
|
|
1506
|
-
declare function ConstructorParametersDeferred<Type extends TSchema>(type: Type, options?: TSchemaOptions): TConstructorParametersDeferred<Type>;
|
|
1833
|
+
export declare function ConstructorParametersDeferred<Type extends TSchema>(type: Type, options?: TSchemaOptions): TConstructorParametersDeferred<Type>;
|
|
1507
1834
|
/** Applies a ConstructorParameters action to a type. */
|
|
1508
|
-
type TConstructorParameters<Type extends TSchema> = (TConstructorParametersAction<Type>);
|
|
1835
|
+
export type TConstructorParameters<Type extends TSchema> = (TConstructorParametersAction<Type>);
|
|
1509
1836
|
/** Applies a ConstructorParameters action to a type. */
|
|
1510
|
-
declare function ConstructorParameters<Type extends TSchema>(type: Type, options?: TSchemaOptions): TConstructorParameters<Type>;
|
|
1837
|
+
export declare function ConstructorParameters<Type extends TSchema>(type: Type, options?: TSchemaOptions): TConstructorParameters<Type>;
|
|
1511
1838
|
type TConstructorParametersOperation<Type extends TSchema, Parameters extends TSchema[] = Type extends TConstructor ? Type['parameters'] : [], InstantiatedParameters extends TSchema[] = TInstantiateElements<{}, TState<[], []>, Parameters>, Result extends TSchema = TTuple<InstantiatedParameters>> = Result;
|
|
1512
|
-
type TConstructorParametersAction<Type extends TSchema, Result extends TSchema = TCanInstantiate<[Type]> extends true ? TConstructorParametersOperation<Type> : TConstructorParametersDeferred<Type>> = Result;
|
|
1513
|
-
declare function ConstructorParametersAction<Type extends TSchema>(type: Type, options: TSchemaOptions): TConstructorParametersAction<Type>;
|
|
1514
|
-
type TConstructorParametersInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, InstantiatedType extends TSchema = TInstantiateType<Context, State, Type>> = TConstructorParametersAction<InstantiatedType>;
|
|
1515
|
-
declare function ConstructorParametersInstantiate<Context extends TProperties, State extends TState, Type extends TSchema>(context: Context, state: State, type: Type, options: TSchemaOptions): TConstructorParametersInstantiate<Context, State, Type>;
|
|
1839
|
+
export type TConstructorParametersAction<Type extends TSchema, Result extends TSchema = TCanInstantiate<[Type]> extends true ? TConstructorParametersOperation<Type> : TConstructorParametersDeferred<Type>> = Result;
|
|
1840
|
+
export declare function ConstructorParametersAction<Type extends TSchema>(type: Type, options: TSchemaOptions): TConstructorParametersAction<Type>;
|
|
1841
|
+
export type TConstructorParametersInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, InstantiatedType extends TSchema = TInstantiateType<Context, State, Type>> = TConstructorParametersAction<InstantiatedType>;
|
|
1842
|
+
export declare function ConstructorParametersInstantiate<Context extends TProperties, State extends TState, Type extends TSchema>(context: Context, state: State, type: Type, options: TSchemaOptions): TConstructorParametersInstantiate<Context, State, Type>;
|
|
1516
1843
|
/** Creates a deferred Exclude action. */
|
|
1517
|
-
type TExcludeDeferred<Left extends TSchema, Right extends TSchema> = (TDeferred<'Exclude', [Left, Right]>);
|
|
1844
|
+
export type TExcludeDeferred<Left extends TSchema, Right extends TSchema> = (TDeferred<'Exclude', [Left, Right]>);
|
|
1518
1845
|
/** Creates a deferred Exclude action. */
|
|
1519
|
-
declare function ExcludeDeferred<Left extends TSchema, Right extends TSchema>(left: Left, right: Right, options?: TSchemaOptions): TExcludeDeferred<Left, Right>;
|
|
1846
|
+
export declare function ExcludeDeferred<Left extends TSchema, Right extends TSchema>(left: Left, right: Right, options?: TSchemaOptions): TExcludeDeferred<Left, Right>;
|
|
1520
1847
|
/** Applies a Exclude action using the given types */
|
|
1521
|
-
type TExclude<Left extends TSchema, Right extends TSchema> = (TExcludeAction<Left, Right>);
|
|
1848
|
+
export type TExclude<Left extends TSchema, Right extends TSchema> = (TExcludeAction<Left, Right>);
|
|
1522
1849
|
/** Applies a Exclude action using the given types */
|
|
1523
1850
|
declare function Exclude$1<Left extends TSchema, Right extends TSchema>(left: Left, right: Right, options?: TSchemaOptions): TExclude<Left, Right>;
|
|
1524
|
-
type TExcludeAction<Left extends TSchema, Right extends TSchema, Result extends TSchema = TCanInstantiate<[Left, Right]> extends true ? TExcludeOperation<Left, Right> : TExcludeDeferred<Left, Right>> = Result;
|
|
1525
|
-
declare function ExcludeAction<Left extends TSchema, Right extends TSchema>(left: Left, right: Right, options: TSchemaOptions): TExcludeAction<Left, Right>;
|
|
1526
|
-
type TExcludeInstantiate<Context extends TProperties, State extends TState, Left extends TSchema, Right extends TSchema, InstantiatedLeft extends TSchema = TInstantiateType<Context, State, Left>, InstantiatedRight extends TSchema = TInstantiateType<Context, State, Right>> = TExcludeAction<InstantiatedLeft, InstantiatedRight>;
|
|
1527
|
-
declare function ExcludeInstantiate<Context extends TProperties, State extends TState, Left extends TSchema, Right extends TSchema>(context: Context, state: State, left: Left, right: Right, options: TSchemaOptions): TExcludeInstantiate<Context, State, Left, Right>;
|
|
1851
|
+
export type TExcludeAction<Left extends TSchema, Right extends TSchema, Result extends TSchema = TCanInstantiate<[Left, Right]> extends true ? TExcludeOperation<Left, Right> : TExcludeDeferred<Left, Right>> = Result;
|
|
1852
|
+
export declare function ExcludeAction<Left extends TSchema, Right extends TSchema>(left: Left, right: Right, options: TSchemaOptions): TExcludeAction<Left, Right>;
|
|
1853
|
+
export type TExcludeInstantiate<Context extends TProperties, State extends TState, Left extends TSchema, Right extends TSchema, InstantiatedLeft extends TSchema = TInstantiateType<Context, State, Left>, InstantiatedRight extends TSchema = TInstantiateType<Context, State, Right>> = TExcludeAction<InstantiatedLeft, InstantiatedRight>;
|
|
1854
|
+
export declare function ExcludeInstantiate<Context extends TProperties, State extends TState, Left extends TSchema, Right extends TSchema>(context: Context, state: State, left: Left, right: Right, options: TSchemaOptions): TExcludeInstantiate<Context, State, Left, Right>;
|
|
1528
1855
|
/** Creates a deferred Extract action. */
|
|
1529
|
-
type TExtractDeferred<Left extends TSchema, Right extends TSchema> = (TDeferred<'Extract', [Left, Right]>);
|
|
1856
|
+
export type TExtractDeferred<Left extends TSchema, Right extends TSchema> = (TDeferred<'Extract', [Left, Right]>);
|
|
1530
1857
|
/** Creates a deferred Extract action. */
|
|
1531
|
-
declare function ExtractDeferred<Left extends TSchema, Right extends TSchema>(left: Left, right: Right, options?: TSchemaOptions): TExtractDeferred<Left, Right>;
|
|
1858
|
+
export declare function ExtractDeferred<Left extends TSchema, Right extends TSchema>(left: Left, right: Right, options?: TSchemaOptions): TExtractDeferred<Left, Right>;
|
|
1532
1859
|
/** Applies an Extract action using the given types. */
|
|
1533
|
-
type TExtract<Left extends TSchema, Right extends TSchema> = (TExtractAction<Left, Right>);
|
|
1860
|
+
export type TExtract<Left extends TSchema, Right extends TSchema> = (TExtractAction<Left, Right>);
|
|
1534
1861
|
/** Applies an Extract action using the given types. */
|
|
1535
1862
|
declare function Extract$1<Left extends TSchema, Right extends TSchema>(left: Left, right: Right, options?: TSchemaOptions): TExtract<Left, Right>;
|
|
1536
1863
|
type TExtractType<Left extends TSchema, Right extends TSchema, Check extends TResult = TExtends<{}, Left, Right>, Result extends TSchema[] = Check extends TExtendsTrueLike ? [Left] : []> = Result;
|
|
1537
1864
|
type TExtractUnion<Left extends TSchema[], Right extends TSchema, Result extends TSchema[] = []> = (Left extends [infer Head extends TSchema, ...infer Tail extends TSchema[]] ? TExtractUnion<Tail, Right, [...Result, ...TExtractType<Head, Right>]> : Result);
|
|
1538
1865
|
type TExtractOperation<Left extends TSchema, Right extends TSchema, Evaluated extends TSchema = TEvaluateType<Left>, Canonical extends TSchema[] = Evaluated extends TUnion<infer Types extends TSchema[]> ? Types : [Evaluated], Remaining extends TSchema[] = TExtractUnion<Canonical, Right>, Result extends TSchema = TEvaluateUnion<Remaining>> = Result;
|
|
1539
|
-
type TExtractAction<Left extends TSchema, Right extends TSchema, Result extends TSchema = TCanInstantiate<[Left, Right]> extends true ? TExtractOperation<Left, Right> : TExtractDeferred<Left, Right>> = Result;
|
|
1540
|
-
declare function ExtractAction<Left extends TSchema, Right extends TSchema>(left: Left, right: Right, options: TSchemaOptions): TExtractAction<Left, Right>;
|
|
1541
|
-
type TExtractInstantiate<Context extends TProperties, State extends TState, Left extends TSchema, Right extends TSchema, InstantiatedLeft extends TSchema = TInstantiateType<Context, State, Left>, InstantiatedRight extends TSchema = TInstantiateType<Context, State, Right>> = TExtractAction<InstantiatedLeft, InstantiatedRight>;
|
|
1542
|
-
declare function ExtractInstantiate<Context extends TProperties, State extends TState, Left extends TSchema, Right extends TSchema>(context: Context, state: State, left: Left, right: Right, options: TSchemaOptions): TExtractInstantiate<Context, State, Left, Right>;
|
|
1866
|
+
export type TExtractAction<Left extends TSchema, Right extends TSchema, Result extends TSchema = TCanInstantiate<[Left, Right]> extends true ? TExtractOperation<Left, Right> : TExtractDeferred<Left, Right>> = Result;
|
|
1867
|
+
export declare function ExtractAction<Left extends TSchema, Right extends TSchema>(left: Left, right: Right, options: TSchemaOptions): TExtractAction<Left, Right>;
|
|
1868
|
+
export type TExtractInstantiate<Context extends TProperties, State extends TState, Left extends TSchema, Right extends TSchema, InstantiatedLeft extends TSchema = TInstantiateType<Context, State, Left>, InstantiatedRight extends TSchema = TInstantiateType<Context, State, Right>> = TExtractAction<InstantiatedLeft, InstantiatedRight>;
|
|
1869
|
+
export declare function ExtractInstantiate<Context extends TProperties, State extends TState, Left extends TSchema, Right extends TSchema>(context: Context, state: State, left: Left, right: Right, options: TSchemaOptions): TExtractInstantiate<Context, State, Left, Right>;
|
|
1543
1870
|
type TKeysToLiterals<Keys extends PropertyKey[], Result extends TLiteral[] = []> = (Keys extends [infer Left extends PropertyKey, ...infer Right extends PropertyKey[]] ? (Left extends TLiteralValue ? TKeysToLiterals<Right, [...Result, TLiteral<Left>]> : TKeysToLiterals<Right, Result>) : Result);
|
|
1544
|
-
type TKeysToIndexer<Keys extends PropertyKey[], Literals extends TLiteral[] = TKeysToLiterals<Keys>, Result extends TSchema = TUnion<Literals>> = Result;
|
|
1545
|
-
declare function KeysToIndexer<Keys extends PropertyKey[]>(keys: [...Keys]): TKeysToIndexer<Keys>;
|
|
1871
|
+
export type TKeysToIndexer<Keys extends PropertyKey[], Literals extends TLiteral[] = TKeysToLiterals<Keys>, Result extends TSchema = TUnion<Literals>> = Result;
|
|
1872
|
+
export declare function KeysToIndexer<Keys extends PropertyKey[]>(keys: [...Keys]): TKeysToIndexer<Keys>;
|
|
1546
1873
|
/** Creates a deferred Index action. */
|
|
1547
|
-
type TIndexDeferred<Type extends TSchema, Indexer extends TSchema> = (TDeferred<'Index', [Type, Indexer]>);
|
|
1874
|
+
export type TIndexDeferred<Type extends TSchema, Indexer extends TSchema> = (TDeferred<'Index', [Type, Indexer]>);
|
|
1548
1875
|
/** Creates a deferred Index action. */
|
|
1549
|
-
declare function IndexDeferred<Type extends TSchema, Indexer extends TSchema>(type: Type, indexer: Indexer, options?: TSchemaOptions): TIndexDeferred<Type, Indexer>;
|
|
1876
|
+
export declare function IndexDeferred<Type extends TSchema, Indexer extends TSchema>(type: Type, indexer: Indexer, options?: TSchemaOptions): TIndexDeferred<Type, Indexer>;
|
|
1550
1877
|
/** Applies a Index action using the given types. */
|
|
1551
|
-
type TIndex<Type extends TSchema, Indexer extends TSchema> = (TIndexAction<Type, Indexer>);
|
|
1878
|
+
export type TIndex<Type extends TSchema, Indexer extends TSchema> = (TIndexAction<Type, Indexer>);
|
|
1552
1879
|
/** Applies a Index action using the given types. */
|
|
1553
|
-
declare function Index<Type extends TSchema, Indexer extends PropertyKey[]>(type: Type, indexer: readonly [...Indexer], options?: TSchemaOptions): TIndex<Type, TKeysToIndexer<Indexer>>;
|
|
1880
|
+
export declare function Index<Type extends TSchema, Indexer extends PropertyKey[]>(type: Type, indexer: readonly [...Indexer], options?: TSchemaOptions): TIndex<Type, TKeysToIndexer<Indexer>>;
|
|
1554
1881
|
/** Applies a Index action using the given types. */
|
|
1555
|
-
declare function Index<Type extends TSchema, Indexer extends TSchema>(type: Type, indexer: Indexer, options?: TSchemaOptions): TIndex<Type, Indexer>;
|
|
1882
|
+
export declare function Index<Type extends TSchema, Indexer extends TSchema>(type: Type, indexer: Indexer, options?: TSchemaOptions): TIndex<Type, Indexer>;
|
|
1556
1883
|
type TFromCyclic$4<Defs extends TProperties, Ref extends string, Target extends TSchema = TCyclicTarget<Defs, Ref>, Result extends TProperties = TFromType$10<Target>> = Result;
|
|
1557
1884
|
type TFromDependent$4<If extends TSchema, Then extends TSchema, Else extends TSchema, Evaluated extends TSchema = TEvaluateDependent<If, Then, Else>, Result extends TSchema = TFromType$10<Evaluated>> = Result;
|
|
1558
1885
|
type TCollapseIntersectProperties<Left extends TProperties, Right extends TProperties, LeftKeys extends keyof Left = Exclude<keyof Left, keyof Right>, RightKeys extends keyof Right = Exclude<keyof Right, keyof Left>, SharedKeys extends keyof Left & keyof Right = Extract<keyof Left, keyof Right>, LeftProperties extends TProperties = { [Key in LeftKeys]: Left[Key]; }, RightProperties extends TProperties = { [Key in RightKeys]: Right[Key]; }, SharedProperties extends TProperties = { [Key in SharedKeys]: TEvaluateIntersect<[Left[Key], Right[Key]]>; }, Unique extends TProperties = TAssign<LeftProperties, RightProperties>, Shared extends TProperties = TAssign<Unique, SharedProperties>> = Shared;
|
|
@@ -1563,16 +1890,16 @@ type TCollapseUnionProperties<Left extends TProperties, Right extends TPropertie
|
|
|
1563
1890
|
type TReduceVariants<Types extends TSchema[], Result extends TProperties> = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? TReduceVariants<Right, TCollapseUnionProperties<Result, TFromType$10<Left>>> : Result);
|
|
1564
1891
|
type TFromUnion$5<Types extends TSchema[]> = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? TReduceVariants<Right, TFromType$10<Left>> : TUnreachable);
|
|
1565
1892
|
type TFromType$10<Type extends TSchema, Result extends TProperties = (Type extends TCyclic<infer Defs extends TProperties, infer Ref extends string> ? TFromCyclic$4<Defs, Ref> : Type extends TDependent$1<infer If extends TSchema, infer Then extends TSchema, infer Else extends TSchema> ? TFromDependent$4<If, Then, Else> : Type extends TIntersect<infer Types extends TSchema[]> ? TFromIntersect$4<Types> : Type extends TUnion<infer Types extends TSchema[]> ? TFromUnion$5<Types> : Type extends TTuple<infer Types extends TSchema[]> ? TFromTuple$3<Types> : Type extends TObject<infer Properties extends TProperties> ? TFromObject$5<Properties> : {})> = Result;
|
|
1566
|
-
type TCollapseToObject<Type extends TSchema, Properties extends TProperties = TFromType$10<Type>, Result extends TSchema = TObject<Properties>> = Result;
|
|
1893
|
+
export type TCollapseToObject<Type extends TSchema, Properties extends TProperties = TFromType$10<Type>, Result extends TSchema = TObject<Properties>> = Result;
|
|
1567
1894
|
/**
|
|
1568
1895
|
* Collapses a type into a TObject schema. This is a lossy fast path used to
|
|
1569
1896
|
* normalize arbitrary TSchema types into a TObject structure. This function is
|
|
1570
1897
|
* primarily used in indexing operations where a normalized object structure
|
|
1571
1898
|
* is required. If the type cannot be collapsed, an empty object schema is returned.
|
|
1572
1899
|
*/
|
|
1573
|
-
declare function CollapseToObject<Type extends TSchema>(type: Type): TCollapseToObject<Type>;
|
|
1574
|
-
type TConvertToIntegerKey<Value extends TLiteralValue, Normal extends string = `${Value}`, Result extends TLiteralValue = (Normal extends ` ${infer _ extends number}` ? Normal : Normal extends `${infer _ extends number} ` ? Normal : Normal extends `0${infer _ extends number}` ? Normal : Normal extends `-${infer _ extends number}` ? Normal : Normal extends `${infer Value extends number}` ? Value : Value)> = Result;
|
|
1575
|
-
declare function ConvertToIntegerKey<Value extends TLiteralValue>(value: Value): TConvertToIntegerKey<Value>;
|
|
1900
|
+
export declare function CollapseToObject<Type extends TSchema>(type: Type): TCollapseToObject<Type>;
|
|
1901
|
+
export type TConvertToIntegerKey<Value extends TLiteralValue, Normal extends string = `${Value}`, Result extends TLiteralValue = (Normal extends ` ${infer _ extends number}` ? Normal : Normal extends `${infer _ extends number} ` ? Normal : Normal extends `0${infer _ extends number}` ? Normal : Normal extends `-${infer _ extends number}` ? Normal : Normal extends `${infer Value extends number}` ? Value : Value)> = Result;
|
|
1902
|
+
export declare function ConvertToIntegerKey<Value extends TLiteralValue>(value: Value): TConvertToIntegerKey<Value>;
|
|
1576
1903
|
type TNormalizeLiteral<Value extends TLiteralValue, Result extends TSchema = TLiteral<TConvertToIntegerKey<Value>>> = Result;
|
|
1577
1904
|
type TNormalizeIndexerTypes<Types extends TSchema[], Result extends TSchema[] = []> = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? TNormalizeIndexerTypes<Right, [...Result, TNormalizeIndexer<Left>]> : Result);
|
|
1578
1905
|
type TNormalizeIndexer<Type extends TSchema, Result extends TSchema = (Type extends TIntersect<infer Types extends TSchema[]> ? TIntersect<TNormalizeIndexerTypes<Types>> : Type extends TUnion<infer Types extends TSchema[]> ? TUnion<TNormalizeIndexerTypes<Types>> : Type extends TLiteral<infer Value extends TLiteralValue> ? TNormalizeLiteral<Value> : Type)> = Result;
|
|
@@ -1605,31 +1932,31 @@ type TFromTupleWithoutIndexer<Types extends TSchema[], Result extends TSchema =
|
|
|
1605
1932
|
type TFromTuple$2<Types extends TSchema[], Indexer extends TSchema, Result extends TSchema = (Indexer extends TLiteral<infer _ extends 'length'> ? TLiteral<Types['length']> : Indexer extends TNumber$1 | TInteger$1 ? TFromTupleWithoutIndexer<Types> : TFromTupleWithIndexer<Types, Indexer>)> = Result;
|
|
1606
1933
|
type TFromType$7<Type extends TSchema, Indexer extends TSchema> = (Type extends TArray<infer Type extends TSchema> ? TFromArray$2<Type, Indexer> : Type extends TObject<infer Properties extends TProperties> ? TFromObject$4<Properties, Indexer> : Type extends TTuple<infer Types extends TSchema[]> ? TFromTuple$2<Types, Indexer> : TNever);
|
|
1607
1934
|
type TNormalizeType$1<Type extends TSchema, Result extends TSchema = (Type extends TCyclic ? TCollapseToObject<Type> : Type extends TDependent$1 ? TCollapseToObject<Type> : Type extends TIntersect ? TCollapseToObject<Type> : Type extends TUnion ? TCollapseToObject<Type> : Type)> = Result;
|
|
1608
|
-
type TIndexAction<Type extends TSchema, Indexer extends TSchema, Result extends TSchema = TCanInstantiate<[Type, Indexer]> extends true ? TFromType$7<TNormalizeType$1<Type>, Indexer> : TIndexDeferred<Type, Indexer>> = Result;
|
|
1609
|
-
declare function IndexAction<Type extends TSchema, Indexer extends TSchema>(type: Type, indexer: Indexer, options: TSchemaOptions): TIndexAction<Type, Indexer>;
|
|
1610
|
-
type TIndexInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, Indexer extends TSchema, InstantiatedType extends TSchema = TInstantiateType<Context, State, Type>, InstantiatedIndexer extends TSchema = TInstantiateType<Context, State, Indexer>> = TIndexAction<InstantiatedType, InstantiatedIndexer>;
|
|
1611
|
-
declare function IndexInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, Indexer extends TSchema>(context: Context, state: State, type: Type, indexer: Indexer, options: TSchemaOptions): TIndexInstantiate<Context, State, Type, Indexer>;
|
|
1935
|
+
export type TIndexAction<Type extends TSchema, Indexer extends TSchema, Result extends TSchema = TCanInstantiate<[Type, Indexer]> extends true ? TFromType$7<TNormalizeType$1<Type>, Indexer> : TIndexDeferred<Type, Indexer>> = Result;
|
|
1936
|
+
export declare function IndexAction<Type extends TSchema, Indexer extends TSchema>(type: Type, indexer: Indexer, options: TSchemaOptions): TIndexAction<Type, Indexer>;
|
|
1937
|
+
export type TIndexInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, Indexer extends TSchema, InstantiatedType extends TSchema = TInstantiateType<Context, State, Type>, InstantiatedIndexer extends TSchema = TInstantiateType<Context, State, Indexer>> = TIndexAction<InstantiatedType, InstantiatedIndexer>;
|
|
1938
|
+
export declare function IndexInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, Indexer extends TSchema>(context: Context, state: State, type: Type, indexer: Indexer, options: TSchemaOptions): TIndexInstantiate<Context, State, Type, Indexer>;
|
|
1612
1939
|
/** Creates a deferred InstanceType action. */
|
|
1613
|
-
type TInstanceTypeDeferred<Type extends TSchema> = (TDeferred<'InstanceType', [Type]>);
|
|
1940
|
+
export type TInstanceTypeDeferred<Type extends TSchema> = (TDeferred<'InstanceType', [Type]>);
|
|
1614
1941
|
/** Creates a deferred InstanceType action. */
|
|
1615
|
-
declare function InstanceTypeDeferred<Type extends TSchema>(type: Type, options?: TSchemaOptions): TInstanceTypeDeferred<Type>;
|
|
1942
|
+
export declare function InstanceTypeDeferred<Type extends TSchema>(type: Type, options?: TSchemaOptions): TInstanceTypeDeferred<Type>;
|
|
1616
1943
|
/** Applies a InstanceType action to the given type. */
|
|
1617
|
-
type TInstanceType<Type extends TSchema> = (TInstanceTypeAction<Type>);
|
|
1944
|
+
export type TInstanceType<Type extends TSchema> = (TInstanceTypeAction<Type>);
|
|
1618
1945
|
/** Applies a InstanceType action to the given type. */
|
|
1619
|
-
declare function InstanceType
|
|
1946
|
+
export declare function InstanceType<Type extends TSchema>(type: Type, options?: TSchemaOptions): TInstanceType<Type>;
|
|
1620
1947
|
type TInstanceTypeOperation<Type extends TSchema> = (Type extends TConstructor ? Type['instanceType'] : TNever);
|
|
1621
|
-
type TInstanceTypeAction<Type extends TSchema, Result extends TSchema = TCanInstantiate<[Type]> extends true ? TInstanceTypeOperation<Type> : TInstanceTypeDeferred<Type>> = Result;
|
|
1622
|
-
declare function InstanceTypeAction<Type extends TSchema>(type: Type, options: TSchemaOptions): TInstanceTypeAction<Type>;
|
|
1623
|
-
type TInstanceTypeInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, InstantiatedType extends TSchema = TInstantiateType<Context, State, Type>> = TInstanceTypeAction<InstantiatedType>;
|
|
1624
|
-
declare function InstanceTypeInstantiate<Context extends TProperties, State extends TState, Type extends TSchema>(context: Context, state: State, type: Type, options?: TSchemaOptions): TInstanceTypeInstantiate<Context, State, Type>;
|
|
1948
|
+
export type TInstanceTypeAction<Type extends TSchema, Result extends TSchema = TCanInstantiate<[Type]> extends true ? TInstanceTypeOperation<Type> : TInstanceTypeDeferred<Type>> = Result;
|
|
1949
|
+
export declare function InstanceTypeAction<Type extends TSchema>(type: Type, options: TSchemaOptions): TInstanceTypeAction<Type>;
|
|
1950
|
+
export type TInstanceTypeInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, InstantiatedType extends TSchema = TInstantiateType<Context, State, Type>> = TInstanceTypeAction<InstantiatedType>;
|
|
1951
|
+
export declare function InstanceTypeInstantiate<Context extends TProperties, State extends TState, Type extends TSchema>(context: Context, state: State, type: Type, options?: TSchemaOptions): TInstanceTypeInstantiate<Context, State, Type>;
|
|
1625
1952
|
/** Creates a deferred KeyOf action. */
|
|
1626
|
-
type TKeyOfDeferred<Type extends TSchema> = (TDeferred<'KeyOf', [Type]>);
|
|
1953
|
+
export type TKeyOfDeferred<Type extends TSchema> = (TDeferred<'KeyOf', [Type]>);
|
|
1627
1954
|
/** Creates a deferred KeyOf action. */
|
|
1628
|
-
declare function KeyOfDeferred<Type extends TSchema>(type: Type, options?: TSchemaOptions): TKeyOfDeferred<Type>;
|
|
1955
|
+
export declare function KeyOfDeferred<Type extends TSchema>(type: Type, options?: TSchemaOptions): TKeyOfDeferred<Type>;
|
|
1629
1956
|
/** Applies a KeyOf action to the given type. */
|
|
1630
|
-
type TKeyOf<Type extends TSchema> = (TKeyOfAction<Type>);
|
|
1957
|
+
export type TKeyOf<Type extends TSchema> = (TKeyOfAction<Type>);
|
|
1631
1958
|
/** Applies a KeyOf action to the given type. */
|
|
1632
|
-
declare function KeyOf<Type extends TSchema>(type: Type, options?: TSchemaOptions): TKeyOf<Type>;
|
|
1959
|
+
export declare function KeyOf<Type extends TSchema>(type: Type, options?: TSchemaOptions): TKeyOf<Type>;
|
|
1633
1960
|
type TFromAny<Result = TUnion<[TNumber$1, TString$1, TSymbol]>> = Result;
|
|
1634
1961
|
type TFromArray$1<_Type extends TSchema> = TNumber$1;
|
|
1635
1962
|
type TFromPropertyKeys<Keys extends PropertyKey[], Result extends TSchema[] = []> = (Keys extends [infer Left extends PropertyKey, ...infer Right extends PropertyKey[]] ? Left extends TLiteralValue ? TFromPropertyKeys<Right, [...Result, TLiteral<Left>]> : TUnreachable : Result);
|
|
@@ -1638,18 +1965,18 @@ type TFromRecord<Type extends TRecord, Result extends TSchema = TRecordKey<Type>
|
|
|
1638
1965
|
type TFromTuple$1<Types extends TSchema[], Result extends TSchema[] = []> = (Types extends [...infer Left extends TSchema[], infer _ extends TSchema] ? TFromTuple$1<Left, [TLiteral<Left['length']>, ...Result]> : TEvaluateUnionFast<Result>);
|
|
1639
1966
|
type TFromType$6<Type extends TSchema> = (Type extends TAny ? TFromAny : Type extends TArray<infer Type extends TSchema> ? TFromArray$1<Type> : Type extends TObject<infer Properties extends TProperties> ? TFromObject$3<Properties> : Type extends TRecord ? TFromRecord<Type> : Type extends TTuple<infer Types extends TSchema[]> ? TFromTuple$1<Types> : TNever);
|
|
1640
1967
|
type TNormalizeType<Type extends TSchema, Result extends TSchema = (Type extends TCyclic ? TCollapseToObject<Type> : Type extends TDependent$1 ? TCollapseToObject<Type> : Type extends TIntersect ? TCollapseToObject<Type> : Type extends TUnion ? TCollapseToObject<Type> : Type)> = Result;
|
|
1641
|
-
type TKeyOfAction<Type extends TSchema, Result extends TSchema = TCanInstantiate<[Type]> extends true ? TFromType$6<TNormalizeType<Type>> : TKeyOfDeferred<Type>> = Result;
|
|
1642
|
-
declare function KeyOfAction<Type extends TSchema>(type: Type, options: TSchemaOptions): TKeyOfAction<Type>;
|
|
1643
|
-
type TKeyOfInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, InstantiatedType extends TSchema = TInstantiateType<Context, State, Type>> = TKeyOfAction<InstantiatedType>;
|
|
1644
|
-
declare function KeyOfInstantiate<Context extends TProperties, State extends TState, Type extends TSchema>(context: Context, state: State, type: Type, options: TSchemaOptions): TKeyOfInstantiate<Context, State, Type>;
|
|
1968
|
+
export type TKeyOfAction<Type extends TSchema, Result extends TSchema = TCanInstantiate<[Type]> extends true ? TFromType$6<TNormalizeType<Type>> : TKeyOfDeferred<Type>> = Result;
|
|
1969
|
+
export declare function KeyOfAction<Type extends TSchema>(type: Type, options: TSchemaOptions): TKeyOfAction<Type>;
|
|
1970
|
+
export type TKeyOfInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, InstantiatedType extends TSchema = TInstantiateType<Context, State, Type>> = TKeyOfAction<InstantiatedType>;
|
|
1971
|
+
export declare function KeyOfInstantiate<Context extends TProperties, State extends TState, Type extends TSchema>(context: Context, state: State, type: Type, options: TSchemaOptions): TKeyOfInstantiate<Context, State, Type>;
|
|
1645
1972
|
/** Creates a deferred Mapped action. */
|
|
1646
|
-
type TMappedDeferred<Identifier extends TIdentifier, Type extends TSchema, As extends TSchema, Property extends TSchema> = (TDeferred<'Mapped', [Identifier, Type, As, Property]>);
|
|
1973
|
+
export type TMappedDeferred<Identifier extends TIdentifier, Type extends TSchema, As extends TSchema, Property extends TSchema> = (TDeferred<'Mapped', [Identifier, Type, As, Property]>);
|
|
1647
1974
|
/** Creates a deferred Mapped action. */
|
|
1648
|
-
declare function MappedDeferred<Identifier extends TIdentifier, Type extends TSchema, As extends TSchema, Property extends TSchema>(identifier: Identifier, type: Type, as: As, property: Property, options?: TSchemaOptions): TMappedDeferred<Identifier, Type, As, Property>;
|
|
1975
|
+
export declare function MappedDeferred<Identifier extends TIdentifier, Type extends TSchema, As extends TSchema, Property extends TSchema>(identifier: Identifier, type: Type, as: As, property: Property, options?: TSchemaOptions): TMappedDeferred<Identifier, Type, As, Property>;
|
|
1649
1976
|
/** Applies a Mapped action using the given types. */
|
|
1650
|
-
type TMapped<Identifier extends TIdentifier, Type extends TSchema, As extends TSchema, Property extends TSchema> = (TMappedAction<{}, TState<[], []>, Identifier, Type, As, Property>);
|
|
1977
|
+
export type TMapped<Identifier extends TIdentifier, Type extends TSchema, As extends TSchema, Property extends TSchema> = (TMappedAction<{}, TState<[], []>, Identifier, Type, As, Property>);
|
|
1651
1978
|
/** Applies a Mapped action using the given types. */
|
|
1652
|
-
declare function Mapped<Identifier extends TIdentifier, Type extends TSchema, As extends TSchema, Property extends TSchema>(identifier: Identifier, type: Type, as: As, property: Property, options?: TSchemaOptions): TMapped<Identifier, Type, As, Property>;
|
|
1979
|
+
export declare function Mapped<Identifier extends TIdentifier, Type extends TSchema, As extends TSchema, Property extends TSchema>(identifier: Identifier, type: Type, as: As, property: Property, options?: TSchemaOptions): TMapped<Identifier, Type, As, Property>;
|
|
1653
1980
|
type TFromTemplateLiteral<Pattern extends string, Evaluated extends TSchema = TEvaluateTemplateLiteral<Pattern>, Result extends TSchema[] = TFromType$5<Evaluated>> = Result;
|
|
1654
1981
|
type TFromUnion$3<Types extends TSchema[], Result extends TSchema[] = []> = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? TFromUnion$3<Right, [...Result, ...TFromType$5<Left>]> : Result);
|
|
1655
1982
|
type TFromEnum<Values extends TEnumValue[], Evaluated extends TSchema = TEvaluateEnum<Values>, Result extends TSchema[] = TFromType$5<Evaluated>> = Result;
|
|
@@ -1661,34 +1988,34 @@ type TMappedVariant<Context extends TProperties, State extends TState, Identifie
|
|
|
1661
1988
|
type TMappedProperties<Context extends TProperties, State extends TState, Identifier extends TIdentifier, Variants extends TSchema[], As extends TSchema, Property extends TSchema, Result extends TProperties[] = []> = (Variants extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? TMappedProperties<Context, State, Identifier, Right, As, Property, [...Result, TMappedVariant<Context, State, Identifier, Left, As, Property>]> : Result);
|
|
1662
1989
|
type TReduceProperties<Properties extends TProperties[], Result extends TSchema[] = []> = (Properties extends [infer Left extends TProperties, ...infer Right extends TProperties[]] ? TReduceProperties<Right, [...Result, TObject<Left>]> : Result);
|
|
1663
1990
|
type TMappedOperation<Context extends TProperties, State extends TState, Identifier extends TIdentifier, Type extends TSchema, As extends TSchema, Property extends TSchema, Variants extends TSchema[] = TMappedVariants<Type>, MappedProperties extends TProperties[] = TMappedProperties<Context, State, Identifier, Variants, As, Property>, MappedObjects extends TSchema[] = TReduceProperties<MappedProperties>, Result extends TSchema = TEvaluateIntersect<MappedObjects>> = Result;
|
|
1664
|
-
type TMappedAction<Context extends TProperties, State extends TState, Identifier extends TIdentifier, Type extends TSchema, As extends TSchema, Property extends TSchema, Result extends TSchema = TCanInstantiate<[Type]> extends true ? TMappedOperation<Context, State, Identifier, Type, As, Property> : TMappedDeferred<Identifier, Type, As, Property>> = Result;
|
|
1665
|
-
declare function MappedAction<Context extends TProperties, State extends TState, Identifier extends TIdentifier, Type extends TSchema, As extends TSchema, Property extends TSchema>(context: Context, state: State, identifier: Identifier, type: Type, as: As, property: Property, options: TSchemaOptions): TMappedAction<Context, State, Identifier, Type, As, Property>;
|
|
1666
|
-
type TMappedInstantiate<Context extends TProperties, State extends TState, Identifier extends TIdentifier, Type extends TSchema, As extends TSchema, Property extends TSchema, InstaniatedType extends TSchema = TInstantiateType<Context, State, Type>> = TMappedAction<Context, State, Identifier, InstaniatedType, As, Property>;
|
|
1667
|
-
declare function MappedInstantiate<Context extends TProperties, State extends TState, Identifier extends TIdentifier, Type extends TSchema, As extends TSchema, Property extends TSchema>(context: Context, state: State, identifier: Identifier, type: Type, as: As, property: Property, options: TSchemaOptions): TMappedInstantiate<Context, State, Identifier, Type, As, Property>;
|
|
1991
|
+
export type TMappedAction<Context extends TProperties, State extends TState, Identifier extends TIdentifier, Type extends TSchema, As extends TSchema, Property extends TSchema, Result extends TSchema = TCanInstantiate<[Type]> extends true ? TMappedOperation<Context, State, Identifier, Type, As, Property> : TMappedDeferred<Identifier, Type, As, Property>> = Result;
|
|
1992
|
+
export declare function MappedAction<Context extends TProperties, State extends TState, Identifier extends TIdentifier, Type extends TSchema, As extends TSchema, Property extends TSchema>(context: Context, state: State, identifier: Identifier, type: Type, as: As, property: Property, options: TSchemaOptions): TMappedAction<Context, State, Identifier, Type, As, Property>;
|
|
1993
|
+
export type TMappedInstantiate<Context extends TProperties, State extends TState, Identifier extends TIdentifier, Type extends TSchema, As extends TSchema, Property extends TSchema, InstaniatedType extends TSchema = TInstantiateType<Context, State, Type>> = TMappedAction<Context, State, Identifier, InstaniatedType, As, Property>;
|
|
1994
|
+
export declare function MappedInstantiate<Context extends TProperties, State extends TState, Identifier extends TIdentifier, Type extends TSchema, As extends TSchema, Property extends TSchema>(context: Context, state: State, identifier: Identifier, type: Type, as: As, property: Property, options: TSchemaOptions): TMappedInstantiate<Context, State, Identifier, Type, As, Property>;
|
|
1668
1995
|
type TInstantiateCyclics<Context extends TProperties, Declarations extends TProperties, CyclicKeys extends string[], DeclarationContext extends TProperties = TAssign<Context, Declarations>, Result extends TProperties = { [Key in Extract<keyof Declarations, CyclicKeys[number]>]: TInstantiateCyclic<DeclarationContext, Key, Declarations[Key]>; }> = Result;
|
|
1669
1996
|
type TInstantiateNonCyclics<Context extends TProperties, Declarations extends TProperties, CyclicKeys extends string[], DeclarationContext extends TProperties = TAssign<Context, Declarations>, Result extends TProperties = { [Key in Exclude<keyof Declarations, CyclicKeys[number]>]: TInstantiateType<DeclarationContext, TState<[], []>, Declarations[Key]>; }> = Result;
|
|
1670
1997
|
type TInstantiateModule<Context extends TProperties, Declarations extends TProperties, CyclicCandidates extends string[] = TCyclicCandidates<Declarations>, InstantiatedCyclics extends TProperties = TInstantiateCyclics<Context, Declarations, CyclicCandidates>, InstantiatedNonCyclics extends TProperties = TInstantiateNonCyclics<Context, Declarations, CyclicCandidates>, InstantiatedModule extends TProperties = InstantiatedCyclics & InstantiatedNonCyclics> = { [Key in keyof InstantiatedModule]: InstantiatedModule[Key]; } & {};
|
|
1671
|
-
type TModuleInstantiate<Context extends TProperties, _State extends TState, Declarations extends TProperties, InstantiatedModule extends TProperties = TInstantiateModule<Context, Declarations>> = InstantiatedModule;
|
|
1672
|
-
declare function ModuleInstantiate<Context extends TProperties, State extends TState, Declarations extends TProperties>(context: Context, _state: State, declarations: Declarations, options: TSchemaOptions): TModuleInstantiate<Context, State, Declarations>;
|
|
1998
|
+
export type TModuleInstantiate<Context extends TProperties, _State extends TState, Declarations extends TProperties, InstantiatedModule extends TProperties = TInstantiateModule<Context, Declarations>> = InstantiatedModule;
|
|
1999
|
+
export declare function ModuleInstantiate<Context extends TProperties, State extends TState, Declarations extends TProperties>(context: Context, _state: State, declarations: Declarations, options: TSchemaOptions): TModuleInstantiate<Context, State, Declarations>;
|
|
1673
2000
|
/** Creates a deferred NonNullable action. */
|
|
1674
|
-
type TNonNullableDeferred<Type extends TSchema> = (TDeferred<'NonNullable', [Type]>);
|
|
2001
|
+
export type TNonNullableDeferred<Type extends TSchema> = (TDeferred<'NonNullable', [Type]>);
|
|
1675
2002
|
/** Creates a deferred NonNullable action. */
|
|
1676
|
-
declare function NonNullableDeferred<Type extends TSchema>(type: Type, options?: TSchemaOptions): TNonNullableDeferred<Type>;
|
|
2003
|
+
export declare function NonNullableDeferred<Type extends TSchema>(type: Type, options?: TSchemaOptions): TNonNullableDeferred<Type>;
|
|
1677
2004
|
/** Applies a NonNullable action to the given type. */
|
|
1678
|
-
type TNonNullable<Type extends TSchema> = (TNonNullableAction<Type>);
|
|
2005
|
+
export type TNonNullable<Type extends TSchema> = (TNonNullableAction<Type>);
|
|
1679
2006
|
/** Applies a NonNullable action to the given type. */
|
|
1680
|
-
declare function NonNullable<Type extends TSchema>(type: Type, options?: TSchemaOptions): TNonNullable<Type>;
|
|
2007
|
+
export declare function NonNullable<Type extends TSchema>(type: Type, options?: TSchemaOptions): TNonNullable<Type>;
|
|
1681
2008
|
type TNonNullableOperation<Type extends TSchema, Excluded extends TSchema = TUnion<[TNull, TUndefined]>> = TExcludeAction<Type, Excluded>;
|
|
1682
|
-
type TNonNullableAction<Type extends TSchema, Result extends TSchema = TCanInstantiate<[Type]> extends true ? TNonNullableOperation<Type> : TNonNullableDeferred<Type>> = Result;
|
|
1683
|
-
declare function NonNullableAction<Type extends TSchema>(type: Type, options: TSchemaOptions): TNonNullableAction<Type>;
|
|
1684
|
-
type TNonNullableInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, InstantiatedType extends TSchema = TInstantiateType<Context, State, Type>> = TNonNullableAction<InstantiatedType>;
|
|
1685
|
-
declare function NonNullableInstantiate<Context extends TProperties, State extends TState, Type extends TSchema>(context: Context, state: State, type: Type, options: TSchemaOptions): TNonNullableInstantiate<Context, State, Type>;
|
|
2009
|
+
export type TNonNullableAction<Type extends TSchema, Result extends TSchema = TCanInstantiate<[Type]> extends true ? TNonNullableOperation<Type> : TNonNullableDeferred<Type>> = Result;
|
|
2010
|
+
export declare function NonNullableAction<Type extends TSchema>(type: Type, options: TSchemaOptions): TNonNullableAction<Type>;
|
|
2011
|
+
export type TNonNullableInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, InstantiatedType extends TSchema = TInstantiateType<Context, State, Type>> = TNonNullableAction<InstantiatedType>;
|
|
2012
|
+
export declare function NonNullableInstantiate<Context extends TProperties, State extends TState, Type extends TSchema>(context: Context, state: State, type: Type, options: TSchemaOptions): TNonNullableInstantiate<Context, State, Type>;
|
|
1686
2013
|
/** Creates a deferred Omit action. */
|
|
1687
|
-
type TOmitDeferred<Type extends TSchema, Indexer extends TSchema> = (TDeferred<'Omit', [Type, Indexer]>);
|
|
2014
|
+
export type TOmitDeferred<Type extends TSchema, Indexer extends TSchema> = (TDeferred<'Omit', [Type, Indexer]>);
|
|
1688
2015
|
/** Creates a deferred Omit action. */
|
|
1689
|
-
declare function OmitDeferred<Type extends TSchema, Indexer extends TSchema>(type: Type, indexer: Indexer, options?: TSchemaOptions): TOmitDeferred<Type, Indexer>;
|
|
2016
|
+
export declare function OmitDeferred<Type extends TSchema, Indexer extends TSchema>(type: Type, indexer: Indexer, options?: TSchemaOptions): TOmitDeferred<Type, Indexer>;
|
|
1690
2017
|
/** Applies a Omit action using the given types. */
|
|
1691
|
-
type TOmit<Type extends TSchema, Indexer extends TSchema> = (TOmitAction<Type, Indexer>);
|
|
2018
|
+
export type TOmit<Type extends TSchema, Indexer extends TSchema> = (TOmitAction<Type, Indexer>);
|
|
1692
2019
|
/** Applies a Omit action using the given types. */
|
|
1693
2020
|
declare function Omit$1<Type extends TSchema, Indexer extends PropertyKey[]>(type: Type, indexer: readonly [...Indexer], options?: TSchemaOptions): TOmit<Type, TKeysToIndexer<Indexer>>;
|
|
1694
2021
|
/** Applies a Omit action using the given types. */
|
|
@@ -1698,29 +2025,29 @@ type TToIndexable<Type extends TSchema, Collapsed extends TSchema = TCollapseToO
|
|
|
1698
2025
|
type TNormalKeys<Keys extends string[], UnionKeys extends string = Keys[number], Result extends string | number = (UnionKeys extends `${infer Value extends number}` ? UnionKeys | Value : UnionKeys)> = Result;
|
|
1699
2026
|
type TFromKeys$1<Properties extends TProperties, Keys extends string[], Omitted extends TProperties = Omit<Properties, TNormalKeys<Keys>>, Result extends TProperties = { [Key in keyof Omitted]: Omitted[Key]; }> = Result;
|
|
1700
2027
|
type TFromType$4<Type extends TSchema, Indexer extends TSchema, Indexable extends TProperties = TToIndexable<Type>, IndexableKeys extends string[] = TToIndexableKeys<Indexer>, Omitted extends TProperties = TFromKeys$1<Indexable, IndexableKeys>, Result extends TSchema = TObject<Omitted>> = Result;
|
|
1701
|
-
type TOmitAction<Type extends TSchema, Indexer extends TSchema, Result extends TSchema = TCanInstantiate<[Type, Indexer]> extends true ? TFromType$4<Type, Indexer> : TOmitDeferred<Type, Indexer>> = Result;
|
|
1702
|
-
declare function OmitAction<Type extends TSchema, Indexer extends TSchema>(type: Type, indexer: Indexer, options: TSchemaOptions): TOmitAction<Type, Indexer>;
|
|
1703
|
-
type TOmitInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, Indexer extends TSchema, InstantiatedType extends TSchema = TInstantiateType<Context, State, Type>, InstantiatedIndexer extends TSchema = TInstantiateType<Context, State, Indexer>> = TOmitAction<InstantiatedType, InstantiatedIndexer>;
|
|
1704
|
-
declare function OmitInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, Indexer extends TSchema>(context: Context, state: State, type: Type, indexer: Indexer, options: TSchemaOptions): TOmitInstantiate<Context, State, Type, Indexer>;
|
|
2028
|
+
export type TOmitAction<Type extends TSchema, Indexer extends TSchema, Result extends TSchema = TCanInstantiate<[Type, Indexer]> extends true ? TFromType$4<Type, Indexer> : TOmitDeferred<Type, Indexer>> = Result;
|
|
2029
|
+
export declare function OmitAction<Type extends TSchema, Indexer extends TSchema>(type: Type, indexer: Indexer, options: TSchemaOptions): TOmitAction<Type, Indexer>;
|
|
2030
|
+
export type TOmitInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, Indexer extends TSchema, InstantiatedType extends TSchema = TInstantiateType<Context, State, Type>, InstantiatedIndexer extends TSchema = TInstantiateType<Context, State, Indexer>> = TOmitAction<InstantiatedType, InstantiatedIndexer>;
|
|
2031
|
+
export declare function OmitInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, Indexer extends TSchema>(context: Context, state: State, type: Type, indexer: Indexer, options: TSchemaOptions): TOmitInstantiate<Context, State, Type, Indexer>;
|
|
1705
2032
|
/** Creates a deferred Parameters action. */
|
|
1706
|
-
type TParametersDeferred<Type extends TSchema> = (TDeferred<'Parameters', [Type]>);
|
|
2033
|
+
export type TParametersDeferred<Type extends TSchema> = (TDeferred<'Parameters', [Type]>);
|
|
1707
2034
|
/** Creates a deferred Parameters action. */
|
|
1708
|
-
declare function ParametersDeferred<Type extends TSchema>(type: Type, options?: TSchemaOptions): TParametersDeferred<Type>;
|
|
2035
|
+
export declare function ParametersDeferred<Type extends TSchema>(type: Type, options?: TSchemaOptions): TParametersDeferred<Type>;
|
|
1709
2036
|
/** Applies a Parameters action to the given type. */
|
|
1710
|
-
type TParameters<Type extends TSchema> = (TParametersAction<Type>);
|
|
2037
|
+
export type TParameters<Type extends TSchema> = (TParametersAction<Type>);
|
|
1711
2038
|
/** Applies a Parameters action to the given type. */
|
|
1712
|
-
declare function Parameters
|
|
2039
|
+
export declare function Parameters<Type extends TSchema>(type: Type, options?: TSchemaOptions): TParameters<Type>;
|
|
1713
2040
|
type TParametersOperation<Type extends TSchema, Parameters extends TSchema[] = Type extends TFunction ? Type['parameters'] : [], InstantiatedParameters extends TSchema[] = TInstantiateElements<{}, TState<[], []>, Parameters>, Result extends TSchema = TTuple<InstantiatedParameters>> = Result;
|
|
1714
|
-
type TParametersAction<Type extends TSchema, Result extends TSchema = TCanInstantiate<[Type]> extends true ? TParametersOperation<Type> : TParametersDeferred<Type>> = Result;
|
|
1715
|
-
declare function ParametersAction<Type extends TSchema>(type: Type, options: TSchemaOptions): TParametersAction<Type>;
|
|
1716
|
-
type TParametersInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, InstantiatedType extends TSchema = TInstantiateType<Context, State, Type>> = TParametersAction<InstantiatedType>;
|
|
1717
|
-
declare function ParametersInstantiate<Context extends TProperties, State extends TState, Type extends TSchema>(context: Context, state: State, type: Type, options: TSchemaOptions): TParametersInstantiate<Context, State, Type>;
|
|
2041
|
+
export type TParametersAction<Type extends TSchema, Result extends TSchema = TCanInstantiate<[Type]> extends true ? TParametersOperation<Type> : TParametersDeferred<Type>> = Result;
|
|
2042
|
+
export declare function ParametersAction<Type extends TSchema>(type: Type, options: TSchemaOptions): TParametersAction<Type>;
|
|
2043
|
+
export type TParametersInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, InstantiatedType extends TSchema = TInstantiateType<Context, State, Type>> = TParametersAction<InstantiatedType>;
|
|
2044
|
+
export declare function ParametersInstantiate<Context extends TProperties, State extends TState, Type extends TSchema>(context: Context, state: State, type: Type, options: TSchemaOptions): TParametersInstantiate<Context, State, Type>;
|
|
1718
2045
|
/** Creates a deferred Partial action. */
|
|
1719
|
-
type TPartialDeferred<Type extends TSchema> = (TDeferred<'Partial', [Type]>);
|
|
2046
|
+
export type TPartialDeferred<Type extends TSchema> = (TDeferred<'Partial', [Type]>);
|
|
1720
2047
|
/** Creates a deferred Partial action. */
|
|
1721
|
-
declare function PartialDeferred<Type extends TSchema>(type: Type, options?: TSchemaOptions): TPartialDeferred<Type>;
|
|
2048
|
+
export declare function PartialDeferred<Type extends TSchema>(type: Type, options?: TSchemaOptions): TPartialDeferred<Type>;
|
|
1722
2049
|
/** Applies a Partial action to the given type. */
|
|
1723
|
-
type TPartial<Type extends TSchema> = (TPartialAction<Type>);
|
|
2050
|
+
export type TPartial<Type extends TSchema> = (TPartialAction<Type>);
|
|
1724
2051
|
/** Applies a Partial action to the given type. */
|
|
1725
2052
|
declare function Partial$1<Type extends TSchema>(type: Type, options?: TSchemaOptions): TPartial<Type>;
|
|
1726
2053
|
type TFromCyclic$2<Defs extends TProperties, Ref extends string, Target extends TSchema = TCyclicTarget<Defs, Ref>, Partial extends TSchema = TFromType$3<Target>, Result extends TSchema = TCyclic<TAssign<Defs, { [_ in Ref]: Partial; }>, Ref>> = Result;
|
|
@@ -1729,16 +2056,16 @@ type TFromIntersect$2<Types extends TSchema[], Evaluated extends TSchema = TEval
|
|
|
1729
2056
|
type TFromUnion$2<Types extends TSchema[], Result extends TSchema[] = []> = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? TFromUnion$2<Right, [...Result, TFromType$3<Left>]> : TUnion<Result>);
|
|
1730
2057
|
type TFromObject$2<Properties extends TProperties, Mapped extends TProperties = { [Key in keyof Properties]: TAddOptional<Properties[Key]>; }, Result extends TSchema = TObject<Mapped>> = Result;
|
|
1731
2058
|
type TFromType$3<Type extends TSchema> = (Type extends TCyclic<infer Defs extends TProperties, infer Ref extends string> ? TFromCyclic$2<Defs, Ref> : Type extends TDependent$1<infer If extends TSchema, infer Then extends TSchema, infer Else extends TSchema> ? TFromDependent$2<If, Then, Else> : Type extends TIntersect<infer Types extends TSchema[]> ? TFromIntersect$2<Types> : Type extends TUnion<infer Types extends TSchema[]> ? TFromUnion$2<Types> : Type extends TObject<infer Properties extends TProperties> ? TFromObject$2<Properties> : TObject<{}>);
|
|
1732
|
-
type TPartialAction<Type extends TSchema, Result extends TSchema = TCanInstantiate<[Type]> extends true ? TFromType$3<Type> : TPartialDeferred<Type>> = Result;
|
|
1733
|
-
declare function PartialAction<Type extends TSchema>(type: Type, options: TSchemaOptions): TPartialAction<Type>;
|
|
1734
|
-
type TPartialInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, InstantiatedType extends TSchema = TInstantiateType<Context, State, Type>> = TPartialAction<InstantiatedType>;
|
|
1735
|
-
declare function PartialInstantiate<Context extends TProperties, State extends TState, Type extends TSchema>(context: Context, state: State, type: Type, options: TSchemaOptions): TPartialInstantiate<Context, State, Type>;
|
|
2059
|
+
export type TPartialAction<Type extends TSchema, Result extends TSchema = TCanInstantiate<[Type]> extends true ? TFromType$3<Type> : TPartialDeferred<Type>> = Result;
|
|
2060
|
+
export declare function PartialAction<Type extends TSchema>(type: Type, options: TSchemaOptions): TPartialAction<Type>;
|
|
2061
|
+
export type TPartialInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, InstantiatedType extends TSchema = TInstantiateType<Context, State, Type>> = TPartialAction<InstantiatedType>;
|
|
2062
|
+
export declare function PartialInstantiate<Context extends TProperties, State extends TState, Type extends TSchema>(context: Context, state: State, type: Type, options: TSchemaOptions): TPartialInstantiate<Context, State, Type>;
|
|
1736
2063
|
/** Creates a deferred Pick action. */
|
|
1737
|
-
type TPickDeferred<Type extends TSchema, Indexer extends TSchema> = (TDeferred<'Pick', [Type, Indexer]>);
|
|
2064
|
+
export type TPickDeferred<Type extends TSchema, Indexer extends TSchema> = (TDeferred<'Pick', [Type, Indexer]>);
|
|
1738
2065
|
/** Creates a deferred Pick action. */
|
|
1739
|
-
declare function PickDeferred<Type extends TSchema, Indexer extends TSchema>(type: Type, indexer: Indexer, options?: TSchemaOptions): TPickDeferred<Type, Indexer>;
|
|
2066
|
+
export declare function PickDeferred<Type extends TSchema, Indexer extends TSchema>(type: Type, indexer: Indexer, options?: TSchemaOptions): TPickDeferred<Type, Indexer>;
|
|
1740
2067
|
/** Applies a Pick action using the given types. */
|
|
1741
|
-
type TPick<Type extends TSchema, Indexer extends TSchema> = (TPickAction<Type, Indexer>);
|
|
2068
|
+
export type TPick<Type extends TSchema, Indexer extends TSchema> = (TPickAction<Type, Indexer>);
|
|
1742
2069
|
/** Applies a Pick action using the given types. */
|
|
1743
2070
|
declare function Pick$1<Type extends TSchema, Indexer extends PropertyKey[]>(type: Type, indexer: readonly [...Indexer], options?: TSchemaOptions): TPick<Type, TKeysToIndexer<Indexer>>;
|
|
1744
2071
|
/** Applies a Pick action using the given types. */
|
|
@@ -1746,23 +2073,23 @@ declare function Pick$1<Type extends TSchema, Indexer extends TSchema>(type: Typ
|
|
|
1746
2073
|
type TComparable<Indexable extends TProperties> = (keyof Indexable extends string | number ? `${keyof Indexable}` : never);
|
|
1747
2074
|
type TFromKeys<Indexable extends TProperties, Keys extends string[], Result extends TProperties = {}> = (Keys extends [infer Left extends string, ...infer Right extends string[]] ? Left extends TComparable<Indexable> ? TFromKeys<Indexable, Right, TAssign<Result, { [_ in Left]: Indexable[Left]; }>> : TFromKeys<Indexable, Right, Result> : Result);
|
|
1748
2075
|
type TFromType$2<Type extends TSchema, Indexer extends TSchema, Indexable extends TProperties = TToIndexable<Type>, Keys extends string[] = TToIndexableKeys<Indexer>, Applied extends TProperties = TFromKeys<Indexable, Keys>, Result extends TSchema = TObject<Applied>> = Result;
|
|
1749
|
-
type TPickAction<Type extends TSchema, Indexer extends TSchema, Result extends TSchema = TCanInstantiate<[Type, Indexer]> extends true ? TFromType$2<Type, Indexer> : TPickDeferred<Type, Indexer>> = Result;
|
|
1750
|
-
declare function PickAction<Type extends TSchema, Indexer extends TSchema>(type: Type, indexer: Indexer, options: TSchemaOptions): TPickAction<Type, Indexer>;
|
|
1751
|
-
type TPickInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, Indexer extends TSchema, InstantiatedType extends TSchema = TInstantiateType<Context, State, Type>, InstantiatedIndexer extends TSchema = TInstantiateType<Context, State, Indexer>> = TPickAction<InstantiatedType, InstantiatedIndexer>;
|
|
1752
|
-
declare function PickInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, Indexer extends TSchema>(context: Context, state: State, type: Type, indexer: Indexer, options: TSchemaOptions): TPickInstantiate<Context, State, Type, Indexer>;
|
|
2076
|
+
export type TPickAction<Type extends TSchema, Indexer extends TSchema, Result extends TSchema = TCanInstantiate<[Type, Indexer]> extends true ? TFromType$2<Type, Indexer> : TPickDeferred<Type, Indexer>> = Result;
|
|
2077
|
+
export declare function PickAction<Type extends TSchema, Indexer extends TSchema>(type: Type, indexer: Indexer, options: TSchemaOptions): TPickAction<Type, Indexer>;
|
|
2078
|
+
export type TPickInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, Indexer extends TSchema, InstantiatedType extends TSchema = TInstantiateType<Context, State, Type>, InstantiatedIndexer extends TSchema = TInstantiateType<Context, State, Indexer>> = TPickAction<InstantiatedType, InstantiatedIndexer>;
|
|
2079
|
+
export declare function PickInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, Indexer extends TSchema>(context: Context, state: State, type: Type, indexer: Indexer, options: TSchemaOptions): TPickInstantiate<Context, State, Type, Indexer>;
|
|
1753
2080
|
/** Creates a deferred ReadonlyType action. */
|
|
1754
|
-
type TReadonlyObjectDeferred<Type extends TSchema> = (TDeferred<'ReadonlyObject', [Type]>);
|
|
2081
|
+
export type TReadonlyObjectDeferred<Type extends TSchema> = (TDeferred<'ReadonlyObject', [Type]>);
|
|
1755
2082
|
/** Creates a deferred ReadonlyType action. */
|
|
1756
|
-
declare function ReadonlyObjectDeferred<Type extends TSchema>(type: Type, options?: TSchemaOptions): TDeferred<"ReadonlyObject", [Type]>;
|
|
2083
|
+
export declare function ReadonlyObjectDeferred<Type extends TSchema>(type: Type, options?: TSchemaOptions): TDeferred<"ReadonlyObject", [Type]>;
|
|
1757
2084
|
/** This type is an alias for TypeScript's `Readonly<T>` utility type. It will make all properties of a TObject readonly or marks an TArray or TTuple as immutable `readonly T[]`. */
|
|
1758
|
-
type TReadonlyObject<Type extends TSchema> = (TReadonlyObjectAction<Type>);
|
|
2085
|
+
export type TReadonlyObject<Type extends TSchema> = (TReadonlyObjectAction<Type>);
|
|
1759
2086
|
/** This type is an alias for TypeScript's `Readonly<T>` utility type. It will make all properties of a TObject readonly or marks an TArray or TTuple as immutable `readonly T[]`. */
|
|
1760
|
-
declare function ReadonlyObject<Type extends TSchema>(type: Type, options?: TSchemaOptions): TReadonlyObject<Type>;
|
|
2087
|
+
export declare function ReadonlyObject<Type extends TSchema>(type: Type, options?: TSchemaOptions): TReadonlyObject<Type>;
|
|
1761
2088
|
/**
|
|
1762
2089
|
* This type has been renamed to ReadonlyObject.
|
|
1763
2090
|
* @deprecated
|
|
1764
2091
|
*/
|
|
1765
|
-
declare const ReadonlyType: typeof ReadonlyObject;
|
|
2092
|
+
export declare const ReadonlyType: typeof ReadonlyObject;
|
|
1766
2093
|
type TFromArray<Type extends TSchema, Result extends TSchema = TAddImmutable<TArray<Type>>> = Result;
|
|
1767
2094
|
type TFromCyclic$1<Defs extends TProperties, Ref extends string, Target extends TSchema = TCyclicTarget<Defs, Ref>, Partial extends TSchema = TFromType$1<Target>, Result extends TSchema = TCyclic<TAssign<Defs, { [_ in Ref]: Partial; }>, Ref>> = Result;
|
|
1768
2095
|
type TFromDependent$1<If extends TSchema, Then extends TSchema, Else extends TSchema, Evaluated extends TSchema = TEvaluateDependent<If, Then, Else>, Result extends TSchema = TFromType$1<Evaluated>> = Result;
|
|
@@ -1771,12 +2098,12 @@ type TFromObject$1<Properties extends TProperties, Mapped extends TProperties =
|
|
|
1771
2098
|
type TFromTuple<Types extends TSchema[], Result extends TSchema = TAddImmutable<TTuple<Types>>> = Result;
|
|
1772
2099
|
type TFromUnion$1<Types extends TSchema[], Result extends TSchema[] = []> = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? TFromUnion$1<Right, [...Result, TFromType$1<Left>]> : TUnion<Result>);
|
|
1773
2100
|
type TFromType$1<Type extends TSchema> = (Type extends TArray<infer Type extends TSchema> ? TFromArray<Type> : Type extends TCyclic<infer Defs extends TProperties, infer Ref extends string> ? TFromCyclic$1<Defs, Ref> : Type extends TDependent$1<infer If extends TSchema, infer Then extends TSchema, infer Else extends TSchema> ? TFromDependent$1<If, Then, Else> : Type extends TIntersect<infer Types extends TSchema[]> ? TFromIntersect$1<Types> : Type extends TObject<infer Properties extends TProperties> ? TFromObject$1<Properties> : Type extends TTuple<infer Types extends TSchema[]> ? TFromTuple<Types> : Type extends TUnion<infer Types extends TSchema[]> ? TFromUnion$1<Types> : Type);
|
|
1774
|
-
type TReadonlyObjectAction<Type extends TSchema, Result extends TSchema = TCanInstantiate<[Type]> extends true ? TFromType$1<Type> : TReadonlyObjectDeferred<Type>> = Result;
|
|
1775
|
-
declare function ReadonlyObjectAction<Type extends TSchema>(type: Type, options: TSchemaOptions): TReadonlyObjectAction<Type>;
|
|
1776
|
-
type TReadonlyObjectInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, InstantiateType extends TSchema = TInstantiateType<Context, State, Type>> = TReadonlyObjectAction<InstantiateType>;
|
|
1777
|
-
declare function ReadonlyObjectInstantiate<Context extends TProperties, State extends TState, Type extends TSchema>(context: Context, state: State, type: Type, options: TSchemaOptions): TReadonlyObjectInstantiate<Context, State, Type>;
|
|
1778
|
-
type TRefInstantiate<Context extends TProperties, State extends TState, Type extends TRef, Ref extends string> = (Ref extends State['visited'][number] ? Type : Ref extends keyof Context ? TInstantiateType<Context, TState<State['callstack'], [...State['visited'], Ref]>, Context[Ref]> : Type);
|
|
1779
|
-
declare function RefInstantiate<Context extends TProperties, State extends TState, Type extends TRef, Ref extends string>(context: Context, state: State, type: Type, ref: Ref): TRefInstantiate<Context, State, Type, Ref>;
|
|
2101
|
+
export type TReadonlyObjectAction<Type extends TSchema, Result extends TSchema = TCanInstantiate<[Type]> extends true ? TFromType$1<Type> : TReadonlyObjectDeferred<Type>> = Result;
|
|
2102
|
+
export declare function ReadonlyObjectAction<Type extends TSchema>(type: Type, options: TSchemaOptions): TReadonlyObjectAction<Type>;
|
|
2103
|
+
export type TReadonlyObjectInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, InstantiateType extends TSchema = TInstantiateType<Context, State, Type>> = TReadonlyObjectAction<InstantiateType>;
|
|
2104
|
+
export declare function ReadonlyObjectInstantiate<Context extends TProperties, State extends TState, Type extends TSchema>(context: Context, state: State, type: Type, options: TSchemaOptions): TReadonlyObjectInstantiate<Context, State, Type>;
|
|
2105
|
+
export type TRefInstantiate<Context extends TProperties, State extends TState, Type extends TRef, Ref extends string> = (Ref extends State['visited'][number] ? Type : Ref extends keyof Context ? TInstantiateType<Context, TState<State['callstack'], [...State['visited'], Ref]>, Context[Ref]> : Type);
|
|
2106
|
+
export declare function RefInstantiate<Context extends TProperties, State extends TState, Type extends TRef, Ref extends string>(context: Context, state: State, type: Type, ref: Ref): TRefInstantiate<Context, State, Type, Ref>;
|
|
1780
2107
|
type TFromCyclic<Defs extends TProperties, Ref extends string, Target extends TSchema = TCyclicTarget<Defs, Ref>, Partial extends TSchema = TFromType<Target>, Result extends TSchema = TCyclic<TAssign<Defs, { [_ in Ref]: Partial; }>, Ref>> = Result;
|
|
1781
2108
|
type TFromDependent<If extends TSchema, Then extends TSchema, Else extends TSchema, Evaluated extends TSchema = TEvaluateDependent<If, Then, Else>, Result extends TSchema = TFromType<Evaluated>> = Result;
|
|
1782
2109
|
type TFromIntersect<Types extends TSchema[], Evaluated extends TSchema = TEvaluateIntersect<Types>, Result extends TSchema = TFromType<Evaluated>> = Result;
|
|
@@ -1784,42 +2111,42 @@ type TFromUnion<Types extends TSchema[], Result extends TSchema[] = []> = (Types
|
|
|
1784
2111
|
type TFromObject<Properties extends TProperties, Mapped extends TProperties = { [Key in keyof Properties]: TRemoveOptional<Properties[Key]>; }, Result extends TSchema = TObject<Mapped>> = Result;
|
|
1785
2112
|
type TFromType<Type extends TSchema> = (Type extends TCyclic<infer Defs extends TProperties, infer Ref extends string> ? TFromCyclic<Defs, Ref> : Type extends TDependent$1<infer If extends TSchema, infer Then extends TSchema, infer Else extends TSchema> ? TFromDependent<If, Then, Else> : Type extends TIntersect<infer Types extends TSchema[]> ? TFromIntersect<Types> : Type extends TUnion<infer Types extends TSchema[]> ? TFromUnion<Types> : Type extends TObject<infer Properties extends TProperties> ? TFromObject<Properties> : TObject<{}>);
|
|
1786
2113
|
/** Creates a deferred Required action. */
|
|
1787
|
-
type TRequiredDeferred<Type extends TSchema> = (TDeferred<'Required', [Type]>);
|
|
2114
|
+
export type TRequiredDeferred<Type extends TSchema> = (TDeferred<'Required', [Type]>);
|
|
1788
2115
|
/** Creates a deferred Required action. */
|
|
1789
|
-
declare function RequiredDeferred<Type extends TSchema>(type: Type, options?: TSchemaOptions): TDeferred<"Required", [Type]>;
|
|
2116
|
+
export declare function RequiredDeferred<Type extends TSchema>(type: Type, options?: TSchemaOptions): TDeferred<"Required", [Type]>;
|
|
1790
2117
|
/** Applies a Required action to the given type. */
|
|
1791
|
-
type TRequired<Type extends TSchema> = (TRequiredAction<Type>);
|
|
2118
|
+
export type TRequired<Type extends TSchema> = (TRequiredAction<Type>);
|
|
1792
2119
|
/** Applies a Required action to the given type. */
|
|
1793
2120
|
declare function Required$1<Type extends TSchema>(type: Type, options?: TSchemaOptions): TRequired<Type>;
|
|
1794
|
-
type TRequiredAction<Type extends TSchema, Result extends TSchema = TCanInstantiate<[Type]> extends true ? TFromType<Type> : TRequiredDeferred<Type>> = Result;
|
|
1795
|
-
declare function RequiredAction<Type extends TSchema>(type: Type, options: TSchemaOptions): TRequiredAction<Type>;
|
|
1796
|
-
type TRequiredInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, InstantiatedType extends TSchema = TInstantiateType<Context, State, Type>> = TRequiredAction<InstantiatedType>;
|
|
1797
|
-
declare function RequiredInstantiate<Context extends TProperties, State extends TState, Type extends TSchema>(context: Context, state: State, type: Type, options: TSchemaOptions): TRequiredInstantiate<Context, State, Type>;
|
|
2121
|
+
export type TRequiredAction<Type extends TSchema, Result extends TSchema = TCanInstantiate<[Type]> extends true ? TFromType<Type> : TRequiredDeferred<Type>> = Result;
|
|
2122
|
+
export declare function RequiredAction<Type extends TSchema>(type: Type, options: TSchemaOptions): TRequiredAction<Type>;
|
|
2123
|
+
export type TRequiredInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, InstantiatedType extends TSchema = TInstantiateType<Context, State, Type>> = TRequiredAction<InstantiatedType>;
|
|
2124
|
+
export declare function RequiredInstantiate<Context extends TProperties, State extends TState, Type extends TSchema>(context: Context, state: State, type: Type, options: TSchemaOptions): TRequiredInstantiate<Context, State, Type>;
|
|
1798
2125
|
/** Creates a deferred ReturnType action. */
|
|
1799
|
-
type TReturnTypeDeferred<Type extends TSchema> = (TDeferred<'ReturnType', [Type]>);
|
|
2126
|
+
export type TReturnTypeDeferred<Type extends TSchema> = (TDeferred<'ReturnType', [Type]>);
|
|
1800
2127
|
/** Creates a deferred ReturnType action. */
|
|
1801
|
-
declare function ReturnTypeDeferred<Type extends TSchema>(type: Type, options?: TSchemaOptions): TReturnTypeDeferred<Type>;
|
|
2128
|
+
export declare function ReturnTypeDeferred<Type extends TSchema>(type: Type, options?: TSchemaOptions): TReturnTypeDeferred<Type>;
|
|
1802
2129
|
/** Applies a ReturnType action to the given type. */
|
|
1803
|
-
type TReturnType<Type extends TSchema> = (TReturnTypeAction<Type>);
|
|
2130
|
+
export type TReturnType<Type extends TSchema> = (TReturnTypeAction<Type>);
|
|
1804
2131
|
/** Applies a ReturnType action to the given type. */
|
|
1805
2132
|
declare function ReturnType$1<Type extends TSchema>(type: Type, options?: TSchemaOptions): TReturnType<Type>;
|
|
1806
2133
|
type TReturnTypeOperation<Type extends TSchema> = (Type extends TFunction ? Type['returnType'] : TNever);
|
|
1807
|
-
type TReturnTypeAction<Type extends TSchema, Result extends TSchema = TCanInstantiate<[Type]> extends true ? TReturnTypeOperation<Type> : TReturnTypeDeferred<Type>> = Result;
|
|
1808
|
-
declare function ReturnTypeAction<Type extends TSchema>(type: Type, options: TSchemaOptions): TReturnTypeAction<Type>;
|
|
1809
|
-
type TReturnTypeInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, InstantiatedType extends TSchema = TInstantiateType<Context, State, Type>> = TReturnTypeAction<InstantiatedType>;
|
|
1810
|
-
declare function ReturnTypeInstantiate<Context extends TProperties, State extends TState, Type extends TSchema>(context: Context, state: State, type: Type, options?: TSchemaOptions): TReturnTypeInstantiate<Context, State, Type>;
|
|
2134
|
+
export type TReturnTypeAction<Type extends TSchema, Result extends TSchema = TCanInstantiate<[Type]> extends true ? TReturnTypeOperation<Type> : TReturnTypeDeferred<Type>> = Result;
|
|
2135
|
+
export declare function ReturnTypeAction<Type extends TSchema>(type: Type, options: TSchemaOptions): TReturnTypeAction<Type>;
|
|
2136
|
+
export type TReturnTypeInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, InstantiatedType extends TSchema = TInstantiateType<Context, State, Type>> = TReturnTypeAction<InstantiatedType>;
|
|
2137
|
+
export declare function ReturnTypeInstantiate<Context extends TProperties, State extends TState, Type extends TSchema>(context: Context, state: State, type: Type, options?: TSchemaOptions): TReturnTypeInstantiate<Context, State, Type>;
|
|
1811
2138
|
/** Creates a deferred With action. */
|
|
1812
|
-
type TWithDeferred<Type extends TSchema, Options extends TSchema> = (TDeferred<'With', [Type, Options]>);
|
|
2139
|
+
export type TWithDeferred<Type extends TSchema, Options extends TSchema> = (TDeferred<'With', [Type, Options]>);
|
|
1813
2140
|
/** Creates a deferred With action. */
|
|
1814
|
-
declare function WithDeferred<Type extends TSchema, Options extends TSchema>(type: Type, options: Options): TWithDeferred<Type, Options>;
|
|
2141
|
+
export declare function WithDeferred<Type extends TSchema, Options extends TSchema>(type: Type, options: Options): TWithDeferred<Type, Options>;
|
|
1815
2142
|
/** Applies annotation options to the given type. */
|
|
1816
|
-
type TWith<Type extends TSchema, Options extends TSchema> = (Type & Options);
|
|
2143
|
+
export type TWith<Type extends TSchema, Options extends TSchema> = (Type & Options);
|
|
1817
2144
|
/** Applies annotation options to the given type. */
|
|
1818
|
-
declare function With<Type extends TSchema, const Options extends TSchema>(type: Type, options: Options): TWithAction<Type, Options>;
|
|
1819
|
-
type TWithAction<Type extends TSchema, Options extends TSchema, Result extends TSchema = TCanInstantiate<[Type]> extends true ? TWith<Type, Options> : TWithDeferred<Type, Options>> = Result;
|
|
1820
|
-
declare function WithAction<Type extends TSchema, Options extends TSchema>(type: Type, options: Options): TWithAction<Type, Options>;
|
|
1821
|
-
type TWithInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, Options extends TSchema, InstantiatedType extends TSchema = TInstantiateType<Context, State, Type>> = TWithAction<InstantiatedType, Options>;
|
|
1822
|
-
declare function WithInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, Options extends TSchema>(context: Context, state: State, type: Type, options: Options): TWithInstantiate<Context, State, Type, Options>;
|
|
2145
|
+
export declare function With<Type extends TSchema, const Options extends TSchema>(type: Type, options: Options): TWithAction<Type, Options>;
|
|
2146
|
+
export type TWithAction<Type extends TSchema, Options extends TSchema, Result extends TSchema = TCanInstantiate<[Type]> extends true ? TWith<Type, Options> : TWithDeferred<Type, Options>> = Result;
|
|
2147
|
+
export declare function WithAction<Type extends TSchema, Options extends TSchema>(type: Type, options: Options): TWithAction<Type, Options>;
|
|
2148
|
+
export type TWithInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, Options extends TSchema, InstantiatedType extends TSchema = TInstantiateType<Context, State, Type>> = TWithAction<InstantiatedType, Options>;
|
|
2149
|
+
export declare function WithInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, Options extends TSchema>(context: Context, state: State, type: Type, options: Options): TWithInstantiate<Context, State, Type, Options>;
|
|
1823
2150
|
type TSpreadElement<Type extends TSchema, Result extends TSchema[] = (Type extends TRest<infer Rest extends TSchema> ? (Rest extends TTuple<infer Elements extends TSchema[]> ? TRestSpread<Elements> : Rest extends TInfer<string, TSchema> ? [Type] : Rest extends TRef<string> ? [Type] : [TNever]) : [Type])> = Result;
|
|
1824
2151
|
type TRestSpread<Types extends TSchema[], Result extends TSchema[] = []> = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? TRestSpread<Right, [...Result, ...TSpreadElement<Left>]> : Result);
|
|
1825
2152
|
interface TState<CallStack extends string[] = string[], Visited extends string[] = string[]> {
|
|
@@ -1835,33 +2162,33 @@ type TInstantiateDeferred<Context extends TProperties, State extends TState, Act
|
|
|
1835
2162
|
type TInstantiateImmediate<Context extends TProperties, State extends TState, Type extends TSchema, InstantiatedType extends TSchema = (Type extends TRef<infer Ref extends string> ? TRefInstantiate<Context, State, Type, Ref> : Type extends TArray<infer Type extends TSchema> ? TArray<TInstantiateType<Context, State, Type>> : Type extends TCall<infer Target extends TSchema, infer Parameters extends TSchema[]> ? TCallInstantiate<Context, State, Target, Parameters> : Type extends TConstructor<infer Parameters extends TSchema[], infer InstanceType extends TSchema> ? TConstructor<TInstantiateTypes<Context, State, Parameters>, TInstantiateType<Context, State, InstanceType>> : Type extends TFunction<infer Parameters extends TSchema[], infer ReturnType extends TSchema> ? TFunction<TInstantiateTypes<Context, State, Parameters>, TInstantiateType<Context, State, ReturnType>> : Type extends TDependent$1<infer If extends TSchema, infer Then extends TSchema, infer Else extends TSchema> ? TDependent$1<TInstantiateType<Context, State, If>, TInstantiateType<Context, State, Then>, TInstantiateType<Context, State, Else>> : Type extends TIntersect<infer Types extends TSchema[]> ? TIntersect<TInstantiateTypes<Context, State, Types>> : Type extends TObject<infer Properties extends TProperties> ? TObject<TInstantiateProperties<Context, State, Properties>> : Type extends TRecord<infer Key extends string, infer Type extends TSchema> ? TRecord<Key, TInstantiateType<Context, State, Type>> : Type extends TRest<infer Type extends TSchema> ? TRest<TInstantiateType<Context, State, Type>> : Type extends TTuple<infer Types extends TSchema[]> ? TTuple<TInstantiateElements<Context, State, Types>> : Type extends TUnion<infer Types extends TSchema[]> ? TUnion<TInstantiateTypes<Context, State, Types>> : Type), WithModifiers extends TSchema = TWithModifiers<Type, InstantiatedType>> = WithModifiers;
|
|
1836
2163
|
type TInstantiateType<Context extends TProperties, State extends TState, Type extends TSchema, Result extends TSchema = Type extends TDeferred<infer Action extends string, infer Types extends TSchema[]> ? TInstantiateDeferred<Context, State, Action, Types> : TInstantiateImmediate<Context, State, Type>> = Result;
|
|
1837
2164
|
/** Instantiates computed schematics using the given context and type. */
|
|
1838
|
-
type TInstantiate<Context extends TProperties, Type extends TSchema> = (TInstantiateType<Context, TState<[], []>, Type>);
|
|
2165
|
+
export type TInstantiate<Context extends TProperties, Type extends TSchema> = (TInstantiateType<Context, TState<[], []>, Type>);
|
|
1839
2166
|
/** Instantiates computed schematics using the given context and type. */
|
|
1840
|
-
declare function Instantiate<Context extends TProperties, Type extends TSchema>(context: Context, type: Type): TInstantiate<Context, Type>;
|
|
2167
|
+
export declare function Instantiate<Context extends TProperties, Type extends TSchema>(context: Context, type: Type): TInstantiate<Context, Type>;
|
|
1841
2168
|
type TAddOptionalOperation<Type extends TSchema, Result extends TSchema = `~optional` extends keyof Type ? Type : TOptional<Type>> = Result;
|
|
1842
2169
|
type TAddOptionalAction<Type extends TSchema, Result extends TSchema = TAddOptionalOperation<Type>> = Result;
|
|
1843
2170
|
type TAddOptionalInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, InstantiateType extends TSchema = TInstantiateType<Context, State, Type>> = TAddOptionalAction<InstantiateType>;
|
|
1844
2171
|
/** Creates a deferred AddOptional action. */
|
|
1845
|
-
type TAddOptionalDeferred<Type extends TSchema> = (TDeferred<'AddOptional', [Type]>);
|
|
2172
|
+
export type TAddOptionalDeferred<Type extends TSchema> = (TDeferred<'AddOptional', [Type]>);
|
|
1846
2173
|
/** Creates a deferred AddOptional action. */
|
|
1847
|
-
declare function AddOptionalDeferred<Type extends TSchema>(type: Type, options?: TSchemaOptions): TAddOptionalDeferred<Type>;
|
|
2174
|
+
export declare function AddOptionalDeferred<Type extends TSchema>(type: Type, options?: TSchemaOptions): TAddOptionalDeferred<Type>;
|
|
1848
2175
|
/** Applies an AddOptional action to a type. */
|
|
1849
|
-
type TAddOptional<Type extends TSchema> = (TAddOptionalAction<Type>);
|
|
2176
|
+
export type TAddOptional<Type extends TSchema> = (TAddOptionalAction<Type>);
|
|
1850
2177
|
/** Applies an AddOptional action to a type. */
|
|
1851
|
-
declare function AddOptional<Type extends TSchema>(type: Type, options?: TSchemaOptions): TAddOptional<Type>;
|
|
1852
|
-
type TOptional<Type extends TSchema = TSchema> = (Type & {
|
|
2178
|
+
export declare function AddOptional<Type extends TSchema>(type: Type, options?: TSchemaOptions): TAddOptional<Type>;
|
|
2179
|
+
export type TOptional<Type extends TSchema = TSchema> = (Type & {
|
|
1853
2180
|
'~optional': true;
|
|
1854
2181
|
});
|
|
1855
2182
|
/** Applies an Optional modifier to the given type. */
|
|
1856
|
-
declare function Optional
|
|
2183
|
+
export declare function Optional<Type extends TSchema>(type: Type): TAddOptional<Type>;
|
|
1857
2184
|
/** Returns true if the given value is TOptional */
|
|
1858
|
-
declare function IsOptional
|
|
2185
|
+
export declare function IsOptional(value: unknown): value is TOptional<TSchema>;
|
|
1859
2186
|
type StaticLast<Stack extends string[], Direction extends StaticDirection, Context extends TProperties, This extends TProperties, Type extends TSchema, Result extends unknown[]> = (Type extends TRest<infer RestType extends TSchema> ? RestType extends TArray<infer ArrayType extends TSchema> ? [...Result, ...TStaticElement<Stack, Direction, Context, This, ArrayType>[0][]] : [...Result, never] : [...Result, ...TStaticElement<Stack, Direction, Context, This, Type>]);
|
|
1860
2187
|
type TStaticElement<Stack extends string[], Direction extends StaticDirection, Context extends TProperties, This extends TProperties, Type extends TSchema, IsReadonly extends boolean = Type extends TReadonly$1 ? true : false, IsOptional extends boolean = Type extends TOptional ? true : false, Inferred extends unknown = StaticType<Stack, Direction, Context, This, Type>, Result extends [unknown?] = ([IsReadonly, IsOptional] extends [true, true] ? [Readonly<Inferred>?] : [IsReadonly, IsOptional] extends [false, true] ? [Inferred?] : [IsReadonly, IsOptional] extends [true, false] ? [Readonly<Inferred>] : [Inferred])> = Result;
|
|
1861
|
-
type TStaticElements<Stack extends string[], Direction extends StaticDirection, Context extends TProperties, This extends TProperties, Types extends TSchema[], Result extends unknown[] = []> = (Types extends [infer Last extends TSchema] ? StaticLast<Stack, Direction, Context, This, Last, Result> : Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? TStaticElements<Stack, Direction, Context, This, Right, [...Result, ...TStaticElement<Stack, Direction, Context, This, Left>]> : Result);
|
|
1862
|
-
type StaticTuple<Stack extends string[], Direction extends StaticDirection, Context extends TProperties, This extends TProperties, Tuple extends TSchema, Items extends TSchema[], Elements extends unknown[] = TStaticElements<Stack, Direction, Context, This, Items>, Result extends readonly unknown[] = (Tuple extends TImmutable ? readonly [...Elements] : Elements)> = Result;
|
|
2188
|
+
export type TStaticElements<Stack extends string[], Direction extends StaticDirection, Context extends TProperties, This extends TProperties, Types extends TSchema[], Result extends unknown[] = []> = (Types extends [infer Last extends TSchema] ? StaticLast<Stack, Direction, Context, This, Last, Result> : Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? TStaticElements<Stack, Direction, Context, This, Right, [...Result, ...TStaticElement<Stack, Direction, Context, This, Left>]> : Result);
|
|
2189
|
+
export type StaticTuple<Stack extends string[], Direction extends StaticDirection, Context extends TProperties, This extends TProperties, Tuple extends TSchema, Items extends TSchema[], Elements extends unknown[] = TStaticElements<Stack, Direction, Context, This, Items>, Result extends readonly unknown[] = (Tuple extends TImmutable ? readonly [...Elements] : Elements)> = Result;
|
|
1863
2190
|
/** Represents a Tuple type. */
|
|
1864
|
-
interface TTuple<Types extends TSchema[] = TSchema[]> extends TSchema {
|
|
2191
|
+
export interface TTuple<Types extends TSchema[] = TSchema[]> extends TSchema {
|
|
1865
2192
|
'~kind': 'Tuple';
|
|
1866
2193
|
type: 'array';
|
|
1867
2194
|
additionalItems: false;
|
|
@@ -1869,40 +2196,40 @@ interface TTuple<Types extends TSchema[] = TSchema[]> extends TSchema {
|
|
|
1869
2196
|
minItems: Types['length'];
|
|
1870
2197
|
}
|
|
1871
2198
|
/** Creates a Tuple type. */
|
|
1872
|
-
declare function Tuple<Types extends TSchema[]>(types: [...Types], options?: TTupleOptions): TTuple<Types>;
|
|
2199
|
+
export declare function Tuple<Types extends TSchema[]>(types: [...Types], options?: TTupleOptions): TTuple<Types>;
|
|
1873
2200
|
/** Returns true if the given value is TTuple. */
|
|
1874
|
-
declare function IsTuple(value: unknown): value is TTuple;
|
|
2201
|
+
export declare function IsTuple(value: unknown): value is TTuple;
|
|
1875
2202
|
/** Extracts options from a TTuple. */
|
|
1876
|
-
declare function TupleOptions(type: TTuple): TTupleOptions;
|
|
1877
|
-
type StaticInstantiatedParameters<Stack extends string[], Direction extends StaticDirection, Context extends TProperties, This extends TProperties, Parameters extends TSchema[], Evaluated extends TSchema = TInstantiate<Context, TTuple<Parameters>>, Static extends unknown = StaticType<Stack, Direction, Context, This, Evaluated>, Result extends unknown[] = Static extends unknown[] ? Static : []> = Result;
|
|
1878
|
-
type StaticFunction<Stack extends string[], Direction extends StaticDirection, Context extends TProperties, This extends TProperties, Parameters extends TSchema[], ReturnType extends TSchema, StaticParameters extends unknown[] = StaticInstantiatedParameters<Stack, Direction, Context, This, Parameters>, StaticReturnType extends unknown = StaticType<Stack, Direction, Context, This, ReturnType>, Result = (...args: StaticParameters) => StaticReturnType> = Result;
|
|
2203
|
+
export declare function TupleOptions(type: TTuple): TTupleOptions;
|
|
2204
|
+
export type StaticInstantiatedParameters<Stack extends string[], Direction extends StaticDirection, Context extends TProperties, This extends TProperties, Parameters extends TSchema[], Evaluated extends TSchema = TInstantiate<Context, TTuple<Parameters>>, Static extends unknown = StaticType<Stack, Direction, Context, This, Evaluated>, Result extends unknown[] = Static extends unknown[] ? Static : []> = Result;
|
|
2205
|
+
export type StaticFunction<Stack extends string[], Direction extends StaticDirection, Context extends TProperties, This extends TProperties, Parameters extends TSchema[], ReturnType extends TSchema, StaticParameters extends unknown[] = StaticInstantiatedParameters<Stack, Direction, Context, This, Parameters>, StaticReturnType extends unknown = StaticType<Stack, Direction, Context, This, ReturnType>, Result = (...args: StaticParameters) => StaticReturnType> = Result;
|
|
1879
2206
|
/** Represents a Function type. */
|
|
1880
|
-
interface TFunction<Parameters extends TSchema[] = TSchema[], ReturnType extends TSchema = TSchema> extends TSchema {
|
|
2207
|
+
export interface TFunction<Parameters extends TSchema[] = TSchema[], ReturnType extends TSchema = TSchema> extends TSchema {
|
|
1881
2208
|
'~kind': 'Function';
|
|
1882
2209
|
type: 'function';
|
|
1883
2210
|
parameters: Parameters;
|
|
1884
2211
|
returnType: ReturnType;
|
|
1885
2212
|
}
|
|
1886
2213
|
/** Creates a Function type. */
|
|
1887
|
-
declare function _Function_<Parameters extends TSchema[], ReturnType extends TSchema>(parameters: [...Parameters], returnType: ReturnType, options?: TSchemaOptions): TFunction<Parameters, ReturnType>;
|
|
2214
|
+
export declare function _Function_<Parameters extends TSchema[], ReturnType extends TSchema>(parameters: [...Parameters], returnType: ReturnType, options?: TSchemaOptions): TFunction<Parameters, ReturnType>;
|
|
1888
2215
|
/** Returns true if the given value is TFunction. */
|
|
1889
|
-
declare function IsFunction(value: unknown): value is TFunction;
|
|
2216
|
+
export declare function IsFunction(value: unknown): value is TFunction;
|
|
1890
2217
|
/** Extracts options from a TFunction. */
|
|
1891
|
-
declare function FunctionOptions(type: TFunction): TSchemaOptions;
|
|
1892
|
-
type StaticConstructor<Stack extends string[], Direction extends StaticDirection, Context extends TProperties, This extends TProperties, Parameters extends TSchema[], InstanceType extends TSchema, StaticParameters extends unknown[] = StaticInstantiatedParameters<Stack, Direction, Context, This, Parameters>, StaticReturnType extends unknown = StaticType<Stack, Direction, Context, This, InstanceType>, Result = new (...args: StaticParameters) => StaticReturnType> = Result;
|
|
2218
|
+
export declare function FunctionOptions(type: TFunction): TSchemaOptions;
|
|
2219
|
+
export type StaticConstructor<Stack extends string[], Direction extends StaticDirection, Context extends TProperties, This extends TProperties, Parameters extends TSchema[], InstanceType extends TSchema, StaticParameters extends unknown[] = StaticInstantiatedParameters<Stack, Direction, Context, This, Parameters>, StaticReturnType extends unknown = StaticType<Stack, Direction, Context, This, InstanceType>, Result = new (...args: StaticParameters) => StaticReturnType> = Result;
|
|
1893
2220
|
/** Represents a Constructor type. */
|
|
1894
|
-
interface TConstructor<Parameters extends TSchema[] = TSchema[], InstanceType extends TSchema = TSchema> extends TSchema {
|
|
2221
|
+
export interface TConstructor<Parameters extends TSchema[] = TSchema[], InstanceType extends TSchema = TSchema> extends TSchema {
|
|
1895
2222
|
'~kind': 'Constructor';
|
|
1896
2223
|
type: 'constructor';
|
|
1897
2224
|
parameters: Parameters;
|
|
1898
2225
|
instanceType: InstanceType;
|
|
1899
2226
|
}
|
|
1900
2227
|
/** Creates a Constructor type. */
|
|
1901
|
-
declare function Constructor<Parameters extends TSchema[], InstanceType extends TSchema>(parameters: [...Parameters], instanceType: InstanceType, options?: TSchemaOptions): TConstructor<Parameters, InstanceType>;
|
|
2228
|
+
export declare function Constructor<Parameters extends TSchema[], InstanceType extends TSchema>(parameters: [...Parameters], instanceType: InstanceType, options?: TSchemaOptions): TConstructor<Parameters, InstanceType>;
|
|
1902
2229
|
/** Returns true if the given value is a TConstructor. */
|
|
1903
|
-
declare function IsConstructor(value: unknown): value is TConstructor;
|
|
2230
|
+
export declare function IsConstructor(value: unknown): value is TConstructor;
|
|
1904
2231
|
/** Extracts options from a TConstructor. */
|
|
1905
|
-
declare function ConstructorOptions(type: TConstructor): TSchemaOptions;
|
|
2232
|
+
export declare function ConstructorOptions(type: TConstructor): TSchemaOptions;
|
|
1906
2233
|
type XSchemaObject = object;
|
|
1907
2234
|
type XSchemaBoolean = boolean;
|
|
1908
2235
|
type XSchema = XSchemaObject | XSchemaBoolean;
|
|
@@ -2046,77 +2373,80 @@ type XStaticObject<Stack extends string[], Root extends XSchema, Schema extends
|
|
|
2046
2373
|
type XStaticBoolean<Schema extends boolean, Result extends unknown = Schema extends false ? never : unknown> = Result;
|
|
2047
2374
|
type XStaticSchema<Stack extends string[], Root extends XSchema, Schema extends XSchema, Result extends unknown = Schema extends boolean ? XStaticBoolean<Schema> : XStaticObject<Stack, Root, Schema>> = Result;
|
|
2048
2375
|
type XStatic<Value extends unknown, Schema extends XSchema = Value extends XSchema ? Value : {}, Canonical extends XSchema = XCanonical<Schema>, Result extends unknown = XStaticSchema<[], Canonical, Canonical>> = Result;
|
|
2049
|
-
type StaticEvaluate<T> = { [K in keyof T]: T[K]; } & {};
|
|
2050
|
-
type StaticDirection = 'Encode' | 'Decode';
|
|
2051
|
-
type StaticType<Stack extends string[], Direction extends StaticDirection, Context extends TProperties, This extends TProperties, Type extends TSchema> = (Type extends TCodec<infer Type extends TSchema, infer Decoded extends unknown> ? StaticCodec<Stack, Direction, Context, This, Type, Decoded> : Type extends TAny ? StaticAny : Type extends TArray<infer Items extends TSchema> ? StaticArray<Stack, Direction, Context, This, Type, Items> : Type extends TBigInt$1 ? StaticBigInt : Type extends TBoolean ? StaticBoolean : Type extends TConstructor<infer Parameters extends TSchema[], infer ReturnType extends TSchema> ? StaticConstructor<Stack, Direction, Context, This, Parameters, ReturnType> : Type extends TEnum<infer Values extends TEnumValue[]> ? StaticEnum<Values> : Type extends TFunction<infer Parameters extends TSchema[], infer ReturnType extends TSchema> ? StaticFunction<Stack, Direction, Context, This, Parameters, ReturnType> : Type extends TDependent$1<infer If extends TSchema, infer Then extends TSchema, infer Else extends TSchema> ? StaticDependent<Stack, Direction, Context, This, If, Then, Else> : Type extends TInteger$1 ? StaticInteger : Type extends TIntersect<infer Types extends TSchema[]> ? StaticIntersect<Stack, Direction, Context, This, Types> : Type extends TLiteral<infer Value extends TLiteralValue> ? StaticLiteral<Value> : Type extends TNever ? StaticNever : Type extends TNull ? StaticNull : Type extends TNumber$1 ? StaticNumber : Type extends TObject<infer Properties extends TProperties> ? StaticObject<Stack, Direction, Context, This, Properties> : Type extends TRecord<infer Key extends string, infer Value extends TSchema> ? StaticRecord<Stack, Direction, Context, This, Key, Value> : Type extends TCyclic<infer Defs extends TProperties, infer Ref extends string> ? StaticCyclic<Stack, Direction, Context, This, Defs, Ref> : Type extends TRef<infer Ref extends string> ? StaticRef<Stack, Direction, Context, This, Ref> : Type extends TString$1 ? StaticString : Type extends TSymbol ? StaticSymbol : Type extends TTemplateLiteral<infer Pattern extends string> ? StaticTemplateLiteral<Pattern> : Type extends TThis ? StaticThis<Stack, Direction, Context, This> : Type extends TTuple<infer Items extends TSchema[]> ? StaticTuple<Stack, Direction, Context, This, Type, Items> : Type extends TUndefined ? StaticUndefined : Type extends TUnion<infer Types extends TSchema[]> ? StaticUnion<Stack, Direction, Context, This, Types> : Type extends TUnknown ? StaticUnknown : Type extends TUnsafe<infer Type extends unknown> ? StaticUnsafe<Type> : Type extends TVoid ? StaticVoid : XStatic<Type>);
|
|
2376
|
+
export type StaticEvaluate<T> = { [K in keyof T]: T[K]; } & {};
|
|
2377
|
+
export type StaticDirection = 'Encode' | 'Decode';
|
|
2378
|
+
export type StaticType<Stack extends string[], Direction extends StaticDirection, Context extends TProperties, This extends TProperties, Type extends TSchema> = (Type extends TCodec<infer Type extends TSchema, infer Decoded extends unknown> ? StaticCodec<Stack, Direction, Context, This, Type, Decoded> : Type extends TAny ? StaticAny : Type extends TArray<infer Items extends TSchema> ? StaticArray<Stack, Direction, Context, This, Type, Items> : Type extends TBigInt$1 ? StaticBigInt : Type extends TBoolean ? StaticBoolean : Type extends TConstructor<infer Parameters extends TSchema[], infer ReturnType extends TSchema> ? StaticConstructor<Stack, Direction, Context, This, Parameters, ReturnType> : Type extends TEnum<infer Values extends TEnumValue[]> ? StaticEnum<Values> : Type extends TFunction<infer Parameters extends TSchema[], infer ReturnType extends TSchema> ? StaticFunction<Stack, Direction, Context, This, Parameters, ReturnType> : Type extends TDependent$1<infer If extends TSchema, infer Then extends TSchema, infer Else extends TSchema> ? StaticDependent<Stack, Direction, Context, This, If, Then, Else> : Type extends TInteger$1 ? StaticInteger : Type extends TIntersect<infer Types extends TSchema[]> ? StaticIntersect<Stack, Direction, Context, This, Types> : Type extends TLiteral<infer Value extends TLiteralValue> ? StaticLiteral<Value> : Type extends TNever ? StaticNever : Type extends TNull ? StaticNull : Type extends TNumber$1 ? StaticNumber : Type extends TObject<infer Properties extends TProperties> ? StaticObject<Stack, Direction, Context, This, Properties> : Type extends TRecord<infer Key extends string, infer Value extends TSchema> ? StaticRecord<Stack, Direction, Context, This, Key, Value> : Type extends TCyclic<infer Defs extends TProperties, infer Ref extends string> ? StaticCyclic<Stack, Direction, Context, This, Defs, Ref> : Type extends TRef<infer Ref extends string> ? StaticRef<Stack, Direction, Context, This, Ref> : Type extends TString$1 ? StaticString : Type extends TSymbol ? StaticSymbol : Type extends TTemplateLiteral<infer Pattern extends string> ? StaticTemplateLiteral<Pattern> : Type extends TThis ? StaticThis<Stack, Direction, Context, This> : Type extends TTuple<infer Items extends TSchema[]> ? StaticTuple<Stack, Direction, Context, This, Type, Items> : Type extends TUndefined ? StaticUndefined : Type extends TUnion<infer Types extends TSchema[]> ? StaticUnion<Stack, Direction, Context, This, Types> : Type extends TUnknown ? StaticUnknown : Type extends TUnsafe<infer Type extends unknown> ? StaticUnsafe<Type> : Type extends TVoid ? StaticVoid : XStatic<Type>);
|
|
2052
2379
|
/** Infers a static type from a TypeBox type using Parse logic. */
|
|
2053
|
-
type StaticParse<Type extends TSchema, Context extends TProperties = {}, Result extends unknown = StaticType<[], 'Encode', Context, {}, Type>> = Result;
|
|
2380
|
+
export type StaticParse<Type extends TSchema, Context extends TProperties = {}, Result extends unknown = StaticType<[], 'Encode', Context, {}, Type>> = Result;
|
|
2054
2381
|
/** Infers a static type from a TypeBox type using Decode logic. */
|
|
2055
|
-
type StaticDecode<Type extends TSchema, Context extends TProperties = {}, Result extends unknown = StaticType<[], 'Decode', Context, {}, Type>> = Result;
|
|
2382
|
+
export type StaticDecode<Type extends TSchema, Context extends TProperties = {}, Result extends unknown = StaticType<[], 'Decode', Context, {}, Type>> = Result;
|
|
2056
2383
|
/** Infers a static type from a TypeBox type using Encode logic. */
|
|
2057
|
-
type StaticEncode<Type extends TSchema, Context extends TProperties = {}, Result extends unknown = StaticType<[], 'Encode', Context, {}, Type>> = Result;
|
|
2384
|
+
export type StaticEncode<Type extends TSchema, Context extends TProperties = {}, Result extends unknown = StaticType<[], 'Encode', Context, {}, Type>> = Result;
|
|
2058
2385
|
/** Infers a static type from a TypeBox type. */
|
|
2059
|
-
type Static<Type extends TSchema, Context extends TProperties = {}, Result extends unknown = StaticType<[], 'Encode', Context, {}, Type>> = Result;
|
|
2386
|
+
export type Static<Type extends TSchema, Context extends TProperties = {}, Result extends unknown = StaticType<[], 'Encode', Context, {}, Type>> = Result;
|
|
2060
2387
|
type ReadonlyOptionalKeys<Properties extends TProperties, Result extends PropertyKey = { [Key in keyof Properties]: Properties[Key] extends TReadonly$1<TSchema> ? (Properties[Key] extends TOptional<Properties[Key]> ? Key : never) : never; }[keyof Properties]> = Result;
|
|
2061
2388
|
type ReadonlyKeys<Properties extends TProperties, Result extends PropertyKey = { [Key in keyof Properties]: Properties[Key] extends TReadonly$1<TSchema> ? (Properties[Key] extends TOptional<Properties[Key]> ? never : Key) : never; }[keyof Properties]> = Result;
|
|
2062
2389
|
type OptionalKeys<Properties extends TProperties, Result extends PropertyKey = { [Key in keyof Properties]: Properties[Key] extends TOptional<TSchema> ? (Properties[Key] extends TReadonly$1<Properties[Key]> ? never : Key) : never; }[keyof Properties]> = Result;
|
|
2063
2390
|
type RequiredKeys<Properties extends TProperties, Result extends PropertyKey = keyof Omit<Properties, ReadonlyOptionalKeys<Properties> | ReadonlyKeys<Properties> | OptionalKeys<Properties>>> = Result;
|
|
2064
2391
|
type StaticPropertiesWithModifiers<Properties extends TProperties, PropertiesWithoutModifiers extends Record<PropertyKey, unknown>> = StaticEvaluate<Readonly<Partial<Pick<PropertiesWithoutModifiers, ReadonlyOptionalKeys<Properties>>>> & Readonly<Pick<PropertiesWithoutModifiers, ReadonlyKeys<Properties>>> & Partial<Pick<PropertiesWithoutModifiers, OptionalKeys<Properties>>> & Required<Pick<PropertiesWithoutModifiers, RequiredKeys<Properties>>>>;
|
|
2065
2392
|
type StaticPropertiesWithoutModifiers<Stack extends string[], Direction extends StaticDirection, Context extends TProperties, This extends TProperties, Properties extends TProperties, Result extends Record<PropertyKey, unknown> = { [Key in keyof Properties]: StaticType<Stack, Direction, Context, This, Properties[Key]>; }> = Result;
|
|
2066
|
-
type StaticProperties<Stack extends string[], Direction extends StaticDirection, Context extends TProperties, This extends TProperties, Properties extends TProperties, PropertiesWithoutModifiers extends Record<PropertyKey, unknown> = StaticPropertiesWithoutModifiers<Stack, Direction, Context, This, Properties>, PropertiesWithModifiers extends Record<PropertyKey, unknown> = StaticPropertiesWithModifiers<Properties, PropertiesWithoutModifiers>, Result extends Record<PropertyKey, unknown> = { [Key in keyof PropertiesWithModifiers]: PropertiesWithModifiers[Key]; }> = Result;
|
|
2393
|
+
export type StaticProperties<Stack extends string[], Direction extends StaticDirection, Context extends TProperties, This extends TProperties, Properties extends TProperties, PropertiesWithoutModifiers extends Record<PropertyKey, unknown> = StaticPropertiesWithoutModifiers<Stack, Direction, Context, This, Properties>, PropertiesWithModifiers extends Record<PropertyKey, unknown> = StaticPropertiesWithModifiers<Properties, PropertiesWithoutModifiers>, Result extends Record<PropertyKey, unknown> = { [Key in keyof PropertiesWithModifiers]: PropertiesWithModifiers[Key]; }> = Result;
|
|
2067
2394
|
/** Represents a Record<PropertyKey, TSchema> structure. */
|
|
2068
|
-
interface TProperties extends TSchema {
|
|
2395
|
+
export interface TProperties extends TSchema {
|
|
2069
2396
|
[key: PropertyKey]: TSchema;
|
|
2070
2397
|
}
|
|
2071
2398
|
/** Creates a RequiredArray derived from the given TProperties value. */
|
|
2072
|
-
type TRequiredArray<Properties extends TProperties, RequiredProperties extends TProperties = { [Key in keyof Properties as Properties[Key] extends TOptional<Properties[Key]> ? never : Key]: Properties[Key]; }, RequiredKeys extends string[] = TUnionToTuple<Extract<keyof RequiredProperties, string>>, Result extends string[] | undefined = RequiredKeys extends [] ? undefined : RequiredKeys> = Result;
|
|
2399
|
+
export type TRequiredArray<Properties extends TProperties, RequiredProperties extends TProperties = { [Key in keyof Properties as Properties[Key] extends TOptional<Properties[Key]> ? never : Key]: Properties[Key]; }, RequiredKeys extends string[] = TUnionToTuple<Extract<keyof RequiredProperties, string>>, Result extends string[] | undefined = RequiredKeys extends [] ? undefined : RequiredKeys> = Result;
|
|
2073
2400
|
/** Creates a RequiredArray derived from the given TProperties value. */
|
|
2074
|
-
declare function RequiredArray<Properties extends TProperties>(properties: Properties): TRequiredArray<Properties>;
|
|
2401
|
+
export declare function RequiredArray<Properties extends TProperties>(properties: Properties): TRequiredArray<Properties>;
|
|
2075
2402
|
type TKeyToString<Key extends number | string> = `${Key}`;
|
|
2076
2403
|
/** Extracts a tuple of keys from a TProperties value. */
|
|
2077
|
-
type TPropertyKeys<Properties extends TProperties, ExtractKey extends number | string = Extract<keyof Properties, number | string>, StringKey extends string = TKeyToString<ExtractKey>, Result extends string[] = TUnionToTuple<StringKey>> = Result;
|
|
2404
|
+
export type TPropertyKeys<Properties extends TProperties, ExtractKey extends number | string = Extract<keyof Properties, number | string>, StringKey extends string = TKeyToString<ExtractKey>, Result extends string[] = TUnionToTuple<StringKey>> = Result;
|
|
2078
2405
|
/** Extracts a tuple of keys from a TProperties value. */
|
|
2079
|
-
declare function PropertyKeys<Properties extends TProperties>(properties: Properties): TPropertyKeys<Properties>;
|
|
2406
|
+
export declare function PropertyKeys<Properties extends TProperties>(properties: Properties): TPropertyKeys<Properties>;
|
|
2080
2407
|
type TPropertyValuesReduce<Properties extends TProperties, Keys extends string[], Result extends TSchema[] = []> = Keys extends [infer Left extends string, ...infer Right extends string[]] ? Left extends keyof Properties ? TPropertyValuesReduce<Properties, Right, [...Result, Properties[Left]]> : TPropertyValuesReduce<Properties, Right, Result> : Result;
|
|
2081
2408
|
/** Extracts a tuple of property values from a TProperties value. */
|
|
2082
|
-
type TPropertyValues<Properties extends TProperties, Keys extends string[] = TPropertyKeys<Properties>, Result extends TSchema[] = TPropertyValuesReduce<Properties, Keys>> = Result;
|
|
2409
|
+
export type TPropertyValues<Properties extends TProperties, Keys extends string[] = TPropertyKeys<Properties>, Result extends TSchema[] = TPropertyValuesReduce<Properties, Keys>> = Result;
|
|
2083
2410
|
/** Extracts a tuple of property values from a TProperties value. */
|
|
2084
|
-
declare function PropertyValues<Properties extends TProperties>(properties: Properties): TPropertyValues<Properties>;
|
|
2411
|
+
export declare function PropertyValues<Properties extends TProperties>(properties: Properties): TPropertyValues<Properties>;
|
|
2085
2412
|
type TAddImmutableOperation<Type extends TSchema, Result extends TSchema = '~immutable' extends keyof Type ? Type : TImmutable<Type>> = Result;
|
|
2086
2413
|
type TAddImmutableAction<Type extends TSchema, Result extends TSchema = TAddImmutableOperation<Type>> = Result;
|
|
2087
2414
|
type TAddImmutableInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, InstantiateType extends TSchema = TInstantiateType<Context, State, Type>> = TAddImmutableAction<InstantiateType>;
|
|
2088
2415
|
/** Creates a deferred AddImmutable action. */
|
|
2089
|
-
type TAddImmutableDeferred<Type extends TSchema> = (TDeferred<'AddImmutable', [Type]>);
|
|
2416
|
+
export type TAddImmutableDeferred<Type extends TSchema> = (TDeferred<'AddImmutable', [Type]>);
|
|
2090
2417
|
/** Creates a deferred AddImmutable action. */
|
|
2091
|
-
declare function AddImmutableDeferred<Type extends TSchema>(type: Type, options?: TSchemaOptions): TAddImmutableDeferred<Type>;
|
|
2418
|
+
export declare function AddImmutableDeferred<Type extends TSchema>(type: Type, options?: TSchemaOptions): TAddImmutableDeferred<Type>;
|
|
2092
2419
|
/** Applies an AddImmutable action to a type. */
|
|
2093
|
-
type TAddImmutable<Type extends TSchema> = (TAddImmutableAction<Type>);
|
|
2420
|
+
export type TAddImmutable<Type extends TSchema> = (TAddImmutableAction<Type>);
|
|
2094
2421
|
/** Applies an AddImmutable action to a type. */
|
|
2095
|
-
declare function AddImmutable<Type extends TSchema>(type: Type, options?: TSchemaOptions): TAddImmutable<Type>;
|
|
2422
|
+
export declare function AddImmutable<Type extends TSchema>(type: Type, options?: TSchemaOptions): TAddImmutable<Type>;
|
|
2096
2423
|
/** Creates a deferred RemoveImmutable action. */
|
|
2097
|
-
type TRemoveImmutableDeferred<Type extends TSchema> = (TDeferred<'RemoveImmutable', [Type]>);
|
|
2424
|
+
export type TRemoveImmutableDeferred<Type extends TSchema> = (TDeferred<'RemoveImmutable', [Type]>);
|
|
2098
2425
|
/** Creates a deferred RemoveImmutable action. */
|
|
2099
|
-
declare function RemoveImmutableDeferred<Type extends TSchema>(type: Type, options?: TSchemaOptions): TRemoveImmutableDeferred<Type>;
|
|
2426
|
+
export declare function RemoveImmutableDeferred<Type extends TSchema>(type: Type, options?: TSchemaOptions): TRemoveImmutableDeferred<Type>;
|
|
2100
2427
|
/** Applies an RemoveImmutable action to a type. */
|
|
2101
|
-
type TRemoveImmutable<Type extends TSchema> = (TRemoveImmutableAction<Type>);
|
|
2428
|
+
export type TRemoveImmutable<Type extends TSchema> = (TRemoveImmutableAction<Type>);
|
|
2102
2429
|
/** Applies an RemoveImmutable action to a type. */
|
|
2103
|
-
declare function RemoveImmutable<Type extends TSchema>(type: Type, options?: TSchemaOptions): TRemoveImmutable<Type>;
|
|
2430
|
+
export declare function RemoveImmutable<Type extends TSchema>(type: Type, options?: TSchemaOptions): TRemoveImmutable<Type>;
|
|
2104
2431
|
/** Creates a deferred Evaluate action. */
|
|
2105
|
-
type TEvaluateDeferred<Type extends TSchema> = (TDeferred<'Evaluate', [Type]>);
|
|
2432
|
+
export type TEvaluateDeferred<Type extends TSchema> = (TDeferred<'Evaluate', [Type]>);
|
|
2106
2433
|
/** Creates a deferred Evaluate action. */
|
|
2107
|
-
declare function EvaluateDeferred<Type extends TSchema>(type: Type, options?: TSchemaOptions): TEvaluateDeferred<Type>;
|
|
2434
|
+
export declare function EvaluateDeferred<Type extends TSchema>(type: Type, options?: TSchemaOptions): TEvaluateDeferred<Type>;
|
|
2108
2435
|
/** Applies an Evaluate action to a type. */
|
|
2109
|
-
type TEvaluate<Type extends TSchema> = (TEvaluateAction<Type>);
|
|
2436
|
+
export type TEvaluate<Type extends TSchema> = (TEvaluateAction<Type>);
|
|
2110
2437
|
/** Applies an Evaluate action to a type. */
|
|
2111
|
-
declare function Evaluate<Type extends TSchema>(type: Type, options?: TSchemaOptions): TEvaluate<Type>;
|
|
2438
|
+
export declare function Evaluate<Type extends TSchema>(type: Type, options?: TSchemaOptions): TEvaluate<Type>;
|
|
2112
2439
|
/** Creates a deferred Module action. */
|
|
2113
|
-
type TModuleDeferred<Declarations extends TProperties> = (TDeferred<'Module', [Declarations]>);
|
|
2440
|
+
export type TModuleDeferred<Declarations extends TProperties> = (TDeferred<'Module', [Declarations]>);
|
|
2114
2441
|
/** Creates a deferred Module action. */
|
|
2115
|
-
declare function ModuleDeferred<Declarations extends TProperties>(declarations: Declarations, options?: TSchemaOptions): TModuleDeferred<Declarations>;
|
|
2442
|
+
export declare function ModuleDeferred<Declarations extends TProperties>(declarations: Declarations, options?: TSchemaOptions): TModuleDeferred<Declarations>;
|
|
2116
2443
|
/** Creates a Module with the given declarations */
|
|
2117
|
-
type TModule<Declarations extends TProperties> = (TModuleInstantiate<{}, TState<[], []>, Declarations>);
|
|
2444
|
+
export type TModule<Declarations extends TProperties> = (TModuleInstantiate<{}, TState<[], []>, Declarations>);
|
|
2118
2445
|
/** Creates a Module with the given declarations */
|
|
2119
|
-
declare function Module<Declarations extends TProperties>(declarations: Declarations, options?: TSchemaOptions): TModule<Declarations>;
|
|
2446
|
+
export declare function Module<Declarations extends TProperties>(declarations: Declarations, options?: TSchemaOptions): TModule<Declarations>;
|
|
2447
|
+
declare namespace index_d_exports$1 {
|
|
2448
|
+
export { AddImmutable, AddImmutableDeferred, AddOptional, AddOptionalDeferred, AddReadonly, AddReadonlyDeferred, Capitalize$1 as Capitalize, CapitalizeDeferred, Conditional, ConditionalDeferred, ConstructorParameters, ConstructorParametersDeferred, Evaluate, EvaluateDeferred, Exclude$1 as Exclude, ExcludeDeferred, Extract$1 as Extract, ExtractDeferred, Index, IndexDeferred, InstanceType, InstanceTypeDeferred, Interface, InterfaceDeferred, IsInterfaceDeferred, KeyOf, KeyOfDeferred, Lowercase$1 as Lowercase, LowercaseDeferred, Mapped, MappedDeferred, Module, ModuleDeferred, NonNullable, NonNullableDeferred, Omit$1 as Omit, OmitDeferred, Parameters, ParametersDeferred, Partial$1 as Partial, PartialDeferred, Pick$1 as Pick, PickDeferred, ReadonlyObject, ReadonlyObjectDeferred, ReadonlyType, RemoveImmutable, RemoveImmutableDeferred, RemoveOptional, RemoveOptionalDeferred, RemoveReadonly, RemoveReadonlyDeferred, Required$1 as Required, RequiredDeferred, ReturnType$1 as ReturnType, ReturnTypeDeferred, TAddImmutable, TAddImmutableDeferred, TAddOptional, TAddOptionalDeferred, TAddReadonly, TAddReadonlyDeferred, TCapitalize, TCapitalizeDeferred, TConditional, TConditionalDeferred, TConstructorParameters, TConstructorParametersDeferred, TEvaluate, TEvaluateDeferred, TExclude, TExcludeDeferred, TExtract, TExtractDeferred, TIndex, TIndexDeferred, TInstanceType, TInstanceTypeDeferred, TInterface, TInterfaceDeferred, TKeyOf, TKeyOfDeferred, TLowercase, TLowercaseDeferred, TMapped, TMappedDeferred, TModule, TModuleDeferred, TNonNullable, TNonNullableDeferred, TOmit, TOmitDeferred, TParameters, TParametersDeferred, TPartial, TPartialDeferred, TPick, TPickDeferred, TReadonlyObject, TReadonlyObjectDeferred, TRemoveImmutable, TRemoveImmutableDeferred, TRemoveOptional, TRemoveOptionalDeferred, TRemoveReadonly, TRemoveReadonlyDeferred, TRequired, TRequiredDeferred, TReturnType, TReturnTypeDeferred, TUncapitalize, TUncapitalizeDeferred, TUppercase, TUppercaseDeferred, TWith, TWithDeferred, Uncapitalize$1 as Uncapitalize, UncapitalizeDeferred, Uppercase$1 as Uppercase, UppercaseDeferred, With, WithDeferred };
|
|
2449
|
+
}
|
|
2120
2450
|
type TComparer<Left extends TSchema, Right extends TSchema, CompareResult extends TCompareResult = TCompare<Left, Right>, Result extends 0 | 1 = (CompareResult extends typeof CompareResultRightInside ? 1 : CompareResult extends typeof CompareResultDisjoint ? 1 : 0)> = Result;
|
|
2121
2451
|
type TInsert<Type extends TSchema, Types extends TSchema[], Result extends TSchema[] = []> = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? TComparer<Type, Left> extends 1 ? TInsert<Type, Right, [...Result, Left]> : [...Result, Type, ...Types] : [...Result, Type]);
|
|
2122
2452
|
type TSort<Types extends TSchema[], Result extends TSchema[] = []> = (Types extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? TSort<Right, TInsert<Left, Result>> : Result);
|
|
@@ -2126,27 +2456,27 @@ type TSort<Types extends TSchema[], Result extends TSchema[] = []> = (Types exte
|
|
|
2126
2456
|
* checks to ensure that values are checked against the most narrow types before
|
|
2127
2457
|
* the broadest, which in turn helps ensure order-independent Union checking.
|
|
2128
2458
|
*/
|
|
2129
|
-
type TPriority<Types extends TSchema[], Result extends TSchema[] = TSort<Types>> = Result;
|
|
2459
|
+
export type TPriority<Types extends TSchema[], Result extends TSchema[] = TSort<Types>> = Result;
|
|
2130
2460
|
/**
|
|
2131
2461
|
* Priority sorts types in sequence of narrowest to broadest using an Insertion Sort
|
|
2132
2462
|
* algorithm. This function is typically used to sequence types for union variant
|
|
2133
2463
|
* checks to ensure that values are checked against the most narrow types before
|
|
2134
2464
|
* the broadest, which in turn helps ensure order-independent Union checking.
|
|
2135
2465
|
*/
|
|
2136
|
-
declare function Priority<Types extends TSchema[]>(types: [...Types]): TPriority<Types>;
|
|
2466
|
+
export declare function Priority<Types extends TSchema[]>(types: [...Types]): TPriority<Types>;
|
|
2137
2467
|
declare namespace index_d_exports {
|
|
2138
|
-
export { AddImmutable, AddImmutableDeferred, AddOptional, AddOptionalDeferred, AddReadonly, AddReadonlyDeferred, Any, _Array_ as Array, ArrayOptions, BigInt, BigIntPattern, Boolean, Broaden, Call, CallConstruct, CanComposite, Capitalize$1 as Capitalize, CapitalizeAction, CapitalizeDeferred, CapitalizeInstantiate, Codec, CollapseToObject, Compare, CompareResultDisjoint, CompareResultEqual, CompareResultLeftInside, CompareResultRightInside, Composite, Conditional, ConditionalAction, ConditionalDeferred, ConditionalInstantiate, Constructor, ConstructorOptions, ConstructorParameters, ConstructorParametersAction, ConstructorParametersDeferred, ConstructorParametersInstantiate, ConvertToIntegerKey, Cyclic, CyclicCandidates, CyclicCheck, CyclicDependencies, CyclicExtends, CyclicOptions, CyclicTarget, Decode, DecodeBuilder, Deferred, Dependent, DependentOptions, Distribute, Encode, EncodeBuilder, Enum, Evaluate, EvaluateAction, EvaluateDeferred, EvaluateDependent, EvaluateEnum, EvaluateInstantiate, EvaluateIntersect, EvaluateTemplateLiteral, EvaluateType, EvaluateUnion, EvaluateUnionFast, Exclude$1 as Exclude, ExcludeAction, ExcludeDeferred, ExcludeInstantiate, Extends
|
|
2468
|
+
export { AddImmutable, AddImmutableDeferred, AddOptional, AddOptionalDeferred, AddReadonly, AddReadonlyDeferred, Any, _Array_ as Array, ArrayOptions, BigInt$1 as BigInt, BigIntPattern, Boolean, Broaden, Call, CallConstruct, CanComposite, Capitalize$1 as Capitalize, CapitalizeAction, CapitalizeDeferred, CapitalizeInstantiate, Codec, CollapseToObject, Compare, CompareResultDisjoint, CompareResultEqual, CompareResultLeftInside, CompareResultRightInside, Composite, Conditional, ConditionalAction, ConditionalDeferred, ConditionalInstantiate, Constructor, ConstructorOptions, ConstructorParameters, ConstructorParametersAction, ConstructorParametersDeferred, ConstructorParametersInstantiate, ConvertToIntegerKey, Cyclic, CyclicCandidates, CyclicCheck, CyclicDependencies, CyclicExtends, CyclicOptions, CyclicTarget, Decode, DecodeBuilder, Deferred, Dependent$1 as Dependent, DependentOptions, Distribute, Encode, EncodeBuilder, Enum, Evaluate, EvaluateAction, EvaluateDeferred, EvaluateDependent, EvaluateEnum, EvaluateInstantiate, EvaluateIntersect, EvaluateTemplateLiteral, EvaluateType, EvaluateUnion, EvaluateUnionFast, Exclude$1 as Exclude, ExcludeAction, ExcludeDeferred, ExcludeInstantiate, Extends, result_d_exports as ExtendsResult, Extract$1 as Extract, ExtractAction, ExtractDeferred, ExtractInstantiate, Flatten, _Function_ as Function, FunctionOptions, Generic, Identifier, Immutable, Index, IndexAction, IndexDeferred, IndexInstantiate, Infer, InstanceType, InstanceTypeAction, InstanceTypeDeferred, InstanceTypeInstantiate, Instantiate, InstantiateCyclic, Integer$1 as Integer, IntegerKey, IntegerPattern, Interface, InterfaceAction, InterfaceDeferred, InterfaceInstantiate, Intersect, IntersectOptions, InvalidLiteralValue, IsAny, IsArray, IsBigInt, IsBoolean, IsCall, IsCodec, IsConstructor, IsCyclic, IsDeferred, IsDependent, IsEnum, IsEnumValue, IsFunction, IsGeneric, IsIdentifier, IsImmutable, IsInfer, IsInteger, IsInterfaceDeferred, IsIntersect, IsKind, IsLiteral, IsLiteralBigInt, IsLiteralBoolean, IsLiteralNumber, IsLiteralString, IsLiteralValue, IsNever, IsNull, IsNumber, IsObject, IsOptional, IsParameter, IsReadonly, IsRecord, IsRef, IsRefine, IsRefinement, IsRest, IsSchema, IsString, IsSymbol, IsTemplateLiteral, IsTemplateLiteralDeferred, IsTemplateLiteralFinite, IsTemplateLiteralPattern, IsThis, IsTuple, IsTypeScriptEnumLike, IsUndefined, IsUnion, IsUnknown, IsUnsafe, IsVoid, KeyOf, KeyOfAction, KeyOfDeferred, KeyOfInstantiate, KeysToIndexer, Literal, LiteralTypeName, Lowercase$1 as Lowercase, LowercaseAction, LowercaseDeferred, LowercaseInstantiate, Mapped, MappedAction, MappedDeferred, MappedInstantiate, Module, ModuleDeferred, ModuleInstantiate, Narrow, Never, NeverPattern, NonNullable, NonNullableAction, NonNullableDeferred, NonNullableInstantiate, Null, Number$1 as Number, NumberKey, NumberPattern, _Object_$1 as Object, ObjectOptions, Omit$1 as Omit, OmitAction, OmitDeferred, OmitInstantiate, Optional, Parameter$1 as Parameter, Parameters, ParametersAction, ParametersDeferred, ParametersInstantiate, ParsePatternIntoTypes, ParseTemplateIntoTypes, Partial$1 as Partial, PartialAction, PartialDeferred, PartialInstantiate, Pick$1 as Pick, PickAction, PickDeferred, PickInstantiate, Priority, PropertyKeys, PropertyValues, Readonly$2 as Readonly, ReadonlyObject, ReadonlyObjectAction, ReadonlyObjectDeferred, ReadonlyObjectInstantiate, ReadonlyType, Record$1 as Record, RecordAction, RecordDeferred, RecordFromPattern, RecordInstantiate, RecordKey, RecordOptions, RecordPattern, RecordPatternToType, RecordValue, Ref, RefInstantiate, Refine, RefineAdd, RemoveImmutable, RemoveImmutableDeferred, RemoveOptional, RemoveOptionalDeferred, RemoveReadonly, RemoveReadonlyDeferred, Required$1 as Required, RequiredAction, RequiredArray, RequiredDeferred, RequiredInstantiate, Rest, ReturnType$1 as ReturnType, ReturnTypeAction, ReturnTypeDeferred, ReturnTypeInstantiate, Script, Static, StaticAny, StaticArray, StaticBigInt, StaticBoolean, StaticCodec, StaticConstructor, StaticCyclic, StaticDecode, StaticDependent, StaticDirection, StaticEncode, StaticEnum, StaticEvaluate, StaticFunction, StaticInstantiatedParameters, StaticInteger, StaticIntersect, StaticLiteral, StaticNever, StaticNull, StaticNumber, StaticObject, StaticParse, StaticProperties, StaticRecord, StaticRef, StaticString, StaticSymbol, StaticTemplateLiteral, StaticThis, StaticTuple, StaticType, StaticUndefined, StaticUnion, StaticUnknown, StaticUnsafe, StaticVoid, String$1 as String, StringKey, StringPattern, Symbol, TAddImmutable, TAddImmutableDeferred, TAddOptional, TAddOptionalDeferred, TAddReadonly, TAddReadonlyDeferred, TAny, TArray, TArrayOptions, TBigInt$1 as TBigInt, TBoolean, TBroaden, TCall, TCallConstruct, TCanComposite, TCapitalize, TCapitalizeAction, TCapitalizeDeferred, TCapitalizeInstantiate, TCodec, TCollapseToObject, TCompare, TCompareResult, TComposite, TConditional, TConditionalAction, TConditionalDeferred, TConditionalInstantiate, TConstructor, TConstructorParameters, TConstructorParametersAction, TConstructorParametersDeferred, TConstructorParametersInstantiate, TConvertToIntegerKey, TCyclic, TCyclicCandidates, TCyclicCheck, TCyclicDependencies, TCyclicExtends, TCyclicTarget, TDecodeCallback, TDeferred, TDependent$1 as TDependent, TDistribute$1 as TDistribute, TEncodeCallback, TEnum, TEnumValue, TEvaluate, TEvaluateAction, TEvaluateDeferred, TEvaluateDependent, TEvaluateEnum, TEvaluateInstantiate, TEvaluateIntersect, TEvaluateTemplateLiteral, TEvaluateType, TEvaluateUnion, TEvaluateUnionFast, TExclude, TExcludeAction, TExcludeDeferred, TExcludeInstantiate, TExtends, TExtract, TExtractAction, TExtractDeferred, TExtractInstantiate, TFlatten, TFormat, TFunction, TGeneric, TIdentifier, TImmutable, TIndex, TIndexAction, TIndexDeferred, TIndexInstantiate, TInfer, TInstanceType, TInstanceTypeAction, TInstanceTypeDeferred, TInstanceTypeInstantiate, TInstantiate, TInstantiateCyclic, TInteger$1 as TInteger, TIntegerKey, TInterface, TInterfaceAction, TInterfaceDeferred, TInterfaceInstantiate, TIntersect, TIntersectOptions, TIsTemplateLiteralFinite, TIsTemplateLiteralPattern, TKeyOf, TKeyOfAction, TKeyOfDeferred, TKeyOfInstantiate, TKeysToIndexer, TLiteral, TLiteralTypeName, TLiteralValue, TLowercase, TLowercaseAction, TLowercaseDeferred, TLowercaseInstantiate, TMapped, TMappedAction, TMappedDeferred, TMappedInstantiate, TModule, TModuleDeferred, TModuleInstantiate, TNarrow, TNever, TNonNullable, TNonNullableAction, TNonNullableDeferred, TNonNullableInstantiate, TNull, TNumber$1 as TNumber, TNumberKey, TNumberOptions, TObject, TObjectOptions, TOmit, TOmitAction, TOmitDeferred, TOmitInstantiate, TOptional, TParameter$1 as TParameter, TParameters, TParametersAction, TParametersDeferred, TParametersInstantiate, TParsePatternIntoTypes, TParseTemplateIntoTypes, TPartial, TPartialAction, TPartialDeferred, TPartialInstantiate, TPick, TPickAction, TPickDeferred, TPickInstantiate, TPriority, TProperties, TPropertyKeys, TPropertyValues, TReadonly$1 as TReadonly, TReadonlyObject, TReadonlyObjectAction, TReadonlyObjectDeferred, TReadonlyObjectInstantiate, TRecord, TRecordAction, TRecordDeferred, TRecordInstantiate, TRecordKey, TRecordPattern, TRecordPatternToType, TRecordValue, TRef, TRefInstantiate, TRefine, TRefineAdd, TRefineCheckCallback, TRefineErrorCallback, TRefinement, TRemoveImmutable, TRemoveImmutableDeferred, TRemoveOptional, TRemoveOptionalDeferred, TRemoveReadonly, TRemoveReadonlyDeferred, TRequired, TRequiredAction, TRequiredArray, TRequiredDeferred, TRequiredInstantiate, TRest, TReturnType, TReturnTypeAction, TReturnTypeDeferred, TReturnTypeInstantiate, TSchema, TSchemaOptions, TScript, TScriptOptions, TStaticElements, TString$1 as TString, TStringKey, TStringOptions, TSymbol, TTemplateLiteral, TTemplateLiteralDecode, TTemplateLiteralDecodeUnsafe, TTemplateLiteralDeferred, TTemplateLiteralEncode, TTemplateLiteralFromString, TTemplateLiteralFromTypes, TTemplateLiteralStatic, TThis, TTuple, TTupleOptions, TTupleToIntersect, TTupleToUnion, TTypeScriptEnumLike, TTypeScriptEnumToEnumValues, TUncapitalize, TUncapitalizeAction, TUncapitalizeDeferred, TUncapitalizeInstantiate, TUndefined, TUnion, TUnionLast, TUnionToIntersect, TUnionToTuple, TUnknown, TUnsafe, TUppercase, TUppercaseAction, TUppercaseDeferred, TUppercaseInstantiate, TVoid, TWith, TWithAction, TWithDeferred, TWithInstantiate, TemplateLiteral, TemplateLiteralCreate, TemplateLiteralDecode, TemplateLiteralDecodeUnsafe, TemplateLiteralDeferred, TemplateLiteralEncode, TemplateLiteralFromString, TemplateLiteralFromTypes, This, Tuple, TupleOptions, TypeScriptEnumToEnumValues, Uncapitalize$1 as Uncapitalize, UncapitalizeAction, UncapitalizeDeferred, UncapitalizeInstantiate, Undefined, Union, UnionOptions, Unknown, Unsafe, Uppercase$1 as Uppercase, UppercaseAction, UppercaseDeferred, UppercaseInstantiate, Void, With, WithAction, WithDeferred, WithInstantiate, _Array_, _Function_, _Object_$1 as _Object_ };
|
|
2139
2469
|
}
|
|
2140
|
-
type TScriptOptions = TArrayOptions | TIntersectOptions | TNumberOptions | TObjectOptions | TStringOptions | TTupleOptions;
|
|
2470
|
+
export type TScriptOptions = TArrayOptions | TIntersectOptions | TNumberOptions | TObjectOptions | TStringOptions | TTupleOptions;
|
|
2141
2471
|
/** Parses a string-based TypeScript type expression into a TypeBox type. */
|
|
2142
|
-
type TScript<Context extends TProperties, Input extends string> = (TScript$1<Input> extends [infer Type extends TSchema, string] ? TInstantiateType<Context, TState<[], []>, Type> : TNever);
|
|
2472
|
+
export type TScript<Context extends TProperties, Input extends string> = (TScript$1<Input> extends [infer Type extends TSchema, string] ? TInstantiateType<Context, TState<[], []>, Type> : TNever);
|
|
2143
2473
|
/** Parses a type from a TypeScript type expression */
|
|
2144
|
-
declare function Script<Script extends string>(input: Script): TScript<{}, Script>;
|
|
2474
|
+
export declare function Script<Script extends string>(input: Script): TScript<{}, Script>;
|
|
2145
2475
|
/** Parses a type from a TypeScript type expression */
|
|
2146
|
-
declare function Script<Context extends TProperties, Script extends string>(context: Context, input: Script): TScript<Context, Script>;
|
|
2476
|
+
export declare function Script<Context extends TProperties, Script extends string>(context: Context, input: Script): TScript<Context, Script>;
|
|
2147
2477
|
/** Parses a type from a TypeScript type expression */
|
|
2148
|
-
declare function Script<Script extends string>(input: Script, options: TScriptOptions): TScript<{}, Script>;
|
|
2478
|
+
export declare function Script<Script extends string>(input: Script, options: TScriptOptions): TScript<{}, Script>;
|
|
2149
2479
|
/** Parses a type from a TypeScript type expression */
|
|
2150
|
-
declare function Script<Context extends TProperties, Script extends string>(context: Context, input: Script, options: TScriptOptions): TScript<Context, Script>;
|
|
2151
|
-
export {
|
|
2480
|
+
export declare function Script<Context extends TProperties, Script extends string>(context: Context, input: Script, options: TScriptOptions): TScript<Context, Script>;
|
|
2481
|
+
export { BigInt$1 as BigInt, Capitalize$1 as Capitalize, Dependent$1 as Dependent, Exclude$1 as Exclude, Extract$1 as Extract, Integer$1 as Integer, Lowercase$1 as Lowercase, Number$1 as Number, Omit$1 as Omit, Parameter$1 as Parameter, Partial$1 as Partial, Pick$1 as Pick, Readonly$2 as Readonly, Record$1 as Record, Required$1 as Required, ReturnType$1 as ReturnType, String$1 as String, TBigInt$1 as TBigInt, TDependent$1 as TDependent, TDistribute$1 as TDistribute, TInteger$1 as TInteger, TNumber$1 as TNumber, TParameter$1 as TParameter, TReadonly$1 as TReadonly, TString$1 as TString, Uncapitalize$1 as Uncapitalize, Uppercase$1 as Uppercase, _Object_$1 as _Object_, index_d_exports, result_d_exports };
|
|
2152
2482
|
//# sourceMappingURL=typebox.d.mts.map
|