@sinclair/typebox 0.34.30 → 0.34.32

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.
@@ -0,0 +1,162 @@
1
+ import { Static } from '../parser/index';
2
+ import * as T from '../type/index';
3
+ import * as S from './mapping';
4
+ export type TGenericReferenceParameterList_0<Input extends string, Context extends T.TProperties, Result extends unknown[] = []> = (TType<Input, Context> extends [infer _0, infer Input extends string] ? (Static.Token.Const<',', Input> extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : []) : []) extends [infer _0, infer Input extends string] ? TGenericReferenceParameterList_0<Input, Context, [...Result, _0]> : [Result, Input];
5
+ export type TGenericReferenceParameterList<Input extends string, Context extends T.TProperties = {}> = (TGenericReferenceParameterList_0<Input, Context> extends [infer _0, infer Input extends string] ? ((TType<Input, Context> extends [infer _0, infer Input extends string] ? [[_0], Input] : []) extends [infer _0, infer Input extends string] ? [_0, Input] : [[], Input] extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : [] : []) extends [infer _0 extends [unknown, unknown], infer Input extends string] ? [S.TGenericReferenceParameterListMapping<_0, Context>, Input] : [];
6
+ export type TGenericReference<Input extends string, Context extends T.TProperties = {}> = (Static.Token.Ident<Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TGenericReferenceParameterList<Input, Context> extends [infer _2, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _3, infer Input extends string] ? [[_0, _1, _2, _3], Input] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TGenericReferenceMapping<_0, Context>, Input] : [];
7
+ export type TGenericArgumentsList_0<Input extends string, Context extends T.TProperties, Result extends unknown[] = []> = (Static.Token.Ident<Input> extends [infer _0, infer Input extends string] ? (Static.Token.Const<',', Input> extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : []) : []) extends [infer _0, infer Input extends string] ? TGenericArgumentsList_0<Input, Context, [...Result, _0]> : [Result, Input];
8
+ export type TGenericArgumentsList<Input extends string, Context extends T.TProperties = {}> = (TGenericArgumentsList_0<Input, Context> extends [infer _0, infer Input extends string] ? ((Static.Token.Ident<Input> extends [infer _0, infer Input extends string] ? [[_0], Input] : []) extends [infer _0, infer Input extends string] ? [_0, Input] : [[], Input] extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : [] : []) extends [infer _0 extends [unknown, unknown], infer Input extends string] ? [S.TGenericArgumentsListMapping<_0, Context>, Input] : [];
9
+ export type TGenericArguments<Input extends string, Context extends T.TProperties = {}> = (Static.Token.Const<'<', Input> extends [infer _0, infer Input extends string] ? TGenericArgumentsList<Input, Context> extends [infer _1, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _2, infer Input extends string] ? [[_0, _1, _2], Input] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown], infer Input extends string] ? [S.TGenericArgumentsMapping<_0, Context>, Input] : [];
10
+ export type TKeywordString<Input extends string, Context extends T.TProperties = {}> = Static.Token.Const<'string', Input> extends [infer _0 extends 'string', infer Input extends string] ? [S.TKeywordStringMapping<_0, Context>, Input] : [];
11
+ export type TKeywordNumber<Input extends string, Context extends T.TProperties = {}> = Static.Token.Const<'number', Input> extends [infer _0 extends 'number', infer Input extends string] ? [S.TKeywordNumberMapping<_0, Context>, Input] : [];
12
+ export type TKeywordBoolean<Input extends string, Context extends T.TProperties = {}> = Static.Token.Const<'boolean', Input> extends [infer _0 extends 'boolean', infer Input extends string] ? [S.TKeywordBooleanMapping<_0, Context>, Input] : [];
13
+ export type TKeywordUndefined<Input extends string, Context extends T.TProperties = {}> = Static.Token.Const<'undefined', Input> extends [infer _0 extends 'undefined', infer Input extends string] ? [S.TKeywordUndefinedMapping<_0, Context>, Input] : [];
14
+ export type TKeywordNull<Input extends string, Context extends T.TProperties = {}> = Static.Token.Const<'null', Input> extends [infer _0 extends 'null', infer Input extends string] ? [S.TKeywordNullMapping<_0, Context>, Input] : [];
15
+ export type TKeywordInteger<Input extends string, Context extends T.TProperties = {}> = Static.Token.Const<'integer', Input> extends [infer _0 extends 'integer', infer Input extends string] ? [S.TKeywordIntegerMapping<_0, Context>, Input] : [];
16
+ export type TKeywordBigInt<Input extends string, Context extends T.TProperties = {}> = Static.Token.Const<'bigint', Input> extends [infer _0 extends 'bigint', infer Input extends string] ? [S.TKeywordBigIntMapping<_0, Context>, Input] : [];
17
+ export type TKeywordUnknown<Input extends string, Context extends T.TProperties = {}> = Static.Token.Const<'unknown', Input> extends [infer _0 extends 'unknown', infer Input extends string] ? [S.TKeywordUnknownMapping<_0, Context>, Input] : [];
18
+ export type TKeywordAny<Input extends string, Context extends T.TProperties = {}> = Static.Token.Const<'any', Input> extends [infer _0 extends 'any', infer Input extends string] ? [S.TKeywordAnyMapping<_0, Context>, Input] : [];
19
+ export type TKeywordNever<Input extends string, Context extends T.TProperties = {}> = Static.Token.Const<'never', Input> extends [infer _0 extends 'never', infer Input extends string] ? [S.TKeywordNeverMapping<_0, Context>, Input] : [];
20
+ export type TKeywordSymbol<Input extends string, Context extends T.TProperties = {}> = Static.Token.Const<'symbol', Input> extends [infer _0 extends 'symbol', infer Input extends string] ? [S.TKeywordSymbolMapping<_0, Context>, Input] : [];
21
+ export type TKeywordVoid<Input extends string, Context extends T.TProperties = {}> = Static.Token.Const<'void', Input> extends [infer _0 extends 'void', infer Input extends string] ? [S.TKeywordVoidMapping<_0, Context>, Input] : [];
22
+ export type TKeyword<Input extends string, Context extends T.TProperties = {}> = (TKeywordString<Input, Context> extends [infer _0, infer Input extends string] ? [_0, Input] : TKeywordNumber<Input, Context> extends [infer _0, infer Input extends string] ? [_0, Input] : TKeywordBoolean<Input, Context> extends [infer _0, infer Input extends string] ? [_0, Input] : TKeywordUndefined<Input, Context> extends [infer _0, infer Input extends string] ? [_0, Input] : TKeywordNull<Input, Context> extends [infer _0, infer Input extends string] ? [_0, Input] : TKeywordInteger<Input, Context> extends [infer _0, infer Input extends string] ? [_0, Input] : TKeywordBigInt<Input, Context> extends [infer _0, infer Input extends string] ? [_0, Input] : TKeywordUnknown<Input, Context> extends [infer _0, infer Input extends string] ? [_0, Input] : TKeywordAny<Input, Context> extends [infer _0, infer Input extends string] ? [_0, Input] : TKeywordNever<Input, Context> extends [infer _0, infer Input extends string] ? [_0, Input] : TKeywordSymbol<Input, Context> extends [infer _0, infer Input extends string] ? [_0, Input] : TKeywordVoid<Input, Context> extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends unknown, infer Input extends string] ? [S.TKeywordMapping<_0, Context>, Input] : [];
23
+ export type TLiteralString<Input extends string, Context extends T.TProperties = {}> = Static.Token.String<["'", '"', '`'], Input> extends [infer _0 extends string, infer Input extends string] ? [S.TLiteralStringMapping<_0, Context>, Input] : [];
24
+ export type TLiteralNumber<Input extends string, Context extends T.TProperties = {}> = Static.Token.Number<Input> extends [infer _0 extends string, infer Input extends string] ? [S.TLiteralNumberMapping<_0, Context>, Input] : [];
25
+ export type TLiteralBoolean<Input extends string, Context extends T.TProperties = {}> = (Static.Token.Const<'true', Input> extends [infer _0, infer Input extends string] ? [_0, Input] : Static.Token.Const<'false', Input> extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends 'true' | 'false', infer Input extends string] ? [S.TLiteralBooleanMapping<_0, Context>, Input] : [];
26
+ export type TLiteral<Input extends string, Context extends T.TProperties = {}> = (TLiteralBoolean<Input, Context> extends [infer _0, infer Input extends string] ? [_0, Input] : TLiteralNumber<Input, Context> extends [infer _0, infer Input extends string] ? [_0, Input] : TLiteralString<Input, Context> extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends unknown, infer Input extends string] ? [S.TLiteralMapping<_0, Context>, Input] : [];
27
+ export type TKeyOf<Input extends string, Context extends T.TProperties = {}> = ((Static.Token.Const<'keyof', Input> extends [infer _0, infer Input extends string] ? [[_0], Input] : []) extends [infer _0, infer Input extends string] ? [_0, Input] : [[], Input] extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends [unknown] | [], infer Input extends string] ? [S.TKeyOfMapping<_0, Context>, Input] : [];
28
+ export type TIndexArray_0<Input extends string, Context extends T.TProperties, Result extends unknown[] = []> = ((Static.Token.Const<'[', Input> extends [infer _0, infer Input extends string] ? TType<Input, Context> extends [infer _1, infer Input extends string] ? Static.Token.Const<']', Input> extends [infer _2, infer Input extends string] ? [[_0, _1, _2], Input] : [] : [] : []) extends [infer _0, infer Input extends string] ? [_0, Input] : (Static.Token.Const<'[', Input> extends [infer _0, infer Input extends string] ? (Static.Token.Const<']', Input> extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : []) : []) extends [
29
+ infer _0,
30
+ infer Input extends string
31
+ ] ? [_0, Input] : []) extends [infer _0, infer Input extends string] ? TIndexArray_0<Input, Context, [...Result, _0]> : [Result, Input];
32
+ export type TIndexArray<Input extends string, Context extends T.TProperties = {}> = TIndexArray_0<Input, Context> extends [infer _0 extends ([unknown, unknown, unknown] | [unknown, unknown])[], infer Input extends string] ? [S.TIndexArrayMapping<_0, Context>, Input] : [];
33
+ export type TExtends<Input extends string, Context extends T.TProperties = {}> = ((Static.Token.Const<'extends', Input> extends [infer _0, infer Input extends string] ? TType<Input, Context> extends [infer _1, infer Input extends string] ? Static.Token.Const<'?', Input> extends [infer _2, infer Input extends string] ? TType<Input, Context> extends [infer _3, infer Input extends string] ? Static.Token.Const<':', Input> extends [infer _4, infer Input extends string] ? TType<Input, Context> extends [infer _5, infer Input extends string] ? [[_0, _1, _2, _3, _4, _5], Input] : [] : [] : [] : [] : [] : []) extends [infer _0, infer Input extends string] ? [_0, Input] : [[], Input] extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown, unknown, unknown] | [], infer Input extends string] ? [S.TExtendsMapping<_0, Context>, Input] : [];
34
+ export type TBase<Input extends string, Context extends T.TProperties = {}> = ((Static.Token.Const<'(', Input> extends [infer _0, infer Input extends string] ? TType<Input, Context> extends [infer _1, infer Input extends string] ? Static.Token.Const<')', Input> extends [infer _2, infer Input extends string] ? [[_0, _1, _2], Input] : [] : [] : []) extends [infer _0, infer Input extends string] ? [_0, Input] : TKeyword<Input, Context> extends [infer _0, infer Input extends string] ? [_0, Input] : TObject<Input, Context> extends [infer _0, infer Input extends string] ? [_0, Input] : TTuple<Input, Context> extends [infer _0, infer Input extends string] ? [_0, Input] : TLiteral<Input, Context> extends [infer _0, infer Input extends string] ? [_0, Input] : TConstructor<Input, Context> extends [infer _0, infer Input extends string] ? [_0, Input] : TFunction<Input, Context> extends [infer _0, infer Input extends string] ? [_0, Input] : TMapped<Input, Context> extends [infer _0, infer Input extends string] ? [_0, Input] : TAsyncIterator<Input, Context> extends [infer _0, infer Input extends string] ? [_0, Input] : TIterator<Input, Context> extends [infer _0, infer Input extends string] ? [_0, Input] : TConstructorParameters<Input, Context> extends [infer _0, infer Input extends string] ? [_0, Input] : TFunctionParameters<Input, Context> extends [infer _0, infer Input extends string] ? [_0, Input] : TInstanceType<Input, Context> extends [infer _0, infer Input extends string] ? [_0, Input] : TReturnType<Input, Context> extends [infer _0, infer Input extends string] ? [_0, Input] : TArgument<Input, Context> extends [infer _0, infer Input extends string] ? [_0, Input] : TAwaited<Input, Context> extends [infer _0, infer Input extends string] ? [_0, Input] : TArray<Input, Context> extends [infer _0, infer Input extends string] ? [_0, Input] : TRecord<Input, Context> extends [infer _0, infer Input extends string] ? [_0, Input] : TPromise<Input, Context> extends [infer _0, infer Input extends string] ? [_0, Input] : TPartial<Input, Context> extends [infer _0, infer Input extends string] ? [_0, Input] : TRequired<Input, Context> extends [infer _0, infer Input extends string] ? [_0, Input] : TPick<Input, Context> extends [infer _0, infer Input extends string] ? [_0, Input] : TOmit<Input, Context> extends [infer _0, infer Input extends string] ? [_0, Input] : TExclude<Input, Context> extends [infer _0, infer Input extends string] ? [_0, Input] : TExtract<Input, Context> extends [infer _0, infer Input extends string] ? [_0, Input] : TUppercase<Input, Context> extends [infer _0, infer Input extends string] ? [_0, Input] : TLowercase<Input, Context> extends [infer _0, infer Input extends string] ? [_0, Input] : TCapitalize<Input, Context> extends [infer _0, infer Input extends string] ? [_0, Input] : TUncapitalize<Input, Context> extends [infer _0, infer Input extends string] ? [_0, Input] : TDate<Input, Context> extends [infer _0, infer Input extends string] ? [_0, Input] : TUint8Array<Input, Context> extends [infer _0, infer Input extends string] ? [_0, Input] : TGenericReference<Input, Context> extends [infer _0, infer Input extends string] ? [_0, Input] : TReference<Input, Context> extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends [unknown, unknown, unknown] | unknown, infer Input extends string] ? [S.TBaseMapping<_0, Context>, Input] : [];
35
+ export type TFactor<Input extends string, Context extends T.TProperties = {}> = (TKeyOf<Input, Context> extends [infer _0, infer Input extends string] ? TBase<Input, Context> extends [infer _1, infer Input extends string] ? TIndexArray<Input, Context> extends [infer _2, infer Input extends string] ? TExtends<Input, Context> extends [infer _3, infer Input extends string] ? [[_0, _1, _2, _3], Input] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TFactorMapping<_0, Context>, Input] : [];
36
+ export type TExprTermTail<Input extends string, Context extends T.TProperties = {}> = ((Static.Token.Const<'&', Input> extends [infer _0, infer Input extends string] ? TFactor<Input, Context> extends [infer _1, infer Input extends string] ? TExprTermTail<Input, Context> extends [infer _2, infer Input extends string] ? [[_0, _1, _2], Input] : [] : [] : []) extends [infer _0, infer Input extends string] ? [_0, Input] : [[], Input] extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends [unknown, unknown, unknown] | [], infer Input extends string] ? [S.TExprTermTailMapping<_0, Context>, Input] : [];
37
+ export type TExprTerm<Input extends string, Context extends T.TProperties = {}> = (TFactor<Input, Context> extends [infer _0, infer Input extends string] ? (TExprTermTail<Input, Context> extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : []) : []) extends [infer _0 extends [unknown, unknown], infer Input extends string] ? [S.TExprTermMapping<_0, Context>, Input] : [];
38
+ export type TExprTail<Input extends string, Context extends T.TProperties = {}> = ((Static.Token.Const<'|', Input> extends [infer _0, infer Input extends string] ? TExprTerm<Input, Context> extends [infer _1, infer Input extends string] ? TExprTail<Input, Context> extends [infer _2, infer Input extends string] ? [[_0, _1, _2], Input] : [] : [] : []) extends [infer _0, infer Input extends string] ? [_0, Input] : [[], Input] extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends [unknown, unknown, unknown] | [], infer Input extends string] ? [S.TExprTailMapping<_0, Context>, Input] : [];
39
+ export type TExpr<Input extends string, Context extends T.TProperties = {}> = (TExprTerm<Input, Context> extends [infer _0, infer Input extends string] ? (TExprTail<Input, Context> extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : []) : []) extends [infer _0 extends [unknown, unknown], infer Input extends string] ? [S.TExprMapping<_0, Context>, Input] : [];
40
+ export type TType<Input extends string, Context extends T.TProperties = {}> = (TGenericArguments<Input, Context> extends [infer _0 extends T.TProperties, infer Input extends string] ? TExpr<Input, _0> : [] extends [infer _0, infer Input extends string] ? [_0, Input] : TExpr<Input, Context> extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends unknown, infer Input extends string] ? [S.TTypeMapping<_0, Context>, Input] : [];
41
+ export type TPropertyKey<Input extends string, Context extends T.TProperties = {}> = (Static.Token.Ident<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : Static.Token.String<["'", '"'], Input> extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends string, infer Input extends string] ? [S.TPropertyKeyMapping<_0, Context>, Input] : [];
42
+ export type TReadonly<Input extends string, Context extends T.TProperties = {}> = ((Static.Token.Const<'readonly', Input> extends [infer _0, infer Input extends string] ? [[_0], Input] : []) extends [infer _0, infer Input extends string] ? [_0, Input] : [[], Input] extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends [unknown] | [], infer Input extends string] ? [S.TReadonlyMapping<_0, Context>, Input] : [];
43
+ export type TOptional<Input extends string, Context extends T.TProperties = {}> = ((Static.Token.Const<'?', Input> extends [infer _0, infer Input extends string] ? [[_0], Input] : []) extends [infer _0, infer Input extends string] ? [_0, Input] : [[], Input] extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends [unknown] | [], infer Input extends string] ? [S.TOptionalMapping<_0, Context>, Input] : [];
44
+ export type TProperty<Input extends string, Context extends T.TProperties = {}> = (TReadonly<Input, Context> extends [infer _0, infer Input extends string] ? TPropertyKey<Input, Context> extends [infer _1, infer Input extends string] ? TOptional<Input, Context> extends [infer _2, infer Input extends string] ? Static.Token.Const<':', Input> extends [infer _3, infer Input extends string] ? TType<Input, Context> extends [infer _4, infer Input extends string] ? [[_0, _1, _2, _3, _4], Input] : [] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TPropertyMapping<_0, Context>, Input] : [];
45
+ export type TPropertyDelimiter<Input extends string, Context extends T.TProperties = {}> = ((Static.Token.Const<',', Input> extends [infer _0, infer Input extends string] ? (Static.Token.Const<'\n', Input> extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : []) : []) extends [
46
+ infer _0,
47
+ infer Input extends string
48
+ ] ? [_0, Input] : (Static.Token.Const<';', Input> extends [infer _0, infer Input extends string] ? (Static.Token.Const<'\n', Input> extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : []) : []) extends [
49
+ infer _0,
50
+ infer Input extends string
51
+ ] ? [_0, Input] : (Static.Token.Const<',', Input> extends [infer _0, infer Input extends string] ? [[_0], Input] : []) extends [infer _0, infer Input extends string] ? [_0, Input] : (Static.Token.Const<';', Input> extends [infer _0, infer Input extends string] ? [[_0], Input] : []) extends [infer _0, infer Input extends string] ? [_0, Input] : (Static.Token.Const<'\n', Input> extends [infer _0, infer Input extends string] ? [[_0], Input] : []) extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends [unknown, unknown] | [unknown], infer Input extends string] ? [S.TPropertyDelimiterMapping<_0, Context>, Input] : [];
52
+ export type TPropertyList_0<Input extends string, Context extends T.TProperties, Result extends unknown[] = []> = (TProperty<Input, Context> extends [infer _0, infer Input extends string] ? (TPropertyDelimiter<Input, Context> extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : []) : []) extends [infer _0, infer Input extends string] ? TPropertyList_0<Input, Context, [...Result, _0]> : [Result, Input];
53
+ export type TPropertyList<Input extends string, Context extends T.TProperties = {}> = (TPropertyList_0<Input, Context> extends [infer _0, infer Input extends string] ? ((TProperty<Input, Context> extends [infer _0, infer Input extends string] ? [[_0], Input] : []) extends [infer _0, infer Input extends string] ? [_0, Input] : [[], Input] extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : [] : []) extends [infer _0 extends [unknown, unknown], infer Input extends string] ? [S.TPropertyListMapping<_0, Context>, Input] : [];
54
+ export type TObject<Input extends string, Context extends T.TProperties = {}> = (Static.Token.Const<'{', Input> extends [infer _0, infer Input extends string] ? TPropertyList<Input, Context> extends [infer _1, infer Input extends string] ? Static.Token.Const<'}', Input> extends [infer _2, infer Input extends string] ? [[_0, _1, _2], Input] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown], infer Input extends string] ? [S.TObjectMapping<_0, Context>, Input] : [];
55
+ export type TElementList_0<Input extends string, Context extends T.TProperties, Result extends unknown[] = []> = (TType<Input, Context> extends [infer _0, infer Input extends string] ? (Static.Token.Const<',', Input> extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : []) : []) extends [infer _0, infer Input extends string] ? TElementList_0<Input, Context, [...Result, _0]> : [Result, Input];
56
+ export type TElementList<Input extends string, Context extends T.TProperties = {}> = (TElementList_0<Input, Context> extends [infer _0, infer Input extends string] ? ((TType<Input, Context> extends [infer _0, infer Input extends string] ? [[_0], Input] : []) extends [infer _0, infer Input extends string] ? [_0, Input] : [[], Input] extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : [] : []) extends [infer _0 extends [unknown, unknown], infer Input extends string] ? [S.TElementListMapping<_0, Context>, Input] : [];
57
+ export type TTuple<Input extends string, Context extends T.TProperties = {}> = (Static.Token.Const<'[', Input> extends [infer _0, infer Input extends string] ? TElementList<Input, Context> extends [infer _1, infer Input extends string] ? Static.Token.Const<']', Input> extends [infer _2, infer Input extends string] ? [[_0, _1, _2], Input] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown], infer Input extends string] ? [S.TTupleMapping<_0, Context>, Input] : [];
58
+ export type TParameter<Input extends string, Context extends T.TProperties = {}> = (Static.Token.Ident<Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<':', Input> extends [infer _1, infer Input extends string] ? TType<Input, Context> extends [infer _2, infer Input extends string] ? [[_0, _1, _2], Input] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown], infer Input extends string] ? [S.TParameterMapping<_0, Context>, Input] : [];
59
+ export type TParameterList_0<Input extends string, Context extends T.TProperties, Result extends unknown[] = []> = (TParameter<Input, Context> extends [infer _0, infer Input extends string] ? (Static.Token.Const<',', Input> extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : []) : []) extends [infer _0, infer Input extends string] ? TParameterList_0<Input, Context, [...Result, _0]> : [Result, Input];
60
+ export type TParameterList<Input extends string, Context extends T.TProperties = {}> = (TParameterList_0<Input, Context> extends [infer _0, infer Input extends string] ? ((TParameter<Input, Context> extends [infer _0, infer Input extends string] ? [[_0], Input] : []) extends [infer _0, infer Input extends string] ? [_0, Input] : [[], Input] extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : [] : []) extends [infer _0 extends [unknown, unknown], infer Input extends string] ? [S.TParameterListMapping<_0, Context>, Input] : [];
61
+ export type TFunction<Input extends string, Context extends T.TProperties = {}> = (Static.Token.Const<'(', Input> extends [infer _0, infer Input extends string] ? TParameterList<Input, Context> extends [infer _1, infer Input extends string] ? Static.Token.Const<')', Input> extends [infer _2, infer Input extends string] ? Static.Token.Const<'=>', Input> extends [infer _3, infer Input extends string] ? TType<Input, Context> extends [infer _4, infer Input extends string] ? [[_0, _1, _2, _3, _4], Input] : [] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TFunctionMapping<_0, Context>, Input] : [];
62
+ export type TConstructor<Input extends string, Context extends T.TProperties = {}> = (Static.Token.Const<'new', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'(', Input> extends [infer _1, infer Input extends string] ? TParameterList<Input, Context> extends [infer _2, infer Input extends string] ? Static.Token.Const<')', Input> extends [infer _3, infer Input extends string] ? Static.Token.Const<'=>', Input> extends [infer _4, infer Input extends string] ? TType<Input, Context> extends [infer _5, infer Input extends string] ? [[_0, _1, _2, _3, _4, _5], Input] : [] : [] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TConstructorMapping<_0, Context>, Input] : [];
63
+ export type TMapped<Input extends string, Context extends T.TProperties = {}> = (Static.Token.Const<'{', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'[', Input> extends [infer _1, infer Input extends string] ? Static.Token.Ident<Input> extends [infer _2, infer Input extends string] ? Static.Token.Const<'in', Input> extends [infer _3, infer Input extends string] ? TType<Input, Context> extends [infer _4, infer Input extends string] ? Static.Token.Const<']', Input> extends [infer _5, infer Input extends string] ? Static.Token.Const<':', Input> extends [infer _6, infer Input extends string] ? TType<Input, Context> extends [infer _7, infer Input extends string] ? Static.Token.Const<'}', Input> extends [infer _8, infer Input extends string] ? [[_0, _1, _2, _3, _4, _5, _6, _7, _8], Input] : [] : [] : [] : [] : [] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TMappedMapping<_0, Context>, Input] : [];
64
+ export type TAsyncIterator<Input extends string, Context extends T.TProperties = {}> = (Static.Token.Const<'AsyncIterator', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType<Input, Context> extends [infer _2, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _3, infer Input extends string] ? [[_0, _1, _2, _3], Input] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TAsyncIteratorMapping<_0, Context>, Input] : [];
65
+ export type TIterator<Input extends string, Context extends T.TProperties = {}> = (Static.Token.Const<'Iterator', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType<Input, Context> extends [infer _2, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _3, infer Input extends string] ? [[_0, _1, _2, _3], Input] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TIteratorMapping<_0, Context>, Input] : [];
66
+ export type TArgument<Input extends string, Context extends T.TProperties = {}> = (Static.Token.Const<'Argument', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType<Input, Context> extends [infer _2, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _3, infer Input extends string] ? [[_0, _1, _2, _3], Input] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TArgumentMapping<_0, Context>, Input] : [];
67
+ export type TAwaited<Input extends string, Context extends T.TProperties = {}> = (Static.Token.Const<'Awaited', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType<Input, Context> extends [infer _2, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _3, infer Input extends string] ? [[_0, _1, _2, _3], Input] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TAwaitedMapping<_0, Context>, Input] : [];
68
+ export type TArray<Input extends string, Context extends T.TProperties = {}> = (Static.Token.Const<'Array', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType<Input, Context> extends [infer _2, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _3, infer Input extends string] ? [[_0, _1, _2, _3], Input] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TArrayMapping<_0, Context>, Input] : [];
69
+ export type TRecord<Input extends string, Context extends T.TProperties = {}> = (Static.Token.Const<'Record', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType<Input, Context> extends [infer _2, infer Input extends string] ? Static.Token.Const<',', Input> extends [infer _3, infer Input extends string] ? TType<Input, Context> extends [infer _4, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _5, infer Input extends string] ? [[_0, _1, _2, _3, _4, _5], Input] : [] : [] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TRecordMapping<_0, Context>, Input] : [];
70
+ export type TPromise<Input extends string, Context extends T.TProperties = {}> = (Static.Token.Const<'Promise', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType<Input, Context> extends [infer _2, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _3, infer Input extends string] ? [[_0, _1, _2, _3], Input] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TPromiseMapping<_0, Context>, Input] : [];
71
+ export type TConstructorParameters<Input extends string, Context extends T.TProperties = {}> = (Static.Token.Const<'ConstructorParameters', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType<Input, Context> extends [infer _2, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _3, infer Input extends string] ? [[_0, _1, _2, _3], Input] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TConstructorParametersMapping<_0, Context>, Input] : [];
72
+ export type TFunctionParameters<Input extends string, Context extends T.TProperties = {}> = (Static.Token.Const<'Parameters', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType<Input, Context> extends [infer _2, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _3, infer Input extends string] ? [[_0, _1, _2, _3], Input] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TFunctionParametersMapping<_0, Context>, Input] : [];
73
+ export type TInstanceType<Input extends string, Context extends T.TProperties = {}> = (Static.Token.Const<'InstanceType', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType<Input, Context> extends [infer _2, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _3, infer Input extends string] ? [[_0, _1, _2, _3], Input] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TInstanceTypeMapping<_0, Context>, Input] : [];
74
+ export type TReturnType<Input extends string, Context extends T.TProperties = {}> = (Static.Token.Const<'ReturnType', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType<Input, Context> extends [infer _2, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _3, infer Input extends string] ? [[_0, _1, _2, _3], Input] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TReturnTypeMapping<_0, Context>, Input] : [];
75
+ export type TPartial<Input extends string, Context extends T.TProperties = {}> = (Static.Token.Const<'Partial', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType<Input, Context> extends [infer _2, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _3, infer Input extends string] ? [[_0, _1, _2, _3], Input] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TPartialMapping<_0, Context>, Input] : [];
76
+ export type TRequired<Input extends string, Context extends T.TProperties = {}> = (Static.Token.Const<'Required', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType<Input, Context> extends [infer _2, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _3, infer Input extends string] ? [[_0, _1, _2, _3], Input] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TRequiredMapping<_0, Context>, Input] : [];
77
+ export type TPick<Input extends string, Context extends T.TProperties = {}> = (Static.Token.Const<'Pick', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType<Input, Context> extends [infer _2, infer Input extends string] ? Static.Token.Const<',', Input> extends [infer _3, infer Input extends string] ? TType<Input, Context> extends [infer _4, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _5, infer Input extends string] ? [[_0, _1, _2, _3, _4, _5], Input] : [] : [] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TPickMapping<_0, Context>, Input] : [];
78
+ export type TOmit<Input extends string, Context extends T.TProperties = {}> = (Static.Token.Const<'Omit', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType<Input, Context> extends [infer _2, infer Input extends string] ? Static.Token.Const<',', Input> extends [infer _3, infer Input extends string] ? TType<Input, Context> extends [infer _4, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _5, infer Input extends string] ? [[_0, _1, _2, _3, _4, _5], Input] : [] : [] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TOmitMapping<_0, Context>, Input] : [];
79
+ export type TExclude<Input extends string, Context extends T.TProperties = {}> = (Static.Token.Const<'Exclude', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType<Input, Context> extends [infer _2, infer Input extends string] ? Static.Token.Const<',', Input> extends [infer _3, infer Input extends string] ? TType<Input, Context> extends [infer _4, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _5, infer Input extends string] ? [[_0, _1, _2, _3, _4, _5], Input] : [] : [] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TExcludeMapping<_0, Context>, Input] : [];
80
+ export type TExtract<Input extends string, Context extends T.TProperties = {}> = (Static.Token.Const<'Extract', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType<Input, Context> extends [infer _2, infer Input extends string] ? Static.Token.Const<',', Input> extends [infer _3, infer Input extends string] ? TType<Input, Context> extends [infer _4, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _5, infer Input extends string] ? [[_0, _1, _2, _3, _4, _5], Input] : [] : [] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TExtractMapping<_0, Context>, Input] : [];
81
+ export type TUppercase<Input extends string, Context extends T.TProperties = {}> = (Static.Token.Const<'Uppercase', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType<Input, Context> extends [infer _2, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _3, infer Input extends string] ? [[_0, _1, _2, _3], Input] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TUppercaseMapping<_0, Context>, Input] : [];
82
+ export type TLowercase<Input extends string, Context extends T.TProperties = {}> = (Static.Token.Const<'Lowercase', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType<Input, Context> extends [infer _2, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _3, infer Input extends string] ? [[_0, _1, _2, _3], Input] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TLowercaseMapping<_0, Context>, Input] : [];
83
+ export type TCapitalize<Input extends string, Context extends T.TProperties = {}> = (Static.Token.Const<'Capitalize', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType<Input, Context> extends [infer _2, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _3, infer Input extends string] ? [[_0, _1, _2, _3], Input] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TCapitalizeMapping<_0, Context>, Input] : [];
84
+ export type TUncapitalize<Input extends string, Context extends T.TProperties = {}> = (Static.Token.Const<'Uncapitalize', Input> extends [infer _0, infer Input extends string] ? Static.Token.Const<'<', Input> extends [infer _1, infer Input extends string] ? TType<Input, Context> extends [infer _2, infer Input extends string] ? Static.Token.Const<'>', Input> extends [infer _3, infer Input extends string] ? [[_0, _1, _2, _3], Input] : [] : [] : [] : []) extends [infer _0 extends [unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TUncapitalizeMapping<_0, Context>, Input] : [];
85
+ export type TDate<Input extends string, Context extends T.TProperties = {}> = Static.Token.Const<'Date', Input> extends [infer _0 extends 'Date', infer Input extends string] ? [S.TDateMapping<_0, Context>, Input] : [];
86
+ export type TUint8Array<Input extends string, Context extends T.TProperties = {}> = Static.Token.Const<'Uint8Array', Input> extends [infer _0 extends 'Uint8Array', infer Input extends string] ? [S.TUint8ArrayMapping<_0, Context>, Input] : [];
87
+ export type TReference<Input extends string, Context extends T.TProperties = {}> = Static.Token.Ident<Input> extends [infer _0 extends string, infer Input extends string] ? [S.TReferenceMapping<_0, Context>, Input] : [];
88
+ export declare const GenericReferenceParameterList_0: (input: string, context: T.TProperties, result?: unknown[]) => [unknown[], string];
89
+ export declare const GenericReferenceParameterList: (input: string, context?: T.TProperties) => [unknown, string] | [];
90
+ export declare const GenericReference: (input: string, context?: T.TProperties) => [unknown, string] | [];
91
+ export declare const GenericArgumentsList_0: (input: string, context: T.TProperties, result?: unknown[]) => [unknown[], string];
92
+ export declare const GenericArgumentsList: (input: string, context?: T.TProperties) => [unknown, string] | [];
93
+ export declare const GenericArguments: (input: string, context?: T.TProperties) => [unknown, string] | [];
94
+ export declare const KeywordString: (input: string, context?: T.TProperties) => [unknown, string] | [];
95
+ export declare const KeywordNumber: (input: string, context?: T.TProperties) => [unknown, string] | [];
96
+ export declare const KeywordBoolean: (input: string, context?: T.TProperties) => [unknown, string] | [];
97
+ export declare const KeywordUndefined: (input: string, context?: T.TProperties) => [unknown, string] | [];
98
+ export declare const KeywordNull: (input: string, context?: T.TProperties) => [unknown, string] | [];
99
+ export declare const KeywordInteger: (input: string, context?: T.TProperties) => [unknown, string] | [];
100
+ export declare const KeywordBigInt: (input: string, context?: T.TProperties) => [unknown, string] | [];
101
+ export declare const KeywordUnknown: (input: string, context?: T.TProperties) => [unknown, string] | [];
102
+ export declare const KeywordAny: (input: string, context?: T.TProperties) => [unknown, string] | [];
103
+ export declare const KeywordNever: (input: string, context?: T.TProperties) => [unknown, string] | [];
104
+ export declare const KeywordSymbol: (input: string, context?: T.TProperties) => [unknown, string] | [];
105
+ export declare const KeywordVoid: (input: string, context?: T.TProperties) => [unknown, string] | [];
106
+ export declare const Keyword: (input: string, context?: T.TProperties) => [unknown, string] | [];
107
+ export declare const LiteralString: (input: string, context?: T.TProperties) => [unknown, string] | [];
108
+ export declare const LiteralNumber: (input: string, context?: T.TProperties) => [unknown, string] | [];
109
+ export declare const LiteralBoolean: (input: string, context?: T.TProperties) => [unknown, string] | [];
110
+ export declare const Literal: (input: string, context?: T.TProperties) => [unknown, string] | [];
111
+ export declare const KeyOf: (input: string, context?: T.TProperties) => [unknown, string] | [];
112
+ export declare const IndexArray_0: (input: string, context: T.TProperties, result?: unknown[]) => [unknown[], string];
113
+ export declare const IndexArray: (input: string, context?: T.TProperties) => [unknown, string] | [];
114
+ export declare const Extends: (input: string, context?: T.TProperties) => [unknown, string] | [];
115
+ export declare const Base: (input: string, context?: T.TProperties) => [unknown, string] | [];
116
+ export declare const Factor: (input: string, context?: T.TProperties) => [unknown, string] | [];
117
+ export declare const ExprTermTail: (input: string, context?: T.TProperties) => [unknown, string] | [];
118
+ export declare const ExprTerm: (input: string, context?: T.TProperties) => [unknown, string] | [];
119
+ export declare const ExprTail: (input: string, context?: T.TProperties) => [unknown, string] | [];
120
+ export declare const Expr: (input: string, context?: T.TProperties) => [unknown, string] | [];
121
+ export declare const Type: (input: string, context?: T.TProperties) => [unknown, string] | [];
122
+ export declare const PropertyKey: (input: string, context?: T.TProperties) => [unknown, string] | [];
123
+ export declare const Readonly: (input: string, context?: T.TProperties) => [unknown, string] | [];
124
+ export declare const Optional: (input: string, context?: T.TProperties) => [unknown, string] | [];
125
+ export declare const Property: (input: string, context?: T.TProperties) => [unknown, string] | [];
126
+ export declare const PropertyDelimiter: (input: string, context?: T.TProperties) => [unknown, string] | [];
127
+ export declare const PropertyList_0: (input: string, context: T.TProperties, result?: unknown[]) => [unknown[], string];
128
+ export declare const PropertyList: (input: string, context?: T.TProperties) => [unknown, string] | [];
129
+ export declare const _Object: (input: string, context?: T.TProperties) => [unknown, string] | [];
130
+ export declare const ElementList_0: (input: string, context: T.TProperties, result?: unknown[]) => [unknown[], string];
131
+ export declare const ElementList: (input: string, context?: T.TProperties) => [unknown, string] | [];
132
+ export declare const Tuple: (input: string, context?: T.TProperties) => [unknown, string] | [];
133
+ export declare const Parameter: (input: string, context?: T.TProperties) => [unknown, string] | [];
134
+ export declare const ParameterList_0: (input: string, context: T.TProperties, result?: unknown[]) => [unknown[], string];
135
+ export declare const ParameterList: (input: string, context?: T.TProperties) => [unknown, string] | [];
136
+ export declare const Function: (input: string, context?: T.TProperties) => [unknown, string] | [];
137
+ export declare const Constructor: (input: string, context?: T.TProperties) => [unknown, string] | [];
138
+ export declare const Mapped: (input: string, context?: T.TProperties) => [unknown, string] | [];
139
+ export declare const AsyncIterator: (input: string, context?: T.TProperties) => [unknown, string] | [];
140
+ export declare const Iterator: (input: string, context?: T.TProperties) => [unknown, string] | [];
141
+ export declare const Argument: (input: string, context?: T.TProperties) => [unknown, string] | [];
142
+ export declare const Awaited: (input: string, context?: T.TProperties) => [unknown, string] | [];
143
+ export declare const Array: (input: string, context?: T.TProperties) => [unknown, string] | [];
144
+ export declare const Record: (input: string, context?: T.TProperties) => [unknown, string] | [];
145
+ export declare const Promise: (input: string, context?: T.TProperties) => [unknown, string] | [];
146
+ export declare const ConstructorParameters: (input: string, context?: T.TProperties) => [unknown, string] | [];
147
+ export declare const FunctionParameters: (input: string, context?: T.TProperties) => [unknown, string] | [];
148
+ export declare const InstanceType: (input: string, context?: T.TProperties) => [unknown, string] | [];
149
+ export declare const ReturnType: (input: string, context?: T.TProperties) => [unknown, string] | [];
150
+ export declare const Partial: (input: string, context?: T.TProperties) => [unknown, string] | [];
151
+ export declare const Required: (input: string, context?: T.TProperties) => [unknown, string] | [];
152
+ export declare const Pick: (input: string, context?: T.TProperties) => [unknown, string] | [];
153
+ export declare const Omit: (input: string, context?: T.TProperties) => [unknown, string] | [];
154
+ export declare const Exclude: (input: string, context?: T.TProperties) => [unknown, string] | [];
155
+ export declare const Extract: (input: string, context?: T.TProperties) => [unknown, string] | [];
156
+ export declare const Uppercase: (input: string, context?: T.TProperties) => [unknown, string] | [];
157
+ export declare const Lowercase: (input: string, context?: T.TProperties) => [unknown, string] | [];
158
+ export declare const Capitalize: (input: string, context?: T.TProperties) => [unknown, string] | [];
159
+ export declare const Uncapitalize: (input: string, context?: T.TProperties) => [unknown, string] | [];
160
+ export declare const Date: (input: string, context?: T.TProperties) => [unknown, string] | [];
161
+ export declare const Uint8Array: (input: string, context?: T.TProperties) => [unknown, string] | [];
162
+ export declare const Reference: (input: string, context?: T.TProperties) => [unknown, string] | [];
@@ -0,0 +1,158 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Constructor = exports.Function = exports.ParameterList = exports.ParameterList_0 = exports.Parameter = exports.Tuple = exports.ElementList = exports.ElementList_0 = exports._Object = exports.PropertyList = exports.PropertyList_0 = exports.PropertyDelimiter = exports.Property = exports.Optional = exports.Readonly = exports.PropertyKey = exports.Type = exports.Expr = exports.ExprTail = exports.ExprTerm = exports.ExprTermTail = exports.Factor = exports.Base = exports.Extends = exports.IndexArray = exports.IndexArray_0 = exports.KeyOf = exports.Literal = exports.LiteralBoolean = exports.LiteralNumber = exports.LiteralString = exports.Keyword = exports.KeywordVoid = exports.KeywordSymbol = exports.KeywordNever = exports.KeywordAny = exports.KeywordUnknown = exports.KeywordBigInt = exports.KeywordInteger = exports.KeywordNull = exports.KeywordUndefined = exports.KeywordBoolean = exports.KeywordNumber = exports.KeywordString = exports.GenericArguments = exports.GenericArgumentsList = exports.GenericArgumentsList_0 = exports.GenericReference = exports.GenericReferenceParameterList = exports.GenericReferenceParameterList_0 = void 0;
5
+ exports.Reference = exports.Uint8Array = exports.Date = exports.Uncapitalize = exports.Capitalize = exports.Lowercase = exports.Uppercase = exports.Extract = exports.Exclude = exports.Omit = exports.Pick = exports.Required = exports.Partial = exports.ReturnType = exports.InstanceType = exports.FunctionParameters = exports.ConstructorParameters = exports.Promise = exports.Record = exports.Array = exports.Awaited = exports.Argument = exports.Iterator = exports.AsyncIterator = exports.Mapped = void 0;
6
+ const index_1 = require("../parser/index");
7
+ const S = require("./mapping");
8
+ const If = (result, left, right = () => []) => (result.length === 2 ? left(result) : right());
9
+ const GenericReferenceParameterList_0 = (input, context, result = []) => If(If((0, exports.Type)(input, context), ([_0, input]) => If(index_1.Runtime.Token.Const(',', input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => (0, exports.GenericReferenceParameterList_0)(input, context, [...result, _0]), () => [result, input]);
10
+ exports.GenericReferenceParameterList_0 = GenericReferenceParameterList_0;
11
+ const GenericReferenceParameterList = (input, context = {}) => If(If((0, exports.GenericReferenceParameterList_0)(input, context), ([_0, input]) => If(If(If((0, exports.Type)(input, context), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [S.GenericReferenceParameterListMapping(_0, context), input]);
12
+ exports.GenericReferenceParameterList = GenericReferenceParameterList;
13
+ const GenericReference = (input, context = {}) => If(If(index_1.Runtime.Token.Ident(input), ([_0, input]) => If(index_1.Runtime.Token.Const('<', input), ([_1, input]) => If((0, exports.GenericReferenceParameterList)(input, context), ([_2, input]) => If(index_1.Runtime.Token.Const('>', input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.GenericReferenceMapping(_0, context), input]);
14
+ exports.GenericReference = GenericReference;
15
+ const GenericArgumentsList_0 = (input, context, result = []) => If(If(index_1.Runtime.Token.Ident(input), ([_0, input]) => If(index_1.Runtime.Token.Const(',', input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => (0, exports.GenericArgumentsList_0)(input, context, [...result, _0]), () => [result, input]);
16
+ exports.GenericArgumentsList_0 = GenericArgumentsList_0;
17
+ const GenericArgumentsList = (input, context = {}) => If(If((0, exports.GenericArgumentsList_0)(input, context), ([_0, input]) => If(If(If(index_1.Runtime.Token.Ident(input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [S.GenericArgumentsListMapping(_0, context), input]);
18
+ exports.GenericArgumentsList = GenericArgumentsList;
19
+ const GenericArguments = (input, context = {}) => If(If(index_1.Runtime.Token.Const('<', input), ([_0, input]) => If((0, exports.GenericArgumentsList)(input, context), ([_1, input]) => If(index_1.Runtime.Token.Const('>', input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [S.GenericArgumentsMapping(_0, context), input]);
20
+ exports.GenericArguments = GenericArguments;
21
+ const KeywordString = (input, context = {}) => If(index_1.Runtime.Token.Const('string', input), ([_0, input]) => [S.KeywordStringMapping(_0, context), input]);
22
+ exports.KeywordString = KeywordString;
23
+ const KeywordNumber = (input, context = {}) => If(index_1.Runtime.Token.Const('number', input), ([_0, input]) => [S.KeywordNumberMapping(_0, context), input]);
24
+ exports.KeywordNumber = KeywordNumber;
25
+ const KeywordBoolean = (input, context = {}) => If(index_1.Runtime.Token.Const('boolean', input), ([_0, input]) => [S.KeywordBooleanMapping(_0, context), input]);
26
+ exports.KeywordBoolean = KeywordBoolean;
27
+ const KeywordUndefined = (input, context = {}) => If(index_1.Runtime.Token.Const('undefined', input), ([_0, input]) => [S.KeywordUndefinedMapping(_0, context), input]);
28
+ exports.KeywordUndefined = KeywordUndefined;
29
+ const KeywordNull = (input, context = {}) => If(index_1.Runtime.Token.Const('null', input), ([_0, input]) => [S.KeywordNullMapping(_0, context), input]);
30
+ exports.KeywordNull = KeywordNull;
31
+ const KeywordInteger = (input, context = {}) => If(index_1.Runtime.Token.Const('integer', input), ([_0, input]) => [S.KeywordIntegerMapping(_0, context), input]);
32
+ exports.KeywordInteger = KeywordInteger;
33
+ const KeywordBigInt = (input, context = {}) => If(index_1.Runtime.Token.Const('bigint', input), ([_0, input]) => [S.KeywordBigIntMapping(_0, context), input]);
34
+ exports.KeywordBigInt = KeywordBigInt;
35
+ const KeywordUnknown = (input, context = {}) => If(index_1.Runtime.Token.Const('unknown', input), ([_0, input]) => [S.KeywordUnknownMapping(_0, context), input]);
36
+ exports.KeywordUnknown = KeywordUnknown;
37
+ const KeywordAny = (input, context = {}) => If(index_1.Runtime.Token.Const('any', input), ([_0, input]) => [S.KeywordAnyMapping(_0, context), input]);
38
+ exports.KeywordAny = KeywordAny;
39
+ const KeywordNever = (input, context = {}) => If(index_1.Runtime.Token.Const('never', input), ([_0, input]) => [S.KeywordNeverMapping(_0, context), input]);
40
+ exports.KeywordNever = KeywordNever;
41
+ const KeywordSymbol = (input, context = {}) => If(index_1.Runtime.Token.Const('symbol', input), ([_0, input]) => [S.KeywordSymbolMapping(_0, context), input]);
42
+ exports.KeywordSymbol = KeywordSymbol;
43
+ const KeywordVoid = (input, context = {}) => If(index_1.Runtime.Token.Const('void', input), ([_0, input]) => [S.KeywordVoidMapping(_0, context), input]);
44
+ exports.KeywordVoid = KeywordVoid;
45
+ const Keyword = (input, context = {}) => If(If((0, exports.KeywordString)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.KeywordNumber)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.KeywordBoolean)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.KeywordUndefined)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.KeywordNull)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.KeywordInteger)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.KeywordBigInt)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.KeywordUnknown)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.KeywordAny)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.KeywordNever)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.KeywordSymbol)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.KeywordVoid)(input, context), ([_0, input]) => [_0, input], () => [])))))))))))), ([_0, input]) => [S.KeywordMapping(_0, context), input]);
46
+ exports.Keyword = Keyword;
47
+ const LiteralString = (input, context = {}) => If(index_1.Runtime.Token.String(["'", '"', '`'], input), ([_0, input]) => [S.LiteralStringMapping(_0, context), input]);
48
+ exports.LiteralString = LiteralString;
49
+ const LiteralNumber = (input, context = {}) => If(index_1.Runtime.Token.Number(input), ([_0, input]) => [S.LiteralNumberMapping(_0, context), input]);
50
+ exports.LiteralNumber = LiteralNumber;
51
+ const LiteralBoolean = (input, context = {}) => If(If(index_1.Runtime.Token.Const('true', input), ([_0, input]) => [_0, input], () => If(index_1.Runtime.Token.Const('false', input), ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.LiteralBooleanMapping(_0, context), input]);
52
+ exports.LiteralBoolean = LiteralBoolean;
53
+ const Literal = (input, context = {}) => If(If((0, exports.LiteralBoolean)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.LiteralNumber)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.LiteralString)(input, context), ([_0, input]) => [_0, input], () => []))), ([_0, input]) => [S.LiteralMapping(_0, context), input]);
54
+ exports.Literal = Literal;
55
+ const KeyOf = (input, context = {}) => If(If(If(index_1.Runtime.Token.Const('keyof', input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.KeyOfMapping(_0, context), input]);
56
+ exports.KeyOf = KeyOf;
57
+ const IndexArray_0 = (input, context, result = []) => If(If(If(index_1.Runtime.Token.Const('[', input), ([_0, input]) => If((0, exports.Type)(input, context), ([_1, input]) => If(index_1.Runtime.Token.Const(']', input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [_0, input], () => If(If(index_1.Runtime.Token.Const('[', input), ([_0, input]) => If(index_1.Runtime.Token.Const(']', input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => [])), ([_0, input]) => (0, exports.IndexArray_0)(input, context, [...result, _0]), () => [result, input]);
58
+ exports.IndexArray_0 = IndexArray_0;
59
+ const IndexArray = (input, context = {}) => If((0, exports.IndexArray_0)(input, context), ([_0, input]) => [S.IndexArrayMapping(_0, context), input]);
60
+ exports.IndexArray = IndexArray;
61
+ const Extends = (input, context = {}) => If(If(If(index_1.Runtime.Token.Const('extends', input), ([_0, input]) => If((0, exports.Type)(input, context), ([_1, input]) => If(index_1.Runtime.Token.Const('?', input), ([_2, input]) => If((0, exports.Type)(input, context), ([_3, input]) => If(index_1.Runtime.Token.Const(':', input), ([_4, input]) => If((0, exports.Type)(input, context), ([_5, input]) => [[_0, _1, _2, _3, _4, _5], input])))))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.ExtendsMapping(_0, context), input]);
62
+ exports.Extends = Extends;
63
+ const Base = (input, context = {}) => If(If(If(index_1.Runtime.Token.Const('(', input), ([_0, input]) => If((0, exports.Type)(input, context), ([_1, input]) => If(index_1.Runtime.Token.Const(')', input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [_0, input], () => If((0, exports.Keyword)(input, context), ([_0, input]) => [_0, input], () => If((0, exports._Object)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.Tuple)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.Literal)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.Constructor)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.Function)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.Mapped)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.AsyncIterator)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.Iterator)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.ConstructorParameters)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.FunctionParameters)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.InstanceType)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.ReturnType)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.Argument)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.Awaited)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.Array)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.Record)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.Promise)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.Partial)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.Required)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.Pick)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.Omit)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.Exclude)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.Extract)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.Uppercase)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.Lowercase)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.Capitalize)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.Uncapitalize)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.Date)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.Uint8Array)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.GenericReference)(input, context), ([_0, input]) => [_0, input], () => If((0, exports.Reference)(input, context), ([_0, input]) => [_0, input], () => []))))))))))))))))))))))))))))))))), ([_0, input]) => [S.BaseMapping(_0, context), input]);
64
+ exports.Base = Base;
65
+ const Factor = (input, context = {}) => If(If((0, exports.KeyOf)(input, context), ([_0, input]) => If((0, exports.Base)(input, context), ([_1, input]) => If((0, exports.IndexArray)(input, context), ([_2, input]) => If((0, exports.Extends)(input, context), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.FactorMapping(_0, context), input]);
66
+ exports.Factor = Factor;
67
+ const ExprTermTail = (input, context = {}) => If(If(If(index_1.Runtime.Token.Const('&', input), ([_0, input]) => If((0, exports.Factor)(input, context), ([_1, input]) => If((0, exports.ExprTermTail)(input, context), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.ExprTermTailMapping(_0, context), input]);
68
+ exports.ExprTermTail = ExprTermTail;
69
+ const ExprTerm = (input, context = {}) => If(If((0, exports.Factor)(input, context), ([_0, input]) => If((0, exports.ExprTermTail)(input, context), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [S.ExprTermMapping(_0, context), input]);
70
+ exports.ExprTerm = ExprTerm;
71
+ const ExprTail = (input, context = {}) => If(If(If(index_1.Runtime.Token.Const('|', input), ([_0, input]) => If((0, exports.ExprTerm)(input, context), ([_1, input]) => If((0, exports.ExprTail)(input, context), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.ExprTailMapping(_0, context), input]);
72
+ exports.ExprTail = ExprTail;
73
+ const Expr = (input, context = {}) => If(If((0, exports.ExprTerm)(input, context), ([_0, input]) => If((0, exports.ExprTail)(input, context), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [S.ExprMapping(_0, context), input]);
74
+ exports.Expr = Expr;
75
+ const Type = (input, context = {}) => If(If(If((0, exports.GenericArguments)(input, context), ([_0, input]) => (0, exports.Expr)(input, _0), () => []), ([_0, input]) => [_0, input], () => If((0, exports.Expr)(input, context), ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.TypeMapping(_0, context), input]);
76
+ exports.Type = Type;
77
+ const PropertyKey = (input, context = {}) => If(If(index_1.Runtime.Token.Ident(input), ([_0, input]) => [_0, input], () => If(index_1.Runtime.Token.String(["'", '"'], input), ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.PropertyKeyMapping(_0, context), input]);
78
+ exports.PropertyKey = PropertyKey;
79
+ const Readonly = (input, context = {}) => If(If(If(index_1.Runtime.Token.Const('readonly', input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.ReadonlyMapping(_0, context), input]);
80
+ exports.Readonly = Readonly;
81
+ const Optional = (input, context = {}) => If(If(If(index_1.Runtime.Token.Const('?', input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.OptionalMapping(_0, context), input]);
82
+ exports.Optional = Optional;
83
+ const Property = (input, context = {}) => If(If((0, exports.Readonly)(input, context), ([_0, input]) => If((0, exports.PropertyKey)(input, context), ([_1, input]) => If((0, exports.Optional)(input, context), ([_2, input]) => If(index_1.Runtime.Token.Const(':', input), ([_3, input]) => If((0, exports.Type)(input, context), ([_4, input]) => [[_0, _1, _2, _3, _4], input]))))), ([_0, input]) => [S.PropertyMapping(_0, context), input]);
84
+ exports.Property = Property;
85
+ const PropertyDelimiter = (input, context = {}) => If(If(If(index_1.Runtime.Token.Const(',', input), ([_0, input]) => If(index_1.Runtime.Token.Const('\n', input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If(If(index_1.Runtime.Token.Const(';', input), ([_0, input]) => If(index_1.Runtime.Token.Const('\n', input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If(If(index_1.Runtime.Token.Const(',', input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If(If(index_1.Runtime.Token.Const(';', input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If(If(index_1.Runtime.Token.Const('\n', input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => []))))), ([_0, input]) => [S.PropertyDelimiterMapping(_0, context), input]);
86
+ exports.PropertyDelimiter = PropertyDelimiter;
87
+ const PropertyList_0 = (input, context, result = []) => If(If((0, exports.Property)(input, context), ([_0, input]) => If((0, exports.PropertyDelimiter)(input, context), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => (0, exports.PropertyList_0)(input, context, [...result, _0]), () => [result, input]);
88
+ exports.PropertyList_0 = PropertyList_0;
89
+ const PropertyList = (input, context = {}) => If(If((0, exports.PropertyList_0)(input, context), ([_0, input]) => If(If(If((0, exports.Property)(input, context), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [S.PropertyListMapping(_0, context), input]);
90
+ exports.PropertyList = PropertyList;
91
+ const _Object = (input, context = {}) => If(If(index_1.Runtime.Token.Const('{', input), ([_0, input]) => If((0, exports.PropertyList)(input, context), ([_1, input]) => If(index_1.Runtime.Token.Const('}', input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [S.ObjectMapping(_0, context), input]);
92
+ exports._Object = _Object;
93
+ const ElementList_0 = (input, context, result = []) => If(If((0, exports.Type)(input, context), ([_0, input]) => If(index_1.Runtime.Token.Const(',', input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => (0, exports.ElementList_0)(input, context, [...result, _0]), () => [result, input]);
94
+ exports.ElementList_0 = ElementList_0;
95
+ const ElementList = (input, context = {}) => If(If((0, exports.ElementList_0)(input, context), ([_0, input]) => If(If(If((0, exports.Type)(input, context), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [S.ElementListMapping(_0, context), input]);
96
+ exports.ElementList = ElementList;
97
+ const Tuple = (input, context = {}) => If(If(index_1.Runtime.Token.Const('[', input), ([_0, input]) => If((0, exports.ElementList)(input, context), ([_1, input]) => If(index_1.Runtime.Token.Const(']', input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [S.TupleMapping(_0, context), input]);
98
+ exports.Tuple = Tuple;
99
+ const Parameter = (input, context = {}) => If(If(index_1.Runtime.Token.Ident(input), ([_0, input]) => If(index_1.Runtime.Token.Const(':', input), ([_1, input]) => If((0, exports.Type)(input, context), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [S.ParameterMapping(_0, context), input]);
100
+ exports.Parameter = Parameter;
101
+ const ParameterList_0 = (input, context, result = []) => If(If((0, exports.Parameter)(input, context), ([_0, input]) => If(index_1.Runtime.Token.Const(',', input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => (0, exports.ParameterList_0)(input, context, [...result, _0]), () => [result, input]);
102
+ exports.ParameterList_0 = ParameterList_0;
103
+ const ParameterList = (input, context = {}) => If(If((0, exports.ParameterList_0)(input, context), ([_0, input]) => If(If(If((0, exports.Parameter)(input, context), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [S.ParameterListMapping(_0, context), input]);
104
+ exports.ParameterList = ParameterList;
105
+ const Function = (input, context = {}) => If(If(index_1.Runtime.Token.Const('(', input), ([_0, input]) => If((0, exports.ParameterList)(input, context), ([_1, input]) => If(index_1.Runtime.Token.Const(')', input), ([_2, input]) => If(index_1.Runtime.Token.Const('=>', input), ([_3, input]) => If((0, exports.Type)(input, context), ([_4, input]) => [[_0, _1, _2, _3, _4], input]))))), ([_0, input]) => [S.FunctionMapping(_0, context), input]);
106
+ exports.Function = Function;
107
+ const Constructor = (input, context = {}) => If(If(index_1.Runtime.Token.Const('new', input), ([_0, input]) => If(index_1.Runtime.Token.Const('(', input), ([_1, input]) => If((0, exports.ParameterList)(input, context), ([_2, input]) => If(index_1.Runtime.Token.Const(')', input), ([_3, input]) => If(index_1.Runtime.Token.Const('=>', input), ([_4, input]) => If((0, exports.Type)(input, context), ([_5, input]) => [[_0, _1, _2, _3, _4, _5], input])))))), ([_0, input]) => [S.ConstructorMapping(_0, context), input]);
108
+ exports.Constructor = Constructor;
109
+ const Mapped = (input, context = {}) => If(If(index_1.Runtime.Token.Const('{', input), ([_0, input]) => If(index_1.Runtime.Token.Const('[', input), ([_1, input]) => If(index_1.Runtime.Token.Ident(input), ([_2, input]) => If(index_1.Runtime.Token.Const('in', input), ([_3, input]) => If((0, exports.Type)(input, context), ([_4, input]) => If(index_1.Runtime.Token.Const(']', input), ([_5, input]) => If(index_1.Runtime.Token.Const(':', input), ([_6, input]) => If((0, exports.Type)(input, context), ([_7, input]) => If(index_1.Runtime.Token.Const('}', input), ([_8, input]) => [[_0, _1, _2, _3, _4, _5, _6, _7, _8], input]))))))))), ([_0, input]) => [S.MappedMapping(_0, context), input]);
110
+ exports.Mapped = Mapped;
111
+ const AsyncIterator = (input, context = {}) => If(If(index_1.Runtime.Token.Const('AsyncIterator', input), ([_0, input]) => If(index_1.Runtime.Token.Const('<', input), ([_1, input]) => If((0, exports.Type)(input, context), ([_2, input]) => If(index_1.Runtime.Token.Const('>', input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.AsyncIteratorMapping(_0, context), input]);
112
+ exports.AsyncIterator = AsyncIterator;
113
+ const Iterator = (input, context = {}) => If(If(index_1.Runtime.Token.Const('Iterator', input), ([_0, input]) => If(index_1.Runtime.Token.Const('<', input), ([_1, input]) => If((0, exports.Type)(input, context), ([_2, input]) => If(index_1.Runtime.Token.Const('>', input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.IteratorMapping(_0, context), input]);
114
+ exports.Iterator = Iterator;
115
+ const Argument = (input, context = {}) => If(If(index_1.Runtime.Token.Const('Argument', input), ([_0, input]) => If(index_1.Runtime.Token.Const('<', input), ([_1, input]) => If((0, exports.Type)(input, context), ([_2, input]) => If(index_1.Runtime.Token.Const('>', input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.ArgumentMapping(_0, context), input]);
116
+ exports.Argument = Argument;
117
+ const Awaited = (input, context = {}) => If(If(index_1.Runtime.Token.Const('Awaited', input), ([_0, input]) => If(index_1.Runtime.Token.Const('<', input), ([_1, input]) => If((0, exports.Type)(input, context), ([_2, input]) => If(index_1.Runtime.Token.Const('>', input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.AwaitedMapping(_0, context), input]);
118
+ exports.Awaited = Awaited;
119
+ const Array = (input, context = {}) => If(If(index_1.Runtime.Token.Const('Array', input), ([_0, input]) => If(index_1.Runtime.Token.Const('<', input), ([_1, input]) => If((0, exports.Type)(input, context), ([_2, input]) => If(index_1.Runtime.Token.Const('>', input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.ArrayMapping(_0, context), input]);
120
+ exports.Array = Array;
121
+ const Record = (input, context = {}) => If(If(index_1.Runtime.Token.Const('Record', input), ([_0, input]) => If(index_1.Runtime.Token.Const('<', input), ([_1, input]) => If((0, exports.Type)(input, context), ([_2, input]) => If(index_1.Runtime.Token.Const(',', input), ([_3, input]) => If((0, exports.Type)(input, context), ([_4, input]) => If(index_1.Runtime.Token.Const('>', input), ([_5, input]) => [[_0, _1, _2, _3, _4, _5], input])))))), ([_0, input]) => [S.RecordMapping(_0, context), input]);
122
+ exports.Record = Record;
123
+ const Promise = (input, context = {}) => If(If(index_1.Runtime.Token.Const('Promise', input), ([_0, input]) => If(index_1.Runtime.Token.Const('<', input), ([_1, input]) => If((0, exports.Type)(input, context), ([_2, input]) => If(index_1.Runtime.Token.Const('>', input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.PromiseMapping(_0, context), input]);
124
+ exports.Promise = Promise;
125
+ const ConstructorParameters = (input, context = {}) => If(If(index_1.Runtime.Token.Const('ConstructorParameters', input), ([_0, input]) => If(index_1.Runtime.Token.Const('<', input), ([_1, input]) => If((0, exports.Type)(input, context), ([_2, input]) => If(index_1.Runtime.Token.Const('>', input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.ConstructorParametersMapping(_0, context), input]);
126
+ exports.ConstructorParameters = ConstructorParameters;
127
+ const FunctionParameters = (input, context = {}) => If(If(index_1.Runtime.Token.Const('Parameters', input), ([_0, input]) => If(index_1.Runtime.Token.Const('<', input), ([_1, input]) => If((0, exports.Type)(input, context), ([_2, input]) => If(index_1.Runtime.Token.Const('>', input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.FunctionParametersMapping(_0, context), input]);
128
+ exports.FunctionParameters = FunctionParameters;
129
+ const InstanceType = (input, context = {}) => If(If(index_1.Runtime.Token.Const('InstanceType', input), ([_0, input]) => If(index_1.Runtime.Token.Const('<', input), ([_1, input]) => If((0, exports.Type)(input, context), ([_2, input]) => If(index_1.Runtime.Token.Const('>', input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.InstanceTypeMapping(_0, context), input]);
130
+ exports.InstanceType = InstanceType;
131
+ const ReturnType = (input, context = {}) => If(If(index_1.Runtime.Token.Const('ReturnType', input), ([_0, input]) => If(index_1.Runtime.Token.Const('<', input), ([_1, input]) => If((0, exports.Type)(input, context), ([_2, input]) => If(index_1.Runtime.Token.Const('>', input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.ReturnTypeMapping(_0, context), input]);
132
+ exports.ReturnType = ReturnType;
133
+ const Partial = (input, context = {}) => If(If(index_1.Runtime.Token.Const('Partial', input), ([_0, input]) => If(index_1.Runtime.Token.Const('<', input), ([_1, input]) => If((0, exports.Type)(input, context), ([_2, input]) => If(index_1.Runtime.Token.Const('>', input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.PartialMapping(_0, context), input]);
134
+ exports.Partial = Partial;
135
+ const Required = (input, context = {}) => If(If(index_1.Runtime.Token.Const('Required', input), ([_0, input]) => If(index_1.Runtime.Token.Const('<', input), ([_1, input]) => If((0, exports.Type)(input, context), ([_2, input]) => If(index_1.Runtime.Token.Const('>', input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.RequiredMapping(_0, context), input]);
136
+ exports.Required = Required;
137
+ const Pick = (input, context = {}) => If(If(index_1.Runtime.Token.Const('Pick', input), ([_0, input]) => If(index_1.Runtime.Token.Const('<', input), ([_1, input]) => If((0, exports.Type)(input, context), ([_2, input]) => If(index_1.Runtime.Token.Const(',', input), ([_3, input]) => If((0, exports.Type)(input, context), ([_4, input]) => If(index_1.Runtime.Token.Const('>', input), ([_5, input]) => [[_0, _1, _2, _3, _4, _5], input])))))), ([_0, input]) => [S.PickMapping(_0, context), input]);
138
+ exports.Pick = Pick;
139
+ const Omit = (input, context = {}) => If(If(index_1.Runtime.Token.Const('Omit', input), ([_0, input]) => If(index_1.Runtime.Token.Const('<', input), ([_1, input]) => If((0, exports.Type)(input, context), ([_2, input]) => If(index_1.Runtime.Token.Const(',', input), ([_3, input]) => If((0, exports.Type)(input, context), ([_4, input]) => If(index_1.Runtime.Token.Const('>', input), ([_5, input]) => [[_0, _1, _2, _3, _4, _5], input])))))), ([_0, input]) => [S.OmitMapping(_0, context), input]);
140
+ exports.Omit = Omit;
141
+ const Exclude = (input, context = {}) => If(If(index_1.Runtime.Token.Const('Exclude', input), ([_0, input]) => If(index_1.Runtime.Token.Const('<', input), ([_1, input]) => If((0, exports.Type)(input, context), ([_2, input]) => If(index_1.Runtime.Token.Const(',', input), ([_3, input]) => If((0, exports.Type)(input, context), ([_4, input]) => If(index_1.Runtime.Token.Const('>', input), ([_5, input]) => [[_0, _1, _2, _3, _4, _5], input])))))), ([_0, input]) => [S.ExcludeMapping(_0, context), input]);
142
+ exports.Exclude = Exclude;
143
+ const Extract = (input, context = {}) => If(If(index_1.Runtime.Token.Const('Extract', input), ([_0, input]) => If(index_1.Runtime.Token.Const('<', input), ([_1, input]) => If((0, exports.Type)(input, context), ([_2, input]) => If(index_1.Runtime.Token.Const(',', input), ([_3, input]) => If((0, exports.Type)(input, context), ([_4, input]) => If(index_1.Runtime.Token.Const('>', input), ([_5, input]) => [[_0, _1, _2, _3, _4, _5], input])))))), ([_0, input]) => [S.ExtractMapping(_0, context), input]);
144
+ exports.Extract = Extract;
145
+ const Uppercase = (input, context = {}) => If(If(index_1.Runtime.Token.Const('Uppercase', input), ([_0, input]) => If(index_1.Runtime.Token.Const('<', input), ([_1, input]) => If((0, exports.Type)(input, context), ([_2, input]) => If(index_1.Runtime.Token.Const('>', input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.UppercaseMapping(_0, context), input]);
146
+ exports.Uppercase = Uppercase;
147
+ const Lowercase = (input, context = {}) => If(If(index_1.Runtime.Token.Const('Lowercase', input), ([_0, input]) => If(index_1.Runtime.Token.Const('<', input), ([_1, input]) => If((0, exports.Type)(input, context), ([_2, input]) => If(index_1.Runtime.Token.Const('>', input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.LowercaseMapping(_0, context), input]);
148
+ exports.Lowercase = Lowercase;
149
+ const Capitalize = (input, context = {}) => If(If(index_1.Runtime.Token.Const('Capitalize', input), ([_0, input]) => If(index_1.Runtime.Token.Const('<', input), ([_1, input]) => If((0, exports.Type)(input, context), ([_2, input]) => If(index_1.Runtime.Token.Const('>', input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.CapitalizeMapping(_0, context), input]);
150
+ exports.Capitalize = Capitalize;
151
+ const Uncapitalize = (input, context = {}) => If(If(index_1.Runtime.Token.Const('Uncapitalize', input), ([_0, input]) => If(index_1.Runtime.Token.Const('<', input), ([_1, input]) => If((0, exports.Type)(input, context), ([_2, input]) => If(index_1.Runtime.Token.Const('>', input), ([_3, input]) => [[_0, _1, _2, _3], input])))), ([_0, input]) => [S.UncapitalizeMapping(_0, context), input]);
152
+ exports.Uncapitalize = Uncapitalize;
153
+ const Date = (input, context = {}) => If(index_1.Runtime.Token.Const('Date', input), ([_0, input]) => [S.DateMapping(_0, context), input]);
154
+ exports.Date = Date;
155
+ const Uint8Array = (input, context = {}) => If(index_1.Runtime.Token.Const('Uint8Array', input), ([_0, input]) => [S.Uint8ArrayMapping(_0, context), input]);
156
+ exports.Uint8Array = Uint8Array;
157
+ const Reference = (input, context = {}) => If(index_1.Runtime.Token.Ident(input), ([_0, input]) => [S.ReferenceMapping(_0, context), input]);
158
+ exports.Reference = Reference;
@@ -1,29 +1,12 @@
1
- import * as t from '../type/index';
2
- import { Static } from '../parser/index';
3
- import { Type } from './static';
4
- /** `[Experimental]` Parses a TypeScript annotation into a TypeBox type but does not infer schematics */
5
- export declare function NoInfer<Context extends Record<PropertyKey, t.TSchema>, Code extends string>(context: Context, code: Code, options?: t.SchemaOptions): t.TSchema;
6
- /** `[Experimental]` Parses a TypeScript annotation into a TypeBox type but does not infer schematics */
7
- export declare function NoInfer<Code extends string>(code: Code, options?: t.SchemaOptions): t.TSchema;
8
- /** `[Experimental]` Parses a TypeScript annotation into a TypeBox type */
9
- export type TSyntax<Context extends Record<PropertyKey, t.TSchema>, Code extends string> = (Static.Parse<Type, Code, Context> extends [infer Type extends t.TSchema, string] ? Type : t.TNever);
10
- /** `[Experimental]` Parses a TypeScript annotation into a TypeBox type */
11
- export declare function Syntax<Context extends Record<PropertyKey, t.TSchema>, Annotation extends string>(context: Context, annotation: Annotation, options?: t.SchemaOptions): TSyntax<Context, Annotation>;
12
- /** `[Experimental]` Parses a TypeScript annotation into a TypeBox type */
13
- export declare function Syntax<Annotation extends string>(annotation: Annotation, options?: t.SchemaOptions): TSyntax<{}, Annotation>;
14
- /**
15
- * @deprecated Use Syntax() function
16
- */
17
- export declare function Parse<Context extends Record<PropertyKey, t.TSchema>, Annotation extends string>(context: Context, annotation: Annotation, options?: t.SchemaOptions): TSyntax<Context, Annotation>;
18
- /**
19
- * @deprecated Use Syntax() function
20
- */
21
- export declare function Parse<Annotation extends string>(annotation: Annotation, options?: t.SchemaOptions): TSyntax<{}, Annotation>;
22
- /**
23
- * @deprecated Use NoInfer() function
24
- */
25
- export declare function ParseOnly<Context extends Record<PropertyKey, t.TSchema>, Code extends string>(context: Context, code: Code, options?: t.SchemaOptions): t.TSchema | undefined;
26
- /**
27
- * @deprecated Use NoInfer() function
28
- */
29
- export declare function ParseOnly<Code extends string>(code: Code, options?: t.SchemaOptions): t.TSchema | undefined;
1
+ import * as t from '@sinclair/typebox';
2
+ import { TType } from './parser';
3
+ /** `[Experimental]` Parses type expressions into TypeBox types but does not infer */
4
+ export declare function NoInfer<Context extends Record<PropertyKey, t.TSchema>, Input extends string>(context: Context, input: Input, options?: t.SchemaOptions): t.TSchema;
5
+ /** `[Experimental]` Parses type expressions into TypeBox types but does not infer */
6
+ export declare function NoInfer<Input extends string>(input: Input, options?: t.SchemaOptions): t.TSchema;
7
+ /** `[Experimental]` Parses type expressions into TypeBox types */
8
+ export type TSyntax<Context extends Record<PropertyKey, t.TSchema>, Code extends string> = (TType<Code, Context> extends [infer Type extends t.TSchema, string] ? Type : t.TNever);
9
+ /** `[Experimental]` Parses type expressions into TypeBox types */
10
+ export declare function Syntax<Context extends Record<PropertyKey, t.TSchema>, Input extends string>(context: Context, input: Input, options?: t.SchemaOptions): TSyntax<Context, Input>;
11
+ /** `[Experimental]` Parses type expressions into TypeBox types */
12
+ export declare function Syntax<Input extends string>(annotation: Input, options?: t.SchemaOptions): TSyntax<{}, Input>;
@@ -3,33 +3,19 @@
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.NoInfer = NoInfer;
5
5
  exports.Syntax = Syntax;
6
- exports.Parse = Parse;
7
- exports.ParseOnly = ParseOnly;
8
- const t = require("../type/index");
9
- const runtime_1 = require("./runtime");
10
- /** `[Experimental]` Parses a TypeScript annotation into a TypeBox type but does not infer schematics */
6
+ const t = require("@sinclair/typebox");
7
+ const parser_1 = require("./parser");
8
+ /** `[Experimental]` Parses type expressions into TypeBox types but does not infer */
11
9
  // prettier-ignore
12
10
  function NoInfer(...args) {
13
11
  const withContext = typeof args[0] === 'string' ? false : true;
14
12
  const [context, code, options] = withContext ? [args[0], args[1], args[2] || {}] : [{}, args[0], args[1] || {}];
15
- const result = runtime_1.Module.Parse('Type', code, context)[0];
13
+ const result = (0, parser_1.Type)(code, context)[0];
16
14
  return t.KindGuard.IsSchema(result)
17
15
  ? t.CloneType(result, options)
18
16
  : t.Never(options);
19
17
  }
20
- /** `[Experimental]` Parses a TypeScript annotation into a TypeBox type */
18
+ /** `[Experimental]` Parses type expressions into TypeBox types */
21
19
  function Syntax(...args) {
22
20
  return NoInfer.apply(null, args);
23
21
  }
24
- /**
25
- * @deprecated Use Syntax() function
26
- */
27
- function Parse(...args) {
28
- return NoInfer.apply(null, args);
29
- }
30
- /**
31
- * @deprecated Use NoInfer() function
32
- */
33
- function ParseOnly(...args) {
34
- return NoInfer.apply(null, args);
35
- }
@@ -28,8 +28,8 @@ type TFromUnionKeyLiteralString<Key extends TLiteral<string>, Type extends TSche
28
28
  type TFromUnionKeyLiteralNumber<Key extends TLiteral<number>, Type extends TSchema> = {
29
29
  [_ in Key['const']]: Type;
30
30
  };
31
- type TFromUnionKeyRest<Keys extends TSchema[], Type extends TSchema> = Keys extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? (Left extends TUnion<infer Types extends TSchema[]> ? TFromUnionKeyRest<Types, Type> & TFromUnionKeyRest<Right, Type> : Left extends TLiteral<string> ? TFromUnionKeyLiteralString<Left, Type> & TFromUnionKeyRest<Right, Type> : Left extends TLiteral<number> ? TFromUnionKeyLiteralNumber<Left, Type> & TFromUnionKeyRest<Right, Type> : {}) : {};
32
- type TFromUnionKey<Key extends TSchema[], Type extends TSchema, P extends TProperties = TFromUnionKeyRest<Key, Type>> = (Ensure<TObject<Evaluate<P>>>);
31
+ type TFromUnionKeyVariants<Keys extends TSchema[], Type extends TSchema, Result extends TProperties = {}> = Keys extends [infer Left extends TSchema, ...infer Right extends TSchema[]] ? (Left extends TUnion<infer Types extends TSchema[]> ? TFromUnionKeyVariants<Right, Type, Result & TFromUnionKeyVariants<Types, Type>> : Left extends TLiteral<string> ? TFromUnionKeyVariants<Right, Type, Result & TFromUnionKeyLiteralString<Left, Type>> : Left extends TLiteral<number> ? TFromUnionKeyVariants<Right, Type, Result & TFromUnionKeyLiteralNumber<Left, Type>> : {}) : Result;
32
+ type TFromUnionKey<Key extends TSchema[], Type extends TSchema, Properties extends TProperties = TFromUnionKeyVariants<Key, Type>> = (Ensure<TObject<Evaluate<Properties>>>);
33
33
  type TFromLiteralKey<Key extends TLiteralValue, Type extends TSchema> = (Ensure<TObject<{
34
34
  [_ in Assert<Key, PropertyKey>]: Type;
35
35
  }>>);