typebox 1.0.34 → 1.0.35

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,6 @@
1
+ import { type TNumber } from '../../types/number.mjs';
2
+ import { type TString } from '../../types/string.mjs';
3
+ import { type TSymbol } from '../../types/symbol.mjs';
4
+ import { type TUnion } from '../../types/union.mjs';
5
+ export type TFromAny<Result = TUnion<[TNumber, TString, TSymbol]>> = Result;
6
+ export declare function FromAny(): TFromAny;
@@ -0,0 +1,8 @@
1
+ // deno-fmt-ignore-file
2
+ import { Number } from '../../types/number.mjs';
3
+ import { String } from '../../types/string.mjs';
4
+ import { Symbol } from '../../types/symbol.mjs';
5
+ import { Union } from '../../types/union.mjs';
6
+ export function FromAny() {
7
+ return Union([Number(), String(), Symbol()]);
8
+ }
@@ -1,4 +1,4 @@
1
1
  import { type TSchema } from '../../types/index.mjs';
2
- import { type TNumber } from "../../types/number.mjs";
2
+ import { type TNumber } from '../../types/number.mjs';
3
3
  export type TFromArray<_Type extends TSchema> = TNumber;
4
4
  export declare function FromArray<_Type extends TSchema>(_type: _Type): TFromArray<_Type>;
@@ -1,5 +1,5 @@
1
1
  // deno-fmt-ignore-file
2
- import { Number } from "../../types/number.mjs";
2
+ import { Number } from '../../types/number.mjs';
3
3
  export function FromArray(_type) {
4
4
  return Number();
5
5
  }
@@ -1,5 +1,6 @@
1
1
  import { type TSchema, type TSchemaOptions } from '../../types/schema.mjs';
2
2
  import { type TProperties } from '../../types/properties.mjs';
3
+ import { type TAny } from '../../types/any.mjs';
3
4
  import { type TArray } from '../../types/array.mjs';
4
5
  import { type TCyclic } from '../../types/cyclic.mjs';
5
6
  import { type TIntersect } from '../../types/intersect.mjs';
@@ -11,12 +12,13 @@ import { type TUnion } from '../../types/union.mjs';
11
12
  import { type TKeyOfDeferred } from '../../action/keyof.mjs';
12
13
  import { type TState, type TInstantiateType, type TCanInstantiate } from '../instantiate.mjs';
13
14
  import { type TCollapseToObject } from '../object/index.mjs';
14
- import { type TFromArray } from "./from-array.mjs";
15
+ import { type TFromAny } from './from-any.mjs';
16
+ import { type TFromArray } from './from-array.mjs';
15
17
  import { type TFromObject } from './from-object.mjs';
16
18
  import { type TFromRecord } from './from-record.mjs';
17
19
  import { type TFromTuple } from './from-tuple.mjs';
18
20
  type TNormalizeType<Type extends TSchema, Result extends TSchema = (Type extends TCyclic | TIntersect | TUnion ? TCollapseToObject<Type> : Type)> = Result;
19
- export type TKeyOfAction<Type extends TSchema, Normalized extends TSchema = TNormalizeType<Type>> = (Normalized extends TArray<infer Type extends TSchema> ? TFromArray<Type> : Normalized extends TObject<infer Properties extends TProperties> ? TFromObject<Properties> : Normalized extends TRecord ? TFromRecord<Normalized> : Normalized extends TTuple<infer Types extends TSchema[]> ? TFromTuple<Types> : TNever);
21
+ export type TKeyOfAction<Type extends TSchema, Normal extends TSchema = TNormalizeType<Type>> = (Normal extends TAny ? TFromAny : Normal extends TArray<infer Type extends TSchema> ? TFromArray<Type> : Normal extends TObject<infer Properties extends TProperties> ? TFromObject<Properties> : Normal extends TRecord ? TFromRecord<Normal> : Normal extends TTuple<infer Types extends TSchema[]> ? TFromTuple<Types> : TNever);
20
22
  export declare function KeyOfAction<Type extends TSchema>(type: Type): TKeyOfAction<Type>;
21
23
  export type TKeyOfImmediate<Context extends TProperties, State extends TState, Type extends TSchema, InstantiatedType extends TSchema = TInstantiateType<Context, State, Type>> = TKeyOfAction<InstantiatedType>;
22
24
  export declare function KeyOfImmediate<Context extends TProperties, State extends TState, Type extends TSchema>(context: Context, state: State, type: Type, options: TSchemaOptions): TKeyOfImmediate<Context, State, Type>;
@@ -1,5 +1,6 @@
1
1
  // deno-fmt-ignore-file
2
2
  import { Memory } from '../../../system/memory/index.mjs';
3
+ import { IsAny } from '../../types/any.mjs';
3
4
  import { IsArray } from '../../types/array.mjs';
4
5
  import { IsCyclic } from '../../types/cyclic.mjs';
5
6
  import { IsIntersect } from '../../types/intersect.mjs';
@@ -14,7 +15,8 @@ import { CollapseToObject } from '../object/index.mjs';
14
15
  // ------------------------------------------------------------------
15
16
  // Computed
16
17
  // ------------------------------------------------------------------
17
- import { FromArray } from "./from-array.mjs";
18
+ import { FromAny } from './from-any.mjs';
19
+ import { FromArray } from './from-array.mjs';
18
20
  import { FromObject } from './from-object.mjs';
19
21
  import { FromRecord } from './from-record.mjs';
20
22
  import { FromTuple } from './from-tuple.mjs';
@@ -25,11 +27,12 @@ function NormalizeType(type) {
25
27
  }
26
28
  export function KeyOfAction(type) {
27
29
  const normal = NormalizeType(type);
28
- return (IsArray(normal) ? FromArray(normal.items) :
29
- IsObject(normal) ? FromObject(normal.properties) :
30
- IsRecord(normal) ? FromRecord(normal) :
31
- IsTuple(normal) ? FromTuple(normal.items) :
32
- Never());
30
+ return (IsAny(normal) ? FromAny() :
31
+ IsArray(normal) ? FromArray(normal.items) :
32
+ IsObject(normal) ? FromObject(normal.properties) :
33
+ IsRecord(normal) ? FromRecord(normal) :
34
+ IsTuple(normal) ? FromTuple(normal.items) :
35
+ Never());
33
36
  }
34
37
  export function KeyOfImmediate(context, state, type, options) {
35
38
  const instantiatedType = InstantiateType(context, state, type);
@@ -99,6 +99,8 @@ export type TGenericCallArgumentsMapping<Input extends [unknown, unknown, unknow
99
99
  export declare function GenericCallArgumentsMapping(input: [unknown, unknown, unknown]): unknown;
100
100
  export type TGenericCallMapping<Input extends [unknown, unknown], Result = Input extends [infer Ref extends string, infer Arguments extends T.TSchema[]] ? TIntrinsicOrCall<Ref, Arguments> : never> = Result;
101
101
  export declare function GenericCallMapping(input: [unknown, unknown]): unknown;
102
+ export type TOptionalSemiColonMapping<Input extends [unknown] | []> = null;
103
+ export declare function OptionalSemiColonMapping(input: [unknown] | []): unknown;
102
104
  export type TKeywordStringMapping<Input extends 'string'> = (T.TString);
103
105
  export declare function KeywordStringMapping(input: 'string'): unknown;
104
106
  export type TKeywordNumberMapping<Input extends 'number'> = (T.TNumber);
@@ -267,8 +269,8 @@ export type TMappedOptionalMapping<Input extends [unknown, unknown] | [unknown]
267
269
  export declare function MappedOptionalMapping(input: [unknown, unknown] | [unknown] | []): unknown;
268
270
  export type TMappedAsMapping<Input extends [unknown, unknown] | []> = (Input extends ['as', infer Type extends T.TSchema] ? [Type] : []);
269
271
  export declare function MappedAsMapping(input: [unknown, unknown] | []): unknown;
270
- export type TMappedMapping<Input extends [unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown]> = (Input extends ['{', infer Readonly extends TModifierOperation, '[', infer Key extends string, 'in', infer Union extends T.TSchema, infer As extends T.TSchema[], ']', infer Optional extends TModifierOperation, ':', infer Type extends T.TSchema, '}'] ? (As extends [infer As extends T.TSchema] ? C.TMappedDeferred<T.TIdentifier<Key>, Union, As, TApplyReadonly<Readonly, TApplyOptional<Optional, Type>>> : C.TMappedDeferred<T.TIdentifier<Key>, Union, T.TRef<Key>, TApplyReadonly<Readonly, TApplyOptional<Optional, Type>>>) : never);
271
- export declare function MappedMapping(input: [unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown]): unknown;
272
+ export type TMappedMapping<Input extends [unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown]> = (Input extends ['{', infer Readonly extends TModifierOperation, '[', infer Key extends string, 'in', infer Union extends T.TSchema, infer As extends T.TSchema[], ']', infer Optional extends TModifierOperation, ':', infer Type extends T.TSchema, null, '}'] ? (As extends [infer As extends T.TSchema] ? C.TMappedDeferred<T.TIdentifier<Key>, Union, As, TApplyReadonly<Readonly, TApplyOptional<Optional, Type>>> : C.TMappedDeferred<T.TIdentifier<Key>, Union, T.TRef<Key>, TApplyReadonly<Readonly, TApplyOptional<Optional, Type>>>) : never);
273
+ export declare function MappedMapping(input: [unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown]): unknown;
272
274
  export type TReferenceMapping<Input extends string, Result extends T.TSchema = T.TRef<Input>> = Result;
273
275
  export declare function ReferenceMapping(input: string): unknown;
274
276
  export type TOptionsMapping<Input extends [unknown, unknown, unknown, unknown, unknown, unknown]> = (Input extends ['Options', '<', infer Type extends T.TSchema, ',', infer Options extends T.TSchemaOptions, '>'] ? C.TOptionsDeferred<Type, Options> : never);
@@ -349,8 +351,8 @@ export type TModuleDeclarationDelimiterMapping<Input extends [unknown, unknown]
349
351
  export declare function ModuleDeclarationDelimiterMapping(input: [unknown, unknown] | [unknown]): unknown;
350
352
  export type TModuleDeclarationListMapping<Input extends [unknown, unknown]> = (TPropertiesReduce<TDelimited<Input>>);
351
353
  export declare function ModuleDeclarationListMapping(input: [unknown, unknown]): unknown;
352
- export type TModuleDeclarationMapping<Input extends [unknown, unknown]> = (Input extends [null, infer ModuleDeclaration extends T.TProperties] ? ModuleDeclaration : never);
353
- export declare function ModuleDeclarationMapping(input: [unknown, unknown]): unknown;
354
+ export type TModuleDeclarationMapping<Input extends [unknown, unknown, unknown]> = (Input extends [null, infer ModuleDeclaration extends T.TProperties, null] ? ModuleDeclaration : never);
355
+ export declare function ModuleDeclarationMapping(input: [unknown, unknown, unknown]): unknown;
354
356
  export type TModuleMapping<Input extends [unknown, unknown]> = (Input extends [infer ModuleDeclaration extends T.TProperties, infer ModuleDeclarationList extends [T.TProperties, T.TProperties]] ? C.TModuleDeferred<Memory.TAssign<ModuleDeclaration, ModuleDeclarationList[0]>> : never);
355
357
  export declare function ModuleMapping(input: [unknown, unknown]): unknown;
356
358
  export type TScriptMapping<Input extends unknown> = (Input);
@@ -84,6 +84,9 @@ export function GenericCallArgumentsMapping(input) {
84
84
  export function GenericCallMapping(input) {
85
85
  return IntrinsicOrCall(input[0], input[1]);
86
86
  }
87
+ export function OptionalSemiColonMapping(input) {
88
+ return null;
89
+ }
87
90
  export function KeywordStringMapping(input) {
88
91
  return T.String();
89
92
  }
@@ -12,6 +12,7 @@ export type TGenericCallArgumentList_0<Input extends string, Result extends unkn
12
12
  export type TGenericCallArgumentList<Input extends string> = (TGenericCallArgumentList_0<Input> extends [infer _0, infer Input extends string] ? (((TType<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.TGenericCallArgumentListMapping<_0>, Input] : [];
13
13
  export type TGenericCallArguments<Input extends string> = (Token.TConst<'<', Input> extends [infer _0, infer Input extends string] ? (TGenericCallArgumentList<Input> extends [infer _1, infer Input extends string] ? (Token.TConst<'>', Input> extends [infer _2, infer Input extends string] ? [[_0, _1, _2], Input] : []) : []) : []) extends [infer _0 extends [unknown, unknown, unknown], infer Input extends string] ? [S.TGenericCallArgumentsMapping<_0>, Input] : [];
14
14
  export type TGenericCall<Input extends string> = (Token.TIdent<Input> extends [infer _0, infer Input extends string] ? (TGenericCallArguments<Input> extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : []) : []) extends [infer _0 extends [unknown, unknown], infer Input extends string] ? [S.TGenericCallMapping<_0>, Input] : [];
15
+ export type TOptionalSemiColon<Input extends string> = ((Token.TConst<';', 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.TOptionalSemiColonMapping<_0>, Input] : [];
15
16
  export type TKeywordString<Input extends string> = Token.TConst<'string', Input> extends [infer _0 extends 'string', infer Input extends string] ? [S.TKeywordStringMapping<_0>, Input] : [];
16
17
  export type TKeywordNumber<Input extends string> = Token.TConst<'number', Input> extends [infer _0 extends 'number', infer Input extends string] ? [S.TKeywordNumberMapping<_0>, Input] : [];
17
18
  export type TKeywordBoolean<Input extends string> = Token.TConst<'boolean', Input> extends [infer _0 extends 'boolean', infer Input extends string] ? [S.TKeywordBooleanMapping<_0>, Input] : [];
@@ -86,7 +87,7 @@ export type TConstructor<Input extends string> = (Token.TConst<'new', Input> ext
86
87
  export type TMappedReadonly<Input extends string> = ((Token.TConst<'+', Input> extends [infer _0, infer Input extends string] ? (Token.TConst<'readonly', Input> extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : []) : []) extends [infer _0, infer Input extends string] ? [_0, Input] : (Token.TConst<'-', Input> extends [infer _0, infer Input extends string] ? (Token.TConst<'readonly', Input> extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : []) : []) extends [infer _0, infer Input extends string] ? [_0, Input] : (Token.TConst<'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, unknown] | [unknown] | [], infer Input extends string] ? [S.TMappedReadonlyMapping<_0>, Input] : [];
87
88
  export type TMappedOptional<Input extends string> = ((Token.TConst<'+', Input> extends [infer _0, infer Input extends string] ? (Token.TConst<'?', Input> extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : []) : []) extends [infer _0, infer Input extends string] ? [_0, Input] : (Token.TConst<'-', Input> extends [infer _0, infer Input extends string] ? (Token.TConst<'?', Input> extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : []) : []) extends [infer _0, infer Input extends string] ? [_0, Input] : (Token.TConst<'?', 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, unknown] | [unknown] | [], infer Input extends string] ? [S.TMappedOptionalMapping<_0>, Input] : [];
88
89
  export type TMappedAs<Input extends string> = ((Token.TConst<'as', Input> extends [infer _0, infer Input extends string] ? (TType<Input> extends [infer _1, infer Input extends string] ? [[_0, _1], 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] | [], infer Input extends string] ? [S.TMappedAsMapping<_0>, Input] : [];
89
- export type TMapped<Input extends string> = (Token.TConst<'{', Input> extends [infer _0, infer Input extends string] ? (TMappedReadonly<Input> extends [infer _1, infer Input extends string] ? (Token.TConst<'[', Input> extends [infer _2, infer Input extends string] ? (Token.TIdent<Input> extends [infer _3, infer Input extends string] ? (Token.TConst<'in', Input> extends [infer _4, infer Input extends string] ? (TType<Input> extends [infer _5, infer Input extends string] ? (TMappedAs<Input> extends [infer _6, infer Input extends string] ? (Token.TConst<']', Input> extends [infer _7, infer Input extends string] ? (TMappedOptional<Input> extends [infer _8, infer Input extends string] ? (Token.TConst<':', Input> extends [infer _9, infer Input extends string] ? (TType<Input> extends [infer _10, infer Input extends string] ? (Token.TConst<'}', Input> extends [infer _11, infer Input extends string] ? [[_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11], Input] : []) : []) : []) : []) : []) : []) : []) : []) : []) : []) : []) : []) extends [infer _0 extends [unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TMappedMapping<_0>, Input] : [];
90
+ export type TMapped<Input extends string> = (Token.TConst<'{', Input> extends [infer _0, infer Input extends string] ? (TMappedReadonly<Input> extends [infer _1, infer Input extends string] ? (Token.TConst<'[', Input> extends [infer _2, infer Input extends string] ? (Token.TIdent<Input> extends [infer _3, infer Input extends string] ? (Token.TConst<'in', Input> extends [infer _4, infer Input extends string] ? (TType<Input> extends [infer _5, infer Input extends string] ? (TMappedAs<Input> extends [infer _6, infer Input extends string] ? (Token.TConst<']', Input> extends [infer _7, infer Input extends string] ? (TMappedOptional<Input> extends [infer _8, infer Input extends string] ? (Token.TConst<':', Input> extends [infer _9, infer Input extends string] ? (TType<Input> extends [infer _10, infer Input extends string] ? (TOptionalSemiColon<Input> extends [infer _11, infer Input extends string] ? (Token.TConst<'}', Input> extends [infer _12, infer Input extends string] ? [[_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12], Input] : []) : []) : []) : []) : []) : []) : []) : []) : []) : []) : []) : []) : []) extends [infer _0 extends [unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown], infer Input extends string] ? [S.TMappedMapping<_0>, Input] : [];
90
91
  export type TReference<Input extends string> = Token.TIdent<Input> extends [infer _0 extends string, infer Input extends string] ? [S.TReferenceMapping<_0>, Input] : [];
91
92
  export type TOptions<Input extends string> = (Token.TConst<'Options', Input> extends [infer _0, infer Input extends string] ? (Token.TConst<'<', Input> extends [infer _1, infer Input extends string] ? (TType<Input> extends [infer _2, infer Input extends string] ? (Token.TConst<',', Input> extends [infer _3, infer Input extends string] ? (TJsonObject<Input> extends [infer _4, infer Input extends string] ? (Token.TConst<'>', 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.TOptionsMapping<_0>, Input] : [];
92
93
  export type TJsonNumber<Input extends string> = Token.TNumber<Input> extends [infer _0 extends string, infer Input extends string] ? [S.TJsonNumberMapping<_0>, Input] : [];
@@ -124,7 +125,7 @@ export type TExportKeyword<Input extends string> = ((Token.TConst<'export', Inpu
124
125
  export type TModuleDeclarationDelimiter<Input extends string> = ((Token.TConst<';', Input> extends [infer _0, infer Input extends string] ? (Token.TConst<'\n', Input> extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : []) : []) extends [infer _0, infer Input extends string] ? [_0, Input] : (Token.TConst<';', Input> extends [infer _0, infer Input extends string] ? [[_0], Input] : []) extends [infer _0, infer Input extends string] ? [_0, Input] : (Token.TConst<'\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.TModuleDeclarationDelimiterMapping<_0>, Input] : [];
125
126
  export type TModuleDeclarationList_0<Input extends string, Result extends unknown[] = []> = (TModuleDeclaration<Input> extends [infer _0, infer Input extends string] ? (TModuleDeclarationDelimiter<Input> extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : []) : []) extends [infer _0, infer Input extends string] ? TModuleDeclarationList_0<Input, [...Result, _0]> : [Result, Input];
126
127
  export type TModuleDeclarationList<Input extends string> = (TModuleDeclarationList_0<Input> extends [infer _0, infer Input extends string] ? (((TModuleDeclaration<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.TModuleDeclarationListMapping<_0>, Input] : [];
127
- export type TModuleDeclaration<Input extends string> = (TExportKeyword<Input> extends [infer _0, infer Input extends string] ? ((TInterfaceDeclarationGeneric<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : TInterfaceDeclaration<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : TTypeAliasDeclarationGeneric<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : TTypeAliasDeclaration<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.TModuleDeclarationMapping<_0>, Input] : [];
128
+ export type TModuleDeclaration<Input extends string> = (TExportKeyword<Input> extends [infer _0, infer Input extends string] ? ((TInterfaceDeclarationGeneric<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : TInterfaceDeclaration<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : TTypeAliasDeclarationGeneric<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : TTypeAliasDeclaration<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _1, infer Input extends string] ? (TOptionalSemiColon<Input> extends [infer _2, infer Input extends string] ? [[_0, _1, _2], Input] : []) : []) : []) extends [infer _0 extends [unknown, unknown, unknown], infer Input extends string] ? [S.TModuleDeclarationMapping<_0>, Input] : [];
128
129
  export type TModule<Input extends string> = (TModuleDeclaration<Input> extends [infer _0, infer Input extends string] ? (TModuleDeclarationList<Input> extends [infer _1, infer Input extends string] ? [[_0, _1], Input] : []) : []) extends [infer _0 extends [unknown, unknown], infer Input extends string] ? [S.TModuleMapping<_0>, Input] : [];
129
130
  export type TScript<Input extends string> = (TModule<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : TGenericType<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : TType<Input> extends [infer _0, infer Input extends string] ? [_0, Input] : []) extends [infer _0 extends unknown, infer Input extends string] ? [S.TScriptMapping<_0>, Input] : [];
130
131
  export declare const GenericParameterExtendsEquals: (input: string) => [unknown, string] | [];
@@ -139,6 +140,7 @@ export declare const GenericCallArgumentList_0: (input: string, result?: unknown
139
140
  export declare const GenericCallArgumentList: (input: string) => [unknown, string] | [];
140
141
  export declare const GenericCallArguments: (input: string) => [unknown, string] | [];
141
142
  export declare const GenericCall: (input: string) => [unknown, string] | [];
143
+ export declare const OptionalSemiColon: (input: string) => [unknown, string] | [];
142
144
  export declare const KeywordString: (input: string) => [unknown, string] | [];
143
145
  export declare const KeywordNumber: (input: string) => [unknown, string] | [];
144
146
  export declare const KeywordBoolean: (input: string) => [unknown, string] | [];
@@ -15,6 +15,7 @@ export const GenericCallArgumentList_0 = (input, result = []) => If(If(Type(inpu
15
15
  export const GenericCallArgumentList = (input) => If(If(GenericCallArgumentList_0(input), ([_0, input]) => If(If(If(Type(input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [S.GenericCallArgumentListMapping(_0), input]);
16
16
  export const GenericCallArguments = (input) => If(If(Token.Const('<', input), ([_0, input]) => If(GenericCallArgumentList(input), ([_1, input]) => If(Token.Const('>', input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [S.GenericCallArgumentsMapping(_0), input]);
17
17
  export const GenericCall = (input) => If(If(Token.Ident(input), ([_0, input]) => If(GenericCallArguments(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [S.GenericCallMapping(_0), input]);
18
+ export const OptionalSemiColon = (input) => If(If(If(Token.Const(';', input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.OptionalSemiColonMapping(_0), input]);
18
19
  export const KeywordString = (input) => If(Token.Const('string', input), ([_0, input]) => [S.KeywordStringMapping(_0), input]);
19
20
  export const KeywordNumber = (input) => If(Token.Const('number', input), ([_0, input]) => [S.KeywordNumberMapping(_0), input]);
20
21
  export const KeywordBoolean = (input) => If(Token.Const('boolean', input), ([_0, input]) => [S.KeywordBooleanMapping(_0), input]);
@@ -89,7 +90,7 @@ export const Constructor = (input) => If(If(Token.Const('new', input), ([_0, inp
89
90
  export const MappedReadonly = (input) => If(If(If(Token.Const('+', input), ([_0, input]) => If(Token.Const('readonly', input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If(If(Token.Const('-', input), ([_0, input]) => If(Token.Const('readonly', input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If(If(Token.Const('readonly', input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])))), ([_0, input]) => [S.MappedReadonlyMapping(_0), input]);
90
91
  export const MappedOptional = (input) => If(If(If(Token.Const('+', input), ([_0, input]) => If(Token.Const('?', input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If(If(Token.Const('-', input), ([_0, input]) => If(Token.Const('?', input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If(If(Token.Const('?', input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])))), ([_0, input]) => [S.MappedOptionalMapping(_0), input]);
91
92
  export const MappedAs = (input) => If(If(If(Token.Const('as', input), ([_0, input]) => If(Type(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_0, input]) => [S.MappedAsMapping(_0), input]);
92
- export const Mapped = (input) => If(If(Token.Const('{', input), ([_0, input]) => If(MappedReadonly(input), ([_1, input]) => If(Token.Const('[', input), ([_2, input]) => If(Token.Ident(input), ([_3, input]) => If(Token.Const('in', input), ([_4, input]) => If(Type(input), ([_5, input]) => If(MappedAs(input), ([_6, input]) => If(Token.Const(']', input), ([_7, input]) => If(MappedOptional(input), ([_8, input]) => If(Token.Const(':', input), ([_9, input]) => If(Type(input), ([_10, input]) => If(Token.Const('}', input), ([_11, input]) => [[_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11], input])))))))))))), ([_0, input]) => [S.MappedMapping(_0), input]);
93
+ export const Mapped = (input) => If(If(Token.Const('{', input), ([_0, input]) => If(MappedReadonly(input), ([_1, input]) => If(Token.Const('[', input), ([_2, input]) => If(Token.Ident(input), ([_3, input]) => If(Token.Const('in', input), ([_4, input]) => If(Type(input), ([_5, input]) => If(MappedAs(input), ([_6, input]) => If(Token.Const(']', input), ([_7, input]) => If(MappedOptional(input), ([_8, input]) => If(Token.Const(':', input), ([_9, input]) => If(Type(input), ([_10, input]) => If(OptionalSemiColon(input), ([_11, input]) => If(Token.Const('}', input), ([_12, input]) => [[_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12], input]))))))))))))), ([_0, input]) => [S.MappedMapping(_0), input]);
93
94
  export const Reference = (input) => If(Token.Ident(input), ([_0, input]) => [S.ReferenceMapping(_0), input]);
94
95
  export const Options = (input) => If(If(Token.Const('Options', input), ([_0, input]) => If(Token.Const('<', input), ([_1, input]) => If(Type(input), ([_2, input]) => If(Token.Const(',', input), ([_3, input]) => If(JsonObject(input), ([_4, input]) => If(Token.Const('>', input), ([_5, input]) => [[_0, _1, _2, _3, _4, _5], input])))))), ([_0, input]) => [S.OptionsMapping(_0), input]);
95
96
  export const JsonNumber = (input) => If(Token.Number(input), ([_0, input]) => [S.JsonNumberMapping(_0), input]);
@@ -127,6 +128,6 @@ export const ExportKeyword = (input) => If(If(If(Token.Const('export', input), (
127
128
  export const ModuleDeclarationDelimiter = (input) => If(If(If(Token.Const(';', input), ([_0, input]) => If(Token.Const('\n', input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [_0, input], () => If(If(Token.Const(';', input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If(If(Token.Const('\n', input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => []))), ([_0, input]) => [S.ModuleDeclarationDelimiterMapping(_0), input]);
128
129
  export const ModuleDeclarationList_0 = (input, result = []) => If(If(ModuleDeclaration(input), ([_0, input]) => If(ModuleDeclarationDelimiter(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => ModuleDeclarationList_0(input, [...result, _0]), () => [result, input]);
129
130
  export const ModuleDeclarationList = (input) => If(If(ModuleDeclarationList_0(input), ([_0, input]) => If(If(If(ModuleDeclaration(input), ([_0, input]) => [[_0], input]), ([_0, input]) => [_0, input], () => If([[], input], ([_0, input]) => [_0, input], () => [])), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [S.ModuleDeclarationListMapping(_0), input]);
130
- export const ModuleDeclaration = (input) => If(If(ExportKeyword(input), ([_0, input]) => If(If(InterfaceDeclarationGeneric(input), ([_0, input]) => [_0, input], () => If(InterfaceDeclaration(input), ([_0, input]) => [_0, input], () => If(TypeAliasDeclarationGeneric(input), ([_0, input]) => [_0, input], () => If(TypeAliasDeclaration(input), ([_0, input]) => [_0, input], () => [])))), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [S.ModuleDeclarationMapping(_0), input]);
131
+ export const ModuleDeclaration = (input) => If(If(ExportKeyword(input), ([_0, input]) => If(If(InterfaceDeclarationGeneric(input), ([_0, input]) => [_0, input], () => If(InterfaceDeclaration(input), ([_0, input]) => [_0, input], () => If(TypeAliasDeclarationGeneric(input), ([_0, input]) => [_0, input], () => If(TypeAliasDeclaration(input), ([_0, input]) => [_0, input], () => [])))), ([_1, input]) => If(OptionalSemiColon(input), ([_2, input]) => [[_0, _1, _2], input]))), ([_0, input]) => [S.ModuleDeclarationMapping(_0), input]);
131
132
  export const Module = (input) => If(If(ModuleDeclaration(input), ([_0, input]) => If(ModuleDeclarationList(input), ([_1, input]) => [[_0, _1], input])), ([_0, input]) => [S.ModuleMapping(_0), input]);
132
133
  export const Script = (input) => If(If(Module(input), ([_0, input]) => [_0, input], () => If(GenericType(input), ([_0, input]) => [_0, input], () => If(Type(input), ([_0, input]) => [_0, input], () => []))), ([_0, input]) => [S.ScriptMapping(_0), input]);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "typebox",
3
3
  "description": "A Runtime Type System for JavaScript",
4
- "version": "1.0.34",
4
+ "version": "1.0.35",
5
5
  "keywords": [
6
6
  "typescript",
7
7
  "jsonschema"