typebox 1.2.3 → 1.2.4
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/build/type/action/_add_immutable.d.mts +11 -0
- package/build/type/action/_add_immutable.mjs +11 -0
- package/build/type/action/_add_optional.d.mts +11 -0
- package/build/type/action/_add_optional.mjs +11 -0
- package/build/type/action/_add_readonly.d.mts +11 -0
- package/build/type/action/_add_readonly.mjs +11 -0
- package/build/type/action/_remove_immutable.d.mts +11 -0
- package/build/type/action/_remove_immutable.mjs +11 -0
- package/build/type/action/_remove_optional.d.mts +11 -0
- package/build/type/action/_remove_optional.mjs +11 -0
- package/build/type/action/_remove_readonly.d.mts +11 -0
- package/build/type/action/_remove_readonly.mjs +11 -0
- package/build/type/action/index.d.mts +6 -2
- package/build/type/action/index.mjs +6 -2
- package/build/type/engine/evaluate/composite.d.mts +10 -6
- package/build/type/engine/evaluate/composite.mjs +10 -6
- package/build/type/engine/immutable/instantiate_add.d.mts +10 -0
- package/build/type/engine/immutable/instantiate_add.mjs +14 -0
- package/build/type/engine/immutable/instantiate_remove.d.mts +10 -0
- package/build/type/engine/immutable/instantiate_remove.mjs +14 -0
- package/build/type/engine/instantiate.d.mts +32 -15
- package/build/type/engine/instantiate.mjs +61 -61
- package/build/type/engine/optional/instantiate_add.d.mts +10 -0
- package/build/type/engine/optional/instantiate_add.mjs +14 -0
- package/build/type/engine/optional/instantiate_remove.d.mts +10 -0
- package/build/type/engine/optional/instantiate_remove.mjs +14 -0
- package/build/type/engine/partial/from_object.d.mts +2 -2
- package/build/type/engine/partial/from_object.mjs +2 -2
- package/build/type/engine/readonly/instantiate_add.d.mts +10 -0
- package/build/type/engine/readonly/instantiate_add.mjs +14 -0
- package/build/type/engine/readonly/instantiate_remove.d.mts +10 -0
- package/build/type/engine/readonly/instantiate_remove.mjs +14 -0
- package/build/type/engine/readonly_object/from_array.d.mts +2 -2
- package/build/type/engine/readonly_object/from_array.mjs +2 -2
- package/build/type/engine/readonly_object/from_object.d.mts +2 -2
- package/build/type/engine/readonly_object/from_object.mjs +2 -2
- package/build/type/engine/readonly_object/from_tuple.d.mts +2 -2
- package/build/type/engine/readonly_object/from_tuple.mjs +2 -2
- package/build/type/engine/required/from_object.d.mts +2 -2
- package/build/type/engine/required/from_object.mjs +2 -2
- package/build/type/engine/template_literal/is_pattern.mjs +1 -0
- package/build/type/script/mapping.d.mts +42 -42
- package/build/type/script/mapping.mjs +46 -46
- package/build/type/types/_immutable.d.mts +2 -9
- package/build/type/types/_immutable.mjs +2 -10
- package/build/type/types/_optional.d.mts +2 -9
- package/build/type/types/_optional.mjs +2 -11
- package/build/type/types/_readonly.d.mts +2 -9
- package/build/type/types/_readonly.mjs +2 -10
- package/build/type/types/deferred.d.mts +1 -0
- package/build/type/types/deferred.mjs +1 -1
- package/package.json +1 -1
- package/build/type/action/_optional.d.mts +0 -19
- package/build/type/action/_optional.mjs +0 -40
- package/build/type/action/_readonly.d.mts +0 -19
- package/build/type/action/_readonly.mjs +0 -40
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type TSchema, type TSchemaOptions } from '../../types/schema.mjs';
|
|
2
|
+
import { type TProperties } from '../../types/properties.mjs';
|
|
3
|
+
import { type TOptional } from '../../types/_optional.mjs';
|
|
4
|
+
import { type TState, type TInstantiateType } from '../instantiate.mjs';
|
|
5
|
+
type TRemoveOptionalOperation<Type extends TSchema, Result extends TSchema = Type extends TOptional<infer Type extends TSchema> ? Type : Type> = Result;
|
|
6
|
+
export type TRemoveOptionalAction<Type extends TSchema, Result extends TSchema = TRemoveOptionalOperation<Type>> = Result;
|
|
7
|
+
export declare function RemoveOptionalAction<Type extends TSchema>(type: Type, options: TSchemaOptions): TRemoveOptionalAction<Type>;
|
|
8
|
+
export type TRemoveOptionalInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, InstantiateType extends TSchema = TInstantiateType<Context, State, Type>> = TRemoveOptionalAction<InstantiateType>;
|
|
9
|
+
export declare function RemoveOptionalInstantiate<Context extends TProperties, State extends TState, Type extends TSchema>(context: Context, state: State, type: Type, options: TSchemaOptions): TRemoveOptionalInstantiate<Context, State, Type>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// deno-fmt-ignore-file
|
|
2
|
+
import { Memory } from '../../../system/memory/index.mjs';
|
|
3
|
+
import { InstantiateType } from '../instantiate.mjs';
|
|
4
|
+
function RemoveOptionalOperation(type) {
|
|
5
|
+
return Memory.Discard(type, ['~optional']);
|
|
6
|
+
}
|
|
7
|
+
export function RemoveOptionalAction(type, options) {
|
|
8
|
+
const result = Memory.Update(RemoveOptionalOperation(type), {}, options);
|
|
9
|
+
return result;
|
|
10
|
+
}
|
|
11
|
+
export function RemoveOptionalInstantiate(context, state, type, options) {
|
|
12
|
+
const instantiatedType = InstantiateType(context, state, type);
|
|
13
|
+
return RemoveOptionalAction(instantiatedType, options);
|
|
14
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type TSchema } from '../../types/schema.mjs';
|
|
2
2
|
import { type TObject } from '../../types/object.mjs';
|
|
3
|
-
import { type
|
|
3
|
+
import { type TAddOptional } from '../../action/_add_optional.mjs';
|
|
4
4
|
import { type TProperties } from '../../types/properties.mjs';
|
|
5
5
|
export type TFromObject<Properties extends TProperties, Mapped extends TProperties = {
|
|
6
|
-
[Key in keyof Properties]:
|
|
6
|
+
[Key in keyof Properties]: TAddOptional<Properties[Key]>;
|
|
7
7
|
}, Result extends TSchema = TObject<Mapped>> = Result;
|
|
8
8
|
export declare function FromObject<Properties extends TProperties>(properties: Properties): TFromObject<Properties>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// deno-fmt-ignore-file
|
|
2
2
|
import { Guard } from '../../../guard/index.mjs';
|
|
3
3
|
import { Object } from '../../types/object.mjs';
|
|
4
|
-
import {
|
|
4
|
+
import { AddOptional } from '../../action/_add_optional.mjs';
|
|
5
5
|
export function FromObject(properties) {
|
|
6
6
|
const mapped = Guard.Keys(properties).reduce((result, left) => {
|
|
7
|
-
return { ...result, [left]:
|
|
7
|
+
return { ...result, [left]: AddOptional(properties[left]) };
|
|
8
8
|
}, {});
|
|
9
9
|
const result = Object(mapped);
|
|
10
10
|
return result;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type TSchema, type TSchemaOptions } from '../../types/schema.mjs';
|
|
2
|
+
import { type TProperties } from '../../types/properties.mjs';
|
|
3
|
+
import { type TReadonly } from '../../types/_readonly.mjs';
|
|
4
|
+
import { type TState, type TInstantiateType } from '../instantiate.mjs';
|
|
5
|
+
type TAddReadonlyOperation<Type extends TSchema, Result extends TSchema = `~readonly` extends keyof Type ? Type : TReadonly<Type>> = Result;
|
|
6
|
+
export type TAddReadonlyAction<Type extends TSchema, Result extends TSchema = TAddReadonlyOperation<Type>> = Result;
|
|
7
|
+
export declare function AddReadonlyAction<Type extends TSchema>(type: Type, options: TSchemaOptions): TAddReadonlyAction<Type>;
|
|
8
|
+
export type TAddReadonlyInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, InstantiateType extends TSchema = TInstantiateType<Context, State, Type>> = TAddReadonlyAction<InstantiateType>;
|
|
9
|
+
export declare function AddReadonlyInstantiate<Context extends TProperties, State extends TState, Type extends TSchema>(context: Context, state: State, type: Type, options: TSchemaOptions): TAddReadonlyInstantiate<Context, State, Type>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// deno-fmt-ignore-file
|
|
2
|
+
import { Memory } from '../../../system/memory/index.mjs';
|
|
3
|
+
import { InstantiateType } from '../instantiate.mjs';
|
|
4
|
+
function AddReadonlyOperation(type) {
|
|
5
|
+
return Memory.Update(type, { '~readonly': true }, {});
|
|
6
|
+
}
|
|
7
|
+
export function AddReadonlyAction(type, options) {
|
|
8
|
+
const result = Memory.Update(AddReadonlyOperation(type), {}, options);
|
|
9
|
+
return result;
|
|
10
|
+
}
|
|
11
|
+
export function AddReadonlyInstantiate(context, state, type, options) {
|
|
12
|
+
const instantiatedType = InstantiateType(context, state, type);
|
|
13
|
+
return AddReadonlyAction(instantiatedType, options);
|
|
14
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type TSchema, type TSchemaOptions } from '../../types/schema.mjs';
|
|
2
|
+
import { type TProperties } from '../../types/properties.mjs';
|
|
3
|
+
import { type TReadonly } from '../../types/_readonly.mjs';
|
|
4
|
+
import { type TState, type TInstantiateType } from '../instantiate.mjs';
|
|
5
|
+
type TRemoveReadonlyOperation<Type extends TSchema, Result extends TSchema = Type extends TReadonly<infer Type extends TSchema> ? Type : Type> = Result;
|
|
6
|
+
export type TRemoveReadonlyAction<Type extends TSchema, Result extends TSchema = TRemoveReadonlyOperation<Type>> = Result;
|
|
7
|
+
export declare function RemoveReadonlyAction<Type extends TSchema>(type: Type, options: TSchemaOptions): TRemoveReadonlyAction<Type>;
|
|
8
|
+
export type TRemoveReadonlyInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, InstantiateType extends TSchema = TInstantiateType<Context, State, Type>> = TRemoveReadonlyAction<InstantiateType>;
|
|
9
|
+
export declare function RemoveReadonlyInstantiate<Context extends TProperties, State extends TState, Type extends TSchema>(context: Context, state: State, type: Type, options: TSchemaOptions): TRemoveReadonlyInstantiate<Context, State, Type>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// deno-fmt-ignore-file
|
|
2
|
+
import { Memory } from '../../../system/memory/index.mjs';
|
|
3
|
+
import { InstantiateType } from '../instantiate.mjs';
|
|
4
|
+
function RemoveReadonlyOperation(type) {
|
|
5
|
+
return Memory.Discard(type, ['~readonly']);
|
|
6
|
+
}
|
|
7
|
+
export function RemoveReadonlyAction(type, options) {
|
|
8
|
+
const result = Memory.Update(RemoveReadonlyOperation(type), {}, options);
|
|
9
|
+
return result;
|
|
10
|
+
}
|
|
11
|
+
export function RemoveReadonlyInstantiate(context, state, type, options) {
|
|
12
|
+
const instantiatedType = InstantiateType(context, state, type);
|
|
13
|
+
return RemoveReadonlyAction(instantiatedType, options);
|
|
14
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type TSchema } from '../../types/schema.mjs';
|
|
2
2
|
import { type TArray } from '../../types/array.mjs';
|
|
3
|
-
import { type
|
|
4
|
-
export type TFromArray<Type extends TSchema, Result extends TSchema =
|
|
3
|
+
import { type TAddImmutable } from '../../action/_add_immutable.mjs';
|
|
4
|
+
export type TFromArray<Type extends TSchema, Result extends TSchema = TAddImmutable<TArray<Type>>> = Result;
|
|
5
5
|
export declare function FromArray<Type extends TSchema>(type: Type): TFromArray<Type>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// deno-fmt-ignore-file
|
|
2
2
|
import { Array } from '../../types/array.mjs';
|
|
3
|
-
import {
|
|
3
|
+
import { AddImmutable } from '../../action/_add_immutable.mjs';
|
|
4
4
|
export function FromArray(type) {
|
|
5
|
-
const result =
|
|
5
|
+
const result = AddImmutable(Array(type));
|
|
6
6
|
return result;
|
|
7
7
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type TSchema } from '../../types/schema.mjs';
|
|
2
2
|
import { type TObject } from '../../types/object.mjs';
|
|
3
|
-
import { type
|
|
3
|
+
import { type TAddReadonly } from '../../action/_add_readonly.mjs';
|
|
4
4
|
import { type TProperties } from '../../types/properties.mjs';
|
|
5
5
|
export type TFromObject<Properties extends TProperties, Mapped extends TProperties = {
|
|
6
|
-
[Key in keyof Properties]:
|
|
6
|
+
[Key in keyof Properties]: TAddReadonly<Properties[Key]>;
|
|
7
7
|
}, Result extends TSchema = TObject<Mapped>> = Result;
|
|
8
8
|
export declare function FromObject<Properties extends TProperties>(properties: Properties): TFromObject<Properties>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// deno-fmt-ignore-file
|
|
2
2
|
import { Guard } from '../../../guard/index.mjs';
|
|
3
3
|
import { Object } from '../../types/object.mjs';
|
|
4
|
-
import {
|
|
4
|
+
import { AddReadonly } from '../../action/_add_readonly.mjs';
|
|
5
5
|
export function FromObject(properties) {
|
|
6
6
|
const mapped = Guard.Keys(properties).reduce((result, left) => {
|
|
7
|
-
return { ...result, [left]:
|
|
7
|
+
return { ...result, [left]: AddReadonly(properties[left]) };
|
|
8
8
|
}, {});
|
|
9
9
|
const result = Object(mapped);
|
|
10
10
|
return result;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type TSchema } from '../../types/schema.mjs';
|
|
2
2
|
import { type TTuple } from '../../types/tuple.mjs';
|
|
3
|
-
import { type
|
|
4
|
-
export type TFromTuple<Types extends TSchema[], Result extends TSchema =
|
|
3
|
+
import { type TAddImmutable } from '../../action/_add_immutable.mjs';
|
|
4
|
+
export type TFromTuple<Types extends TSchema[], Result extends TSchema = TAddImmutable<TTuple<Types>>> = Result;
|
|
5
5
|
export declare function FromTuple<Types extends TSchema[]>(types: [...Types]): TFromTuple<Types>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// deno-fmt-ignore-file
|
|
2
2
|
import { Tuple } from '../../types/tuple.mjs';
|
|
3
|
-
import {
|
|
3
|
+
import { AddImmutable } from '../../action/_add_immutable.mjs';
|
|
4
4
|
export function FromTuple(types) {
|
|
5
|
-
const result =
|
|
5
|
+
const result = AddImmutable(Tuple(types));
|
|
6
6
|
return result;
|
|
7
7
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type TSchema } from '../../types/schema.mjs';
|
|
2
2
|
import { type TObject } from '../../types/object.mjs';
|
|
3
|
-
import { type
|
|
3
|
+
import { type TRemoveOptional } from '../../action/_remove_optional.mjs';
|
|
4
4
|
import { type TProperties } from '../../types/properties.mjs';
|
|
5
5
|
export type TFromObject<Properties extends TProperties, Mapped extends TProperties = {
|
|
6
|
-
[Key in keyof Properties]:
|
|
6
|
+
[Key in keyof Properties]: TRemoveOptional<Properties[Key]>;
|
|
7
7
|
}, Result extends TSchema = TObject<Mapped>> = Result;
|
|
8
8
|
export declare function FromObject<Properties extends TProperties>(properties: Properties): TFromObject<Properties>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// deno-fmt-ignore-file
|
|
2
2
|
import { Guard } from '../../../guard/index.mjs';
|
|
3
3
|
import { Object } from '../../types/object.mjs';
|
|
4
|
-
import {
|
|
4
|
+
import { RemoveOptional } from '../../action/_remove_optional.mjs';
|
|
5
5
|
export function FromObject(properties) {
|
|
6
6
|
const mapped = Guard.Keys(properties).reduce((result, left) => {
|
|
7
|
-
return { ...result, [left]:
|
|
7
|
+
return { ...result, [left]: RemoveOptional(properties[left]) };
|
|
8
8
|
}, {});
|
|
9
9
|
const result = Object(mapped);
|
|
10
10
|
return result;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Memory } from '../../system/memory/index.mjs';
|
|
2
|
-
import * as C from '../action/index.mjs';
|
|
3
2
|
import * as T from '../types/index.mjs';
|
|
3
|
+
import * as S from '../action/index.mjs';
|
|
4
4
|
type TIntrinsicOrCall<Target extends string, Parameters extends T.TSchema[]> = ([
|
|
5
5
|
Target,
|
|
6
6
|
Parameters
|
|
@@ -16,67 +16,67 @@ type TIntrinsicOrCall<Target extends string, Parameters extends T.TSchema[]> = (
|
|
|
16
16
|
] extends ['Iterator', [infer Type extends T.TSchema]] ? T.TIterator<Type> : [
|
|
17
17
|
Target,
|
|
18
18
|
Parameters
|
|
19
|
-
] extends ['Awaited', [infer Type extends T.TSchema]] ?
|
|
19
|
+
] extends ['Awaited', [infer Type extends T.TSchema]] ? S.TAwaitedDeferred<Type> : [
|
|
20
20
|
Target,
|
|
21
21
|
Parameters
|
|
22
|
-
] extends ['Capitalize', [infer Type extends T.TSchema]] ?
|
|
22
|
+
] extends ['Capitalize', [infer Type extends T.TSchema]] ? S.TCapitalizeDeferred<Type> : [
|
|
23
23
|
Target,
|
|
24
24
|
Parameters
|
|
25
|
-
] extends ['ConstructorParameters', [infer Type extends T.TSchema]] ?
|
|
25
|
+
] extends ['ConstructorParameters', [infer Type extends T.TSchema]] ? S.TConstructorParametersDeferred<Type> : [
|
|
26
26
|
Target,
|
|
27
27
|
Parameters
|
|
28
|
-
] extends ['Evaluate', [infer Type extends T.TSchema]] ?
|
|
28
|
+
] extends ['Evaluate', [infer Type extends T.TSchema]] ? S.TEvaluateDeferred<Type> : [
|
|
29
29
|
Target,
|
|
30
30
|
Parameters
|
|
31
|
-
] extends ['Exclude', [infer Left extends T.TSchema, infer Right extends T.TSchema]] ?
|
|
31
|
+
] extends ['Exclude', [infer Left extends T.TSchema, infer Right extends T.TSchema]] ? S.TExcludeDeferred<Left, Right> : [
|
|
32
32
|
Target,
|
|
33
33
|
Parameters
|
|
34
|
-
] extends ['Extract', [infer Left extends T.TSchema, infer Right extends T.TSchema]] ?
|
|
34
|
+
] extends ['Extract', [infer Left extends T.TSchema, infer Right extends T.TSchema]] ? S.TExtractDeferred<Left, Right> : [
|
|
35
35
|
Target,
|
|
36
36
|
Parameters
|
|
37
|
-
] extends ['Index', [infer Type extends T.TSchema, infer Indexer extends T.TSchema]] ?
|
|
37
|
+
] extends ['Index', [infer Type extends T.TSchema, infer Indexer extends T.TSchema]] ? S.TIndexDeferred<Type, Indexer> : [
|
|
38
38
|
Target,
|
|
39
39
|
Parameters
|
|
40
|
-
] extends ['InstanceType', [infer Type extends T.TSchema]] ?
|
|
40
|
+
] extends ['InstanceType', [infer Type extends T.TSchema]] ? S.TInstanceTypeDeferred<Type> : [
|
|
41
41
|
Target,
|
|
42
42
|
Parameters
|
|
43
|
-
] extends ['KeyOf', [infer Type extends T.TSchema]] ?
|
|
43
|
+
] extends ['KeyOf', [infer Type extends T.TSchema]] ? S.TKeyOfDeferred<Type> : [
|
|
44
44
|
Target,
|
|
45
45
|
Parameters
|
|
46
|
-
] extends ['Lowercase', [infer Type extends T.TSchema]] ?
|
|
46
|
+
] extends ['Lowercase', [infer Type extends T.TSchema]] ? S.TLowercaseDeferred<Type> : [
|
|
47
47
|
Target,
|
|
48
48
|
Parameters
|
|
49
|
-
] extends ['NonNullable', [infer Type extends T.TSchema]] ?
|
|
49
|
+
] extends ['NonNullable', [infer Type extends T.TSchema]] ? S.TNonNullableDeferred<Type> : [
|
|
50
50
|
Target,
|
|
51
51
|
Parameters
|
|
52
|
-
] extends ['Omit', [infer Type extends T.TSchema, infer Indexer extends T.TSchema]] ?
|
|
52
|
+
] extends ['Omit', [infer Type extends T.TSchema, infer Indexer extends T.TSchema]] ? S.TOmitDeferred<Type, Indexer> : [
|
|
53
53
|
Target,
|
|
54
54
|
Parameters
|
|
55
|
-
] extends ['Parameters', [infer Type extends T.TSchema]] ?
|
|
55
|
+
] extends ['Parameters', [infer Type extends T.TSchema]] ? S.TParametersDeferred<Type> : [
|
|
56
56
|
Target,
|
|
57
57
|
Parameters
|
|
58
|
-
] extends ['Partial', [infer Type extends T.TSchema]] ?
|
|
58
|
+
] extends ['Partial', [infer Type extends T.TSchema]] ? S.TPartialDeferred<Type> : [
|
|
59
59
|
Target,
|
|
60
60
|
Parameters
|
|
61
|
-
] extends ['Pick', [infer Type extends T.TSchema, infer Indexer extends T.TSchema]] ?
|
|
61
|
+
] extends ['Pick', [infer Type extends T.TSchema, infer Indexer extends T.TSchema]] ? S.TPickDeferred<Type, Indexer> : [
|
|
62
62
|
Target,
|
|
63
63
|
Parameters
|
|
64
|
-
] extends ['Readonly', [infer Type extends T.TSchema]] ?
|
|
64
|
+
] extends ['Readonly', [infer Type extends T.TSchema]] ? S.TReadonlyObjectDeferred<Type> : [
|
|
65
65
|
Target,
|
|
66
66
|
Parameters
|
|
67
67
|
] extends ['Record', [infer Key extends T.TSchema, infer Value extends T.TSchema]] ? T.TRecordDeferred<Key, Value> : [
|
|
68
68
|
Target,
|
|
69
69
|
Parameters
|
|
70
|
-
] extends ['Required', [infer Type extends T.TSchema]] ?
|
|
70
|
+
] extends ['Required', [infer Type extends T.TSchema]] ? S.TRequiredDeferred<Type> : [
|
|
71
71
|
Target,
|
|
72
72
|
Parameters
|
|
73
|
-
] extends ['ReturnType', [infer Type extends T.TSchema]] ?
|
|
73
|
+
] extends ['ReturnType', [infer Type extends T.TSchema]] ? S.TReturnTypeDeferred<Type> : [
|
|
74
74
|
Target,
|
|
75
75
|
Parameters
|
|
76
|
-
] extends ['Uncapitalize', [infer Type extends T.TSchema]] ?
|
|
76
|
+
] extends ['Uncapitalize', [infer Type extends T.TSchema]] ? S.TUncapitalizeDeferred<Type> : [
|
|
77
77
|
Target,
|
|
78
78
|
Parameters
|
|
79
|
-
] extends ['Uppercase', [infer Type extends T.TSchema]] ?
|
|
79
|
+
] extends ['Uppercase', [infer Type extends T.TSchema]] ? S.TUppercaseDeferred<Type> : T.TCallConstruct<T.TRef<Target>, Parameters>);
|
|
80
80
|
type TDelimitedDecode<Input extends ([unknown, unknown] | unknown)[], Result extends unknown[] = []> = (Input extends [infer Left, ...infer Right] ? Left extends [infer Item, infer _] ? TDelimitedDecode<Right, [...Result, Item]> : TDelimitedDecode<Right, [...Result, Left]> : Result);
|
|
81
81
|
type TDelimited<Input extends [unknown, unknown]> = Input extends [infer Left extends unknown[], infer Right extends unknown[]] ? TDelimitedDecode<[...Left, ...Right]> : [];
|
|
82
82
|
export type TGenericParameterExtendsEqualsMapping<Input extends [unknown, unknown, unknown, unknown, unknown]> = (Input extends [infer Name extends string, 'extends', infer Extends extends T.TSchema, '=', infer Equals extends T.TSchema] ? T.TParameter<Name, Extends, Equals> : never);
|
|
@@ -161,10 +161,10 @@ export type TBaseMapping<Input extends [unknown, unknown, unknown] | unknown> =
|
|
|
161
161
|
export declare function BaseMapping(input: [unknown, unknown, unknown] | unknown): unknown;
|
|
162
162
|
export type TWithMapping<Input extends [unknown, unknown] | []> = (Input extends ['with', infer JsonObject extends Record<PropertyKey, unknown>] ? JsonObject : []);
|
|
163
163
|
export declare function WithMapping(input: [unknown, unknown] | []): unknown;
|
|
164
|
-
type TFactorIndexArray<Type extends T.TSchema, IndexArray extends unknown[]> = (IndexArray extends [infer Left extends T.TSchema[], ...infer Right extends unknown[]] ? (Left extends [infer Indexer extends T.TSchema] ? TFactorIndexArray<
|
|
165
|
-
type TFactorExtends<Type extends T.TSchema, Extends extends unknown[]> = (Extends extends [infer Right extends T.TSchema, infer True extends T.TSchema, infer False extends T.TSchema] ?
|
|
166
|
-
type TFactorWith<Type extends T.TSchema, With extends unknown> = (With extends Record<PropertyKey, unknown> ?
|
|
167
|
-
export type TFactorMapping<Input extends [unknown, unknown, unknown, unknown, unknown]> = (Input extends [infer KeyOf extends boolean, infer Type extends T.TSchema, infer IndexArray extends unknown[], infer Extend extends unknown[], infer WithClause extends unknown] ? TFactorWith<KeyOf extends true ? TFactorExtends<
|
|
164
|
+
type TFactorIndexArray<Type extends T.TSchema, IndexArray extends unknown[]> = (IndexArray extends [infer Left extends T.TSchema[], ...infer Right extends unknown[]] ? (Left extends [infer Indexer extends T.TSchema] ? TFactorIndexArray<S.TIndexDeferred<Type, Indexer>, Right> : Left extends [] ? TFactorIndexArray<T.TArray<Type>, Right> : T.TNever) : Type);
|
|
165
|
+
type TFactorExtends<Type extends T.TSchema, Extends extends unknown[]> = (Extends extends [infer Right extends T.TSchema, infer True extends T.TSchema, infer False extends T.TSchema] ? S.TConditionalDeferred<Type, Right, True, False> : Type);
|
|
166
|
+
type TFactorWith<Type extends T.TSchema, With extends unknown> = (With extends Record<PropertyKey, unknown> ? S.TWithDeferred<Type, With> : Type);
|
|
167
|
+
export type TFactorMapping<Input extends [unknown, unknown, unknown, unknown, unknown]> = (Input extends [infer KeyOf extends boolean, infer Type extends T.TSchema, infer IndexArray extends unknown[], infer Extend extends unknown[], infer WithClause extends unknown] ? TFactorWith<KeyOf extends true ? TFactorExtends<S.TKeyOfDeferred<TFactorIndexArray<Type, IndexArray>>, Extend> : TFactorExtends<TFactorIndexArray<Type, IndexArray>, Extend>, WithClause> : never);
|
|
168
168
|
export declare function FactorMapping(input: [unknown, unknown, unknown, unknown, unknown]): unknown;
|
|
169
169
|
type TExprBinaryMapping<Left extends T.TSchema, Rest extends unknown[]> = (Rest extends [infer Operator extends unknown, infer Right extends T.TSchema, infer Next extends unknown[]] ? (TExprBinaryMapping<Right, Next> extends infer Schema extends T.TSchema ? (Operator extends '&' ? (Schema extends T.TIntersect<infer Types extends T.TSchema[]> ? T.TIntersect<[Left, ...Types]> : T.TIntersect<[Left, Schema]>) : Operator extends '|' ? (Schema extends T.TUnion<infer Types extends T.TSchema[]> ? T.TUnion<[Left, ...Types]> : T.TUnion<[Left, Schema]>) : never) : never) : Left);
|
|
170
170
|
export type TExprTermTailMapping<Input extends [unknown, unknown, unknown] | []> = (Input);
|
|
@@ -175,7 +175,7 @@ export type TExprTailMapping<Input extends [unknown, unknown, unknown] | []> = (
|
|
|
175
175
|
export declare function ExprTailMapping(input: [unknown, unknown, unknown] | []): unknown;
|
|
176
176
|
export type TExprMapping<Input extends [unknown, unknown]> = (Input extends [infer Left extends T.TSchema, infer Rest extends unknown[]] ? TExprBinaryMapping<Left, Rest> : []);
|
|
177
177
|
export declare function ExprMapping(input: [unknown, unknown]): unknown;
|
|
178
|
-
export type TExprReadonlyMapping<Input extends [unknown, unknown]> = (Input extends ['readonly', infer Type extends T.TSchema] ?
|
|
178
|
+
export type TExprReadonlyMapping<Input extends [unknown, unknown]> = (Input extends ['readonly', infer Type extends T.TSchema] ? S.TAddImmutableDeferred<Type> : never);
|
|
179
179
|
export declare function ExprReadonlyMapping(input: [unknown, unknown]): unknown;
|
|
180
180
|
export type TExprPipeMapping<Input extends [unknown, unknown]> = (Input extends ['|', infer Type extends T.TSchema] ? Type : never);
|
|
181
181
|
export declare function ExprPipeMapping(input: [unknown, unknown]): unknown;
|
|
@@ -203,13 +203,13 @@ export type TPropertyMapping<Input extends [unknown, unknown, unknown, unknown,
|
|
|
203
203
|
[_ in Key]: ([
|
|
204
204
|
IsReadonly,
|
|
205
205
|
IsOptional
|
|
206
|
-
] extends [true, true] ?
|
|
206
|
+
] extends [true, true] ? S.TAddReadonlyDeferred<S.TAddOptionalDeferred<Type>> : [
|
|
207
207
|
IsReadonly,
|
|
208
208
|
IsOptional
|
|
209
|
-
] extends [true, false] ?
|
|
209
|
+
] extends [true, false] ? S.TAddReadonlyDeferred<Type> : [
|
|
210
210
|
IsReadonly,
|
|
211
211
|
IsOptional
|
|
212
|
-
] extends [false, true] ?
|
|
212
|
+
] extends [false, true] ? S.TAddOptionalDeferred<Type> : Type);
|
|
213
213
|
} : never);
|
|
214
214
|
export declare function PropertyMapping(input: [unknown, unknown, unknown, unknown, unknown]): unknown;
|
|
215
215
|
export type TPropertyDelimiterMapping<Input extends [unknown, unknown] | [unknown]> = (Input);
|
|
@@ -229,13 +229,13 @@ export type TPropertiesMapping<Input extends [unknown, unknown, unknown], Result
|
|
|
229
229
|
export declare function PropertiesMapping(input: [unknown, unknown, unknown]): unknown;
|
|
230
230
|
export type T_Object_Mapping<Input extends unknown> = (Input extends [infer Properties extends T.TProperties, infer _PatternProperties extends T.TProperties] ? T.TObject<Properties> : never);
|
|
231
231
|
export declare function _Object_Mapping(input: unknown): unknown;
|
|
232
|
-
export type TElementNamedMapping<Input extends [unknown, unknown, unknown, unknown, unknown] | [unknown, unknown, unknown, unknown] | [unknown, unknown, unknown]> = (Input extends [string, '?', ':', 'readonly', infer Type extends T.TSchema] ?
|
|
232
|
+
export type TElementNamedMapping<Input extends [unknown, unknown, unknown, unknown, unknown] | [unknown, unknown, unknown, unknown] | [unknown, unknown, unknown]> = (Input extends [string, '?', ':', 'readonly', infer Type extends T.TSchema] ? S.TAddReadonlyDeferred<S.TAddOptionalDeferred<Type>> : Input extends [string, /**/ ':', 'readonly', infer Type extends T.TSchema] ? S.TAddReadonlyDeferred<Type> : Input extends [string, '?', ':', /* */ infer Type extends T.TSchema] ? S.TAddOptionalDeferred<Type> : Input extends [string, /**/ ':', /* */ infer Type extends T.TSchema] ? Type : never);
|
|
233
233
|
export declare function ElementNamedMapping(input: [unknown, unknown, unknown, unknown, unknown] | [unknown, unknown, unknown, unknown] | [unknown, unknown, unknown]): unknown;
|
|
234
|
-
export type TElementReadonlyOptionalMapping<Input extends [unknown, unknown, unknown]> = (Input extends ['readonly', infer Type extends T.TSchema, '?'] ?
|
|
234
|
+
export type TElementReadonlyOptionalMapping<Input extends [unknown, unknown, unknown]> = (Input extends ['readonly', infer Type extends T.TSchema, '?'] ? S.TAddReadonlyDeferred<S.TAddOptionalDeferred<Type>> : never);
|
|
235
235
|
export declare function ElementReadonlyOptionalMapping(input: [unknown, unknown, unknown]): unknown;
|
|
236
|
-
export type TElementReadonlyMapping<Input extends [unknown, unknown]> = (Input extends ['readonly', infer Type extends T.TSchema] ?
|
|
236
|
+
export type TElementReadonlyMapping<Input extends [unknown, unknown]> = (Input extends ['readonly', infer Type extends T.TSchema] ? S.TAddReadonlyDeferred<Type> : never);
|
|
237
237
|
export declare function ElementReadonlyMapping(input: [unknown, unknown]): unknown;
|
|
238
|
-
export type TElementOptionalMapping<Input extends [unknown, unknown]> = (Input extends [infer Type extends T.TSchema, '?'] ?
|
|
238
|
+
export type TElementOptionalMapping<Input extends [unknown, unknown]> = (Input extends [infer Type extends T.TSchema, '?'] ? S.TAddOptionalDeferred<Type> : never);
|
|
239
239
|
export declare function ElementOptionalMapping(input: [unknown, unknown]): unknown;
|
|
240
240
|
export type TElementBaseMapping<Input extends unknown> = (Input);
|
|
241
241
|
export declare function ElementBaseMapping(input: unknown): unknown;
|
|
@@ -245,11 +245,11 @@ export type TElementListMapping<Input extends [unknown, unknown]> = (TDelimited<
|
|
|
245
245
|
export declare function ElementListMapping(input: [unknown, unknown]): unknown;
|
|
246
246
|
export type T_Tuple_Mapping<Input extends [unknown, unknown, unknown]> = (Input extends ['[', infer Types extends T.TSchema[], ']'] ? T.TTuple<Types> : never);
|
|
247
247
|
export declare function _Tuple_Mapping(input: [unknown, unknown, unknown]): unknown;
|
|
248
|
-
export type TParameterReadonlyOptionalMapping<Input extends [unknown, unknown, unknown, unknown, unknown]> = (Input extends [string, '?', ':', 'readonly', infer Type extends T.TSchema] ?
|
|
248
|
+
export type TParameterReadonlyOptionalMapping<Input extends [unknown, unknown, unknown, unknown, unknown]> = (Input extends [string, '?', ':', 'readonly', infer Type extends T.TSchema] ? S.TAddReadonlyDeferred<S.TAddOptionalDeferred<Type>> : never);
|
|
249
249
|
export declare function ParameterReadonlyOptionalMapping(input: [unknown, unknown, unknown, unknown, unknown]): unknown;
|
|
250
|
-
export type TParameterReadonlyMapping<Input extends [unknown, unknown, unknown, unknown]> = (Input extends [string, ':', 'readonly', infer Type extends T.TSchema] ?
|
|
250
|
+
export type TParameterReadonlyMapping<Input extends [unknown, unknown, unknown, unknown]> = (Input extends [string, ':', 'readonly', infer Type extends T.TSchema] ? S.TAddReadonlyDeferred<Type> : never);
|
|
251
251
|
export declare function ParameterReadonlyMapping(input: [unknown, unknown, unknown, unknown]): unknown;
|
|
252
|
-
export type TParameterOptionalMapping<Input extends [unknown, unknown, unknown, unknown]> = (Input extends [string, '?', ':', infer Type extends T.TSchema] ?
|
|
252
|
+
export type TParameterOptionalMapping<Input extends [unknown, unknown, unknown, unknown]> = (Input extends [string, '?', ':', infer Type extends T.TSchema] ? S.TAddOptionalDeferred<Type> : never);
|
|
253
253
|
export declare function ParameterOptionalMapping(input: [unknown, unknown, unknown, unknown]): unknown;
|
|
254
254
|
export type TParameterTypeMapping<Input extends [unknown, unknown, unknown]> = (Input extends [string, ':', infer Type extends T.TSchema] ? Type : never);
|
|
255
255
|
export declare function ParameterTypeMapping(input: [unknown, unknown, unknown]): unknown;
|
|
@@ -264,15 +264,15 @@ export declare function _Function_Mapping(input: [unknown, unknown, unknown, unk
|
|
|
264
264
|
export type T_Constructor_Mapping<Input extends [unknown, unknown, unknown, unknown, unknown, unknown]> = (Input extends ['new', '(', infer ParameterList extends T.TSchema[], ')', '=>', infer InstanceType extends T.TSchema] ? T.TConstructor<ParameterList, InstanceType> : never);
|
|
265
265
|
export declare function _Constructor_Mapping(input: [unknown, unknown, unknown, unknown, unknown, unknown]): unknown;
|
|
266
266
|
type TModifierOperation = 'add' | 'remove' | 'none';
|
|
267
|
-
type TApplyReadonly<Readonly extends TModifierOperation, Type extends T.TSchema> = (Readonly extends 'remove' ?
|
|
267
|
+
type TApplyReadonly<Readonly extends TModifierOperation, Type extends T.TSchema> = (Readonly extends 'remove' ? S.TRemoveReadonlyDeferred<Type> : Readonly extends 'add' ? S.TAddReadonlyDeferred<Type> : Type);
|
|
268
268
|
export type TMappedReadonlyMapping<Input extends [unknown, unknown] | [unknown] | []> = (Input extends ['-', 'readonly'] ? 'remove' : Input extends ['+', 'readonly'] ? 'add' : Input extends ['readonly'] ? 'add' : 'none');
|
|
269
269
|
export declare function MappedReadonlyMapping(input: [unknown, unknown] | [unknown] | []): unknown;
|
|
270
|
-
type TApplyOptional<Optional extends TModifierOperation, Type extends T.TSchema> = (Optional extends 'remove' ?
|
|
270
|
+
type TApplyOptional<Optional extends TModifierOperation, Type extends T.TSchema> = (Optional extends 'remove' ? S.TRemoveOptionalDeferred<Type> : Optional extends 'add' ? S.TAddOptionalDeferred<Type> : Type);
|
|
271
271
|
export type TMappedOptionalMapping<Input extends [unknown, unknown] | [unknown] | []> = (Input extends ['-', '?'] ? 'remove' : Input extends ['+', '?'] ? 'add' : Input extends ['?'] ? 'add' : 'none');
|
|
272
272
|
export declare function MappedOptionalMapping(input: [unknown, unknown] | [unknown] | []): unknown;
|
|
273
273
|
export type TMappedAsMapping<Input extends [unknown, unknown] | []> = (Input extends ['as', infer Type extends T.TSchema] ? [Type] : []);
|
|
274
274
|
export declare function MappedAsMapping(input: [unknown, unknown] | []): unknown;
|
|
275
|
-
export 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 T.TSchema, infer As extends T.TSchema[], ']', infer Optional extends TModifierOperation, ':', infer Property extends T.TSchema, null, '}'] ? (As extends [infer As extends T.TSchema] ?
|
|
275
|
+
export 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 T.TSchema, infer As extends T.TSchema[], ']', infer Optional extends TModifierOperation, ':', infer Property extends T.TSchema, null, '}'] ? (As extends [infer As extends T.TSchema] ? S.TMappedDeferred<T.TIdentifier<Key>, Type, As, TApplyReadonly<Readonly, TApplyOptional<Optional, Property>>> : S.TMappedDeferred<T.TIdentifier<Key>, Type, T.TRef<Key>, TApplyReadonly<Readonly, TApplyOptional<Optional, Property>>>) : never);
|
|
276
276
|
export declare function _Mapped_Mapping(input: [unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown]): unknown;
|
|
277
277
|
export type TReferenceMapping<Input extends string, Result extends T.TSchema = T.TRef<Input>> = Result;
|
|
278
278
|
export declare function ReferenceMapping(input: string): unknown;
|
|
@@ -331,11 +331,11 @@ export declare function InterfaceDeclarationHeritageListMapping(input: [unknown,
|
|
|
331
331
|
export type TInterfaceDeclarationHeritageMapping<Input extends [unknown, unknown] | []> = (Input extends ['extends', infer Heritage extends T.TSchema[]] ? Heritage : []);
|
|
332
332
|
export declare function InterfaceDeclarationHeritageMapping(input: [unknown, unknown] | []): unknown;
|
|
333
333
|
export type TInterfaceDeclarationGenericMapping<Input extends [unknown, unknown, unknown, unknown, unknown]> = (Input extends ['interface', infer Name extends string, infer Parameters extends T.TParameter[], infer Heritage extends T.TSchema[], infer Properties extends [T.TProperties, T.TProperties]] ? {
|
|
334
|
-
[_ in Name]: T.TGeneric<Parameters,
|
|
334
|
+
[_ in Name]: T.TGeneric<Parameters, S.TInterfaceDeferred<Heritage, Properties[0]>>;
|
|
335
335
|
} : never);
|
|
336
336
|
export declare function InterfaceDeclarationGenericMapping(input: [unknown, unknown, unknown, unknown, unknown]): unknown;
|
|
337
337
|
export type TInterfaceDeclarationMapping<Input extends [unknown, unknown, unknown, unknown]> = (Input extends ['interface', infer Name extends string, infer Heritage extends T.TSchema[], infer Properties extends [T.TProperties, T.TProperties]] ? {
|
|
338
|
-
[_ in Name]:
|
|
338
|
+
[_ in Name]: S.TInterfaceDeferred<Heritage, Properties[0]>;
|
|
339
339
|
} : never);
|
|
340
340
|
export declare function InterfaceDeclarationMapping(input: [unknown, unknown, unknown, unknown]): unknown;
|
|
341
341
|
export type TTypeAliasDeclarationGenericMapping<Input extends [unknown, unknown, unknown, unknown, unknown]> = (Input extends ['type', infer Name extends string, infer Parameters extends T.TParameter[], '=', infer Type extends T.TSchema] ? {
|
|
@@ -354,7 +354,7 @@ export type TModuleDeclarationListMapping<Input extends [unknown, unknown]> = (T
|
|
|
354
354
|
export declare function ModuleDeclarationListMapping(input: [unknown, unknown]): unknown;
|
|
355
355
|
export type TModuleDeclarationMapping<Input extends [unknown, unknown, unknown]> = (Input extends [null, infer ModuleDeclaration extends T.TProperties, null] ? ModuleDeclaration : never);
|
|
356
356
|
export declare function ModuleDeclarationMapping(input: [unknown, unknown, unknown]): unknown;
|
|
357
|
-
export type TModuleMapping<Input extends [unknown, unknown]> = (Input extends [infer ModuleDeclaration extends T.TProperties, infer ModuleDeclarationList extends [T.TProperties, T.TProperties]] ?
|
|
357
|
+
export type TModuleMapping<Input extends [unknown, unknown]> = (Input extends [infer ModuleDeclaration extends T.TProperties, infer ModuleDeclarationList extends [T.TProperties, T.TProperties]] ? S.TModuleDeferred<Memory.TAssign<ModuleDeclaration, ModuleDeclarationList[0]>> : never);
|
|
358
358
|
export declare function ModuleMapping(input: [unknown, unknown]): unknown;
|
|
359
359
|
export type TScriptMapping<Input extends unknown> = (Input);
|
|
360
360
|
export declare function ScriptMapping(input: unknown): unknown;
|