@sinclair/typebox 0.34.29 → 0.34.30
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/syntax/runtime.d.ts +6 -5
- package/build/cjs/syntax/runtime.js +145 -148
- package/build/cjs/syntax/static.d.ts +66 -76
- package/build/esm/syntax/runtime.d.mts +6 -5
- package/build/esm/syntax/runtime.mjs +145 -148
- package/build/esm/syntax/static.d.mts +66 -76
- package/package.json +1 -1
|
@@ -30,28 +30,40 @@ function DestructureRight(values) {
|
|
|
30
30
|
: [values, undefined];
|
|
31
31
|
}
|
|
32
32
|
// ------------------------------------------------------------------
|
|
33
|
+
// Delimit
|
|
34
|
+
// ------------------------------------------------------------------
|
|
35
|
+
// prettier-ignore
|
|
36
|
+
const DelimitHeadMapping = (results) => results.reduce((result, value) => {
|
|
37
|
+
const [element, _delimiter] = value;
|
|
38
|
+
return [...result, element];
|
|
39
|
+
}, []);
|
|
40
|
+
// prettier-ignore
|
|
41
|
+
const DelimitHead = (element, delimiter) => (Runtime.Array(Runtime.Tuple([element, delimiter]), DelimitHeadMapping));
|
|
42
|
+
// prettier-ignore
|
|
43
|
+
const DelimitTail = (element) => Runtime.Union([
|
|
44
|
+
Runtime.Tuple([element]),
|
|
45
|
+
Runtime.Tuple([]),
|
|
46
|
+
]);
|
|
47
|
+
// prettier-ignore
|
|
48
|
+
const DelimitMapping = (results) => {
|
|
49
|
+
return [...results[0], ...results[1]];
|
|
50
|
+
};
|
|
51
|
+
// prettier-ignore
|
|
52
|
+
const Delimit = (element, delimiter) => Runtime.Tuple([
|
|
53
|
+
DelimitHead(element, delimiter),
|
|
54
|
+
DelimitTail(element),
|
|
55
|
+
], DelimitMapping);
|
|
56
|
+
// ------------------------------------------------------------------
|
|
33
57
|
// Dereference
|
|
34
58
|
// ------------------------------------------------------------------
|
|
35
59
|
const Dereference = (context, key) => {
|
|
36
60
|
return key in context ? context[key] : t.Ref(key);
|
|
37
61
|
};
|
|
38
62
|
// ------------------------------------------------------------------
|
|
39
|
-
//
|
|
63
|
+
// GenericArgumentsList
|
|
40
64
|
// ------------------------------------------------------------------
|
|
41
65
|
// prettier-ignore
|
|
42
|
-
const
|
|
43
|
-
return (results.length === 3 ? [results[0], ...results[2]] :
|
|
44
|
-
results.length === 2 ? [results[0]] :
|
|
45
|
-
results.length === 1 ? [results[0]] :
|
|
46
|
-
[]);
|
|
47
|
-
};
|
|
48
|
-
// prettier-ignore
|
|
49
|
-
const GenericArgumentList = Runtime.Union([
|
|
50
|
-
Runtime.Tuple([Runtime.Ident(), Runtime.Const(Comma), Runtime.Ref('GenericArgumentList')]),
|
|
51
|
-
Runtime.Tuple([Runtime.Ident(), Runtime.Const(Comma)]),
|
|
52
|
-
Runtime.Tuple([Runtime.Ident()]),
|
|
53
|
-
Runtime.Tuple([]),
|
|
54
|
-
], (results) => GenericArgumentListMapping(results));
|
|
66
|
+
const GenericArgumentsList = Delimit(Runtime.Ident(), Runtime.Const(Comma));
|
|
55
67
|
// ------------------------------------------------------------------
|
|
56
68
|
// GenericArguments
|
|
57
69
|
// ------------------------------------------------------------------
|
|
@@ -70,7 +82,7 @@ const GenericArgumentsMapping = (results, context) => {
|
|
|
70
82
|
// prettier-ignore
|
|
71
83
|
const GenericArguments = Runtime.Tuple([
|
|
72
84
|
Runtime.Const(LAngle),
|
|
73
|
-
Runtime.Ref('
|
|
85
|
+
Runtime.Ref('GenericArgumentsList'),
|
|
74
86
|
Runtime.Const(RAngle),
|
|
75
87
|
], (results, context) => GenericArgumentsMapping(results, context));
|
|
76
88
|
// ------------------------------------------------------------------
|
|
@@ -81,11 +93,12 @@ function GenericReferenceMapping(results, context) {
|
|
|
81
93
|
const args = results[2];
|
|
82
94
|
return t.Instantiate(type, args);
|
|
83
95
|
}
|
|
96
|
+
const GenericReferenceParameters = Delimit(Runtime.Ref('Type'), Runtime.Const(Comma));
|
|
84
97
|
// prettier-ignore
|
|
85
98
|
const GenericReference = Runtime.Tuple([
|
|
86
99
|
Runtime.Ident(),
|
|
87
100
|
Runtime.Const(LAngle),
|
|
88
|
-
Runtime.Ref('
|
|
101
|
+
Runtime.Ref('GenericReferenceParameters'),
|
|
89
102
|
Runtime.Const(RAngle)
|
|
90
103
|
], (results, context) => GenericReferenceMapping(results, context));
|
|
91
104
|
// ------------------------------------------------------------------
|
|
@@ -111,17 +124,17 @@ const Literal = Runtime.Union([
|
|
|
111
124
|
// ------------------------------------------------------------------
|
|
112
125
|
// prettier-ignore
|
|
113
126
|
const Keyword = Runtime.Union([
|
|
114
|
-
Runtime.Const('
|
|
115
|
-
Runtime.Const('
|
|
127
|
+
Runtime.Const('string', Runtime.As(t.String())),
|
|
128
|
+
Runtime.Const('number', Runtime.As(t.Number())),
|
|
116
129
|
Runtime.Const('boolean', Runtime.As(t.Boolean())),
|
|
130
|
+
Runtime.Const('undefined', Runtime.As(t.Undefined())),
|
|
131
|
+
Runtime.Const('null', Runtime.As(t.Null())),
|
|
117
132
|
Runtime.Const('integer', Runtime.As(t.Integer())),
|
|
133
|
+
Runtime.Const('bigint', Runtime.As(t.BigInt())),
|
|
134
|
+
Runtime.Const('unknown', Runtime.As(t.Unknown())),
|
|
135
|
+
Runtime.Const('any', Runtime.As(t.Any())),
|
|
118
136
|
Runtime.Const('never', Runtime.As(t.Never())),
|
|
119
|
-
Runtime.Const('null', Runtime.As(t.Null())),
|
|
120
|
-
Runtime.Const('number', Runtime.As(t.Number())),
|
|
121
|
-
Runtime.Const('string', Runtime.As(t.String())),
|
|
122
137
|
Runtime.Const('symbol', Runtime.As(t.Symbol())),
|
|
123
|
-
Runtime.Const('undefined', Runtime.As(t.Undefined())),
|
|
124
|
-
Runtime.Const('unknown', Runtime.As(t.Unknown())),
|
|
125
138
|
Runtime.Const('void', Runtime.As(t.Void())),
|
|
126
139
|
]);
|
|
127
140
|
// ------------------------------------------------------------------
|
|
@@ -137,15 +150,18 @@ const KeyOf = Runtime.Union([
|
|
|
137
150
|
// IndexArray
|
|
138
151
|
// ------------------------------------------------------------------
|
|
139
152
|
// prettier-ignore
|
|
140
|
-
const IndexArrayMapping = (
|
|
141
|
-
|
|
142
|
-
|
|
153
|
+
const IndexArrayMapping = (results) => {
|
|
154
|
+
return results.reduce((result, current) => {
|
|
155
|
+
return current.length === 3
|
|
156
|
+
? [...result, [current[1]]]
|
|
157
|
+
: [...result, []];
|
|
158
|
+
}, []);
|
|
159
|
+
};
|
|
143
160
|
// prettier-ignore
|
|
144
|
-
const IndexArray = Runtime.Union([
|
|
145
|
-
Runtime.Tuple([Runtime.Const(LBracket), Runtime.Ref('Type'), Runtime.Const(RBracket)
|
|
146
|
-
Runtime.Tuple([Runtime.Const(LBracket), Runtime.Const(RBracket)
|
|
147
|
-
|
|
148
|
-
], value => IndexArrayMapping(value));
|
|
161
|
+
const IndexArray = Runtime.Array(Runtime.Union([
|
|
162
|
+
Runtime.Tuple([Runtime.Const(LBracket), Runtime.Ref('Type'), Runtime.Const(RBracket)]),
|
|
163
|
+
Runtime.Tuple([Runtime.Const(LBracket), Runtime.Const(RBracket)]),
|
|
164
|
+
]), IndexArrayMapping);
|
|
149
165
|
// ------------------------------------------------------------------
|
|
150
166
|
// Extends
|
|
151
167
|
// ------------------------------------------------------------------
|
|
@@ -164,50 +180,46 @@ const Extends = Runtime.Union([
|
|
|
164
180
|
// Base
|
|
165
181
|
// ------------------------------------------------------------------
|
|
166
182
|
// prettier-ignore
|
|
167
|
-
const BaseMapping = (
|
|
168
|
-
return
|
|
183
|
+
const BaseMapping = (value) => {
|
|
184
|
+
return t.ValueGuard.IsArray(value) && value.length === 3
|
|
185
|
+
? value[1]
|
|
186
|
+
: value;
|
|
169
187
|
};
|
|
170
188
|
// prettier-ignore
|
|
171
189
|
const Base = Runtime.Union([
|
|
172
|
-
Runtime.Tuple([
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
Runtime.
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
Runtime.Ref('Uncapitalize'),
|
|
206
|
-
Runtime.Ref('Date'),
|
|
207
|
-
Runtime.Ref('Uint8Array'),
|
|
208
|
-
Runtime.Ref('GenericReference'),
|
|
209
|
-
Runtime.Ref('Reference')
|
|
210
|
-
])])
|
|
190
|
+
Runtime.Tuple([Runtime.Const(LParen), Runtime.Ref('Type'), Runtime.Const(RParen)]),
|
|
191
|
+
Runtime.Ref('Keyword'),
|
|
192
|
+
Runtime.Ref('Object'),
|
|
193
|
+
Runtime.Ref('Tuple'),
|
|
194
|
+
Runtime.Ref('Literal'),
|
|
195
|
+
Runtime.Ref('Constructor'),
|
|
196
|
+
Runtime.Ref('Function'),
|
|
197
|
+
Runtime.Ref('Mapped'),
|
|
198
|
+
Runtime.Ref('AsyncIterator'),
|
|
199
|
+
Runtime.Ref('Iterator'),
|
|
200
|
+
Runtime.Ref('ConstructorParameters'),
|
|
201
|
+
Runtime.Ref('FunctionParameters'),
|
|
202
|
+
Runtime.Ref('InstanceType'),
|
|
203
|
+
Runtime.Ref('ReturnType'),
|
|
204
|
+
Runtime.Ref('Argument'),
|
|
205
|
+
Runtime.Ref('Awaited'),
|
|
206
|
+
Runtime.Ref('Array'),
|
|
207
|
+
Runtime.Ref('Record'),
|
|
208
|
+
Runtime.Ref('Promise'),
|
|
209
|
+
Runtime.Ref('Partial'),
|
|
210
|
+
Runtime.Ref('Required'),
|
|
211
|
+
Runtime.Ref('Pick'),
|
|
212
|
+
Runtime.Ref('Omit'),
|
|
213
|
+
Runtime.Ref('Exclude'),
|
|
214
|
+
Runtime.Ref('Extract'),
|
|
215
|
+
Runtime.Ref('Uppercase'),
|
|
216
|
+
Runtime.Ref('Lowercase'),
|
|
217
|
+
Runtime.Ref('Capitalize'),
|
|
218
|
+
Runtime.Ref('Uncapitalize'),
|
|
219
|
+
Runtime.Ref('Date'),
|
|
220
|
+
Runtime.Ref('Uint8Array'),
|
|
221
|
+
Runtime.Ref('GenericReference'),
|
|
222
|
+
Runtime.Ref('Reference')
|
|
211
223
|
], BaseMapping);
|
|
212
224
|
// ------------------------------------------------------------------
|
|
213
225
|
// Factor
|
|
@@ -239,7 +251,7 @@ const Factor = Runtime.Tuple([
|
|
|
239
251
|
Runtime.Ref('Base'),
|
|
240
252
|
Runtime.Ref('IndexArray'),
|
|
241
253
|
Runtime.Ref('Extends')
|
|
242
|
-
],
|
|
254
|
+
], results => FactorMapping(...results));
|
|
243
255
|
// ------------------------------------------------------------------
|
|
244
256
|
// Expr
|
|
245
257
|
// ------------------------------------------------------------------
|
|
@@ -269,7 +281,7 @@ const ExprTermTail = Runtime.Union([
|
|
|
269
281
|
// prettier-ignore
|
|
270
282
|
const ExprTerm = Runtime.Tuple([
|
|
271
283
|
Runtime.Ref('Factor'), Runtime.Ref('ExprTermTail')
|
|
272
|
-
],
|
|
284
|
+
], results => ExprBinaryMapping(...results));
|
|
273
285
|
// prettier-ignore
|
|
274
286
|
const ExprTail = Runtime.Union([
|
|
275
287
|
Runtime.Tuple([Runtime.Const('|'), Runtime.Ref('ExprTerm'), Runtime.Ref('ExprTail')]),
|
|
@@ -278,7 +290,7 @@ const ExprTail = Runtime.Union([
|
|
|
278
290
|
// prettier-ignore
|
|
279
291
|
const Expr = Runtime.Tuple([
|
|
280
292
|
Runtime.Ref('ExprTerm'), Runtime.Ref('ExprTail')
|
|
281
|
-
],
|
|
293
|
+
], results => ExprBinaryMapping(...results));
|
|
282
294
|
// ------------------------------------------------------------------
|
|
283
295
|
// Type
|
|
284
296
|
// ------------------------------------------------------------------
|
|
@@ -288,7 +300,7 @@ const Type = Runtime.Union([
|
|
|
288
300
|
Runtime.Ref('Expr')
|
|
289
301
|
]);
|
|
290
302
|
// ------------------------------------------------------------------
|
|
291
|
-
//
|
|
303
|
+
// Property
|
|
292
304
|
// ------------------------------------------------------------------
|
|
293
305
|
const PropertyKey = Runtime.Union([Runtime.Ident(), Runtime.String([SingleQuote, DoubleQuote])]);
|
|
294
306
|
const Readonly = Runtime.Union([Runtime.Tuple([Runtime.Const('readonly')]), Runtime.Tuple([])], (value) => value.length > 0);
|
|
@@ -307,7 +319,10 @@ const Property = Runtime.Tuple([
|
|
|
307
319
|
Runtime.Ref('Optional'),
|
|
308
320
|
Runtime.Const(Colon),
|
|
309
321
|
Runtime.Ref('Type'),
|
|
310
|
-
],
|
|
322
|
+
], results => PropertyMapping(...results));
|
|
323
|
+
// ------------------------------------------------------------------
|
|
324
|
+
// PropertyDelimiter
|
|
325
|
+
// ------------------------------------------------------------------
|
|
311
326
|
// prettier-ignore
|
|
312
327
|
const PropertyDelimiter = Runtime.Union([
|
|
313
328
|
Runtime.Tuple([Runtime.Const(Comma), Runtime.Const(Newline)]),
|
|
@@ -316,63 +331,50 @@ const PropertyDelimiter = Runtime.Union([
|
|
|
316
331
|
Runtime.Tuple([Runtime.Const(SemiColon)]),
|
|
317
332
|
Runtime.Tuple([Runtime.Const(Newline)]),
|
|
318
333
|
]);
|
|
319
|
-
//
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
Runtime.Tuple([Runtime.Ref('Property')]),
|
|
324
|
-
Runtime.Tuple([])
|
|
325
|
-
], values => (values.length === 3 ? { ...values[0], ...values[2] } :
|
|
326
|
-
values.length === 2 ? values[0] :
|
|
327
|
-
values.length === 1 ? values[0] :
|
|
328
|
-
{}));
|
|
334
|
+
// ------------------------------------------------------------------
|
|
335
|
+
// PropertyList
|
|
336
|
+
// ------------------------------------------------------------------
|
|
337
|
+
const PropertyList = Delimit(Runtime.Ref('Property'), Runtime.Ref('PropertyDelimiter'));
|
|
329
338
|
// ------------------------------------------------------------------
|
|
330
339
|
// Object
|
|
331
340
|
// ------------------------------------------------------------------
|
|
332
341
|
// prettier-ignore
|
|
333
|
-
const ObjectMapping = (
|
|
342
|
+
const ObjectMapping = (results) => {
|
|
343
|
+
const propertyList = results[1];
|
|
344
|
+
return t.Object(propertyList.reduce((result, property) => {
|
|
345
|
+
return { ...result, ...property };
|
|
346
|
+
}, {}));
|
|
347
|
+
};
|
|
334
348
|
// prettier-ignore
|
|
335
349
|
const _Object = Runtime.Tuple([
|
|
336
350
|
Runtime.Const(LBrace),
|
|
337
|
-
Runtime.Ref('
|
|
351
|
+
Runtime.Ref('PropertyList'),
|
|
338
352
|
Runtime.Const(RBrace)
|
|
339
|
-
],
|
|
353
|
+
], ObjectMapping);
|
|
354
|
+
// ------------------------------------------------------------------
|
|
355
|
+
// ElementList
|
|
356
|
+
// ------------------------------------------------------------------
|
|
357
|
+
const ElementList = Delimit(Runtime.Ref('Type'), Runtime.Const(Comma));
|
|
340
358
|
// ------------------------------------------------------------------
|
|
341
359
|
// Tuple
|
|
342
360
|
// ------------------------------------------------------------------
|
|
343
361
|
// prettier-ignore
|
|
344
|
-
const Elements = Runtime.Union([
|
|
345
|
-
Runtime.Tuple([Runtime.Ref('Type'), Runtime.Const(Comma), Runtime.Ref('Elements')]),
|
|
346
|
-
Runtime.Tuple([Runtime.Ref('Type'), Runtime.Const(Comma)]),
|
|
347
|
-
Runtime.Tuple([Runtime.Ref('Type')]),
|
|
348
|
-
Runtime.Tuple([]),
|
|
349
|
-
], value => (value.length === 3 ? [value[0], ...value[2]] :
|
|
350
|
-
value.length === 2 ? [value[0]] :
|
|
351
|
-
value.length === 1 ? [value[0]] :
|
|
352
|
-
[]));
|
|
353
|
-
// prettier-ignore
|
|
354
362
|
const Tuple = Runtime.Tuple([
|
|
355
363
|
Runtime.Const(LBracket),
|
|
356
|
-
Runtime.Ref('
|
|
364
|
+
Runtime.Ref('ElementList'),
|
|
357
365
|
Runtime.Const(RBracket)
|
|
358
|
-
],
|
|
366
|
+
], results => t.Tuple(results[1]));
|
|
359
367
|
// ------------------------------------------------------------------
|
|
360
368
|
// Parameters
|
|
361
369
|
// ------------------------------------------------------------------
|
|
362
370
|
// prettier-ignore
|
|
363
371
|
const Parameter = Runtime.Tuple([
|
|
364
372
|
Runtime.Ident(), Runtime.Const(Colon), Runtime.Ref('Type')
|
|
365
|
-
],
|
|
366
|
-
//
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
Runtime.Tuple([Runtime.Ref('Parameter')]),
|
|
371
|
-
Runtime.Tuple([]),
|
|
372
|
-
], value => (value.length === 3 ? [value[0], ...value[2]] :
|
|
373
|
-
value.length === 2 ? [value[0]] :
|
|
374
|
-
value.length === 1 ? [value[0]] :
|
|
375
|
-
[]));
|
|
373
|
+
], results => results[2]);
|
|
374
|
+
// ------------------------------------------------------------------
|
|
375
|
+
// ParameterList
|
|
376
|
+
// ------------------------------------------------------------------
|
|
377
|
+
const ParameterList = Delimit(Runtime.Ref('Parameter'), Runtime.Const(Comma));
|
|
376
378
|
// ------------------------------------------------------------------
|
|
377
379
|
// Constructor
|
|
378
380
|
// ------------------------------------------------------------------
|
|
@@ -380,27 +382,27 @@ const Parameters = Runtime.Union([
|
|
|
380
382
|
const Constructor = Runtime.Tuple([
|
|
381
383
|
Runtime.Const('new'),
|
|
382
384
|
Runtime.Const(LParen),
|
|
383
|
-
Runtime.Ref('
|
|
385
|
+
Runtime.Ref('ParameterList'),
|
|
384
386
|
Runtime.Const(RParen),
|
|
385
387
|
Runtime.Const('=>'),
|
|
386
388
|
Runtime.Ref('Type')
|
|
387
|
-
],
|
|
389
|
+
], results => t.Constructor(results[2], results[5]));
|
|
388
390
|
// ------------------------------------------------------------------
|
|
389
391
|
// Function
|
|
390
392
|
// ------------------------------------------------------------------
|
|
391
393
|
// prettier-ignore
|
|
392
394
|
const Function = Runtime.Tuple([
|
|
393
395
|
Runtime.Const(LParen),
|
|
394
|
-
Runtime.Ref('
|
|
396
|
+
Runtime.Ref('ParameterList'),
|
|
395
397
|
Runtime.Const(RParen),
|
|
396
398
|
Runtime.Const('=>'),
|
|
397
399
|
Runtime.Ref('Type')
|
|
398
|
-
],
|
|
400
|
+
], results => t.Function(results[1], results[4]));
|
|
399
401
|
// ------------------------------------------------------------------
|
|
400
402
|
// Mapped (requires deferred types)
|
|
401
403
|
// ------------------------------------------------------------------
|
|
402
404
|
// prettier-ignore
|
|
403
|
-
const MappedMapping = (
|
|
405
|
+
const MappedMapping = (results) => {
|
|
404
406
|
return t.Literal('Mapped types not supported');
|
|
405
407
|
};
|
|
406
408
|
// prettier-ignore
|
|
@@ -424,7 +426,7 @@ const AsyncIterator = Runtime.Tuple([
|
|
|
424
426
|
Runtime.Const(LAngle),
|
|
425
427
|
Runtime.Ref('Type'),
|
|
426
428
|
Runtime.Const(RAngle),
|
|
427
|
-
],
|
|
429
|
+
], results => t.AsyncIterator(results[2]));
|
|
428
430
|
// ------------------------------------------------------------------
|
|
429
431
|
// Iterator
|
|
430
432
|
// ------------------------------------------------------------------
|
|
@@ -434,7 +436,7 @@ const Iterator = Runtime.Tuple([
|
|
|
434
436
|
Runtime.Const(LAngle),
|
|
435
437
|
Runtime.Ref('Type'),
|
|
436
438
|
Runtime.Const(RAngle),
|
|
437
|
-
],
|
|
439
|
+
], results => t.Iterator(results[2]));
|
|
438
440
|
// ------------------------------------------------------------------
|
|
439
441
|
// ConstructorParameters
|
|
440
442
|
// ------------------------------------------------------------------
|
|
@@ -444,7 +446,7 @@ const ConstructorParameters = Runtime.Tuple([
|
|
|
444
446
|
Runtime.Const(LAngle),
|
|
445
447
|
Runtime.Ref('Type'),
|
|
446
448
|
Runtime.Const(RAngle),
|
|
447
|
-
],
|
|
449
|
+
], results => t.ConstructorParameters(results[2]));
|
|
448
450
|
// ------------------------------------------------------------------
|
|
449
451
|
// Parameters
|
|
450
452
|
// ------------------------------------------------------------------
|
|
@@ -454,7 +456,7 @@ const FunctionParameters = Runtime.Tuple([
|
|
|
454
456
|
Runtime.Const(LAngle),
|
|
455
457
|
Runtime.Ref('Type'),
|
|
456
458
|
Runtime.Const(RAngle),
|
|
457
|
-
],
|
|
459
|
+
], results => t.Parameters(results[2]));
|
|
458
460
|
// ------------------------------------------------------------------
|
|
459
461
|
// InstanceType
|
|
460
462
|
// ------------------------------------------------------------------
|
|
@@ -464,7 +466,7 @@ const InstanceType = Runtime.Tuple([
|
|
|
464
466
|
Runtime.Const(LAngle),
|
|
465
467
|
Runtime.Ref('Type'),
|
|
466
468
|
Runtime.Const(RAngle),
|
|
467
|
-
],
|
|
469
|
+
], results => t.InstanceType(results[2]));
|
|
468
470
|
// ------------------------------------------------------------------
|
|
469
471
|
// ReturnType
|
|
470
472
|
// ------------------------------------------------------------------
|
|
@@ -474,7 +476,7 @@ const ReturnType = Runtime.Tuple([
|
|
|
474
476
|
Runtime.Const(LAngle),
|
|
475
477
|
Runtime.Ref('Type'),
|
|
476
478
|
Runtime.Const(RAngle),
|
|
477
|
-
],
|
|
479
|
+
], results => t.ReturnType(results[2]));
|
|
478
480
|
// ------------------------------------------------------------------
|
|
479
481
|
// Argument
|
|
480
482
|
// ------------------------------------------------------------------
|
|
@@ -498,7 +500,7 @@ const Awaited = Runtime.Tuple([
|
|
|
498
500
|
Runtime.Const(LAngle),
|
|
499
501
|
Runtime.Ref('Type'),
|
|
500
502
|
Runtime.Const(RAngle),
|
|
501
|
-
],
|
|
503
|
+
], results => t.Awaited(results[2]));
|
|
502
504
|
// ------------------------------------------------------------------
|
|
503
505
|
// Array
|
|
504
506
|
// ------------------------------------------------------------------
|
|
@@ -508,7 +510,7 @@ const Array = Runtime.Tuple([
|
|
|
508
510
|
Runtime.Const(LAngle),
|
|
509
511
|
Runtime.Ref('Type'),
|
|
510
512
|
Runtime.Const(RAngle),
|
|
511
|
-
],
|
|
513
|
+
], results => t.Array(results[2]));
|
|
512
514
|
// ------------------------------------------------------------------
|
|
513
515
|
// Record
|
|
514
516
|
// ------------------------------------------------------------------
|
|
@@ -520,7 +522,7 @@ const Record = Runtime.Tuple([
|
|
|
520
522
|
Runtime.Const(Comma),
|
|
521
523
|
Runtime.Ref('Type'),
|
|
522
524
|
Runtime.Const(RAngle),
|
|
523
|
-
],
|
|
525
|
+
], results => t.Record(results[2], results[4]));
|
|
524
526
|
// ------------------------------------------------------------------
|
|
525
527
|
// Promise
|
|
526
528
|
// ------------------------------------------------------------------
|
|
@@ -530,7 +532,7 @@ const Promise = Runtime.Tuple([
|
|
|
530
532
|
Runtime.Const(LAngle),
|
|
531
533
|
Runtime.Ref('Type'),
|
|
532
534
|
Runtime.Const(RAngle),
|
|
533
|
-
],
|
|
535
|
+
], results => t.Promise(results[2]));
|
|
534
536
|
// ------------------------------------------------------------------
|
|
535
537
|
// Partial
|
|
536
538
|
// ------------------------------------------------------------------
|
|
@@ -540,7 +542,7 @@ const Partial = Runtime.Tuple([
|
|
|
540
542
|
Runtime.Const(LAngle),
|
|
541
543
|
Runtime.Ref('Type'),
|
|
542
544
|
Runtime.Const(RAngle),
|
|
543
|
-
],
|
|
545
|
+
], results => t.Partial(results[2]));
|
|
544
546
|
// ------------------------------------------------------------------
|
|
545
547
|
// Required
|
|
546
548
|
// ------------------------------------------------------------------
|
|
@@ -550,7 +552,7 @@ const Required = Runtime.Tuple([
|
|
|
550
552
|
Runtime.Const(LAngle),
|
|
551
553
|
Runtime.Ref('Type'),
|
|
552
554
|
Runtime.Const(RAngle),
|
|
553
|
-
],
|
|
555
|
+
], results => t.Required(results[2]));
|
|
554
556
|
// ------------------------------------------------------------------
|
|
555
557
|
// Pick
|
|
556
558
|
// ------------------------------------------------------------------
|
|
@@ -562,7 +564,7 @@ const Pick = Runtime.Tuple([
|
|
|
562
564
|
Runtime.Const(Comma),
|
|
563
565
|
Runtime.Ref('Type'),
|
|
564
566
|
Runtime.Const(RAngle),
|
|
565
|
-
],
|
|
567
|
+
], results => t.Pick(results[2], results[4]));
|
|
566
568
|
// ------------------------------------------------------------------
|
|
567
569
|
// Omit
|
|
568
570
|
// ------------------------------------------------------------------
|
|
@@ -574,7 +576,7 @@ const Omit = Runtime.Tuple([
|
|
|
574
576
|
Runtime.Const(Comma),
|
|
575
577
|
Runtime.Ref('Type'),
|
|
576
578
|
Runtime.Const(RAngle),
|
|
577
|
-
],
|
|
579
|
+
], results => t.Omit(results[2], results[4]));
|
|
578
580
|
// ------------------------------------------------------------------
|
|
579
581
|
// Exclude
|
|
580
582
|
// ------------------------------------------------------------------
|
|
@@ -586,7 +588,7 @@ const Exclude = Runtime.Tuple([
|
|
|
586
588
|
Runtime.Const(Comma),
|
|
587
589
|
Runtime.Ref('Type'),
|
|
588
590
|
Runtime.Const(RAngle),
|
|
589
|
-
],
|
|
591
|
+
], results => t.Exclude(results[2], results[4]));
|
|
590
592
|
// ------------------------------------------------------------------
|
|
591
593
|
// Extract
|
|
592
594
|
// ------------------------------------------------------------------
|
|
@@ -598,7 +600,7 @@ const Extract = Runtime.Tuple([
|
|
|
598
600
|
Runtime.Const(Comma),
|
|
599
601
|
Runtime.Ref('Type'),
|
|
600
602
|
Runtime.Const(RAngle),
|
|
601
|
-
],
|
|
603
|
+
], results => t.Extract(results[2], results[4]));
|
|
602
604
|
// ------------------------------------------------------------------
|
|
603
605
|
// Uppercase
|
|
604
606
|
// ------------------------------------------------------------------
|
|
@@ -608,7 +610,7 @@ const Uppercase = Runtime.Tuple([
|
|
|
608
610
|
Runtime.Const(LAngle),
|
|
609
611
|
Runtime.Ref('Type'),
|
|
610
612
|
Runtime.Const(RAngle),
|
|
611
|
-
],
|
|
613
|
+
], results => t.Uppercase(results[2]));
|
|
612
614
|
// ------------------------------------------------------------------
|
|
613
615
|
// Lowercase
|
|
614
616
|
// ------------------------------------------------------------------
|
|
@@ -618,7 +620,7 @@ const Lowercase = Runtime.Tuple([
|
|
|
618
620
|
Runtime.Const(LAngle),
|
|
619
621
|
Runtime.Ref('Type'),
|
|
620
622
|
Runtime.Const(RAngle),
|
|
621
|
-
],
|
|
623
|
+
], results => t.Lowercase(results[2]));
|
|
622
624
|
// ------------------------------------------------------------------
|
|
623
625
|
// Capitalize
|
|
624
626
|
// ------------------------------------------------------------------
|
|
@@ -628,7 +630,7 @@ const Capitalize = Runtime.Tuple([
|
|
|
628
630
|
Runtime.Const(LAngle),
|
|
629
631
|
Runtime.Ref('Type'),
|
|
630
632
|
Runtime.Const(RAngle),
|
|
631
|
-
],
|
|
633
|
+
], results => t.Capitalize(results[2]));
|
|
632
634
|
// ------------------------------------------------------------------
|
|
633
635
|
// Uncapitalize
|
|
634
636
|
// ------------------------------------------------------------------
|
|
@@ -638,7 +640,7 @@ const Uncapitalize = Runtime.Tuple([
|
|
|
638
640
|
Runtime.Const(LAngle),
|
|
639
641
|
Runtime.Ref('Type'),
|
|
640
642
|
Runtime.Const(RAngle),
|
|
641
|
-
],
|
|
643
|
+
], results => t.Uncapitalize(results[2]));
|
|
642
644
|
// ------------------------------------------------------------------
|
|
643
645
|
// Date
|
|
644
646
|
// ------------------------------------------------------------------
|
|
@@ -652,14 +654,8 @@ const Uint8Array = Runtime.Const('Uint8Array', Runtime.As(t.Uint8Array()));
|
|
|
652
654
|
// ------------------------------------------------------------------
|
|
653
655
|
// prettier-ignore
|
|
654
656
|
export const Module = new Runtime.Module({
|
|
655
|
-
|
|
656
|
-
// Generics
|
|
657
|
-
// ----------------------------------------------------------------
|
|
658
|
-
GenericArgumentList,
|
|
657
|
+
GenericArgumentsList,
|
|
659
658
|
GenericArguments,
|
|
660
|
-
// ----------------------------------------------------------------
|
|
661
|
-
// Type
|
|
662
|
-
// ----------------------------------------------------------------
|
|
663
659
|
Literal,
|
|
664
660
|
Keyword,
|
|
665
661
|
KeyOf,
|
|
@@ -677,13 +673,13 @@ export const Module = new Runtime.Module({
|
|
|
677
673
|
Optional,
|
|
678
674
|
Property,
|
|
679
675
|
PropertyDelimiter,
|
|
680
|
-
|
|
676
|
+
PropertyList,
|
|
681
677
|
Object: _Object,
|
|
682
|
-
|
|
678
|
+
ElementList,
|
|
683
679
|
Tuple,
|
|
684
680
|
Parameter,
|
|
681
|
+
ParameterList,
|
|
685
682
|
Function,
|
|
686
|
-
Parameters,
|
|
687
683
|
Constructor,
|
|
688
684
|
Mapped,
|
|
689
685
|
AsyncIterator,
|
|
@@ -709,6 +705,7 @@ export const Module = new Runtime.Module({
|
|
|
709
705
|
Uncapitalize,
|
|
710
706
|
Date,
|
|
711
707
|
Uint8Array,
|
|
708
|
+
GenericReferenceParameters,
|
|
712
709
|
GenericReference,
|
|
713
710
|
Reference,
|
|
714
711
|
});
|