@sinclair/typebox 0.34.14 → 0.34.16

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.
Files changed (85) hide show
  1. package/build/cjs/syntax/index.d.ts +1 -1
  2. package/build/cjs/syntax/index.js +1 -1
  3. package/build/cjs/syntax/runtime.d.ts +38 -54
  4. package/build/cjs/syntax/runtime.js +60 -202
  5. package/build/cjs/syntax/static.d.ts +62 -148
  6. package/build/cjs/syntax/syntax.d.ts +33 -0
  7. package/build/cjs/syntax/syntax.js +37 -0
  8. package/build/cjs/type/constructor-parameters/constructor-parameters.d.ts +3 -3
  9. package/build/cjs/type/constructor-parameters/constructor-parameters.js +3 -1
  10. package/build/cjs/type/instance-type/instance-type.d.ts +5 -4
  11. package/build/cjs/type/instance-type/instance-type.js +3 -1
  12. package/build/cjs/type/parameters/parameters.d.ts +3 -3
  13. package/build/cjs/type/parameters/parameters.js +3 -1
  14. package/build/cjs/type/return-type/return-type.d.ts +5 -4
  15. package/build/cjs/type/return-type/return-type.js +3 -1
  16. package/build/cjs/type/type/javascript.d.ts +4 -4
  17. package/build/cjs/value/convert/convert.js +1 -1
  18. package/build/esm/syntax/index.d.mts +1 -1
  19. package/build/esm/syntax/index.mjs +1 -1
  20. package/build/esm/syntax/runtime.d.mts +38 -54
  21. package/build/esm/syntax/runtime.mjs +60 -202
  22. package/build/esm/syntax/static.d.mts +62 -148
  23. package/build/esm/syntax/syntax.d.mts +33 -0
  24. package/build/esm/syntax/syntax.mjs +30 -0
  25. package/build/esm/type/constructor-parameters/constructor-parameters.d.mts +3 -3
  26. package/build/esm/type/constructor-parameters/constructor-parameters.mjs +3 -1
  27. package/build/esm/type/instance-type/instance-type.d.mts +5 -4
  28. package/build/esm/type/instance-type/instance-type.mjs +3 -1
  29. package/build/esm/type/parameters/parameters.d.mts +3 -3
  30. package/build/esm/type/parameters/parameters.mjs +3 -1
  31. package/build/esm/type/return-type/return-type.d.mts +5 -4
  32. package/build/esm/type/return-type/return-type.mjs +3 -1
  33. package/build/esm/type/type/javascript.d.mts +4 -4
  34. package/build/esm/value/convert/convert.mjs +1 -1
  35. package/package.json +11 -1
  36. package/parser/package.json +4 -0
  37. package/readme.md +86 -161
  38. package/build/cjs/syntax/parse.d.ts +0 -15
  39. package/build/cjs/syntax/parse.js +0 -19
  40. package/build/esm/syntax/parse.d.mts +0 -15
  41. package/build/esm/syntax/parse.mjs +0 -14
  42. /package/build/cjs/{syntax/parsebox → parser}/index.d.ts +0 -0
  43. /package/build/cjs/{syntax/parsebox → parser}/index.js +0 -0
  44. /package/build/cjs/{syntax/parsebox → parser}/runtime/guard.d.ts +0 -0
  45. /package/build/cjs/{syntax/parsebox → parser}/runtime/guard.js +0 -0
  46. /package/build/cjs/{syntax/parsebox → parser}/runtime/index.d.ts +0 -0
  47. /package/build/cjs/{syntax/parsebox → parser}/runtime/index.js +0 -0
  48. /package/build/cjs/{syntax/parsebox → parser}/runtime/module.d.ts +0 -0
  49. /package/build/cjs/{syntax/parsebox → parser}/runtime/module.js +0 -0
  50. /package/build/cjs/{syntax/parsebox → parser}/runtime/parse.d.ts +0 -0
  51. /package/build/cjs/{syntax/parsebox → parser}/runtime/parse.js +0 -0
  52. /package/build/cjs/{syntax/parsebox → parser}/runtime/token.d.ts +0 -0
  53. /package/build/cjs/{syntax/parsebox → parser}/runtime/token.js +0 -0
  54. /package/build/cjs/{syntax/parsebox → parser}/runtime/types.d.ts +0 -0
  55. /package/build/cjs/{syntax/parsebox → parser}/runtime/types.js +0 -0
  56. /package/build/cjs/{syntax/parsebox → parser}/static/index.d.ts +0 -0
  57. /package/build/cjs/{syntax/parsebox → parser}/static/index.js +0 -0
  58. /package/build/cjs/{syntax/parsebox → parser}/static/parse.d.ts +0 -0
  59. /package/build/cjs/{syntax/parsebox → parser}/static/parse.js +0 -0
  60. /package/build/cjs/{syntax/parsebox → parser}/static/token.d.ts +0 -0
  61. /package/build/cjs/{syntax/parsebox → parser}/static/token.js +0 -0
  62. /package/build/cjs/{syntax/parsebox → parser}/static/types.d.ts +0 -0
  63. /package/build/cjs/{syntax/parsebox → parser}/static/types.js +0 -0
  64. /package/build/esm/{syntax/parsebox → parser}/index.d.mts +0 -0
  65. /package/build/esm/{syntax/parsebox → parser}/index.mjs +0 -0
  66. /package/build/esm/{syntax/parsebox → parser}/runtime/guard.d.mts +0 -0
  67. /package/build/esm/{syntax/parsebox → parser}/runtime/guard.mjs +0 -0
  68. /package/build/esm/{syntax/parsebox → parser}/runtime/index.d.mts +0 -0
  69. /package/build/esm/{syntax/parsebox → parser}/runtime/index.mjs +0 -0
  70. /package/build/esm/{syntax/parsebox → parser}/runtime/module.d.mts +0 -0
  71. /package/build/esm/{syntax/parsebox → parser}/runtime/module.mjs +0 -0
  72. /package/build/esm/{syntax/parsebox → parser}/runtime/parse.d.mts +0 -0
  73. /package/build/esm/{syntax/parsebox → parser}/runtime/parse.mjs +0 -0
  74. /package/build/esm/{syntax/parsebox → parser}/runtime/token.d.mts +0 -0
  75. /package/build/esm/{syntax/parsebox → parser}/runtime/token.mjs +0 -0
  76. /package/build/esm/{syntax/parsebox → parser}/runtime/types.d.mts +0 -0
  77. /package/build/esm/{syntax/parsebox → parser}/runtime/types.mjs +0 -0
  78. /package/build/esm/{syntax/parsebox → parser}/static/index.d.mts +0 -0
  79. /package/build/esm/{syntax/parsebox → parser}/static/index.mjs +0 -0
  80. /package/build/esm/{syntax/parsebox → parser}/static/parse.d.mts +0 -0
  81. /package/build/esm/{syntax/parsebox → parser}/static/parse.mjs +0 -0
  82. /package/build/esm/{syntax/parsebox → parser}/static/token.d.mts +0 -0
  83. /package/build/esm/{syntax/parsebox → parser}/static/token.mjs +0 -0
  84. /package/build/esm/{syntax/parsebox → parser}/static/types.d.mts +0 -0
  85. /package/build/esm/{syntax/parsebox → parser}/static/types.mjs +0 -0
@@ -1,5 +1,5 @@
1
- import { Runtime } from './parsebox/index.mjs';
2
- import * as Types from '../type/index.mjs';
1
+ import { Runtime } from '../parser/index.mjs';
2
+ import * as t from '../type/index.mjs';
3
3
  // ------------------------------------------------------------------
4
4
  // Tokens
5
5
  // ------------------------------------------------------------------
@@ -33,126 +33,9 @@ function DestructureRight(values) {
33
33
  // Deref
34
34
  // ------------------------------------------------------------------
35
35
  const Deref = (context, key) => {
36
- return key in context ? context[key] : Types.Ref(key);
36
+ return key in context ? context[key] : t.Ref(key);
37
37
  };
38
38
  // ------------------------------------------------------------------
39
- // ExportModifier
40
- // ------------------------------------------------------------------
41
- // prettier-ignore
42
- const ExportModifierMapping = (values) => {
43
- return values.length === 1;
44
- };
45
- // prettier-ignore
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));
155
- // ------------------------------------------------------------------
156
39
  // Reference
157
40
  // ------------------------------------------------------------------
158
41
  // prettier-ignore
@@ -162,27 +45,27 @@ const Reference = Runtime.Ident((value, context) => Deref(context, value));
162
45
  // ------------------------------------------------------------------
163
46
  // prettier-ignore
164
47
  const Literal = Runtime.Union([
165
- Runtime.Union([Runtime.Const('true'), Runtime.Const('false')], value => Types.Literal(value === 'true')),
166
- Runtime.Number(value => Types.Literal(parseFloat(value))),
167
- Runtime.String([SingleQuote, DoubleQuote, Tilde], value => Types.Literal(value))
48
+ Runtime.Union([Runtime.Const('true'), Runtime.Const('false')], value => t.Literal(value === 'true')),
49
+ Runtime.Number(value => t.Literal(parseFloat(value))),
50
+ Runtime.String([SingleQuote, DoubleQuote, Tilde], value => t.Literal(value))
168
51
  ]);
169
52
  // ------------------------------------------------------------------
170
53
  // Keyword
171
54
  // ------------------------------------------------------------------
172
55
  // prettier-ignore
173
56
  const Keyword = Runtime.Union([
174
- Runtime.Const('any', Runtime.As(Types.Any())),
175
- Runtime.Const('bigint', Runtime.As(Types.BigInt())),
176
- Runtime.Const('boolean', Runtime.As(Types.Boolean())),
177
- Runtime.Const('integer', Runtime.As(Types.Integer())),
178
- Runtime.Const('never', Runtime.As(Types.Never())),
179
- Runtime.Const('null', Runtime.As(Types.Null())),
180
- Runtime.Const('number', Runtime.As(Types.Number())),
181
- Runtime.Const('string', Runtime.As(Types.String())),
182
- Runtime.Const('symbol', Runtime.As(Types.Symbol())),
183
- Runtime.Const('undefined', Runtime.As(Types.Undefined())),
184
- Runtime.Const('unknown', Runtime.As(Types.Unknown())),
185
- Runtime.Const('void', Runtime.As(Types.Void())),
57
+ Runtime.Const('any', Runtime.As(t.Any())),
58
+ Runtime.Const('bigint', Runtime.As(t.BigInt())),
59
+ Runtime.Const('boolean', Runtime.As(t.Boolean())),
60
+ Runtime.Const('integer', Runtime.As(t.Integer())),
61
+ Runtime.Const('never', Runtime.As(t.Never())),
62
+ Runtime.Const('null', Runtime.As(t.Null())),
63
+ Runtime.Const('number', Runtime.As(t.Number())),
64
+ Runtime.Const('string', Runtime.As(t.String())),
65
+ Runtime.Const('symbol', Runtime.As(t.Symbol())),
66
+ Runtime.Const('undefined', Runtime.As(t.Undefined())),
67
+ Runtime.Const('unknown', Runtime.As(t.Unknown())),
68
+ Runtime.Const('void', Runtime.As(t.Void())),
186
69
  ]);
187
70
  // ------------------------------------------------------------------
188
71
  // KeyOf
@@ -273,22 +156,22 @@ const Base = Runtime.Union([
273
156
  // prettier-ignore
274
157
  const FactorExtends = (Type, Extends) => {
275
158
  return Extends.length === 3
276
- ? Types.Extends(Type, Extends[0], Extends[1], Extends[2])
159
+ ? t.Extends(Type, Extends[0], Extends[1], Extends[2])
277
160
  : Type;
278
161
  };
279
162
  // prettier-ignore
280
163
  const FactorIndexArray = (Type, IndexArray) => {
281
164
  const [Left, Right] = DestructureRight(IndexArray);
282
- return (!Types.ValueGuard.IsUndefined(Right) ? (
165
+ return (!t.ValueGuard.IsUndefined(Right) ? (
283
166
  // note: Indexed types require reimplementation to replace `[number]` indexers
284
- Right.length === 1 ? Types.Index(FactorIndexArray(Type, Left), Right[0]) :
285
- Right.length === 0 ? Types.Array(FactorIndexArray(Type, Left)) :
286
- Types.Never()) : Type);
167
+ Right.length === 1 ? t.Index(FactorIndexArray(Type, Left), Right[0]) :
168
+ Right.length === 0 ? t.Array(FactorIndexArray(Type, Left)) :
169
+ t.Never()) : Type);
287
170
  };
288
171
  // prettier-ignore
289
172
  const FactorMapping = (KeyOf, Type, IndexArray, Extends) => {
290
173
  return KeyOf
291
- ? FactorExtends(Types.KeyOf(FactorIndexArray(Type, IndexArray)), Extends)
174
+ ? FactorExtends(t.KeyOf(FactorIndexArray(Type, IndexArray)), Extends)
292
175
  : FactorExtends(FactorIndexArray(Type, IndexArray), Extends);
293
176
  };
294
177
  // prettier-ignore
@@ -307,14 +190,14 @@ function ExprBinaryMapping(Left, Rest) {
307
190
  const [Operator, Right, Next] = Rest;
308
191
  const Schema = ExprBinaryMapping(Right, Next);
309
192
  if (Operator === '&') {
310
- return Types.TypeGuard.IsIntersect(Schema)
311
- ? Types.Intersect([Left, ...Schema.allOf])
312
- : Types.Intersect([Left, Schema]);
193
+ return t.TypeGuard.IsIntersect(Schema)
194
+ ? t.Intersect([Left, ...Schema.allOf])
195
+ : t.Intersect([Left, Schema]);
313
196
  }
314
197
  if (Operator === '|') {
315
- return Types.TypeGuard.IsUnion(Schema)
316
- ? Types.Union([Left, ...Schema.anyOf])
317
- : Types.Union([Left, Schema]);
198
+ return t.TypeGuard.IsUnion(Schema)
199
+ ? t.Union([Left, ...Schema.anyOf])
200
+ : t.Union([Left, Schema]);
318
201
  }
319
202
  throw 1;
320
203
  })() : Left);
@@ -349,9 +232,9 @@ const Readonly = Runtime.Union([Runtime.Tuple([Runtime.Const('readonly')]), Runt
349
232
  const Optional = Runtime.Union([Runtime.Tuple([Runtime.Const(Question)]), Runtime.Tuple([])], (value) => value.length > 0);
350
233
  // prettier-ignore
351
234
  const PropertyMapping = (IsReadonly, Key, IsOptional, _, Type) => ({
352
- [Key]: (IsReadonly && IsOptional ? Types.ReadonlyOptional(Type) :
353
- IsReadonly && !IsOptional ? Types.Readonly(Type) :
354
- !IsReadonly && IsOptional ? Types.Optional(Type) :
235
+ [Key]: (IsReadonly && IsOptional ? t.ReadonlyOptional(Type) :
236
+ IsReadonly && !IsOptional ? t.Readonly(Type) :
237
+ !IsReadonly && IsOptional ? t.Optional(Type) :
355
238
  Type)
356
239
  });
357
240
  // prettier-ignore
@@ -384,7 +267,7 @@ const Properties = Runtime.Union([
384
267
  // Object
385
268
  // ------------------------------------------------------------------
386
269
  // prettier-ignore
387
- const ObjectMapping = (_0, Properties, _2) => Types.Object(Properties);
270
+ const ObjectMapping = (_0, Properties, _2) => t.Object(Properties);
388
271
  // prettier-ignore
389
272
  const _Object = Runtime.Tuple([
390
273
  Runtime.Const(LBrace),
@@ -409,7 +292,7 @@ const Tuple = Runtime.Tuple([
409
292
  Runtime.Const(LBracket),
410
293
  Runtime.Ref('Elements'),
411
294
  Runtime.Const(RBracket)
412
- ], value => Types.Tuple(value[1]));
295
+ ], value => t.Tuple(value[1]));
413
296
  // ------------------------------------------------------------------
414
297
  // Parameters
415
298
  // ------------------------------------------------------------------
@@ -438,7 +321,7 @@ const Constructor = Runtime.Tuple([
438
321
  Runtime.Const(RParen),
439
322
  Runtime.Const('=>'),
440
323
  Runtime.Ref('Type')
441
- ], value => Types.Constructor(value[2], value[5]));
324
+ ], value => t.Constructor(value[2], value[5]));
442
325
  // ------------------------------------------------------------------
443
326
  // Function
444
327
  // ------------------------------------------------------------------
@@ -449,13 +332,13 @@ const Function = Runtime.Tuple([
449
332
  Runtime.Const(RParen),
450
333
  Runtime.Const('=>'),
451
334
  Runtime.Ref('Type')
452
- ], value => Types.Function(value[1], value[4]));
335
+ ], value => t.Function(value[1], value[4]));
453
336
  // ------------------------------------------------------------------
454
337
  // Mapped (requires deferred types)
455
338
  // ------------------------------------------------------------------
456
339
  // prettier-ignore
457
340
  const MappedMapping = (values) => {
458
- return Types.Literal('Mapped types not supported');
341
+ return t.Literal('Mapped types not supported');
459
342
  };
460
343
  // prettier-ignore
461
344
  const Mapped = Runtime.Tuple([
@@ -478,7 +361,7 @@ const AsyncIterator = Runtime.Tuple([
478
361
  Runtime.Const(LAngle),
479
362
  Runtime.Ref('Type'),
480
363
  Runtime.Const(RAngle),
481
- ], value => Types.AsyncIterator(value[2]));
364
+ ], value => t.AsyncIterator(value[2]));
482
365
  // ------------------------------------------------------------------
483
366
  // Iterator
484
367
  // ------------------------------------------------------------------
@@ -488,7 +371,7 @@ const Iterator = Runtime.Tuple([
488
371
  Runtime.Const(LAngle),
489
372
  Runtime.Ref('Type'),
490
373
  Runtime.Const(RAngle),
491
- ], value => Types.Iterator(value[2]));
374
+ ], value => t.Iterator(value[2]));
492
375
  // ------------------------------------------------------------------
493
376
  // ConstructorParameters
494
377
  // ------------------------------------------------------------------
@@ -498,7 +381,7 @@ const ConstructorParameters = Runtime.Tuple([
498
381
  Runtime.Const(LAngle),
499
382
  Runtime.Ref('Type'),
500
383
  Runtime.Const(RAngle),
501
- ], value => Types.ConstructorParameters(value[2]));
384
+ ], value => t.ConstructorParameters(value[2]));
502
385
  // ------------------------------------------------------------------
503
386
  // Parameters
504
387
  // ------------------------------------------------------------------
@@ -508,7 +391,7 @@ const FunctionParameters = Runtime.Tuple([
508
391
  Runtime.Const(LAngle),
509
392
  Runtime.Ref('Type'),
510
393
  Runtime.Const(RAngle),
511
- ], value => Types.Parameters(value[2]));
394
+ ], value => t.Parameters(value[2]));
512
395
  // ------------------------------------------------------------------
513
396
  // InstanceType
514
397
  // ------------------------------------------------------------------
@@ -518,7 +401,7 @@ const InstanceType = Runtime.Tuple([
518
401
  Runtime.Const(LAngle),
519
402
  Runtime.Ref('Type'),
520
403
  Runtime.Const(RAngle),
521
- ], value => Types.InstanceType(value[2]));
404
+ ], value => t.InstanceType(value[2]));
522
405
  // ------------------------------------------------------------------
523
406
  // ReturnType
524
407
  // ------------------------------------------------------------------
@@ -528,7 +411,7 @@ const ReturnType = Runtime.Tuple([
528
411
  Runtime.Const(LAngle),
529
412
  Runtime.Ref('Type'),
530
413
  Runtime.Const(RAngle),
531
- ], value => Types.ReturnType(value[2]));
414
+ ], value => t.ReturnType(value[2]));
532
415
  // ------------------------------------------------------------------
533
416
  // Awaited
534
417
  // ------------------------------------------------------------------
@@ -538,7 +421,7 @@ const Awaited = Runtime.Tuple([
538
421
  Runtime.Const(LAngle),
539
422
  Runtime.Ref('Type'),
540
423
  Runtime.Const(RAngle),
541
- ], value => Types.Awaited(value[2]));
424
+ ], value => t.Awaited(value[2]));
542
425
  // ------------------------------------------------------------------
543
426
  // Array
544
427
  // ------------------------------------------------------------------
@@ -548,7 +431,7 @@ const Array = Runtime.Tuple([
548
431
  Runtime.Const(LAngle),
549
432
  Runtime.Ref('Type'),
550
433
  Runtime.Const(RAngle),
551
- ], value => Types.Array(value[2]));
434
+ ], value => t.Array(value[2]));
552
435
  // ------------------------------------------------------------------
553
436
  // Record
554
437
  // ------------------------------------------------------------------
@@ -560,7 +443,7 @@ const Record = Runtime.Tuple([
560
443
  Runtime.Const(Comma),
561
444
  Runtime.Ref('Type'),
562
445
  Runtime.Const(RAngle),
563
- ], value => Types.Record(value[2], value[4]));
446
+ ], value => t.Record(value[2], value[4]));
564
447
  // ------------------------------------------------------------------
565
448
  // Promise
566
449
  // ------------------------------------------------------------------
@@ -570,7 +453,7 @@ const Promise = Runtime.Tuple([
570
453
  Runtime.Const(LAngle),
571
454
  Runtime.Ref('Type'),
572
455
  Runtime.Const(RAngle),
573
- ], value => Types.Promise(value[2]));
456
+ ], value => t.Promise(value[2]));
574
457
  // ------------------------------------------------------------------
575
458
  // Partial
576
459
  // ------------------------------------------------------------------
@@ -580,7 +463,7 @@ const Partial = Runtime.Tuple([
580
463
  Runtime.Const(LAngle),
581
464
  Runtime.Ref('Type'),
582
465
  Runtime.Const(RAngle),
583
- ], value => Types.Partial(value[2]));
466
+ ], value => t.Partial(value[2]));
584
467
  // ------------------------------------------------------------------
585
468
  // Required
586
469
  // ------------------------------------------------------------------
@@ -590,7 +473,7 @@ const Required = Runtime.Tuple([
590
473
  Runtime.Const(LAngle),
591
474
  Runtime.Ref('Type'),
592
475
  Runtime.Const(RAngle),
593
- ], value => Types.Required(value[2]));
476
+ ], value => t.Required(value[2]));
594
477
  // ------------------------------------------------------------------
595
478
  // Pick
596
479
  // ------------------------------------------------------------------
@@ -602,7 +485,7 @@ const Pick = Runtime.Tuple([
602
485
  Runtime.Const(Comma),
603
486
  Runtime.Ref('Type'),
604
487
  Runtime.Const(RAngle),
605
- ], value => Types.Pick(value[2], value[4]));
488
+ ], value => t.Pick(value[2], value[4]));
606
489
  // ------------------------------------------------------------------
607
490
  // Omit
608
491
  // ------------------------------------------------------------------
@@ -614,7 +497,7 @@ const Omit = Runtime.Tuple([
614
497
  Runtime.Const(Comma),
615
498
  Runtime.Ref('Type'),
616
499
  Runtime.Const(RAngle),
617
- ], value => Types.Omit(value[2], value[4]));
500
+ ], value => t.Omit(value[2], value[4]));
618
501
  // ------------------------------------------------------------------
619
502
  // Exclude
620
503
  // ------------------------------------------------------------------
@@ -626,7 +509,7 @@ const Exclude = Runtime.Tuple([
626
509
  Runtime.Const(Comma),
627
510
  Runtime.Ref('Type'),
628
511
  Runtime.Const(RAngle),
629
- ], value => Types.Exclude(value[2], value[4]));
512
+ ], value => t.Exclude(value[2], value[4]));
630
513
  // ------------------------------------------------------------------
631
514
  // Extract
632
515
  // ------------------------------------------------------------------
@@ -638,7 +521,7 @@ const Extract = Runtime.Tuple([
638
521
  Runtime.Const(Comma),
639
522
  Runtime.Ref('Type'),
640
523
  Runtime.Const(RAngle),
641
- ], value => Types.Extract(value[2], value[4]));
524
+ ], value => t.Extract(value[2], value[4]));
642
525
  // ------------------------------------------------------------------
643
526
  // Uppercase
644
527
  // ------------------------------------------------------------------
@@ -648,7 +531,7 @@ const Uppercase = Runtime.Tuple([
648
531
  Runtime.Const(LAngle),
649
532
  Runtime.Ref('Type'),
650
533
  Runtime.Const(RAngle),
651
- ], value => Types.Uppercase(value[2]));
534
+ ], value => t.Uppercase(value[2]));
652
535
  // ------------------------------------------------------------------
653
536
  // Lowercase
654
537
  // ------------------------------------------------------------------
@@ -658,7 +541,7 @@ const Lowercase = Runtime.Tuple([
658
541
  Runtime.Const(LAngle),
659
542
  Runtime.Ref('Type'),
660
543
  Runtime.Const(RAngle),
661
- ], value => Types.Lowercase(value[2]));
544
+ ], value => t.Lowercase(value[2]));
662
545
  // ------------------------------------------------------------------
663
546
  // Capitalize
664
547
  // ------------------------------------------------------------------
@@ -668,7 +551,7 @@ const Capitalize = Runtime.Tuple([
668
551
  Runtime.Const(LAngle),
669
552
  Runtime.Ref('Type'),
670
553
  Runtime.Const(RAngle),
671
- ], value => Types.Capitalize(value[2]));
554
+ ], value => t.Capitalize(value[2]));
672
555
  // ------------------------------------------------------------------
673
556
  // Uncapitalize
674
557
  // ------------------------------------------------------------------
@@ -678,41 +561,20 @@ const Uncapitalize = Runtime.Tuple([
678
561
  Runtime.Const(LAngle),
679
562
  Runtime.Ref('Type'),
680
563
  Runtime.Const(RAngle),
681
- ], value => Types.Uncapitalize(value[2]));
564
+ ], value => t.Uncapitalize(value[2]));
682
565
  // ------------------------------------------------------------------
683
566
  // Date
684
567
  // ------------------------------------------------------------------
685
- const Date = Runtime.Const('Date', Runtime.As(Types.Date()));
568
+ const Date = Runtime.Const('Date', Runtime.As(t.Date()));
686
569
  // ------------------------------------------------------------------
687
570
  // Uint8Array
688
571
  // ------------------------------------------------------------------
689
- const Uint8Array = Runtime.Const('Uint8Array', Runtime.As(Types.Uint8Array()));
690
- // ------------------------------------------------------------------
691
- // Main
692
- // ------------------------------------------------------------------
693
- // prettier-ignore
694
- const Main = Runtime.Union([
695
- ModuleDeclaration,
696
- TypeAliasDeclaration,
697
- InterfaceDeclaration,
698
- Type
699
- ]);
572
+ const Uint8Array = Runtime.Const('Uint8Array', Runtime.As(t.Uint8Array()));
700
573
  // ------------------------------------------------------------------
701
574
  // Module
702
575
  // ------------------------------------------------------------------
703
576
  // prettier-ignore
704
577
  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
578
  // ----------------------------------------------------------------
717
579
  // Type Expressions
718
580
  // ----------------------------------------------------------------
@@ -765,8 +627,4 @@ export const Module = new Runtime.Module({
765
627
  Date,
766
628
  Uint8Array,
767
629
  Reference,
768
- // ----------------------------------------------------------------
769
- // Main
770
- // ----------------------------------------------------------------
771
- Main
772
630
  });