@sinclair/typebox 0.34.15 → 0.34.17
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/cjs/compiler/compiler.js +5 -0
- package/build/cjs/errors/errors.js +3 -0
- package/build/cjs/index.d.ts +3 -0
- package/build/cjs/index.js +3 -0
- package/build/cjs/syntax/index.d.ts +1 -1
- package/build/cjs/syntax/index.js +1 -1
- package/build/cjs/syntax/runtime.d.ts +40 -54
- package/build/cjs/syntax/runtime.js +91 -203
- package/build/cjs/syntax/static.d.ts +80 -146
- package/build/cjs/syntax/syntax.d.ts +33 -0
- package/build/cjs/syntax/syntax.js +37 -0
- package/build/cjs/type/argument/argument.d.ts +9 -0
- package/build/cjs/type/argument/argument.js +10 -0
- package/build/cjs/type/argument/index.d.ts +1 -0
- package/build/cjs/type/argument/index.js +18 -0
- package/build/cjs/type/constructor-parameters/constructor-parameters.d.ts +3 -3
- package/build/cjs/type/constructor-parameters/constructor-parameters.js +3 -1
- package/build/cjs/type/guard/kind.d.ts +9 -6
- package/build/cjs/type/guard/kind.js +6 -0
- package/build/cjs/type/guard/type.d.ts +9 -6
- package/build/cjs/type/guard/type.js +9 -0
- package/build/cjs/type/index.d.ts +2 -0
- package/build/cjs/type/index.js +2 -0
- package/build/cjs/type/instance-type/instance-type.d.ts +5 -4
- package/build/cjs/type/instance-type/instance-type.js +3 -1
- package/build/cjs/type/instantiate/index.d.ts +1 -0
- package/build/cjs/type/instantiate/index.js +18 -0
- package/build/cjs/type/instantiate/instantiate.d.ts +25 -0
- package/build/cjs/type/instantiate/instantiate.js +32 -0
- package/build/cjs/type/parameters/parameters.d.ts +3 -3
- package/build/cjs/type/parameters/parameters.js +3 -1
- package/build/cjs/type/record/record.d.ts +16 -1
- package/build/cjs/type/record/record.js +53 -23
- package/build/cjs/type/remap/index.d.ts +1 -0
- package/build/cjs/type/remap/index.js +18 -0
- package/build/cjs/type/remap/remap.d.ts +19 -0
- package/build/cjs/type/remap/remap.js +35 -0
- package/build/cjs/type/return-type/return-type.d.ts +5 -4
- package/build/cjs/type/return-type/return-type.js +3 -1
- package/build/cjs/type/type/javascript.d.ts +10 -4
- package/build/cjs/type/type/javascript.js +44 -34
- package/build/cjs/type/type/type.d.ts +3 -0
- package/build/cjs/type/type/type.js +123 -117
- package/build/cjs/value/check/check.js +5 -0
- package/build/cjs/value/create/create.js +5 -0
- package/build/esm/compiler/compiler.mjs +5 -0
- package/build/esm/errors/errors.mjs +3 -0
- package/build/esm/index.d.mts +3 -0
- package/build/esm/index.mjs +3 -0
- package/build/esm/syntax/index.d.mts +1 -1
- package/build/esm/syntax/index.mjs +1 -1
- package/build/esm/syntax/runtime.d.mts +40 -54
- package/build/esm/syntax/runtime.mjs +91 -203
- package/build/esm/syntax/static.d.mts +80 -146
- package/build/esm/syntax/syntax.d.mts +33 -0
- package/build/esm/syntax/syntax.mjs +30 -0
- package/build/esm/type/argument/argument.d.mts +9 -0
- package/build/esm/type/argument/argument.mjs +6 -0
- package/build/esm/type/argument/index.d.mts +1 -0
- package/build/esm/type/argument/index.mjs +1 -0
- package/build/esm/type/constructor-parameters/constructor-parameters.d.mts +3 -3
- package/build/esm/type/constructor-parameters/constructor-parameters.mjs +3 -1
- package/build/esm/type/guard/kind.d.mts +9 -6
- package/build/esm/type/guard/kind.mjs +5 -0
- package/build/esm/type/guard/type.d.mts +9 -6
- package/build/esm/type/guard/type.mjs +8 -0
- package/build/esm/type/index.d.mts +2 -0
- package/build/esm/type/index.mjs +2 -0
- package/build/esm/type/instance-type/instance-type.d.mts +5 -4
- package/build/esm/type/instance-type/instance-type.mjs +3 -1
- package/build/esm/type/instantiate/index.d.mts +1 -0
- package/build/esm/type/instantiate/index.mjs +1 -0
- package/build/esm/type/instantiate/instantiate.d.mts +25 -0
- package/build/esm/type/instantiate/instantiate.mjs +28 -0
- package/build/esm/type/parameters/parameters.d.mts +3 -3
- package/build/esm/type/parameters/parameters.mjs +3 -1
- package/build/esm/type/record/record.d.mts +16 -1
- package/build/esm/type/record/record.mjs +35 -8
- package/build/esm/type/remap/index.d.mts +1 -0
- package/build/esm/type/remap/index.mjs +1 -0
- package/build/esm/type/remap/remap.d.mts +19 -0
- package/build/esm/type/remap/remap.mjs +31 -0
- package/build/esm/type/return-type/return-type.d.mts +5 -4
- package/build/esm/type/return-type/return-type.mjs +3 -1
- package/build/esm/type/type/javascript.d.mts +10 -4
- package/build/esm/type/type/javascript.mjs +10 -0
- package/build/esm/type/type/type.d.mts +3 -0
- package/build/esm/type/type/type.mjs +3 -0
- package/build/esm/value/check/check.mjs +5 -0
- package/build/esm/value/create/create.mjs +5 -0
- package/package.json +11 -1
- package/parser/package.json +4 -0
- package/readme.md +107 -184
- package/build/cjs/syntax/parse.d.ts +0 -15
- package/build/cjs/syntax/parse.js +0 -19
- package/build/esm/syntax/parse.d.mts +0 -15
- package/build/esm/syntax/parse.mjs +0 -14
- /package/build/cjs/{syntax/parsebox → parser}/index.d.ts +0 -0
- /package/build/cjs/{syntax/parsebox → parser}/index.js +0 -0
- /package/build/cjs/{syntax/parsebox → parser}/runtime/guard.d.ts +0 -0
- /package/build/cjs/{syntax/parsebox → parser}/runtime/guard.js +0 -0
- /package/build/cjs/{syntax/parsebox → parser}/runtime/index.d.ts +0 -0
- /package/build/cjs/{syntax/parsebox → parser}/runtime/index.js +0 -0
- /package/build/cjs/{syntax/parsebox → parser}/runtime/module.d.ts +0 -0
- /package/build/cjs/{syntax/parsebox → parser}/runtime/module.js +0 -0
- /package/build/cjs/{syntax/parsebox → parser}/runtime/parse.d.ts +0 -0
- /package/build/cjs/{syntax/parsebox → parser}/runtime/parse.js +0 -0
- /package/build/cjs/{syntax/parsebox → parser}/runtime/token.d.ts +0 -0
- /package/build/cjs/{syntax/parsebox → parser}/runtime/token.js +0 -0
- /package/build/cjs/{syntax/parsebox → parser}/runtime/types.d.ts +0 -0
- /package/build/cjs/{syntax/parsebox → parser}/runtime/types.js +0 -0
- /package/build/cjs/{syntax/parsebox → parser}/static/index.d.ts +0 -0
- /package/build/cjs/{syntax/parsebox → parser}/static/index.js +0 -0
- /package/build/cjs/{syntax/parsebox → parser}/static/parse.d.ts +0 -0
- /package/build/cjs/{syntax/parsebox → parser}/static/parse.js +0 -0
- /package/build/cjs/{syntax/parsebox → parser}/static/token.d.ts +0 -0
- /package/build/cjs/{syntax/parsebox → parser}/static/token.js +0 -0
- /package/build/cjs/{syntax/parsebox → parser}/static/types.d.ts +0 -0
- /package/build/cjs/{syntax/parsebox → parser}/static/types.js +0 -0
- /package/build/esm/{syntax/parsebox → parser}/index.d.mts +0 -0
- /package/build/esm/{syntax/parsebox → parser}/index.mjs +0 -0
- /package/build/esm/{syntax/parsebox → parser}/runtime/guard.d.mts +0 -0
- /package/build/esm/{syntax/parsebox → parser}/runtime/guard.mjs +0 -0
- /package/build/esm/{syntax/parsebox → parser}/runtime/index.d.mts +0 -0
- /package/build/esm/{syntax/parsebox → parser}/runtime/index.mjs +0 -0
- /package/build/esm/{syntax/parsebox → parser}/runtime/module.d.mts +0 -0
- /package/build/esm/{syntax/parsebox → parser}/runtime/module.mjs +0 -0
- /package/build/esm/{syntax/parsebox → parser}/runtime/parse.d.mts +0 -0
- /package/build/esm/{syntax/parsebox → parser}/runtime/parse.mjs +0 -0
- /package/build/esm/{syntax/parsebox → parser}/runtime/token.d.mts +0 -0
- /package/build/esm/{syntax/parsebox → parser}/runtime/token.mjs +0 -0
- /package/build/esm/{syntax/parsebox → parser}/runtime/types.d.mts +0 -0
- /package/build/esm/{syntax/parsebox → parser}/runtime/types.mjs +0 -0
- /package/build/esm/{syntax/parsebox → parser}/static/index.d.mts +0 -0
- /package/build/esm/{syntax/parsebox → parser}/static/index.mjs +0 -0
- /package/build/esm/{syntax/parsebox → parser}/static/parse.d.mts +0 -0
- /package/build/esm/{syntax/parsebox → parser}/static/parse.mjs +0 -0
- /package/build/esm/{syntax/parsebox → parser}/static/token.d.mts +0 -0
- /package/build/esm/{syntax/parsebox → parser}/static/token.mjs +0 -0
- /package/build/esm/{syntax/parsebox → parser}/static/types.d.mts +0 -0
- /package/build/esm/{syntax/parsebox → parser}/static/types.mjs +0 -0
|
@@ -1,71 +1,57 @@
|
|
|
1
|
-
import { Runtime } from '
|
|
2
|
-
import * as
|
|
1
|
+
import { Runtime } from '../parser/index.mjs';
|
|
2
|
+
import * as t from '../type/index.mjs';
|
|
3
3
|
export declare const Module: Runtime.Module<{
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
Heritage: Runtime.IUnion<unknown[]>;
|
|
7
|
-
InterfaceDeclaration: Runtime.ITuple<{
|
|
8
|
-
[x: string]: Types.TIntersect<[...Types.TRef<string>[], Types.TObject<Types.TProperties>]>;
|
|
9
|
-
}>;
|
|
10
|
-
TypeAliasDeclaration: Runtime.ITuple<{
|
|
11
|
-
[x: string]: Types.TSchema;
|
|
12
|
-
}>;
|
|
13
|
-
ModuleType: Runtime.IUnion<unknown>;
|
|
14
|
-
ModuleProperties: Runtime.IUnion<Types.TProperties>;
|
|
15
|
-
ModuleDeclaration: Runtime.ITuple<Types.TModule<Types.TProperties, {
|
|
16
|
-
[x: string]: Types.TSchema;
|
|
17
|
-
[x: number]: Types.TSchema;
|
|
18
|
-
}>>;
|
|
19
|
-
Literal: Runtime.IUnion<Types.TLiteral<string> | Types.TLiteral<number> | Types.TLiteral<boolean>>;
|
|
20
|
-
Keyword: Runtime.IUnion<Types.TAny | Types.TNever | Types.TString | Types.TBoolean | Types.TNumber | Types.TInteger | Types.TBigInt | Types.TNull | Types.TSymbol | Types.TUndefined | Types.TUnknown | Types.TVoid>;
|
|
4
|
+
Literal: Runtime.IUnion<t.TLiteral<string> | t.TLiteral<number> | t.TLiteral<boolean>>;
|
|
5
|
+
Keyword: Runtime.IUnion<t.TAny | t.TBoolean | t.TBigInt | t.TNever | t.TString | t.TNumber | t.TInteger | t.TNull | t.TSymbol | t.TUndefined | t.TUnknown | t.TVoid>;
|
|
21
6
|
KeyOf: Runtime.IUnion<boolean>;
|
|
22
7
|
IndexArray: Runtime.IUnion<unknown[]>;
|
|
23
8
|
Extends: Runtime.IUnion<unknown[]>;
|
|
24
9
|
Base: Runtime.IUnion<unknown>;
|
|
25
|
-
Factor: Runtime.ITuple<
|
|
10
|
+
Factor: Runtime.ITuple<t.TSchema>;
|
|
26
11
|
ExprTermTail: Runtime.IUnion<[] | ["&", unknown, unknown]>;
|
|
27
|
-
ExprTerm: Runtime.ITuple<
|
|
12
|
+
ExprTerm: Runtime.ITuple<t.TSchema>;
|
|
28
13
|
ExprTail: Runtime.IUnion<[] | ["|", unknown, unknown]>;
|
|
29
|
-
Expr: Runtime.ITuple<
|
|
14
|
+
Expr: Runtime.ITuple<t.TSchema>;
|
|
30
15
|
Type: Runtime.IRef<unknown>;
|
|
31
16
|
PropertyKey: Runtime.IUnion<string>;
|
|
32
17
|
Readonly: Runtime.IUnion<boolean>;
|
|
33
18
|
Optional: Runtime.IUnion<boolean>;
|
|
34
19
|
Property: Runtime.ITuple<{
|
|
35
|
-
[x: string]:
|
|
20
|
+
[x: string]: t.TSchema;
|
|
36
21
|
}>;
|
|
37
22
|
PropertyDelimiter: Runtime.IUnion<[","] | [",", "\n"] | [";"] | [";", "\n"] | ["\n"]>;
|
|
38
|
-
Properties: Runtime.IUnion<
|
|
39
|
-
Object: Runtime.ITuple<
|
|
23
|
+
Properties: Runtime.IUnion<t.TProperties>;
|
|
24
|
+
Object: Runtime.ITuple<t.TObject<t.TProperties>>;
|
|
40
25
|
Elements: Runtime.IUnion<unknown[]>;
|
|
41
|
-
Tuple: Runtime.ITuple<
|
|
42
|
-
Parameter: Runtime.ITuple<
|
|
43
|
-
Function: Runtime.ITuple<
|
|
26
|
+
Tuple: Runtime.ITuple<t.TTuple<t.TSchema[]>>;
|
|
27
|
+
Parameter: Runtime.ITuple<t.TSchema>;
|
|
28
|
+
Function: Runtime.ITuple<t.TFunction<t.TSchema[], t.TSchema>>;
|
|
44
29
|
Parameters: Runtime.IUnion<unknown[]>;
|
|
45
|
-
Constructor: Runtime.ITuple<
|
|
46
|
-
Mapped: Runtime.ITuple<
|
|
47
|
-
AsyncIterator: Runtime.ITuple<
|
|
48
|
-
Iterator: Runtime.ITuple<
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
30
|
+
Constructor: Runtime.ITuple<t.TConstructor<t.TSchema[], t.TSchema>>;
|
|
31
|
+
Mapped: Runtime.ITuple<t.TLiteral<"Mapped types not supported">>;
|
|
32
|
+
AsyncIterator: Runtime.ITuple<t.TAsyncIterator<t.TSchema>>;
|
|
33
|
+
Iterator: Runtime.ITuple<t.TIterator<t.TSchema>>;
|
|
34
|
+
Argument: Runtime.ITuple<t.TNever | t.TArgument<number>>;
|
|
35
|
+
Awaited: Runtime.ITuple<t.TSchema>;
|
|
36
|
+
Array: Runtime.ITuple<t.TArray<t.TSchema>>;
|
|
37
|
+
Record: Runtime.ITuple<t.TNever>;
|
|
38
|
+
Promise: Runtime.ITuple<t.TPromise<t.TSchema>>;
|
|
39
|
+
ConstructorParameters: Runtime.ITuple<t.TTuple<t.TSchema[]>>;
|
|
40
|
+
FunctionParameters: Runtime.ITuple<t.TTuple<t.TSchema[]>>;
|
|
41
|
+
InstanceType: Runtime.ITuple<t.TSchema>;
|
|
42
|
+
ReturnType: Runtime.ITuple<t.TSchema>;
|
|
43
|
+
Partial: Runtime.ITuple<t.TObject<{}>>;
|
|
44
|
+
Required: Runtime.ITuple<t.TObject<{}>>;
|
|
45
|
+
Pick: Runtime.ITuple<t.TObject<{}>>;
|
|
46
|
+
Omit: Runtime.ITuple<t.TObject<{}>>;
|
|
47
|
+
Exclude: Runtime.ITuple<t.TNever>;
|
|
48
|
+
Extract: Runtime.ITuple<t.TSchema>;
|
|
49
|
+
Uppercase: Runtime.ITuple<t.TSchema>;
|
|
50
|
+
Lowercase: Runtime.ITuple<t.TSchema>;
|
|
51
|
+
Capitalize: Runtime.ITuple<t.TSchema>;
|
|
52
|
+
Uncapitalize: Runtime.ITuple<t.TSchema>;
|
|
53
|
+
Date: Runtime.IConst<t.TDate>;
|
|
54
|
+
Uint8Array: Runtime.IConst<t.TUint8Array>;
|
|
55
|
+
GenericReference: Runtime.ITuple<t.TSchema>;
|
|
56
|
+
Reference: Runtime.IIdent<t.TSchema>;
|
|
71
57
|
}>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Runtime } from '
|
|
2
|
-
import * as
|
|
1
|
+
import { Runtime } from '../parser/index.mjs';
|
|
2
|
+
import * as t from '../type/index.mjs';
|
|
3
3
|
// ------------------------------------------------------------------
|
|
4
4
|
// Tokens
|
|
5
5
|
// ------------------------------------------------------------------
|
|
@@ -30,159 +30,54 @@ function DestructureRight(values) {
|
|
|
30
30
|
: [values, undefined];
|
|
31
31
|
}
|
|
32
32
|
// ------------------------------------------------------------------
|
|
33
|
-
//
|
|
33
|
+
// Dereference
|
|
34
34
|
// ------------------------------------------------------------------
|
|
35
|
-
const
|
|
36
|
-
return key in context ? context[key] :
|
|
35
|
+
const Dereference = (context, key) => {
|
|
36
|
+
return key in context ? context[key] : t.Ref(key);
|
|
37
37
|
};
|
|
38
38
|
// ------------------------------------------------------------------
|
|
39
|
-
//
|
|
39
|
+
// GenericReference
|
|
40
40
|
// ------------------------------------------------------------------
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
return
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
const ExportModifier = Runtime.Union([
|
|
47
|
-
Runtime.Tuple([Runtime.Const('export')]), Runtime.Tuple([])
|
|
48
|
-
], ExportModifierMapping);
|
|
49
|
-
// ------------------------------------------------------------------
|
|
50
|
-
// TypeAliasDeclaration
|
|
51
|
-
// ------------------------------------------------------------------
|
|
52
|
-
// prettier-ignore
|
|
53
|
-
const TypeAliasDeclarationMapping = (_Export, _Keyword, Ident, _Equals, Type) => {
|
|
54
|
-
return { [Ident]: Type };
|
|
55
|
-
};
|
|
56
|
-
// prettier-ignore
|
|
57
|
-
const TypeAliasDeclaration = Runtime.Tuple([
|
|
58
|
-
Runtime.Ref('ExportModifier'),
|
|
59
|
-
Runtime.Const('type'),
|
|
60
|
-
Runtime.Ident(),
|
|
61
|
-
Runtime.Const(Equals),
|
|
62
|
-
Runtime.Ref('Type')
|
|
63
|
-
], value => TypeAliasDeclarationMapping(...value));
|
|
64
|
-
// ------------------------------------------------------------------
|
|
65
|
-
// HeritageList
|
|
66
|
-
// ------------------------------------------------------------------
|
|
67
|
-
// prettier-ignore (note, heritage list should disallow trailing comma)
|
|
68
|
-
const HeritageListDelimiter = Runtime.Union([Runtime.Tuple([Runtime.Const(Comma), Runtime.Const(Newline)]), Runtime.Tuple([Runtime.Const(Comma)])]);
|
|
69
|
-
// prettier-ignore
|
|
70
|
-
const HeritageListMapping = (values, context) => {
|
|
71
|
-
return (values.length === 3 ? [Deref(context, values[0]), ...values[2]] :
|
|
72
|
-
values.length === 1 ? [Deref(context, values[0])] :
|
|
73
|
-
[]);
|
|
74
|
-
};
|
|
75
|
-
// prettier-ignore
|
|
76
|
-
const HeritageList = Runtime.Union([
|
|
77
|
-
Runtime.Tuple([Runtime.Ident(), HeritageListDelimiter, Runtime.Ref('HeritageList')]),
|
|
78
|
-
Runtime.Tuple([Runtime.Ident()]),
|
|
79
|
-
Runtime.Tuple([])
|
|
80
|
-
], HeritageListMapping);
|
|
81
|
-
// ------------------------------------------------------------------
|
|
82
|
-
// Heritage
|
|
83
|
-
// ------------------------------------------------------------------
|
|
84
|
-
// prettier-ignore
|
|
85
|
-
const HeritageMapping = (values) => {
|
|
86
|
-
return (values.length === 2 ? values[1] : []);
|
|
87
|
-
};
|
|
88
|
-
// prettier-ignore
|
|
89
|
-
const Heritage = Runtime.Union([
|
|
90
|
-
Runtime.Tuple([Runtime.Const('extends'), Runtime.Ref('HeritageList')]),
|
|
91
|
-
Runtime.Tuple([])
|
|
92
|
-
], HeritageMapping);
|
|
93
|
-
// ------------------------------------------------------------------
|
|
94
|
-
// InterfaceDeclaration
|
|
95
|
-
// ------------------------------------------------------------------
|
|
96
|
-
// prettier-ignore
|
|
97
|
-
const InterfaceDeclarationMapping = (_0, _1, Ident, Heritage, _4, Properties, _6) => {
|
|
98
|
-
return { [Ident]: Types.Intersect([...Heritage, Types.Object(Properties)]) };
|
|
99
|
-
};
|
|
100
|
-
// prettier-ignore
|
|
101
|
-
const InterfaceDeclaration = Runtime.Tuple([
|
|
102
|
-
Runtime.Ref('ExportModifier'),
|
|
103
|
-
Runtime.Const('interface'),
|
|
104
|
-
Runtime.Ident(),
|
|
105
|
-
Runtime.Ref('Heritage'),
|
|
106
|
-
Runtime.Const(LBrace),
|
|
107
|
-
Runtime.Ref('Properties'),
|
|
108
|
-
Runtime.Const(RBrace),
|
|
109
|
-
], values => InterfaceDeclarationMapping(...values));
|
|
110
|
-
// ------------------------------------------------------------------
|
|
111
|
-
// ModuleType
|
|
112
|
-
// ------------------------------------------------------------------
|
|
113
|
-
// prettier-ignore
|
|
114
|
-
const ModuleType = Runtime.Union([
|
|
115
|
-
Runtime.Ref('InterfaceDeclaration'),
|
|
116
|
-
Runtime.Ref('TypeAliasDeclaration')
|
|
117
|
-
]);
|
|
118
|
-
// ------------------------------------------------------------------
|
|
119
|
-
// ModuleProperties
|
|
120
|
-
// ------------------------------------------------------------------
|
|
121
|
-
// prettier-ignore
|
|
122
|
-
const ModulePropertiesDelimiter = Runtime.Union([
|
|
123
|
-
Runtime.Tuple([Runtime.Const(SemiColon), Runtime.Const(Newline)]),
|
|
124
|
-
Runtime.Tuple([Runtime.Const(SemiColon)]),
|
|
125
|
-
Runtime.Tuple([Runtime.Const(Newline)]),
|
|
126
|
-
]);
|
|
127
|
-
// prettier-ignore
|
|
128
|
-
const ModulePropertiesMapping = (values) => {
|
|
129
|
-
return (values.length === 3 ? { ...values[0], ...values[2] } :
|
|
130
|
-
values.length === 1 ? values[0] :
|
|
131
|
-
{});
|
|
132
|
-
};
|
|
133
|
-
// prettier-ignore
|
|
134
|
-
const ModuleProperties = Runtime.Union([
|
|
135
|
-
Runtime.Tuple([Runtime.Ref('ModuleType'), ModulePropertiesDelimiter, Runtime.Ref('ModuleProperties')]),
|
|
136
|
-
Runtime.Tuple([Runtime.Ref('ModuleType')]),
|
|
137
|
-
Runtime.Tuple([]),
|
|
138
|
-
], ModulePropertiesMapping);
|
|
139
|
-
// ------------------------------------------------------------------
|
|
140
|
-
// ModuleDeclaration
|
|
141
|
-
// ------------------------------------------------------------------
|
|
142
|
-
// prettier-ignore
|
|
143
|
-
const ModuleIdentifier = Runtime.Union([
|
|
144
|
-
Runtime.Tuple([Runtime.Ident()]),
|
|
145
|
-
Runtime.Tuple([])
|
|
146
|
-
]);
|
|
147
|
-
// prettier-ignore
|
|
148
|
-
const ModuleDeclarationMapping = (_1, _2, _Ident, _3, Properties, _5) => {
|
|
149
|
-
return Types.Module(Properties);
|
|
150
|
-
};
|
|
151
|
-
// prettier-ignore
|
|
152
|
-
const ModuleDeclaration = Runtime.Tuple([
|
|
153
|
-
Runtime.Ref('ExportModifier'), Runtime.Const('module'), ModuleIdentifier, Runtime.Const(LBrace), Runtime.Ref('ModuleProperties'), Runtime.Const(RBrace)
|
|
154
|
-
], values => ModuleDeclarationMapping(...values));
|
|
41
|
+
function GenericReferenceMapping(results, context) {
|
|
42
|
+
const target = Dereference(context, results[0]);
|
|
43
|
+
return t.Instantiate(target, results[2]);
|
|
44
|
+
}
|
|
45
|
+
const GenericReference = Runtime.Tuple([Runtime.Ident(), Runtime.Const(LAngle), Runtime.Ref('Elements'), Runtime.Const(RAngle)], (results, context) => GenericReferenceMapping(results, context));
|
|
155
46
|
// ------------------------------------------------------------------
|
|
156
47
|
// Reference
|
|
157
48
|
// ------------------------------------------------------------------
|
|
49
|
+
function ReferenceMapping(result, context) {
|
|
50
|
+
const target = Dereference(context, result);
|
|
51
|
+
return target;
|
|
52
|
+
}
|
|
158
53
|
// prettier-ignore
|
|
159
|
-
const Reference = Runtime.Ident((
|
|
54
|
+
const Reference = Runtime.Ident((result, context) => ReferenceMapping(result, context));
|
|
160
55
|
// ------------------------------------------------------------------
|
|
161
56
|
// Literal
|
|
162
57
|
// ------------------------------------------------------------------
|
|
163
58
|
// prettier-ignore
|
|
164
59
|
const Literal = Runtime.Union([
|
|
165
|
-
Runtime.Union([Runtime.Const('true'), Runtime.Const('false')], value =>
|
|
166
|
-
Runtime.Number(value =>
|
|
167
|
-
Runtime.String([SingleQuote, DoubleQuote, Tilde], value =>
|
|
60
|
+
Runtime.Union([Runtime.Const('true'), Runtime.Const('false')], value => t.Literal(value === 'true')),
|
|
61
|
+
Runtime.Number(value => t.Literal(parseFloat(value))),
|
|
62
|
+
Runtime.String([SingleQuote, DoubleQuote, Tilde], value => t.Literal(value))
|
|
168
63
|
]);
|
|
169
64
|
// ------------------------------------------------------------------
|
|
170
65
|
// Keyword
|
|
171
66
|
// ------------------------------------------------------------------
|
|
172
67
|
// prettier-ignore
|
|
173
68
|
const Keyword = Runtime.Union([
|
|
174
|
-
Runtime.Const('any', Runtime.As(
|
|
175
|
-
Runtime.Const('bigint', Runtime.As(
|
|
176
|
-
Runtime.Const('boolean', Runtime.As(
|
|
177
|
-
Runtime.Const('integer', Runtime.As(
|
|
178
|
-
Runtime.Const('never', Runtime.As(
|
|
179
|
-
Runtime.Const('null', Runtime.As(
|
|
180
|
-
Runtime.Const('number', Runtime.As(
|
|
181
|
-
Runtime.Const('string', Runtime.As(
|
|
182
|
-
Runtime.Const('symbol', Runtime.As(
|
|
183
|
-
Runtime.Const('undefined', Runtime.As(
|
|
184
|
-
Runtime.Const('unknown', Runtime.As(
|
|
185
|
-
Runtime.Const('void', Runtime.As(
|
|
69
|
+
Runtime.Const('any', Runtime.As(t.Any())),
|
|
70
|
+
Runtime.Const('bigint', Runtime.As(t.BigInt())),
|
|
71
|
+
Runtime.Const('boolean', Runtime.As(t.Boolean())),
|
|
72
|
+
Runtime.Const('integer', Runtime.As(t.Integer())),
|
|
73
|
+
Runtime.Const('never', Runtime.As(t.Never())),
|
|
74
|
+
Runtime.Const('null', Runtime.As(t.Null())),
|
|
75
|
+
Runtime.Const('number', Runtime.As(t.Number())),
|
|
76
|
+
Runtime.Const('string', Runtime.As(t.String())),
|
|
77
|
+
Runtime.Const('symbol', Runtime.As(t.Symbol())),
|
|
78
|
+
Runtime.Const('undefined', Runtime.As(t.Undefined())),
|
|
79
|
+
Runtime.Const('unknown', Runtime.As(t.Unknown())),
|
|
80
|
+
Runtime.Const('void', Runtime.As(t.Void())),
|
|
186
81
|
]);
|
|
187
82
|
// ------------------------------------------------------------------
|
|
188
83
|
// KeyOf
|
|
@@ -248,6 +143,7 @@ const Base = Runtime.Union([
|
|
|
248
143
|
Runtime.Ref('FunctionParameters'),
|
|
249
144
|
Runtime.Ref('InstanceType'),
|
|
250
145
|
Runtime.Ref('ReturnType'),
|
|
146
|
+
Runtime.Ref('Argument'),
|
|
251
147
|
Runtime.Ref('Awaited'),
|
|
252
148
|
Runtime.Ref('Array'),
|
|
253
149
|
Runtime.Ref('Record'),
|
|
@@ -264,6 +160,7 @@ const Base = Runtime.Union([
|
|
|
264
160
|
Runtime.Ref('Uncapitalize'),
|
|
265
161
|
Runtime.Ref('Date'),
|
|
266
162
|
Runtime.Ref('Uint8Array'),
|
|
163
|
+
Runtime.Ref('GenericReference'),
|
|
267
164
|
Runtime.Ref('Reference')
|
|
268
165
|
])])
|
|
269
166
|
], BaseMapping);
|
|
@@ -273,22 +170,22 @@ const Base = Runtime.Union([
|
|
|
273
170
|
// prettier-ignore
|
|
274
171
|
const FactorExtends = (Type, Extends) => {
|
|
275
172
|
return Extends.length === 3
|
|
276
|
-
?
|
|
173
|
+
? t.Extends(Type, Extends[0], Extends[1], Extends[2])
|
|
277
174
|
: Type;
|
|
278
175
|
};
|
|
279
176
|
// prettier-ignore
|
|
280
177
|
const FactorIndexArray = (Type, IndexArray) => {
|
|
281
178
|
const [Left, Right] = DestructureRight(IndexArray);
|
|
282
|
-
return (!
|
|
179
|
+
return (!t.ValueGuard.IsUndefined(Right) ? (
|
|
283
180
|
// note: Indexed types require reimplementation to replace `[number]` indexers
|
|
284
|
-
Right.length === 1 ?
|
|
285
|
-
Right.length === 0 ?
|
|
286
|
-
|
|
181
|
+
Right.length === 1 ? t.Index(FactorIndexArray(Type, Left), Right[0]) :
|
|
182
|
+
Right.length === 0 ? t.Array(FactorIndexArray(Type, Left)) :
|
|
183
|
+
t.Never()) : Type);
|
|
287
184
|
};
|
|
288
185
|
// prettier-ignore
|
|
289
186
|
const FactorMapping = (KeyOf, Type, IndexArray, Extends) => {
|
|
290
187
|
return KeyOf
|
|
291
|
-
? FactorExtends(
|
|
188
|
+
? FactorExtends(t.KeyOf(FactorIndexArray(Type, IndexArray)), Extends)
|
|
292
189
|
: FactorExtends(FactorIndexArray(Type, IndexArray), Extends);
|
|
293
190
|
};
|
|
294
191
|
// prettier-ignore
|
|
@@ -307,14 +204,14 @@ function ExprBinaryMapping(Left, Rest) {
|
|
|
307
204
|
const [Operator, Right, Next] = Rest;
|
|
308
205
|
const Schema = ExprBinaryMapping(Right, Next);
|
|
309
206
|
if (Operator === '&') {
|
|
310
|
-
return
|
|
311
|
-
?
|
|
312
|
-
:
|
|
207
|
+
return t.TypeGuard.IsIntersect(Schema)
|
|
208
|
+
? t.Intersect([Left, ...Schema.allOf])
|
|
209
|
+
: t.Intersect([Left, Schema]);
|
|
313
210
|
}
|
|
314
211
|
if (Operator === '|') {
|
|
315
|
-
return
|
|
316
|
-
?
|
|
317
|
-
:
|
|
212
|
+
return t.TypeGuard.IsUnion(Schema)
|
|
213
|
+
? t.Union([Left, ...Schema.anyOf])
|
|
214
|
+
: t.Union([Left, Schema]);
|
|
318
215
|
}
|
|
319
216
|
throw 1;
|
|
320
217
|
})() : Left);
|
|
@@ -349,9 +246,9 @@ const Readonly = Runtime.Union([Runtime.Tuple([Runtime.Const('readonly')]), Runt
|
|
|
349
246
|
const Optional = Runtime.Union([Runtime.Tuple([Runtime.Const(Question)]), Runtime.Tuple([])], (value) => value.length > 0);
|
|
350
247
|
// prettier-ignore
|
|
351
248
|
const PropertyMapping = (IsReadonly, Key, IsOptional, _, Type) => ({
|
|
352
|
-
[Key]: (IsReadonly && IsOptional ?
|
|
353
|
-
IsReadonly && !IsOptional ?
|
|
354
|
-
!IsReadonly && IsOptional ?
|
|
249
|
+
[Key]: (IsReadonly && IsOptional ? t.ReadonlyOptional(Type) :
|
|
250
|
+
IsReadonly && !IsOptional ? t.Readonly(Type) :
|
|
251
|
+
!IsReadonly && IsOptional ? t.Optional(Type) :
|
|
355
252
|
Type)
|
|
356
253
|
});
|
|
357
254
|
// prettier-ignore
|
|
@@ -384,7 +281,7 @@ const Properties = Runtime.Union([
|
|
|
384
281
|
// Object
|
|
385
282
|
// ------------------------------------------------------------------
|
|
386
283
|
// prettier-ignore
|
|
387
|
-
const ObjectMapping = (_0, Properties, _2) =>
|
|
284
|
+
const ObjectMapping = (_0, Properties, _2) => t.Object(Properties);
|
|
388
285
|
// prettier-ignore
|
|
389
286
|
const _Object = Runtime.Tuple([
|
|
390
287
|
Runtime.Const(LBrace),
|
|
@@ -409,7 +306,7 @@ const Tuple = Runtime.Tuple([
|
|
|
409
306
|
Runtime.Const(LBracket),
|
|
410
307
|
Runtime.Ref('Elements'),
|
|
411
308
|
Runtime.Const(RBracket)
|
|
412
|
-
], value =>
|
|
309
|
+
], value => t.Tuple(value[1]));
|
|
413
310
|
// ------------------------------------------------------------------
|
|
414
311
|
// Parameters
|
|
415
312
|
// ------------------------------------------------------------------
|
|
@@ -438,7 +335,7 @@ const Constructor = Runtime.Tuple([
|
|
|
438
335
|
Runtime.Const(RParen),
|
|
439
336
|
Runtime.Const('=>'),
|
|
440
337
|
Runtime.Ref('Type')
|
|
441
|
-
], value =>
|
|
338
|
+
], value => t.Constructor(value[2], value[5]));
|
|
442
339
|
// ------------------------------------------------------------------
|
|
443
340
|
// Function
|
|
444
341
|
// ------------------------------------------------------------------
|
|
@@ -449,13 +346,13 @@ const Function = Runtime.Tuple([
|
|
|
449
346
|
Runtime.Const(RParen),
|
|
450
347
|
Runtime.Const('=>'),
|
|
451
348
|
Runtime.Ref('Type')
|
|
452
|
-
], value =>
|
|
349
|
+
], value => t.Function(value[1], value[4]));
|
|
453
350
|
// ------------------------------------------------------------------
|
|
454
351
|
// Mapped (requires deferred types)
|
|
455
352
|
// ------------------------------------------------------------------
|
|
456
353
|
// prettier-ignore
|
|
457
354
|
const MappedMapping = (values) => {
|
|
458
|
-
return
|
|
355
|
+
return t.Literal('Mapped types not supported');
|
|
459
356
|
};
|
|
460
357
|
// prettier-ignore
|
|
461
358
|
const Mapped = Runtime.Tuple([
|
|
@@ -478,7 +375,7 @@ const AsyncIterator = Runtime.Tuple([
|
|
|
478
375
|
Runtime.Const(LAngle),
|
|
479
376
|
Runtime.Ref('Type'),
|
|
480
377
|
Runtime.Const(RAngle),
|
|
481
|
-
], value =>
|
|
378
|
+
], value => t.AsyncIterator(value[2]));
|
|
482
379
|
// ------------------------------------------------------------------
|
|
483
380
|
// Iterator
|
|
484
381
|
// ------------------------------------------------------------------
|
|
@@ -488,7 +385,7 @@ const Iterator = Runtime.Tuple([
|
|
|
488
385
|
Runtime.Const(LAngle),
|
|
489
386
|
Runtime.Ref('Type'),
|
|
490
387
|
Runtime.Const(RAngle),
|
|
491
|
-
], value =>
|
|
388
|
+
], value => t.Iterator(value[2]));
|
|
492
389
|
// ------------------------------------------------------------------
|
|
493
390
|
// ConstructorParameters
|
|
494
391
|
// ------------------------------------------------------------------
|
|
@@ -498,7 +395,7 @@ const ConstructorParameters = Runtime.Tuple([
|
|
|
498
395
|
Runtime.Const(LAngle),
|
|
499
396
|
Runtime.Ref('Type'),
|
|
500
397
|
Runtime.Const(RAngle),
|
|
501
|
-
], value =>
|
|
398
|
+
], value => t.ConstructorParameters(value[2]));
|
|
502
399
|
// ------------------------------------------------------------------
|
|
503
400
|
// Parameters
|
|
504
401
|
// ------------------------------------------------------------------
|
|
@@ -508,7 +405,7 @@ const FunctionParameters = Runtime.Tuple([
|
|
|
508
405
|
Runtime.Const(LAngle),
|
|
509
406
|
Runtime.Ref('Type'),
|
|
510
407
|
Runtime.Const(RAngle),
|
|
511
|
-
], value =>
|
|
408
|
+
], value => t.Parameters(value[2]));
|
|
512
409
|
// ------------------------------------------------------------------
|
|
513
410
|
// InstanceType
|
|
514
411
|
// ------------------------------------------------------------------
|
|
@@ -518,7 +415,7 @@ const InstanceType = Runtime.Tuple([
|
|
|
518
415
|
Runtime.Const(LAngle),
|
|
519
416
|
Runtime.Ref('Type'),
|
|
520
417
|
Runtime.Const(RAngle),
|
|
521
|
-
], value =>
|
|
418
|
+
], value => t.InstanceType(value[2]));
|
|
522
419
|
// ------------------------------------------------------------------
|
|
523
420
|
// ReturnType
|
|
524
421
|
// ------------------------------------------------------------------
|
|
@@ -528,7 +425,21 @@ const ReturnType = Runtime.Tuple([
|
|
|
528
425
|
Runtime.Const(LAngle),
|
|
529
426
|
Runtime.Ref('Type'),
|
|
530
427
|
Runtime.Const(RAngle),
|
|
531
|
-
], value =>
|
|
428
|
+
], value => t.ReturnType(value[2]));
|
|
429
|
+
// ------------------------------------------------------------------
|
|
430
|
+
// Argument
|
|
431
|
+
// ------------------------------------------------------------------
|
|
432
|
+
// prettier-ignore
|
|
433
|
+
const Argument = Runtime.Tuple([
|
|
434
|
+
Runtime.Const('Argument'),
|
|
435
|
+
Runtime.Const(LAngle),
|
|
436
|
+
Runtime.Ref('Type'),
|
|
437
|
+
Runtime.Const(RAngle),
|
|
438
|
+
], results => {
|
|
439
|
+
return t.KindGuard.IsLiteralNumber(results[2])
|
|
440
|
+
? t.Argument(Math.trunc(results[2].const))
|
|
441
|
+
: t.Never();
|
|
442
|
+
});
|
|
532
443
|
// ------------------------------------------------------------------
|
|
533
444
|
// Awaited
|
|
534
445
|
// ------------------------------------------------------------------
|
|
@@ -538,7 +449,7 @@ const Awaited = Runtime.Tuple([
|
|
|
538
449
|
Runtime.Const(LAngle),
|
|
539
450
|
Runtime.Ref('Type'),
|
|
540
451
|
Runtime.Const(RAngle),
|
|
541
|
-
], value =>
|
|
452
|
+
], value => t.Awaited(value[2]));
|
|
542
453
|
// ------------------------------------------------------------------
|
|
543
454
|
// Array
|
|
544
455
|
// ------------------------------------------------------------------
|
|
@@ -548,7 +459,7 @@ const Array = Runtime.Tuple([
|
|
|
548
459
|
Runtime.Const(LAngle),
|
|
549
460
|
Runtime.Ref('Type'),
|
|
550
461
|
Runtime.Const(RAngle),
|
|
551
|
-
], value =>
|
|
462
|
+
], value => t.Array(value[2]));
|
|
552
463
|
// ------------------------------------------------------------------
|
|
553
464
|
// Record
|
|
554
465
|
// ------------------------------------------------------------------
|
|
@@ -560,7 +471,7 @@ const Record = Runtime.Tuple([
|
|
|
560
471
|
Runtime.Const(Comma),
|
|
561
472
|
Runtime.Ref('Type'),
|
|
562
473
|
Runtime.Const(RAngle),
|
|
563
|
-
], value =>
|
|
474
|
+
], value => t.Record(value[2], value[4]));
|
|
564
475
|
// ------------------------------------------------------------------
|
|
565
476
|
// Promise
|
|
566
477
|
// ------------------------------------------------------------------
|
|
@@ -570,7 +481,7 @@ const Promise = Runtime.Tuple([
|
|
|
570
481
|
Runtime.Const(LAngle),
|
|
571
482
|
Runtime.Ref('Type'),
|
|
572
483
|
Runtime.Const(RAngle),
|
|
573
|
-
], value =>
|
|
484
|
+
], value => t.Promise(value[2]));
|
|
574
485
|
// ------------------------------------------------------------------
|
|
575
486
|
// Partial
|
|
576
487
|
// ------------------------------------------------------------------
|
|
@@ -580,7 +491,7 @@ const Partial = Runtime.Tuple([
|
|
|
580
491
|
Runtime.Const(LAngle),
|
|
581
492
|
Runtime.Ref('Type'),
|
|
582
493
|
Runtime.Const(RAngle),
|
|
583
|
-
], value =>
|
|
494
|
+
], value => t.Partial(value[2]));
|
|
584
495
|
// ------------------------------------------------------------------
|
|
585
496
|
// Required
|
|
586
497
|
// ------------------------------------------------------------------
|
|
@@ -590,7 +501,7 @@ const Required = Runtime.Tuple([
|
|
|
590
501
|
Runtime.Const(LAngle),
|
|
591
502
|
Runtime.Ref('Type'),
|
|
592
503
|
Runtime.Const(RAngle),
|
|
593
|
-
], value =>
|
|
504
|
+
], value => t.Required(value[2]));
|
|
594
505
|
// ------------------------------------------------------------------
|
|
595
506
|
// Pick
|
|
596
507
|
// ------------------------------------------------------------------
|
|
@@ -602,7 +513,7 @@ const Pick = Runtime.Tuple([
|
|
|
602
513
|
Runtime.Const(Comma),
|
|
603
514
|
Runtime.Ref('Type'),
|
|
604
515
|
Runtime.Const(RAngle),
|
|
605
|
-
], value =>
|
|
516
|
+
], value => t.Pick(value[2], value[4]));
|
|
606
517
|
// ------------------------------------------------------------------
|
|
607
518
|
// Omit
|
|
608
519
|
// ------------------------------------------------------------------
|
|
@@ -614,7 +525,7 @@ const Omit = Runtime.Tuple([
|
|
|
614
525
|
Runtime.Const(Comma),
|
|
615
526
|
Runtime.Ref('Type'),
|
|
616
527
|
Runtime.Const(RAngle),
|
|
617
|
-
], value =>
|
|
528
|
+
], value => t.Omit(value[2], value[4]));
|
|
618
529
|
// ------------------------------------------------------------------
|
|
619
530
|
// Exclude
|
|
620
531
|
// ------------------------------------------------------------------
|
|
@@ -626,7 +537,7 @@ const Exclude = Runtime.Tuple([
|
|
|
626
537
|
Runtime.Const(Comma),
|
|
627
538
|
Runtime.Ref('Type'),
|
|
628
539
|
Runtime.Const(RAngle),
|
|
629
|
-
], value =>
|
|
540
|
+
], value => t.Exclude(value[2], value[4]));
|
|
630
541
|
// ------------------------------------------------------------------
|
|
631
542
|
// Extract
|
|
632
543
|
// ------------------------------------------------------------------
|
|
@@ -638,7 +549,7 @@ const Extract = Runtime.Tuple([
|
|
|
638
549
|
Runtime.Const(Comma),
|
|
639
550
|
Runtime.Ref('Type'),
|
|
640
551
|
Runtime.Const(RAngle),
|
|
641
|
-
], value =>
|
|
552
|
+
], value => t.Extract(value[2], value[4]));
|
|
642
553
|
// ------------------------------------------------------------------
|
|
643
554
|
// Uppercase
|
|
644
555
|
// ------------------------------------------------------------------
|
|
@@ -648,7 +559,7 @@ const Uppercase = Runtime.Tuple([
|
|
|
648
559
|
Runtime.Const(LAngle),
|
|
649
560
|
Runtime.Ref('Type'),
|
|
650
561
|
Runtime.Const(RAngle),
|
|
651
|
-
], value =>
|
|
562
|
+
], value => t.Uppercase(value[2]));
|
|
652
563
|
// ------------------------------------------------------------------
|
|
653
564
|
// Lowercase
|
|
654
565
|
// ------------------------------------------------------------------
|
|
@@ -658,7 +569,7 @@ const Lowercase = Runtime.Tuple([
|
|
|
658
569
|
Runtime.Const(LAngle),
|
|
659
570
|
Runtime.Ref('Type'),
|
|
660
571
|
Runtime.Const(RAngle),
|
|
661
|
-
], value =>
|
|
572
|
+
], value => t.Lowercase(value[2]));
|
|
662
573
|
// ------------------------------------------------------------------
|
|
663
574
|
// Capitalize
|
|
664
575
|
// ------------------------------------------------------------------
|
|
@@ -668,7 +579,7 @@ const Capitalize = Runtime.Tuple([
|
|
|
668
579
|
Runtime.Const(LAngle),
|
|
669
580
|
Runtime.Ref('Type'),
|
|
670
581
|
Runtime.Const(RAngle),
|
|
671
|
-
], value =>
|
|
582
|
+
], value => t.Capitalize(value[2]));
|
|
672
583
|
// ------------------------------------------------------------------
|
|
673
584
|
// Uncapitalize
|
|
674
585
|
// ------------------------------------------------------------------
|
|
@@ -678,41 +589,20 @@ const Uncapitalize = Runtime.Tuple([
|
|
|
678
589
|
Runtime.Const(LAngle),
|
|
679
590
|
Runtime.Ref('Type'),
|
|
680
591
|
Runtime.Const(RAngle),
|
|
681
|
-
], value =>
|
|
592
|
+
], value => t.Uncapitalize(value[2]));
|
|
682
593
|
// ------------------------------------------------------------------
|
|
683
594
|
// Date
|
|
684
595
|
// ------------------------------------------------------------------
|
|
685
|
-
const Date = Runtime.Const('Date', Runtime.As(
|
|
596
|
+
const Date = Runtime.Const('Date', Runtime.As(t.Date()));
|
|
686
597
|
// ------------------------------------------------------------------
|
|
687
598
|
// Uint8Array
|
|
688
599
|
// ------------------------------------------------------------------
|
|
689
|
-
const Uint8Array = Runtime.Const('Uint8Array', Runtime.As(
|
|
690
|
-
// ------------------------------------------------------------------
|
|
691
|
-
// Main
|
|
692
|
-
// ------------------------------------------------------------------
|
|
693
|
-
// prettier-ignore
|
|
694
|
-
const Main = Runtime.Union([
|
|
695
|
-
ModuleDeclaration,
|
|
696
|
-
TypeAliasDeclaration,
|
|
697
|
-
InterfaceDeclaration,
|
|
698
|
-
Type
|
|
699
|
-
]);
|
|
600
|
+
const Uint8Array = Runtime.Const('Uint8Array', Runtime.As(t.Uint8Array()));
|
|
700
601
|
// ------------------------------------------------------------------
|
|
701
602
|
// Module
|
|
702
603
|
// ------------------------------------------------------------------
|
|
703
604
|
// prettier-ignore
|
|
704
605
|
export const Module = new Runtime.Module({
|
|
705
|
-
// ----------------------------------------------------------------
|
|
706
|
-
// Modules, Interfaces and Type Aliases
|
|
707
|
-
// ----------------------------------------------------------------
|
|
708
|
-
ExportModifier,
|
|
709
|
-
HeritageList,
|
|
710
|
-
Heritage,
|
|
711
|
-
InterfaceDeclaration,
|
|
712
|
-
TypeAliasDeclaration,
|
|
713
|
-
ModuleType,
|
|
714
|
-
ModuleProperties,
|
|
715
|
-
ModuleDeclaration,
|
|
716
606
|
// ----------------------------------------------------------------
|
|
717
607
|
// Type Expressions
|
|
718
608
|
// ----------------------------------------------------------------
|
|
@@ -744,6 +634,7 @@ export const Module = new Runtime.Module({
|
|
|
744
634
|
Mapped,
|
|
745
635
|
AsyncIterator,
|
|
746
636
|
Iterator,
|
|
637
|
+
Argument,
|
|
747
638
|
Awaited,
|
|
748
639
|
Array,
|
|
749
640
|
Record,
|
|
@@ -764,9 +655,6 @@ export const Module = new Runtime.Module({
|
|
|
764
655
|
Uncapitalize,
|
|
765
656
|
Date,
|
|
766
657
|
Uint8Array,
|
|
658
|
+
GenericReference,
|
|
767
659
|
Reference,
|
|
768
|
-
// ----------------------------------------------------------------
|
|
769
|
-
// Main
|
|
770
|
-
// ----------------------------------------------------------------
|
|
771
|
-
Main
|
|
772
660
|
});
|