@sinclair/typebox 0.32.8 → 0.32.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/build/import/index.d.mts +3 -2
  2. package/build/import/index.mjs +12 -2
  3. package/build/import/type/composite/composite.d.mts +16 -11
  4. package/build/import/type/composite/composite.mjs +36 -9
  5. package/build/import/type/helpers/helpers.d.mts +2 -2
  6. package/build/import/type/keyof/keyof-property-keys.d.mts +5 -7
  7. package/build/import/type/partial/partial.d.mts +2 -4
  8. package/build/import/type/partial/partial.mjs +3 -0
  9. package/build/import/type/required/required.d.mts +2 -3
  10. package/build/import/type/required/required.mjs +3 -0
  11. package/build/import/type/sets/set.d.mts +12 -8
  12. package/build/import/type/sets/set.mjs +14 -4
  13. package/build/import/type/type/json.d.mts +1 -1
  14. package/build/import/type/type/json.mjs +2 -2
  15. package/build/require/index.d.ts +3 -2
  16. package/build/require/index.js +178 -160
  17. package/build/require/type/composite/composite.d.ts +16 -11
  18. package/build/require/type/composite/composite.js +37 -10
  19. package/build/require/type/helpers/helpers.d.ts +2 -2
  20. package/build/require/type/keyof/keyof-property-keys.d.ts +5 -7
  21. package/build/require/type/partial/partial.d.ts +2 -4
  22. package/build/require/type/partial/partial.js +3 -0
  23. package/build/require/type/required/required.d.ts +2 -3
  24. package/build/require/type/required/required.js +3 -0
  25. package/build/require/type/sets/set.d.ts +12 -8
  26. package/build/require/type/sets/set.js +14 -4
  27. package/build/require/type/type/json.d.ts +1 -1
  28. package/build/require/type/type/json.js +2 -2
  29. package/package.json +1 -1
  30. package/readme.md +2 -2
@@ -4,6 +4,8 @@ export { TypeRegistry, FormatRegistry } from './type/registry/index.mjs';
4
4
  export { TypeGuard, ValueGuard } from './type/guard/index.mjs';
5
5
  export { CloneType, CloneRest } from './type/clone/type.mjs';
6
6
  export { TypeBoxError } from './type/error/index.mjs';
7
+ export { SetComplement, SetDistinct, SetIncludes, SetIntersect, SetIntersectMany, SetIsSubset, SetUnion, SetUnionMany, type TSetComplement, type TSetDistinct, type TSetIncludes, type TSetIntersect, type TSetIntersectMany, type TSetIsSubset, type TSetUnion, type TSetUnionMany, } from './type/sets/index.mjs';
8
+ export { Increment, type TIncrement, type Assert, type AssertType, type AssertRest, type AssertProperties, type Ensure, type Evaluate, type TupleToIntersect, type TupleToUnion, type UnionToTuple } from './type/helpers/index.mjs';
7
9
  export { Any, type TAny } from './type/any/index.mjs';
8
10
  export { Array, type TArray, type ArrayOptions } from './type/array/index.mjs';
9
11
  export { AsyncIterator, type TAsyncIterator } from './type/async-iterator/index.mjs';
@@ -21,7 +23,6 @@ export { Exclude, type TExclude, type TExcludeFromMappedResult } from './type/ex
21
23
  export { Extends, ExtendsCheck, ExtendsResult, ExtendsUndefinedCheck, type TExtends, type ExtendsFromMappedResult, type ExtendsFromMappedKey } from './type/extends/index.mjs';
22
24
  export { Extract, type TExtract, type TExtractFromMappedResult } from './type/extract/index.mjs';
23
25
  export { Function, type TFunction } from './type/function/index.mjs';
24
- export { Increment, type Assert, type AssertType, type AssertRest, type AssertProperties, type Ensure, type Evaluate, type TupleToIntersect, type TupleToUnion, type UnionToTuple } from './type/helpers/index.mjs';
25
26
  export { Index, IndexPropertyKeys, IndexFromPropertyKeys, IndexFromPropertyKey, IndexFromMappedKey, IndexFromMappedResult, type TIndex, type TIndexPropertyKeys, type TIndexFromPropertyKeys, type TIndexFromPropertyKey, type TIndexFromMappedKey, type TIndexFromMappedResult, } from './type/indexed/index.mjs';
26
27
  export { InstanceType, type TInstanceType } from './type/instance-type/index.mjs';
27
28
  export { Integer, type TInteger, type IntegerOptions } from './type/integer/index.mjs';
@@ -55,7 +56,7 @@ export { type TSchema, type TKind, type SchemaOptions, type TAnySchema } from '.
55
56
  export { type Static, type StaticDecode, type StaticEncode, type TDecodeType, type TDecodeRest, type TDecodeProperties } from './type/static/index.mjs';
56
57
  export { Strict } from './type/strict/index.mjs';
57
58
  export { String, type TString, type StringOptions, type StringFormatOption, type StringContentEncodingOption } from './type/string/index.mjs';
58
- export { Symbol, type TSymbol, type TSymbolValue as SymbolValue } from './type/symbol/index.mjs';
59
+ export { Symbol, type TSymbol, type TSymbolValue } from './type/symbol/index.mjs';
59
60
  export { TemplateLiteral, TemplateLiteralSyntax, TemplateLiteralGenerate, TemplateLiteralParse, TemplateLiteralParseExact, IsTemplateLiteralFinite, TemplateLiteralExpressionGenerate, IsTemplateLiteralExpressionFinite, type TTemplateLiteral, type TTemplateLiteralSyntax, type TTemplateLiteralGenerate, type TTemplateLiteralKind, type TIsTemplateLiteralFinite, } from './type/template-literal/index.mjs';
60
61
  export { Transform, TransformDecodeBuilder, TransformEncodeBuilder, type TTransform, type TransformOptions, type TransformFunction } from './type/transform/index.mjs';
61
62
  export { Tuple, type TTuple } from './type/tuple/index.mjs';
@@ -6,9 +6,20 @@ export { PatternBoolean, PatternBooleanExact, PatternNumber, PatternNumberExact,
6
6
  export { TypeRegistry, FormatRegistry } from './type/registry/index.mjs';
7
7
  export { TypeGuard, ValueGuard } from './type/guard/index.mjs';
8
8
  export { CloneType, CloneRest } from './type/clone/type.mjs';
9
+ // ------------------------------------------------------------------
10
+ // Error
11
+ // ------------------------------------------------------------------
9
12
  export { TypeBoxError } from './type/error/index.mjs';
10
13
  // ------------------------------------------------------------------
11
- // Type
14
+ // Sets
15
+ // ------------------------------------------------------------------
16
+ export { SetComplement, SetDistinct, SetIncludes, SetIntersect, SetIntersectMany, SetIsSubset, SetUnion, SetUnionMany, } from './type/sets/index.mjs';
17
+ // ------------------------------------------------------------------
18
+ // Helpers
19
+ // ------------------------------------------------------------------
20
+ export { Increment } from './type/helpers/index.mjs';
21
+ // ------------------------------------------------------------------
22
+ // Types
12
23
  // ------------------------------------------------------------------
13
24
  export { Any } from './type/any/index.mjs';
14
25
  export { Array } from './type/array/index.mjs';
@@ -27,7 +38,6 @@ export { Exclude } from './type/exclude/index.mjs';
27
38
  export { Extends, ExtendsCheck, ExtendsResult, ExtendsUndefinedCheck } from './type/extends/index.mjs';
28
39
  export { Extract } from './type/extract/index.mjs';
29
40
  export { Function } from './type/function/index.mjs';
30
- export { Increment } from './type/helpers/index.mjs';
31
41
  export { Index, IndexPropertyKeys, IndexFromPropertyKeys, IndexFromPropertyKey, IndexFromMappedKey, IndexFromMappedResult, } from './type/indexed/index.mjs';
32
42
  export { InstanceType } from './type/instance-type/index.mjs';
33
43
  export { Integer } from './type/integer/index.mjs';
@@ -1,13 +1,18 @@
1
- import type { UnionToTuple, Assert, Ensure, Evaluate } from '../helpers/index.mjs';
1
+ import type { TSchema } from '../schema/index.mjs';
2
+ import type { Evaluate } from '../helpers/index.mjs';
3
+ import { type TIntersectEvaluated } from '../intersect/index.mjs';
4
+ import { type TIndexFromPropertyKeys } from '../indexed/index.mjs';
5
+ import { type TKeyOfPropertyKeys } from '../keyof/index.mjs';
6
+ import { type TNever } from '../never/index.mjs';
2
7
  import { type TObject, type TProperties, type ObjectOptions } from '../object/index.mjs';
3
- import { type TIntersect } from '../intersect/index.mjs';
4
- import { type TIndex } from '../indexed/index.mjs';
5
- type TCompositeKeys<T extends TObject[], Acc extends PropertyKey = never> = T extends [infer L extends TObject, ...infer R extends TObject[]] ? TCompositeKeys<R, Acc | keyof L['properties']> : Acc;
6
- type TCompositeIndex<T extends TIntersect<TObject[]>, K extends string[], Acc extends TProperties = {}> = K extends [infer L extends string, ...infer R extends string[]] ? TCompositeIndex<T, R, Acc & {
7
- [_ in L]: TIndex<T, [L]>;
8
- }> : Acc;
9
- type TCompositeReduce<T extends TObject[]> = UnionToTuple<TCompositeKeys<T>> extends infer K ? Evaluate<TCompositeIndex<TIntersect<T>, Assert<K, string[]>>> : {};
10
- export type TComposite<T extends TObject[]> = TIntersect<T> extends TIntersect ? Ensure<TObject<TCompositeReduce<T>>> : Ensure<TObject<{}>>;
11
- /** `[Json]` Creates a Composite object type */
12
- export declare function Composite<T extends TObject[]>(T: [...T], options?: ObjectOptions): TComposite<T>;
8
+ import { TSetDistinct } from '../sets/index.mjs';
9
+ type TCompositeKeys<T extends TSchema[], Acc extends PropertyKey[] = []> = (T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TCompositeKeys<R, TSetDistinct<[...Acc, ...TKeyOfPropertyKeys<L>]>> : Acc);
10
+ type TFilterNever<T extends TSchema[], Acc extends TSchema[] = []> = (T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? L extends TNever ? Acc : TFilterNever<R, [...Acc, L]> : Acc);
11
+ type TCompositeProperty<T extends TSchema[], K extends PropertyKey, Acc extends TSchema[] = []> = (T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TCompositeProperty<R, K, TFilterNever<[...Acc, ...TIndexFromPropertyKeys<L, [K]>]>> : Acc);
12
+ type TCompositeProperties<T extends TSchema[], K extends PropertyKey[], Acc = {}> = (K extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? TCompositeProperties<T, R, Acc & {
13
+ [_ in L]: TIntersectEvaluated<TCompositeProperty<T, L>>;
14
+ }> : Acc);
15
+ type TCompositeEvaluate<T extends TSchema[], K extends PropertyKey[] = TCompositeKeys<T>, P extends TProperties = Evaluate<TCompositeProperties<T, K>>, R extends TObject = TObject<P>> = R;
16
+ export type TComposite<T extends TSchema[]> = TCompositeEvaluate<T>;
17
+ export declare function Composite<T extends TSchema[]>(T: [...T], options?: ObjectOptions): TComposite<T>;
13
18
  export {};
@@ -1,11 +1,38 @@
1
- import { Object } from '../object/index.mjs';
2
- import { Intersect } from '../intersect/index.mjs';
3
- import { Index } from '../indexed/index.mjs';
1
+ import { IntersectEvaluated } from '../intersect/index.mjs';
2
+ import { IndexFromPropertyKeys } from '../indexed/index.mjs';
4
3
  import { KeyOfPropertyKeys } from '../keyof/index.mjs';
5
- /** `[Json]` Creates a Composite object type */
6
- export function Composite(T, options) {
7
- const intersect = Intersect(T, {});
8
- const keys = KeyOfPropertyKeys(intersect);
9
- const properties = keys.reduce((acc, key) => ({ ...acc, [key]: Index(intersect, [key]) }), {});
10
- return Object(properties, options);
4
+ import { Object } from '../object/index.mjs';
5
+ import { SetDistinct } from '../sets/index.mjs';
6
+ // ------------------------------------------------------------------
7
+ // TypeGuard
8
+ // ------------------------------------------------------------------
9
+ import { IsNever } from '../guard/type.mjs';
10
+ // prettier-ignore
11
+ function CompositeKeys(T) {
12
+ return T.reduce((Acc, L) => {
13
+ return SetDistinct([...Acc, ...KeyOfPropertyKeys(L)]);
14
+ }, []);
15
+ }
16
+ // prettier-ignore
17
+ function FilterNever(T) {
18
+ return T.filter(L => !IsNever(L));
19
+ }
20
+ // prettier-ignore
21
+ function CompositeProperty(T, K) {
22
+ return T.reduce((Acc, L) => {
23
+ return FilterNever([...Acc, ...IndexFromPropertyKeys(L, [K])]);
24
+ }, []);
25
+ }
26
+ // prettier-ignore
27
+ function CompositeProperties(T, K) {
28
+ return K.reduce((Acc, L) => {
29
+ return { ...Acc, [L]: IntersectEvaluated(CompositeProperty(T, L)) };
30
+ }, {});
31
+ }
32
+ // prettier-ignore
33
+ export function Composite(T, options = {}) {
34
+ const K = CompositeKeys(T);
35
+ const P = CompositeProperties(T, K);
36
+ const R = Object(P, options);
37
+ return R;
11
38
  }
@@ -33,9 +33,9 @@ type IncrementBase = {
33
33
  type IncrementTake<T extends keyof IncrementBase> = IncrementBase[T];
34
34
  type IncrementStep<T extends string> = T extends IncrementBase['m'] ? IncrementBase['t'] : T extends `${infer L extends keyof IncrementBase}${infer R}` ? L extends IncrementBase['m'] ? `${IncrementTake<L>}${IncrementStep<R>}` : `${IncrementTake<L>}${R}` : never;
35
35
  type IncrementReverse<T extends string> = T extends `${infer L}${infer R}` ? `${IncrementReverse<R>}${L}` : T;
36
- export type Increment<T extends string> = IncrementReverse<IncrementStep<IncrementReverse<T>>>;
36
+ export type TIncrement<T extends string> = IncrementReverse<IncrementStep<IncrementReverse<T>>>;
37
37
  /** Increments the given string value + 1 */
38
- export declare function Increment<T extends string>(T: T): Increment<T>;
38
+ export declare function Increment<T extends string>(T: T): TIncrement<T>;
39
39
  export type AssertProperties<T> = T extends TProperties ? T : TProperties;
40
40
  export type AssertRest<T, E extends TSchema[] = TSchema[]> = T extends E ? T : [];
41
41
  export type AssertType<T, E extends TSchema = TSchema> = T extends E ? T : TNever;
@@ -1,5 +1,5 @@
1
1
  import type { TSchema } from '../schema/index.mjs';
2
- import { type ZeroString, type UnionToTuple, Increment } from '../helpers/index.mjs';
2
+ import { type ZeroString, type UnionToTuple, type TIncrement } from '../helpers/index.mjs';
3
3
  import type { TRecursive } from '../recursive/index.mjs';
4
4
  import type { TIntersect } from '../intersect/index.mjs';
5
5
  import type { TUnion } from '../union/index.mjs';
@@ -8,16 +8,14 @@ import type { TArray } from '../array/index.mjs';
8
8
  import type { TObject, TProperties } from '../object/index.mjs';
9
9
  import { type TSetUnionMany, type TSetIntersectMany } from '../sets/index.mjs';
10
10
  type TFromRest<T extends TSchema[], Acc extends PropertyKey[][] = []> = (T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TFromRest<R, [...Acc, TKeyOfPropertyKeys<L>]> : Acc);
11
- type FromIntersect<T extends TSchema[], C extends PropertyKey[][] = TFromRest<T>, R extends PropertyKey[] = TSetUnionMany<C>> = R;
12
- declare function FromIntersect<T extends TSchema[]>(T: [...T]): FromIntersect<T>;
13
- type FromUnion<T extends TSchema[], C extends PropertyKey[][] = TFromRest<T>, R extends PropertyKey[] = TSetIntersectMany<C>> = R;
14
- declare function FromUnion<T extends TSchema[]>(T: [...T]): FromUnion<T>;
15
- type TFromTuple<T extends TSchema[], I extends string = ZeroString, Acc extends PropertyKey[] = []> = T extends [infer _ extends TSchema, ...infer R extends TSchema[]] ? TFromTuple<R, Increment<I>, [...Acc, I]> : Acc;
11
+ type TFromIntersect<T extends TSchema[], C extends PropertyKey[][] = TFromRest<T>, R extends PropertyKey[] = TSetUnionMany<C>> = R;
12
+ type TFromUnion<T extends TSchema[], C extends PropertyKey[][] = TFromRest<T>, R extends PropertyKey[] = TSetIntersectMany<C>> = R;
13
+ type TFromTuple<T extends TSchema[], I extends string = ZeroString, Acc extends PropertyKey[] = []> = T extends [infer _ extends TSchema, ...infer R extends TSchema[]] ? TFromTuple<R, TIncrement<I>, [...Acc, I]> : Acc;
16
14
  type TFromArray<_ extends TSchema> = ([
17
15
  '[number]'
18
16
  ]);
19
17
  type TFromProperties<T extends TProperties> = (UnionToTuple<keyof T>);
20
- export type TKeyOfPropertyKeys<T extends TSchema> = (T extends TRecursive<infer S> ? TKeyOfPropertyKeys<S> : T extends TIntersect<infer S> ? FromIntersect<S> : T extends TUnion<infer S> ? FromUnion<S> : T extends TTuple<infer S> ? TFromTuple<S> : T extends TArray<infer S> ? TFromArray<S> : T extends TObject<infer S> ? TFromProperties<S> : [
18
+ export type TKeyOfPropertyKeys<T extends TSchema> = (T extends TRecursive<infer S> ? TKeyOfPropertyKeys<S> : T extends TIntersect<infer S> ? TFromIntersect<S> : T extends TUnion<infer S> ? TFromUnion<S> : T extends TTuple<infer S> ? TFromTuple<S> : T extends TArray<infer S> ? TFromArray<S> : T extends TObject<infer S> ? TFromProperties<S> : [
21
19
  ]);
22
20
  /** Returns a tuple of PropertyKeys derived from the given TSchema. */
23
21
  export declare function KeyOfPropertyKeys<T extends TSchema>(T: T): TKeyOfPropertyKeys<T>;
@@ -9,13 +9,11 @@ import { type TObject, type TProperties } from '../object/index.mjs';
9
9
  import { type TIntersect } from '../intersect/index.mjs';
10
10
  import { type TUnion } from '../union/index.mjs';
11
11
  import { type TPartialFromMappedResult } from './partial-from-mapped-result.mjs';
12
- type TFromRest<T extends TSchema[], Acc extends TSchema[] = []> = (T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TFromRest<R, [...Acc, PartialResolve<L>]> : Acc);
12
+ type TFromRest<T extends TSchema[], Acc extends TSchema[] = []> = (T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TFromRest<R, [...Acc, TPartial<L>]> : Acc);
13
13
  type TFromProperties<T extends TProperties> = Evaluate<{
14
14
  [K in keyof T]: T[K] extends (TReadonlyOptional<infer S>) ? TReadonlyOptional<S> : T[K] extends (TReadonly<infer S>) ? TReadonlyOptional<S> : T[K] extends (TOptional<infer S>) ? TOptional<S> : TOptional<T[K]>;
15
15
  }>;
16
- type PartialResolve<T extends TSchema> = (T extends TRecursive<infer S> ? TRecursive<PartialResolve<S>> : T extends TIntersect<infer S> ? TIntersect<TFromRest<S>> : T extends TUnion<infer S> ? TUnion<TFromRest<S>> : T extends TObject<infer S> ? TObject<TFromProperties<S>> : TObject<{}>);
17
- declare function PartialResolve<T extends TSchema>(T: T): PartialResolve<T>;
18
- export type TPartial<T extends TSchema> = PartialResolve<T>;
16
+ export type TPartial<T extends TSchema> = (T extends TRecursive<infer S> ? TRecursive<TPartial<S>> : T extends TIntersect<infer S> ? TIntersect<TFromRest<S>> : T extends TUnion<infer S> ? TUnion<TFromRest<S>> : T extends TObject<infer S> ? TObject<TFromProperties<S>> : TObject<{}>);
19
17
  /** `[Json]` Constructs a type where all properties are optional */
20
18
  export declare function Partial<T extends TMappedResult>(T: T, options?: SchemaOptions): TPartialFromMappedResult<T>;
21
19
  /** `[Json]` Constructs a type where all properties are optional */
@@ -20,6 +20,9 @@ function FromProperties(T) {
20
20
  return { ...Acc, [K]: Optional(T[K]) };
21
21
  }, {});
22
22
  }
23
+ // ------------------------------------------------------------------
24
+ // PartialResolve
25
+ // ------------------------------------------------------------------
23
26
  // prettier-ignore
24
27
  function PartialResolve(T) {
25
28
  return (IsIntersect(T) ? Intersect(FromRest(T.allOf)) :
@@ -9,12 +9,11 @@ import { type TIntersect } from '../intersect/index.mjs';
9
9
  import { type TUnion } from '../union/index.mjs';
10
10
  import { type TObject, type TProperties } from '../object/index.mjs';
11
11
  import { type TRequiredFromMappedResult } from './required-from-mapped-result.mjs';
12
- type TFromRest<T extends TSchema[], Acc extends TSchema[] = []> = (T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TFromRest<R, [...Acc, TRequiredResolve<L>]> : Acc);
12
+ type TFromRest<T extends TSchema[], Acc extends TSchema[] = []> = (T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TFromRest<R, [...Acc, TRequired<L>]> : Acc);
13
13
  type TFromProperties<T extends TProperties> = Evaluate<{
14
14
  [K in keyof T]: T[K] extends (TReadonlyOptional<infer S>) ? TReadonly<S> : T[K] extends (TReadonly<infer S>) ? TReadonly<S> : T[K] extends (TOptional<infer S>) ? S : T[K];
15
15
  }>;
16
- type TRequiredResolve<T extends TSchema> = (T extends TRecursive<infer S> ? TRecursive<TRequiredResolve<S>> : T extends TIntersect<infer S> ? TIntersect<TFromRest<S>> : T extends TUnion<infer S> ? TUnion<TFromRest<S>> : T extends TObject<infer S> ? TObject<TFromProperties<S>> : TObject<{}>);
17
- export type TRequired<T extends TSchema> = TRequiredResolve<T>;
16
+ export type TRequired<T extends TSchema> = (T extends TRecursive<infer S> ? TRecursive<TRequired<S>> : T extends TIntersect<infer S> ? TIntersect<TFromRest<S>> : T extends TUnion<infer S> ? TUnion<TFromRest<S>> : T extends TObject<infer S> ? TObject<TFromProperties<S>> : TObject<{}>);
18
17
  /** `[Json]` Constructs a type where all properties are required */
19
18
  export declare function Required<T extends TMappedResult>(T: T, options?: SchemaOptions): TRequiredFromMappedResult<T>;
20
19
  /** `[Json]` Constructs a type where all properties are required */
@@ -19,6 +19,9 @@ function FromProperties(T) {
19
19
  return { ...Acc, [K]: Discard(T[K], [OptionalKind]) };
20
20
  }, {});
21
21
  }
22
+ // ------------------------------------------------------------------
23
+ // RequiredResolve
24
+ // ------------------------------------------------------------------
22
25
  // prettier-ignore
23
26
  function RequiredResolve(T) {
24
27
  return (IsIntersect(T) ? Intersect(FromRest(T.allOf)) :
@@ -1,24 +1,28 @@
1
1
  export type TSetIncludes<T extends PropertyKey[], S extends PropertyKey> = (T extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? S extends L ? true : TSetIncludes<R, S> : false);
2
- /** Returns true if element S is in the set of T */
2
+ /** Returns true if element right is in the set of left */
3
3
  export declare function SetIncludes<T extends PropertyKey[], S extends PropertyKey>(T: [...T], S: S): TSetIncludes<T, S>;
4
- export type SetIsSubset<T extends PropertyKey[], S extends PropertyKey[]> = (T extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? TSetIncludes<S, L> extends true ? SetIsSubset<R, S> : false : true);
5
- /** Returns true if T is a subset of S */
6
- export declare function SetIsSubset<T extends PropertyKey[], S extends PropertyKey[]>(T: [...T], S: [...S]): SetIsSubset<T, S>;
4
+ export type TSetIsSubset<T extends PropertyKey[], S extends PropertyKey[]> = (T extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? TSetIncludes<S, L> extends true ? TSetIsSubset<R, S> : false : true);
5
+ /** Returns true if left is a subset of right */
6
+ export declare function SetIsSubset<T extends PropertyKey[], S extends PropertyKey[]>(T: [...T], S: [...S]): TSetIsSubset<T, S>;
7
7
  export type TSetDistinct<T extends PropertyKey[], Acc extends PropertyKey[] = []> = T extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? TSetIncludes<Acc, L> extends false ? TSetDistinct<R, [...Acc, L]> : TSetDistinct<R, [...Acc]> : Acc;
8
8
  /** Returns a distinct set of elements */
9
9
  export declare function SetDistinct<T extends PropertyKey[]>(T: [...T]): TSetDistinct<T>;
10
- export type TSetIntersect<T extends PropertyKey[], S extends PropertyKey[], Acc extends PropertyKey[] = []> = (T extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? TSetIncludes<S, L> extends true ? TSetIntersect<R, S, [L, ...Acc]> : TSetIntersect<R, S, [...Acc]> : Acc);
10
+ export type TSetIntersect<T extends PropertyKey[], S extends PropertyKey[], Acc extends PropertyKey[] = []> = (T extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? TSetIncludes<S, L> extends true ? TSetIntersect<R, S, [...Acc, L]> : TSetIntersect<R, S, [...Acc]> : Acc);
11
11
  /** Returns the Intersect of the given sets */
12
12
  export declare function SetIntersect<T extends PropertyKey[], S extends PropertyKey[]>(T: [...T], S: [...S]): TSetIntersect<T, S>;
13
- export type TSetUnion<T extends PropertyKey[], S extends PropertyKey[], Acc extends PropertyKey[] = S> = (T extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? TSetUnion<R, S, [...Acc, L]> : Acc);
13
+ export type TSetUnion<T extends PropertyKey[], S extends PropertyKey[]> = ([
14
+ ...T,
15
+ ...S
16
+ ]);
14
17
  /** Returns the Union of the given sets */
15
18
  export declare function SetUnion<T extends PropertyKey[], S extends PropertyKey[]>(T: [...T], S: [...S]): TSetUnion<T, S>;
16
19
  export type TSetComplement<T extends PropertyKey[], S extends PropertyKey[], Acc extends PropertyKey[] = []> = (T extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? TSetIncludes<S, L> extends true ? TSetComplement<R, S, [...Acc]> : TSetComplement<R, S, [...Acc, L]> : Acc);
17
20
  /** Returns the Complement by omitting elements in T that are in S */
18
21
  export declare function SetComplement<T extends PropertyKey[], S extends PropertyKey[]>(T: [...T], S: [...S]): TSetComplement<T, S>;
19
- export type TSetIntersectMany<T extends PropertyKey[][], Acc extends PropertyKey[] = []> = (T extends [infer L extends PropertyKey[]] ? L : T extends [infer L extends PropertyKey[], ...infer R extends PropertyKey[][]] ? TSetIntersectMany<R, TSetIntersect<Acc, L>> : Acc);
20
- /** Returns the Intersect of multiple sets */
22
+ type TSetIntersectManyResolve<T extends PropertyKey[][], Acc extends PropertyKey[]> = (T extends [infer L extends PropertyKey[], ...infer R extends PropertyKey[][]] ? TSetIntersectManyResolve<R, TSetIntersect<Acc, L>> : Acc);
23
+ export type TSetIntersectMany<T extends PropertyKey[][]> = (T extends [infer L extends PropertyKey[]] ? L : T extends [infer L extends PropertyKey[], ...infer R extends PropertyKey[][]] ? TSetIntersectManyResolve<R, L> : []);
21
24
  export declare function SetIntersectMany<T extends PropertyKey[][]>(T: [...T]): TSetIntersectMany<T>;
22
25
  export type TSetUnionMany<T extends PropertyKey[][], Acc extends PropertyKey[] = []> = (T extends [infer L extends PropertyKey[], ...infer R extends PropertyKey[][]] ? TSetUnionMany<R, TSetUnion<Acc, L>> : Acc);
23
26
  /** Returns the Union of multiple sets */
24
27
  export declare function SetUnionMany<T extends PropertyKey[][]>(T: [...T]): TSetUnionMany<T>;
28
+ export {};
@@ -1,9 +1,9 @@
1
- /** Returns true if element S is in the set of T */
1
+ /** Returns true if element right is in the set of left */
2
2
  // prettier-ignore
3
3
  export function SetIncludes(T, S) {
4
4
  return T.includes(S);
5
5
  }
6
- /** Returns true if T is a subset of S */
6
+ /** Returns true if left is a subset of right */
7
7
  export function SetIsSubset(T, S) {
8
8
  return T.every((L) => SetIncludes(S, L));
9
9
  }
@@ -24,10 +24,20 @@ export function SetUnion(T, S) {
24
24
  export function SetComplement(T, S) {
25
25
  return T.filter(L => !S.includes(L));
26
26
  }
27
- /** Returns the Intersect of multiple sets */
27
+ // prettier-ignore
28
+ function SetIntersectManyResolve(T, Init) {
29
+ return T.reduce((Acc, L) => {
30
+ return SetIntersect(Acc, L);
31
+ }, Init);
32
+ }
28
33
  // prettier-ignore
29
34
  export function SetIntersectMany(T) {
30
- return (T.length === 1 ? T[0] : T.reduce((Acc, L) => [...SetIntersect(Acc, L)], []));
35
+ return (T.length === 1
36
+ ? T[0]
37
+ // Use left to initialize the accumulator for resolve
38
+ : T.length > 1
39
+ ? SetIntersectManyResolve(T.slice(1), T[0])
40
+ : []);
31
41
  }
32
42
  /** Returns the Union of multiple sets */
33
43
  export function SetUnionMany(T) {
@@ -71,7 +71,7 @@ export declare class JsonTypeBuilder {
71
71
  /** `[Json]` Intrinsic function to Capitalize LiteralString types */
72
72
  Capitalize<T extends TSchema>(schema: T, options?: SchemaOptions): TCapitalize<T>;
73
73
  /** `[Json]` Creates a Composite object type */
74
- Composite<T extends TObject[]>(objects: [...T], options?: ObjectOptions): TComposite<T>;
74
+ Composite<T extends TSchema[]>(schemas: [...T], options?: ObjectOptions): TComposite<T>;
75
75
  /** `[JavaScript]` Creates a readonly const type from the given value. */
76
76
  Const</* const (not supported in 4.0) */ T>(value: T, options?: SchemaOptions): TConst<T>;
77
77
  /** `[Json]` Creates a dereferenced type */
@@ -83,8 +83,8 @@ export class JsonTypeBuilder {
83
83
  return Capitalize(schema, options);
84
84
  }
85
85
  /** `[Json]` Creates a Composite object type */
86
- Composite(objects, options) {
87
- return Composite(objects, options); // (error) TS 5.4.0-dev - review TComposite implementation
86
+ Composite(schemas, options) {
87
+ return Composite(schemas, options); // (error) TS 5.4.0-dev - review TComposite implementation
88
88
  }
89
89
  /** `[JavaScript]` Creates a readonly const type from the given value. */
90
90
  Const(value, options = {}) {
@@ -4,6 +4,8 @@ export { TypeRegistry, FormatRegistry } from './type/registry/index';
4
4
  export { TypeGuard, ValueGuard } from './type/guard/index';
5
5
  export { CloneType, CloneRest } from './type/clone/type';
6
6
  export { TypeBoxError } from './type/error/index';
7
+ export { SetComplement, SetDistinct, SetIncludes, SetIntersect, SetIntersectMany, SetIsSubset, SetUnion, SetUnionMany, type TSetComplement, type TSetDistinct, type TSetIncludes, type TSetIntersect, type TSetIntersectMany, type TSetIsSubset, type TSetUnion, type TSetUnionMany, } from './type/sets/index';
8
+ export { Increment, type TIncrement, type Assert, type AssertType, type AssertRest, type AssertProperties, type Ensure, type Evaluate, type TupleToIntersect, type TupleToUnion, type UnionToTuple } from './type/helpers/index';
7
9
  export { Any, type TAny } from './type/any/index';
8
10
  export { Array, type TArray, type ArrayOptions } from './type/array/index';
9
11
  export { AsyncIterator, type TAsyncIterator } from './type/async-iterator/index';
@@ -21,7 +23,6 @@ export { Exclude, type TExclude, type TExcludeFromMappedResult } from './type/ex
21
23
  export { Extends, ExtendsCheck, ExtendsResult, ExtendsUndefinedCheck, type TExtends, type ExtendsFromMappedResult, type ExtendsFromMappedKey } from './type/extends/index';
22
24
  export { Extract, type TExtract, type TExtractFromMappedResult } from './type/extract/index';
23
25
  export { Function, type TFunction } from './type/function/index';
24
- export { Increment, type Assert, type AssertType, type AssertRest, type AssertProperties, type Ensure, type Evaluate, type TupleToIntersect, type TupleToUnion, type UnionToTuple } from './type/helpers/index';
25
26
  export { Index, IndexPropertyKeys, IndexFromPropertyKeys, IndexFromPropertyKey, IndexFromMappedKey, IndexFromMappedResult, type TIndex, type TIndexPropertyKeys, type TIndexFromPropertyKeys, type TIndexFromPropertyKey, type TIndexFromMappedKey, type TIndexFromMappedResult, } from './type/indexed/index';
26
27
  export { InstanceType, type TInstanceType } from './type/instance-type/index';
27
28
  export { Integer, type TInteger, type IntegerOptions } from './type/integer/index';
@@ -55,7 +56,7 @@ export { type TSchema, type TKind, type SchemaOptions, type TAnySchema } from '.
55
56
  export { type Static, type StaticDecode, type StaticEncode, type TDecodeType, type TDecodeRest, type TDecodeProperties } from './type/static/index';
56
57
  export { Strict } from './type/strict/index';
57
58
  export { String, type TString, type StringOptions, type StringFormatOption, type StringContentEncodingOption } from './type/string/index';
58
- export { Symbol, type TSymbol, type TSymbolValue as SymbolValue } from './type/symbol/index';
59
+ export { Symbol, type TSymbol, type TSymbolValue } from './type/symbol/index';
59
60
  export { TemplateLiteral, TemplateLiteralSyntax, TemplateLiteralGenerate, TemplateLiteralParse, TemplateLiteralParseExact, IsTemplateLiteralFinite, TemplateLiteralExpressionGenerate, IsTemplateLiteralExpressionFinite, type TTemplateLiteral, type TTemplateLiteralSyntax, type TTemplateLiteralGenerate, type TTemplateLiteralKind, type TIsTemplateLiteralFinite, } from './type/template-literal/index';
60
61
  export { Transform, TransformDecodeBuilder, TransformEncodeBuilder, type TTransform, type TransformOptions, type TransformFunction } from './type/transform/index';
61
62
  export { Tuple, type TTuple } from './type/tuple/index';
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.Iterator = exports.IntersectEvaluated = exports.Intersect = exports.Integer = exports.InstanceType = exports.IndexFromMappedResult = exports.IndexFromMappedKey = exports.IndexFromPropertyKey = exports.IndexFromPropertyKeys = exports.IndexPropertyKeys = exports.Index = exports.Increment = exports.Function = exports.Extract = exports.ExtendsUndefinedCheck = exports.ExtendsResult = exports.ExtendsCheck = exports.Extends = exports.Exclude = exports.Enum = exports.Deref = exports.Date = exports.ConstructorParameters = exports.Constructor = exports.Const = exports.Composite = exports.Boolean = exports.BigInt = exports.Awaited = exports.AsyncIterator = exports.Array = exports.Any = exports.TypeBoxError = exports.CloneRest = exports.CloneType = exports.ValueGuard = exports.TypeGuard = exports.FormatRegistry = exports.TypeRegistry = exports.PatternStringExact = exports.PatternString = exports.PatternNumberExact = exports.PatternNumber = exports.PatternBooleanExact = exports.PatternBoolean = exports.TransformKind = exports.OptionalKind = exports.ReadonlyKind = exports.Hint = exports.Kind = void 0;
5
- exports.IsTemplateLiteralExpressionFinite = exports.TemplateLiteralExpressionGenerate = exports.IsTemplateLiteralFinite = exports.TemplateLiteralParseExact = exports.TemplateLiteralParse = exports.TemplateLiteralGenerate = exports.TemplateLiteralSyntax = exports.TemplateLiteral = exports.Symbol = exports.String = exports.Strict = exports.ReturnType = exports.Rest = exports.Required = exports.RegExp = exports.Ref = exports.Recursive = exports.Record = exports.ReadonlyOptional = exports.ReadonlyFromMappedResult = exports.Readonly = exports.Promise = exports.Pick = exports.PartialFromMappedResult = exports.Partial = exports.Parameters = exports.OptionalFromMappedResult = exports.Optional = exports.Omit = exports.Object = exports.Number = exports.Null = exports.Not = exports.Never = exports.MappedFunctionReturnType = exports.MappedResult = exports.MappedKey = exports.Mapped = exports.Literal = exports.KeyOfPattern = exports.KeyOfFromMappedResult = exports.KeyOfPropertyKeysToRest = exports.KeyOfPropertyKeys = exports.KeyOf = exports.Uppercase = exports.Uncapitalize = exports.Lowercase = exports.Capitalize = exports.IntrinsicFromMappedKey = exports.Intrinsic = void 0;
6
- exports.JavaScriptTypeBuilder = exports.JsonTypeBuilder = exports.Type = exports.Void = exports.Unsafe = exports.Unknown = exports.UnionEvaluated = exports.Union = exports.Undefined = exports.Uint8Array = exports.Tuple = exports.TransformEncodeBuilder = exports.TransformDecodeBuilder = exports.Transform = void 0;
4
+ exports.IndexFromPropertyKeys = exports.IndexPropertyKeys = exports.Index = exports.Function = exports.Extract = exports.ExtendsUndefinedCheck = exports.ExtendsResult = exports.ExtendsCheck = exports.Extends = exports.Exclude = exports.Enum = exports.Deref = exports.Date = exports.ConstructorParameters = exports.Constructor = exports.Const = exports.Composite = exports.Boolean = exports.BigInt = exports.Awaited = exports.AsyncIterator = exports.Array = exports.Any = exports.Increment = exports.SetUnionMany = exports.SetUnion = exports.SetIsSubset = exports.SetIntersectMany = exports.SetIntersect = exports.SetIncludes = exports.SetDistinct = exports.SetComplement = exports.TypeBoxError = exports.CloneRest = exports.CloneType = exports.ValueGuard = exports.TypeGuard = exports.FormatRegistry = exports.TypeRegistry = exports.PatternStringExact = exports.PatternString = exports.PatternNumberExact = exports.PatternNumber = exports.PatternBooleanExact = exports.PatternBoolean = exports.TransformKind = exports.OptionalKind = exports.ReadonlyKind = exports.Hint = exports.Kind = void 0;
5
+ exports.Symbol = exports.String = exports.Strict = exports.ReturnType = exports.Rest = exports.Required = exports.RegExp = exports.Ref = exports.Recursive = exports.Record = exports.ReadonlyOptional = exports.ReadonlyFromMappedResult = exports.Readonly = exports.Promise = exports.Pick = exports.PartialFromMappedResult = exports.Partial = exports.Parameters = exports.OptionalFromMappedResult = exports.Optional = exports.Omit = exports.Object = exports.Number = exports.Null = exports.Not = exports.Never = exports.MappedFunctionReturnType = exports.MappedResult = exports.MappedKey = exports.Mapped = exports.Literal = exports.KeyOfPattern = exports.KeyOfFromMappedResult = exports.KeyOfPropertyKeysToRest = exports.KeyOfPropertyKeys = exports.KeyOf = exports.Uppercase = exports.Uncapitalize = exports.Lowercase = exports.Capitalize = exports.IntrinsicFromMappedKey = exports.Intrinsic = exports.Iterator = exports.IntersectEvaluated = exports.Intersect = exports.Integer = exports.InstanceType = exports.IndexFromMappedResult = exports.IndexFromMappedKey = exports.IndexFromPropertyKey = void 0;
6
+ exports.JavaScriptTypeBuilder = exports.JsonTypeBuilder = exports.Type = exports.Void = exports.Unsafe = exports.Unknown = exports.UnionEvaluated = exports.Union = exports.Undefined = exports.Uint8Array = exports.Tuple = exports.TransformEncodeBuilder = exports.TransformDecodeBuilder = exports.Transform = exports.IsTemplateLiteralExpressionFinite = exports.TemplateLiteralExpressionGenerate = exports.IsTemplateLiteralFinite = exports.TemplateLiteralParseExact = exports.TemplateLiteralParse = exports.TemplateLiteralGenerate = exports.TemplateLiteralSyntax = exports.TemplateLiteral = void 0;
7
7
  // ------------------------------------------------------------------
8
8
  // Infrastructure
9
9
  // ------------------------------------------------------------------
@@ -29,167 +29,185 @@ Object.defineProperty(exports, "ValueGuard", { enumerable: true, get: function (
29
29
  var type_1 = require("./type/clone/type");
30
30
  Object.defineProperty(exports, "CloneType", { enumerable: true, get: function () { return type_1.CloneType; } });
31
31
  Object.defineProperty(exports, "CloneRest", { enumerable: true, get: function () { return type_1.CloneRest; } });
32
+ // ------------------------------------------------------------------
33
+ // Error
34
+ // ------------------------------------------------------------------
32
35
  var index_5 = require("./type/error/index");
33
36
  Object.defineProperty(exports, "TypeBoxError", { enumerable: true, get: function () { return index_5.TypeBoxError; } });
34
37
  // ------------------------------------------------------------------
35
- // Type
38
+ // Sets
39
+ // ------------------------------------------------------------------
40
+ var index_6 = require("./type/sets/index");
41
+ Object.defineProperty(exports, "SetComplement", { enumerable: true, get: function () { return index_6.SetComplement; } });
42
+ Object.defineProperty(exports, "SetDistinct", { enumerable: true, get: function () { return index_6.SetDistinct; } });
43
+ Object.defineProperty(exports, "SetIncludes", { enumerable: true, get: function () { return index_6.SetIncludes; } });
44
+ Object.defineProperty(exports, "SetIntersect", { enumerable: true, get: function () { return index_6.SetIntersect; } });
45
+ Object.defineProperty(exports, "SetIntersectMany", { enumerable: true, get: function () { return index_6.SetIntersectMany; } });
46
+ Object.defineProperty(exports, "SetIsSubset", { enumerable: true, get: function () { return index_6.SetIsSubset; } });
47
+ Object.defineProperty(exports, "SetUnion", { enumerable: true, get: function () { return index_6.SetUnion; } });
48
+ Object.defineProperty(exports, "SetUnionMany", { enumerable: true, get: function () { return index_6.SetUnionMany; } });
49
+ // ------------------------------------------------------------------
50
+ // Helpers
51
+ // ------------------------------------------------------------------
52
+ var index_7 = require("./type/helpers/index");
53
+ Object.defineProperty(exports, "Increment", { enumerable: true, get: function () { return index_7.Increment; } });
54
+ // ------------------------------------------------------------------
55
+ // Types
36
56
  // ------------------------------------------------------------------
37
- var index_6 = require("./type/any/index");
38
- Object.defineProperty(exports, "Any", { enumerable: true, get: function () { return index_6.Any; } });
39
- var index_7 = require("./type/array/index");
40
- Object.defineProperty(exports, "Array", { enumerable: true, get: function () { return index_7.Array; } });
41
- var index_8 = require("./type/async-iterator/index");
42
- Object.defineProperty(exports, "AsyncIterator", { enumerable: true, get: function () { return index_8.AsyncIterator; } });
43
- var index_9 = require("./type/awaited/index");
44
- Object.defineProperty(exports, "Awaited", { enumerable: true, get: function () { return index_9.Awaited; } });
45
- var index_10 = require("./type/bigint/index");
46
- Object.defineProperty(exports, "BigInt", { enumerable: true, get: function () { return index_10.BigInt; } });
47
- var index_11 = require("./type/boolean/index");
48
- Object.defineProperty(exports, "Boolean", { enumerable: true, get: function () { return index_11.Boolean; } });
49
- var index_12 = require("./type/composite/index");
50
- Object.defineProperty(exports, "Composite", { enumerable: true, get: function () { return index_12.Composite; } });
51
- var index_13 = require("./type/const/index");
52
- Object.defineProperty(exports, "Const", { enumerable: true, get: function () { return index_13.Const; } });
53
- var index_14 = require("./type/constructor/index");
54
- Object.defineProperty(exports, "Constructor", { enumerable: true, get: function () { return index_14.Constructor; } });
55
- var index_15 = require("./type/constructor-parameters/index");
56
- Object.defineProperty(exports, "ConstructorParameters", { enumerable: true, get: function () { return index_15.ConstructorParameters; } });
57
- var index_16 = require("./type/date/index");
58
- Object.defineProperty(exports, "Date", { enumerable: true, get: function () { return index_16.Date; } });
59
- var index_17 = require("./type/deref/index");
60
- Object.defineProperty(exports, "Deref", { enumerable: true, get: function () { return index_17.Deref; } });
61
- var index_18 = require("./type/enum/index");
62
- Object.defineProperty(exports, "Enum", { enumerable: true, get: function () { return index_18.Enum; } });
63
- var index_19 = require("./type/exclude/index");
64
- Object.defineProperty(exports, "Exclude", { enumerable: true, get: function () { return index_19.Exclude; } });
65
- var index_20 = require("./type/extends/index");
66
- Object.defineProperty(exports, "Extends", { enumerable: true, get: function () { return index_20.Extends; } });
67
- Object.defineProperty(exports, "ExtendsCheck", { enumerable: true, get: function () { return index_20.ExtendsCheck; } });
68
- Object.defineProperty(exports, "ExtendsResult", { enumerable: true, get: function () { return index_20.ExtendsResult; } });
69
- Object.defineProperty(exports, "ExtendsUndefinedCheck", { enumerable: true, get: function () { return index_20.ExtendsUndefinedCheck; } });
70
- var index_21 = require("./type/extract/index");
71
- Object.defineProperty(exports, "Extract", { enumerable: true, get: function () { return index_21.Extract; } });
72
- var index_22 = require("./type/function/index");
73
- Object.defineProperty(exports, "Function", { enumerable: true, get: function () { return index_22.Function; } });
74
- var index_23 = require("./type/helpers/index");
75
- Object.defineProperty(exports, "Increment", { enumerable: true, get: function () { return index_23.Increment; } });
76
- var index_24 = require("./type/indexed/index");
77
- Object.defineProperty(exports, "Index", { enumerable: true, get: function () { return index_24.Index; } });
78
- Object.defineProperty(exports, "IndexPropertyKeys", { enumerable: true, get: function () { return index_24.IndexPropertyKeys; } });
79
- Object.defineProperty(exports, "IndexFromPropertyKeys", { enumerable: true, get: function () { return index_24.IndexFromPropertyKeys; } });
80
- Object.defineProperty(exports, "IndexFromPropertyKey", { enumerable: true, get: function () { return index_24.IndexFromPropertyKey; } });
81
- Object.defineProperty(exports, "IndexFromMappedKey", { enumerable: true, get: function () { return index_24.IndexFromMappedKey; } });
82
- Object.defineProperty(exports, "IndexFromMappedResult", { enumerable: true, get: function () { return index_24.IndexFromMappedResult; } });
83
- var index_25 = require("./type/instance-type/index");
84
- Object.defineProperty(exports, "InstanceType", { enumerable: true, get: function () { return index_25.InstanceType; } });
85
- var index_26 = require("./type/integer/index");
86
- Object.defineProperty(exports, "Integer", { enumerable: true, get: function () { return index_26.Integer; } });
87
- var index_27 = require("./type/intersect/index");
88
- Object.defineProperty(exports, "Intersect", { enumerable: true, get: function () { return index_27.Intersect; } });
89
- Object.defineProperty(exports, "IntersectEvaluated", { enumerable: true, get: function () { return index_27.IntersectEvaluated; } });
90
- var index_28 = require("./type/iterator/index");
91
- Object.defineProperty(exports, "Iterator", { enumerable: true, get: function () { return index_28.Iterator; } });
92
- var index_29 = require("./type/intrinsic/index");
93
- Object.defineProperty(exports, "Intrinsic", { enumerable: true, get: function () { return index_29.Intrinsic; } });
94
- Object.defineProperty(exports, "IntrinsicFromMappedKey", { enumerable: true, get: function () { return index_29.IntrinsicFromMappedKey; } });
95
- Object.defineProperty(exports, "Capitalize", { enumerable: true, get: function () { return index_29.Capitalize; } });
96
- Object.defineProperty(exports, "Lowercase", { enumerable: true, get: function () { return index_29.Lowercase; } });
97
- Object.defineProperty(exports, "Uncapitalize", { enumerable: true, get: function () { return index_29.Uncapitalize; } });
98
- Object.defineProperty(exports, "Uppercase", { enumerable: true, get: function () { return index_29.Uppercase; } });
99
- var index_30 = require("./type/keyof/index");
100
- Object.defineProperty(exports, "KeyOf", { enumerable: true, get: function () { return index_30.KeyOf; } });
101
- Object.defineProperty(exports, "KeyOfPropertyKeys", { enumerable: true, get: function () { return index_30.KeyOfPropertyKeys; } });
102
- Object.defineProperty(exports, "KeyOfPropertyKeysToRest", { enumerable: true, get: function () { return index_30.KeyOfPropertyKeysToRest; } });
103
- Object.defineProperty(exports, "KeyOfFromMappedResult", { enumerable: true, get: function () { return index_30.KeyOfFromMappedResult; } });
104
- Object.defineProperty(exports, "KeyOfPattern", { enumerable: true, get: function () { return index_30.KeyOfPattern; } });
105
- var index_31 = require("./type/literal/index");
106
- Object.defineProperty(exports, "Literal", { enumerable: true, get: function () { return index_31.Literal; } });
107
- var index_32 = require("./type/mapped/index");
108
- Object.defineProperty(exports, "Mapped", { enumerable: true, get: function () { return index_32.Mapped; } });
109
- Object.defineProperty(exports, "MappedKey", { enumerable: true, get: function () { return index_32.MappedKey; } });
110
- Object.defineProperty(exports, "MappedResult", { enumerable: true, get: function () { return index_32.MappedResult; } });
111
- Object.defineProperty(exports, "MappedFunctionReturnType", { enumerable: true, get: function () { return index_32.MappedFunctionReturnType; } });
112
- var index_33 = require("./type/never/index");
113
- Object.defineProperty(exports, "Never", { enumerable: true, get: function () { return index_33.Never; } });
114
- var index_34 = require("./type/not/index");
115
- Object.defineProperty(exports, "Not", { enumerable: true, get: function () { return index_34.Not; } });
116
- var index_35 = require("./type/null/index");
117
- Object.defineProperty(exports, "Null", { enumerable: true, get: function () { return index_35.Null; } });
118
- var index_36 = require("./type/number/index");
119
- Object.defineProperty(exports, "Number", { enumerable: true, get: function () { return index_36.Number; } });
120
- var index_37 = require("./type/object/index");
121
- Object.defineProperty(exports, "Object", { enumerable: true, get: function () { return index_37.Object; } });
122
- var index_38 = require("./type/omit/index");
123
- Object.defineProperty(exports, "Omit", { enumerable: true, get: function () { return index_38.Omit; } });
124
- var index_39 = require("./type/optional/index");
125
- Object.defineProperty(exports, "Optional", { enumerable: true, get: function () { return index_39.Optional; } });
126
- Object.defineProperty(exports, "OptionalFromMappedResult", { enumerable: true, get: function () { return index_39.OptionalFromMappedResult; } });
127
- var index_40 = require("./type/parameters/index");
128
- Object.defineProperty(exports, "Parameters", { enumerable: true, get: function () { return index_40.Parameters; } });
129
- var index_41 = require("./type/partial/index");
130
- Object.defineProperty(exports, "Partial", { enumerable: true, get: function () { return index_41.Partial; } });
131
- Object.defineProperty(exports, "PartialFromMappedResult", { enumerable: true, get: function () { return index_41.PartialFromMappedResult; } });
132
- var index_42 = require("./type/pick/index");
133
- Object.defineProperty(exports, "Pick", { enumerable: true, get: function () { return index_42.Pick; } });
134
- var index_43 = require("./type/promise/index");
135
- Object.defineProperty(exports, "Promise", { enumerable: true, get: function () { return index_43.Promise; } });
136
- var index_44 = require("./type/readonly/index");
137
- Object.defineProperty(exports, "Readonly", { enumerable: true, get: function () { return index_44.Readonly; } });
138
- Object.defineProperty(exports, "ReadonlyFromMappedResult", { enumerable: true, get: function () { return index_44.ReadonlyFromMappedResult; } });
139
- var index_45 = require("./type/readonly-optional/index");
140
- Object.defineProperty(exports, "ReadonlyOptional", { enumerable: true, get: function () { return index_45.ReadonlyOptional; } });
141
- var index_46 = require("./type/record/index");
142
- Object.defineProperty(exports, "Record", { enumerable: true, get: function () { return index_46.Record; } });
143
- var index_47 = require("./type/recursive/index");
144
- Object.defineProperty(exports, "Recursive", { enumerable: true, get: function () { return index_47.Recursive; } });
145
- var index_48 = require("./type/ref/index");
146
- Object.defineProperty(exports, "Ref", { enumerable: true, get: function () { return index_48.Ref; } });
147
- var index_49 = require("./type/regexp/index");
148
- Object.defineProperty(exports, "RegExp", { enumerable: true, get: function () { return index_49.RegExp; } });
149
- var index_50 = require("./type/required/index");
150
- Object.defineProperty(exports, "Required", { enumerable: true, get: function () { return index_50.Required; } });
151
- var index_51 = require("./type/rest/index");
152
- Object.defineProperty(exports, "Rest", { enumerable: true, get: function () { return index_51.Rest; } });
153
- var index_52 = require("./type/return-type/index");
154
- Object.defineProperty(exports, "ReturnType", { enumerable: true, get: function () { return index_52.ReturnType; } });
155
- var index_53 = require("./type/strict/index");
156
- Object.defineProperty(exports, "Strict", { enumerable: true, get: function () { return index_53.Strict; } });
157
- var index_54 = require("./type/string/index");
158
- Object.defineProperty(exports, "String", { enumerable: true, get: function () { return index_54.String; } });
159
- var index_55 = require("./type/symbol/index");
160
- Object.defineProperty(exports, "Symbol", { enumerable: true, get: function () { return index_55.Symbol; } });
161
- var index_56 = require("./type/template-literal/index");
162
- Object.defineProperty(exports, "TemplateLiteral", { enumerable: true, get: function () { return index_56.TemplateLiteral; } });
163
- Object.defineProperty(exports, "TemplateLiteralSyntax", { enumerable: true, get: function () { return index_56.TemplateLiteralSyntax; } });
164
- Object.defineProperty(exports, "TemplateLiteralGenerate", { enumerable: true, get: function () { return index_56.TemplateLiteralGenerate; } });
165
- Object.defineProperty(exports, "TemplateLiteralParse", { enumerable: true, get: function () { return index_56.TemplateLiteralParse; } });
166
- Object.defineProperty(exports, "TemplateLiteralParseExact", { enumerable: true, get: function () { return index_56.TemplateLiteralParseExact; } });
167
- Object.defineProperty(exports, "IsTemplateLiteralFinite", { enumerable: true, get: function () { return index_56.IsTemplateLiteralFinite; } });
168
- Object.defineProperty(exports, "TemplateLiteralExpressionGenerate", { enumerable: true, get: function () { return index_56.TemplateLiteralExpressionGenerate; } });
169
- Object.defineProperty(exports, "IsTemplateLiteralExpressionFinite", { enumerable: true, get: function () { return index_56.IsTemplateLiteralExpressionFinite; } });
170
- var index_57 = require("./type/transform/index");
171
- Object.defineProperty(exports, "Transform", { enumerable: true, get: function () { return index_57.Transform; } });
172
- Object.defineProperty(exports, "TransformDecodeBuilder", { enumerable: true, get: function () { return index_57.TransformDecodeBuilder; } });
173
- Object.defineProperty(exports, "TransformEncodeBuilder", { enumerable: true, get: function () { return index_57.TransformEncodeBuilder; } });
174
- var index_58 = require("./type/tuple/index");
175
- Object.defineProperty(exports, "Tuple", { enumerable: true, get: function () { return index_58.Tuple; } });
176
- var index_59 = require("./type/uint8array/index");
177
- Object.defineProperty(exports, "Uint8Array", { enumerable: true, get: function () { return index_59.Uint8Array; } });
178
- var index_60 = require("./type/undefined/index");
179
- Object.defineProperty(exports, "Undefined", { enumerable: true, get: function () { return index_60.Undefined; } });
180
- var index_61 = require("./type/union/index");
181
- Object.defineProperty(exports, "Union", { enumerable: true, get: function () { return index_61.Union; } });
182
- Object.defineProperty(exports, "UnionEvaluated", { enumerable: true, get: function () { return index_61.UnionEvaluated; } });
183
- var index_62 = require("./type/unknown/index");
184
- Object.defineProperty(exports, "Unknown", { enumerable: true, get: function () { return index_62.Unknown; } });
185
- var index_63 = require("./type/unsafe/index");
186
- Object.defineProperty(exports, "Unsafe", { enumerable: true, get: function () { return index_63.Unsafe; } });
187
- var index_64 = require("./type/void/index");
188
- Object.defineProperty(exports, "Void", { enumerable: true, get: function () { return index_64.Void; } });
57
+ var index_8 = require("./type/any/index");
58
+ Object.defineProperty(exports, "Any", { enumerable: true, get: function () { return index_8.Any; } });
59
+ var index_9 = require("./type/array/index");
60
+ Object.defineProperty(exports, "Array", { enumerable: true, get: function () { return index_9.Array; } });
61
+ var index_10 = require("./type/async-iterator/index");
62
+ Object.defineProperty(exports, "AsyncIterator", { enumerable: true, get: function () { return index_10.AsyncIterator; } });
63
+ var index_11 = require("./type/awaited/index");
64
+ Object.defineProperty(exports, "Awaited", { enumerable: true, get: function () { return index_11.Awaited; } });
65
+ var index_12 = require("./type/bigint/index");
66
+ Object.defineProperty(exports, "BigInt", { enumerable: true, get: function () { return index_12.BigInt; } });
67
+ var index_13 = require("./type/boolean/index");
68
+ Object.defineProperty(exports, "Boolean", { enumerable: true, get: function () { return index_13.Boolean; } });
69
+ var index_14 = require("./type/composite/index");
70
+ Object.defineProperty(exports, "Composite", { enumerable: true, get: function () { return index_14.Composite; } });
71
+ var index_15 = require("./type/const/index");
72
+ Object.defineProperty(exports, "Const", { enumerable: true, get: function () { return index_15.Const; } });
73
+ var index_16 = require("./type/constructor/index");
74
+ Object.defineProperty(exports, "Constructor", { enumerable: true, get: function () { return index_16.Constructor; } });
75
+ var index_17 = require("./type/constructor-parameters/index");
76
+ Object.defineProperty(exports, "ConstructorParameters", { enumerable: true, get: function () { return index_17.ConstructorParameters; } });
77
+ var index_18 = require("./type/date/index");
78
+ Object.defineProperty(exports, "Date", { enumerable: true, get: function () { return index_18.Date; } });
79
+ var index_19 = require("./type/deref/index");
80
+ Object.defineProperty(exports, "Deref", { enumerable: true, get: function () { return index_19.Deref; } });
81
+ var index_20 = require("./type/enum/index");
82
+ Object.defineProperty(exports, "Enum", { enumerable: true, get: function () { return index_20.Enum; } });
83
+ var index_21 = require("./type/exclude/index");
84
+ Object.defineProperty(exports, "Exclude", { enumerable: true, get: function () { return index_21.Exclude; } });
85
+ var index_22 = require("./type/extends/index");
86
+ Object.defineProperty(exports, "Extends", { enumerable: true, get: function () { return index_22.Extends; } });
87
+ Object.defineProperty(exports, "ExtendsCheck", { enumerable: true, get: function () { return index_22.ExtendsCheck; } });
88
+ Object.defineProperty(exports, "ExtendsResult", { enumerable: true, get: function () { return index_22.ExtendsResult; } });
89
+ Object.defineProperty(exports, "ExtendsUndefinedCheck", { enumerable: true, get: function () { return index_22.ExtendsUndefinedCheck; } });
90
+ var index_23 = require("./type/extract/index");
91
+ Object.defineProperty(exports, "Extract", { enumerable: true, get: function () { return index_23.Extract; } });
92
+ var index_24 = require("./type/function/index");
93
+ Object.defineProperty(exports, "Function", { enumerable: true, get: function () { return index_24.Function; } });
94
+ var index_25 = require("./type/indexed/index");
95
+ Object.defineProperty(exports, "Index", { enumerable: true, get: function () { return index_25.Index; } });
96
+ Object.defineProperty(exports, "IndexPropertyKeys", { enumerable: true, get: function () { return index_25.IndexPropertyKeys; } });
97
+ Object.defineProperty(exports, "IndexFromPropertyKeys", { enumerable: true, get: function () { return index_25.IndexFromPropertyKeys; } });
98
+ Object.defineProperty(exports, "IndexFromPropertyKey", { enumerable: true, get: function () { return index_25.IndexFromPropertyKey; } });
99
+ Object.defineProperty(exports, "IndexFromMappedKey", { enumerable: true, get: function () { return index_25.IndexFromMappedKey; } });
100
+ Object.defineProperty(exports, "IndexFromMappedResult", { enumerable: true, get: function () { return index_25.IndexFromMappedResult; } });
101
+ var index_26 = require("./type/instance-type/index");
102
+ Object.defineProperty(exports, "InstanceType", { enumerable: true, get: function () { return index_26.InstanceType; } });
103
+ var index_27 = require("./type/integer/index");
104
+ Object.defineProperty(exports, "Integer", { enumerable: true, get: function () { return index_27.Integer; } });
105
+ var index_28 = require("./type/intersect/index");
106
+ Object.defineProperty(exports, "Intersect", { enumerable: true, get: function () { return index_28.Intersect; } });
107
+ Object.defineProperty(exports, "IntersectEvaluated", { enumerable: true, get: function () { return index_28.IntersectEvaluated; } });
108
+ var index_29 = require("./type/iterator/index");
109
+ Object.defineProperty(exports, "Iterator", { enumerable: true, get: function () { return index_29.Iterator; } });
110
+ var index_30 = require("./type/intrinsic/index");
111
+ Object.defineProperty(exports, "Intrinsic", { enumerable: true, get: function () { return index_30.Intrinsic; } });
112
+ Object.defineProperty(exports, "IntrinsicFromMappedKey", { enumerable: true, get: function () { return index_30.IntrinsicFromMappedKey; } });
113
+ Object.defineProperty(exports, "Capitalize", { enumerable: true, get: function () { return index_30.Capitalize; } });
114
+ Object.defineProperty(exports, "Lowercase", { enumerable: true, get: function () { return index_30.Lowercase; } });
115
+ Object.defineProperty(exports, "Uncapitalize", { enumerable: true, get: function () { return index_30.Uncapitalize; } });
116
+ Object.defineProperty(exports, "Uppercase", { enumerable: true, get: function () { return index_30.Uppercase; } });
117
+ var index_31 = require("./type/keyof/index");
118
+ Object.defineProperty(exports, "KeyOf", { enumerable: true, get: function () { return index_31.KeyOf; } });
119
+ Object.defineProperty(exports, "KeyOfPropertyKeys", { enumerable: true, get: function () { return index_31.KeyOfPropertyKeys; } });
120
+ Object.defineProperty(exports, "KeyOfPropertyKeysToRest", { enumerable: true, get: function () { return index_31.KeyOfPropertyKeysToRest; } });
121
+ Object.defineProperty(exports, "KeyOfFromMappedResult", { enumerable: true, get: function () { return index_31.KeyOfFromMappedResult; } });
122
+ Object.defineProperty(exports, "KeyOfPattern", { enumerable: true, get: function () { return index_31.KeyOfPattern; } });
123
+ var index_32 = require("./type/literal/index");
124
+ Object.defineProperty(exports, "Literal", { enumerable: true, get: function () { return index_32.Literal; } });
125
+ var index_33 = require("./type/mapped/index");
126
+ Object.defineProperty(exports, "Mapped", { enumerable: true, get: function () { return index_33.Mapped; } });
127
+ Object.defineProperty(exports, "MappedKey", { enumerable: true, get: function () { return index_33.MappedKey; } });
128
+ Object.defineProperty(exports, "MappedResult", { enumerable: true, get: function () { return index_33.MappedResult; } });
129
+ Object.defineProperty(exports, "MappedFunctionReturnType", { enumerable: true, get: function () { return index_33.MappedFunctionReturnType; } });
130
+ var index_34 = require("./type/never/index");
131
+ Object.defineProperty(exports, "Never", { enumerable: true, get: function () { return index_34.Never; } });
132
+ var index_35 = require("./type/not/index");
133
+ Object.defineProperty(exports, "Not", { enumerable: true, get: function () { return index_35.Not; } });
134
+ var index_36 = require("./type/null/index");
135
+ Object.defineProperty(exports, "Null", { enumerable: true, get: function () { return index_36.Null; } });
136
+ var index_37 = require("./type/number/index");
137
+ Object.defineProperty(exports, "Number", { enumerable: true, get: function () { return index_37.Number; } });
138
+ var index_38 = require("./type/object/index");
139
+ Object.defineProperty(exports, "Object", { enumerable: true, get: function () { return index_38.Object; } });
140
+ var index_39 = require("./type/omit/index");
141
+ Object.defineProperty(exports, "Omit", { enumerable: true, get: function () { return index_39.Omit; } });
142
+ var index_40 = require("./type/optional/index");
143
+ Object.defineProperty(exports, "Optional", { enumerable: true, get: function () { return index_40.Optional; } });
144
+ Object.defineProperty(exports, "OptionalFromMappedResult", { enumerable: true, get: function () { return index_40.OptionalFromMappedResult; } });
145
+ var index_41 = require("./type/parameters/index");
146
+ Object.defineProperty(exports, "Parameters", { enumerable: true, get: function () { return index_41.Parameters; } });
147
+ var index_42 = require("./type/partial/index");
148
+ Object.defineProperty(exports, "Partial", { enumerable: true, get: function () { return index_42.Partial; } });
149
+ Object.defineProperty(exports, "PartialFromMappedResult", { enumerable: true, get: function () { return index_42.PartialFromMappedResult; } });
150
+ var index_43 = require("./type/pick/index");
151
+ Object.defineProperty(exports, "Pick", { enumerable: true, get: function () { return index_43.Pick; } });
152
+ var index_44 = require("./type/promise/index");
153
+ Object.defineProperty(exports, "Promise", { enumerable: true, get: function () { return index_44.Promise; } });
154
+ var index_45 = require("./type/readonly/index");
155
+ Object.defineProperty(exports, "Readonly", { enumerable: true, get: function () { return index_45.Readonly; } });
156
+ Object.defineProperty(exports, "ReadonlyFromMappedResult", { enumerable: true, get: function () { return index_45.ReadonlyFromMappedResult; } });
157
+ var index_46 = require("./type/readonly-optional/index");
158
+ Object.defineProperty(exports, "ReadonlyOptional", { enumerable: true, get: function () { return index_46.ReadonlyOptional; } });
159
+ var index_47 = require("./type/record/index");
160
+ Object.defineProperty(exports, "Record", { enumerable: true, get: function () { return index_47.Record; } });
161
+ var index_48 = require("./type/recursive/index");
162
+ Object.defineProperty(exports, "Recursive", { enumerable: true, get: function () { return index_48.Recursive; } });
163
+ var index_49 = require("./type/ref/index");
164
+ Object.defineProperty(exports, "Ref", { enumerable: true, get: function () { return index_49.Ref; } });
165
+ var index_50 = require("./type/regexp/index");
166
+ Object.defineProperty(exports, "RegExp", { enumerable: true, get: function () { return index_50.RegExp; } });
167
+ var index_51 = require("./type/required/index");
168
+ Object.defineProperty(exports, "Required", { enumerable: true, get: function () { return index_51.Required; } });
169
+ var index_52 = require("./type/rest/index");
170
+ Object.defineProperty(exports, "Rest", { enumerable: true, get: function () { return index_52.Rest; } });
171
+ var index_53 = require("./type/return-type/index");
172
+ Object.defineProperty(exports, "ReturnType", { enumerable: true, get: function () { return index_53.ReturnType; } });
173
+ var index_54 = require("./type/strict/index");
174
+ Object.defineProperty(exports, "Strict", { enumerable: true, get: function () { return index_54.Strict; } });
175
+ var index_55 = require("./type/string/index");
176
+ Object.defineProperty(exports, "String", { enumerable: true, get: function () { return index_55.String; } });
177
+ var index_56 = require("./type/symbol/index");
178
+ Object.defineProperty(exports, "Symbol", { enumerable: true, get: function () { return index_56.Symbol; } });
179
+ var index_57 = require("./type/template-literal/index");
180
+ Object.defineProperty(exports, "TemplateLiteral", { enumerable: true, get: function () { return index_57.TemplateLiteral; } });
181
+ Object.defineProperty(exports, "TemplateLiteralSyntax", { enumerable: true, get: function () { return index_57.TemplateLiteralSyntax; } });
182
+ Object.defineProperty(exports, "TemplateLiteralGenerate", { enumerable: true, get: function () { return index_57.TemplateLiteralGenerate; } });
183
+ Object.defineProperty(exports, "TemplateLiteralParse", { enumerable: true, get: function () { return index_57.TemplateLiteralParse; } });
184
+ Object.defineProperty(exports, "TemplateLiteralParseExact", { enumerable: true, get: function () { return index_57.TemplateLiteralParseExact; } });
185
+ Object.defineProperty(exports, "IsTemplateLiteralFinite", { enumerable: true, get: function () { return index_57.IsTemplateLiteralFinite; } });
186
+ Object.defineProperty(exports, "TemplateLiteralExpressionGenerate", { enumerable: true, get: function () { return index_57.TemplateLiteralExpressionGenerate; } });
187
+ Object.defineProperty(exports, "IsTemplateLiteralExpressionFinite", { enumerable: true, get: function () { return index_57.IsTemplateLiteralExpressionFinite; } });
188
+ var index_58 = require("./type/transform/index");
189
+ Object.defineProperty(exports, "Transform", { enumerable: true, get: function () { return index_58.Transform; } });
190
+ Object.defineProperty(exports, "TransformDecodeBuilder", { enumerable: true, get: function () { return index_58.TransformDecodeBuilder; } });
191
+ Object.defineProperty(exports, "TransformEncodeBuilder", { enumerable: true, get: function () { return index_58.TransformEncodeBuilder; } });
192
+ var index_59 = require("./type/tuple/index");
193
+ Object.defineProperty(exports, "Tuple", { enumerable: true, get: function () { return index_59.Tuple; } });
194
+ var index_60 = require("./type/uint8array/index");
195
+ Object.defineProperty(exports, "Uint8Array", { enumerable: true, get: function () { return index_60.Uint8Array; } });
196
+ var index_61 = require("./type/undefined/index");
197
+ Object.defineProperty(exports, "Undefined", { enumerable: true, get: function () { return index_61.Undefined; } });
198
+ var index_62 = require("./type/union/index");
199
+ Object.defineProperty(exports, "Union", { enumerable: true, get: function () { return index_62.Union; } });
200
+ Object.defineProperty(exports, "UnionEvaluated", { enumerable: true, get: function () { return index_62.UnionEvaluated; } });
201
+ var index_63 = require("./type/unknown/index");
202
+ Object.defineProperty(exports, "Unknown", { enumerable: true, get: function () { return index_63.Unknown; } });
203
+ var index_64 = require("./type/unsafe/index");
204
+ Object.defineProperty(exports, "Unsafe", { enumerable: true, get: function () { return index_64.Unsafe; } });
205
+ var index_65 = require("./type/void/index");
206
+ Object.defineProperty(exports, "Void", { enumerable: true, get: function () { return index_65.Void; } });
189
207
  // ------------------------------------------------------------------
190
208
  // Namespace
191
209
  // ------------------------------------------------------------------
192
- var index_65 = require("./type/type/index");
193
- Object.defineProperty(exports, "Type", { enumerable: true, get: function () { return index_65.Type; } });
194
- Object.defineProperty(exports, "JsonTypeBuilder", { enumerable: true, get: function () { return index_65.JsonTypeBuilder; } });
195
- Object.defineProperty(exports, "JavaScriptTypeBuilder", { enumerable: true, get: function () { return index_65.JavaScriptTypeBuilder; } });
210
+ var index_66 = require("./type/type/index");
211
+ Object.defineProperty(exports, "Type", { enumerable: true, get: function () { return index_66.Type; } });
212
+ Object.defineProperty(exports, "JsonTypeBuilder", { enumerable: true, get: function () { return index_66.JsonTypeBuilder; } });
213
+ Object.defineProperty(exports, "JavaScriptTypeBuilder", { enumerable: true, get: function () { return index_66.JavaScriptTypeBuilder; } });
@@ -1,13 +1,18 @@
1
- import type { UnionToTuple, Assert, Ensure, Evaluate } from '../helpers/index';
1
+ import type { TSchema } from '../schema/index';
2
+ import type { Evaluate } from '../helpers/index';
3
+ import { type TIntersectEvaluated } from '../intersect/index';
4
+ import { type TIndexFromPropertyKeys } from '../indexed/index';
5
+ import { type TKeyOfPropertyKeys } from '../keyof/index';
6
+ import { type TNever } from '../never/index';
2
7
  import { type TObject, type TProperties, type ObjectOptions } from '../object/index';
3
- import { type TIntersect } from '../intersect/index';
4
- import { type TIndex } from '../indexed/index';
5
- type TCompositeKeys<T extends TObject[], Acc extends PropertyKey = never> = T extends [infer L extends TObject, ...infer R extends TObject[]] ? TCompositeKeys<R, Acc | keyof L['properties']> : Acc;
6
- type TCompositeIndex<T extends TIntersect<TObject[]>, K extends string[], Acc extends TProperties = {}> = K extends [infer L extends string, ...infer R extends string[]] ? TCompositeIndex<T, R, Acc & {
7
- [_ in L]: TIndex<T, [L]>;
8
- }> : Acc;
9
- type TCompositeReduce<T extends TObject[]> = UnionToTuple<TCompositeKeys<T>> extends infer K ? Evaluate<TCompositeIndex<TIntersect<T>, Assert<K, string[]>>> : {};
10
- export type TComposite<T extends TObject[]> = TIntersect<T> extends TIntersect ? Ensure<TObject<TCompositeReduce<T>>> : Ensure<TObject<{}>>;
11
- /** `[Json]` Creates a Composite object type */
12
- export declare function Composite<T extends TObject[]>(T: [...T], options?: ObjectOptions): TComposite<T>;
8
+ import { TSetDistinct } from '../sets/index';
9
+ type TCompositeKeys<T extends TSchema[], Acc extends PropertyKey[] = []> = (T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TCompositeKeys<R, TSetDistinct<[...Acc, ...TKeyOfPropertyKeys<L>]>> : Acc);
10
+ type TFilterNever<T extends TSchema[], Acc extends TSchema[] = []> = (T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? L extends TNever ? Acc : TFilterNever<R, [...Acc, L]> : Acc);
11
+ type TCompositeProperty<T extends TSchema[], K extends PropertyKey, Acc extends TSchema[] = []> = (T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TCompositeProperty<R, K, TFilterNever<[...Acc, ...TIndexFromPropertyKeys<L, [K]>]>> : Acc);
12
+ type TCompositeProperties<T extends TSchema[], K extends PropertyKey[], Acc = {}> = (K extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? TCompositeProperties<T, R, Acc & {
13
+ [_ in L]: TIntersectEvaluated<TCompositeProperty<T, L>>;
14
+ }> : Acc);
15
+ type TCompositeEvaluate<T extends TSchema[], K extends PropertyKey[] = TCompositeKeys<T>, P extends TProperties = Evaluate<TCompositeProperties<T, K>>, R extends TObject = TObject<P>> = R;
16
+ export type TComposite<T extends TSchema[]> = TCompositeEvaluate<T>;
17
+ export declare function Composite<T extends TSchema[]>(T: [...T], options?: ObjectOptions): TComposite<T>;
13
18
  export {};
@@ -2,15 +2,42 @@
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.Composite = void 0;
5
- const index_1 = require("../object/index");
6
- const index_2 = require("../intersect/index");
7
- const index_3 = require("../indexed/index");
8
- const index_4 = require("../keyof/index");
9
- /** `[Json]` Creates a Composite object type */
10
- function Composite(T, options) {
11
- const intersect = (0, index_2.Intersect)(T, {});
12
- const keys = (0, index_4.KeyOfPropertyKeys)(intersect);
13
- const properties = keys.reduce((acc, key) => ({ ...acc, [key]: (0, index_3.Index)(intersect, [key]) }), {});
14
- return (0, index_1.Object)(properties, options);
5
+ const index_1 = require("../intersect/index");
6
+ const index_2 = require("../indexed/index");
7
+ const index_3 = require("../keyof/index");
8
+ const index_4 = require("../object/index");
9
+ const index_5 = require("../sets/index");
10
+ // ------------------------------------------------------------------
11
+ // TypeGuard
12
+ // ------------------------------------------------------------------
13
+ const type_1 = require("../guard/type");
14
+ // prettier-ignore
15
+ function CompositeKeys(T) {
16
+ return T.reduce((Acc, L) => {
17
+ return (0, index_5.SetDistinct)([...Acc, ...(0, index_3.KeyOfPropertyKeys)(L)]);
18
+ }, []);
19
+ }
20
+ // prettier-ignore
21
+ function FilterNever(T) {
22
+ return T.filter(L => !(0, type_1.IsNever)(L));
23
+ }
24
+ // prettier-ignore
25
+ function CompositeProperty(T, K) {
26
+ return T.reduce((Acc, L) => {
27
+ return FilterNever([...Acc, ...(0, index_2.IndexFromPropertyKeys)(L, [K])]);
28
+ }, []);
29
+ }
30
+ // prettier-ignore
31
+ function CompositeProperties(T, K) {
32
+ return K.reduce((Acc, L) => {
33
+ return { ...Acc, [L]: (0, index_1.IntersectEvaluated)(CompositeProperty(T, L)) };
34
+ }, {});
35
+ }
36
+ // prettier-ignore
37
+ function Composite(T, options = {}) {
38
+ const K = CompositeKeys(T);
39
+ const P = CompositeProperties(T, K);
40
+ const R = (0, index_4.Object)(P, options);
41
+ return R;
15
42
  }
16
43
  exports.Composite = Composite;
@@ -33,9 +33,9 @@ type IncrementBase = {
33
33
  type IncrementTake<T extends keyof IncrementBase> = IncrementBase[T];
34
34
  type IncrementStep<T extends string> = T extends IncrementBase['m'] ? IncrementBase['t'] : T extends `${infer L extends keyof IncrementBase}${infer R}` ? L extends IncrementBase['m'] ? `${IncrementTake<L>}${IncrementStep<R>}` : `${IncrementTake<L>}${R}` : never;
35
35
  type IncrementReverse<T extends string> = T extends `${infer L}${infer R}` ? `${IncrementReverse<R>}${L}` : T;
36
- export type Increment<T extends string> = IncrementReverse<IncrementStep<IncrementReverse<T>>>;
36
+ export type TIncrement<T extends string> = IncrementReverse<IncrementStep<IncrementReverse<T>>>;
37
37
  /** Increments the given string value + 1 */
38
- export declare function Increment<T extends string>(T: T): Increment<T>;
38
+ export declare function Increment<T extends string>(T: T): TIncrement<T>;
39
39
  export type AssertProperties<T> = T extends TProperties ? T : TProperties;
40
40
  export type AssertRest<T, E extends TSchema[] = TSchema[]> = T extends E ? T : [];
41
41
  export type AssertType<T, E extends TSchema = TSchema> = T extends E ? T : TNever;
@@ -1,5 +1,5 @@
1
1
  import type { TSchema } from '../schema/index';
2
- import { type ZeroString, type UnionToTuple, Increment } from '../helpers/index';
2
+ import { type ZeroString, type UnionToTuple, type TIncrement } from '../helpers/index';
3
3
  import type { TRecursive } from '../recursive/index';
4
4
  import type { TIntersect } from '../intersect/index';
5
5
  import type { TUnion } from '../union/index';
@@ -8,16 +8,14 @@ import type { TArray } from '../array/index';
8
8
  import type { TObject, TProperties } from '../object/index';
9
9
  import { type TSetUnionMany, type TSetIntersectMany } from '../sets/index';
10
10
  type TFromRest<T extends TSchema[], Acc extends PropertyKey[][] = []> = (T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TFromRest<R, [...Acc, TKeyOfPropertyKeys<L>]> : Acc);
11
- type FromIntersect<T extends TSchema[], C extends PropertyKey[][] = TFromRest<T>, R extends PropertyKey[] = TSetUnionMany<C>> = R;
12
- declare function FromIntersect<T extends TSchema[]>(T: [...T]): FromIntersect<T>;
13
- type FromUnion<T extends TSchema[], C extends PropertyKey[][] = TFromRest<T>, R extends PropertyKey[] = TSetIntersectMany<C>> = R;
14
- declare function FromUnion<T extends TSchema[]>(T: [...T]): FromUnion<T>;
15
- type TFromTuple<T extends TSchema[], I extends string = ZeroString, Acc extends PropertyKey[] = []> = T extends [infer _ extends TSchema, ...infer R extends TSchema[]] ? TFromTuple<R, Increment<I>, [...Acc, I]> : Acc;
11
+ type TFromIntersect<T extends TSchema[], C extends PropertyKey[][] = TFromRest<T>, R extends PropertyKey[] = TSetUnionMany<C>> = R;
12
+ type TFromUnion<T extends TSchema[], C extends PropertyKey[][] = TFromRest<T>, R extends PropertyKey[] = TSetIntersectMany<C>> = R;
13
+ type TFromTuple<T extends TSchema[], I extends string = ZeroString, Acc extends PropertyKey[] = []> = T extends [infer _ extends TSchema, ...infer R extends TSchema[]] ? TFromTuple<R, TIncrement<I>, [...Acc, I]> : Acc;
16
14
  type TFromArray<_ extends TSchema> = ([
17
15
  '[number]'
18
16
  ]);
19
17
  type TFromProperties<T extends TProperties> = (UnionToTuple<keyof T>);
20
- export type TKeyOfPropertyKeys<T extends TSchema> = (T extends TRecursive<infer S> ? TKeyOfPropertyKeys<S> : T extends TIntersect<infer S> ? FromIntersect<S> : T extends TUnion<infer S> ? FromUnion<S> : T extends TTuple<infer S> ? TFromTuple<S> : T extends TArray<infer S> ? TFromArray<S> : T extends TObject<infer S> ? TFromProperties<S> : [
18
+ export type TKeyOfPropertyKeys<T extends TSchema> = (T extends TRecursive<infer S> ? TKeyOfPropertyKeys<S> : T extends TIntersect<infer S> ? TFromIntersect<S> : T extends TUnion<infer S> ? TFromUnion<S> : T extends TTuple<infer S> ? TFromTuple<S> : T extends TArray<infer S> ? TFromArray<S> : T extends TObject<infer S> ? TFromProperties<S> : [
21
19
  ]);
22
20
  /** Returns a tuple of PropertyKeys derived from the given TSchema. */
23
21
  export declare function KeyOfPropertyKeys<T extends TSchema>(T: T): TKeyOfPropertyKeys<T>;
@@ -9,13 +9,11 @@ import { type TObject, type TProperties } from '../object/index';
9
9
  import { type TIntersect } from '../intersect/index';
10
10
  import { type TUnion } from '../union/index';
11
11
  import { type TPartialFromMappedResult } from './partial-from-mapped-result';
12
- type TFromRest<T extends TSchema[], Acc extends TSchema[] = []> = (T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TFromRest<R, [...Acc, PartialResolve<L>]> : Acc);
12
+ type TFromRest<T extends TSchema[], Acc extends TSchema[] = []> = (T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TFromRest<R, [...Acc, TPartial<L>]> : Acc);
13
13
  type TFromProperties<T extends TProperties> = Evaluate<{
14
14
  [K in keyof T]: T[K] extends (TReadonlyOptional<infer S>) ? TReadonlyOptional<S> : T[K] extends (TReadonly<infer S>) ? TReadonlyOptional<S> : T[K] extends (TOptional<infer S>) ? TOptional<S> : TOptional<T[K]>;
15
15
  }>;
16
- type PartialResolve<T extends TSchema> = (T extends TRecursive<infer S> ? TRecursive<PartialResolve<S>> : T extends TIntersect<infer S> ? TIntersect<TFromRest<S>> : T extends TUnion<infer S> ? TUnion<TFromRest<S>> : T extends TObject<infer S> ? TObject<TFromProperties<S>> : TObject<{}>);
17
- declare function PartialResolve<T extends TSchema>(T: T): PartialResolve<T>;
18
- export type TPartial<T extends TSchema> = PartialResolve<T>;
16
+ export type TPartial<T extends TSchema> = (T extends TRecursive<infer S> ? TRecursive<TPartial<S>> : T extends TIntersect<infer S> ? TIntersect<TFromRest<S>> : T extends TUnion<infer S> ? TUnion<TFromRest<S>> : T extends TObject<infer S> ? TObject<TFromProperties<S>> : TObject<{}>);
19
17
  /** `[Json]` Constructs a type where all properties are optional */
20
18
  export declare function Partial<T extends TMappedResult>(T: T, options?: SchemaOptions): TPartialFromMappedResult<T>;
21
19
  /** `[Json]` Constructs a type where all properties are optional */
@@ -24,6 +24,9 @@ function FromProperties(T) {
24
24
  return { ...Acc, [K]: (0, index_1.Optional)(T[K]) };
25
25
  }, {});
26
26
  }
27
+ // ------------------------------------------------------------------
28
+ // PartialResolve
29
+ // ------------------------------------------------------------------
27
30
  // prettier-ignore
28
31
  function PartialResolve(T) {
29
32
  return ((0, type_2.IsIntersect)(T) ? (0, index_3.Intersect)(FromRest(T.allOf)) :
@@ -9,12 +9,11 @@ import { type TIntersect } from '../intersect/index';
9
9
  import { type TUnion } from '../union/index';
10
10
  import { type TObject, type TProperties } from '../object/index';
11
11
  import { type TRequiredFromMappedResult } from './required-from-mapped-result';
12
- type TFromRest<T extends TSchema[], Acc extends TSchema[] = []> = (T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TFromRest<R, [...Acc, TRequiredResolve<L>]> : Acc);
12
+ type TFromRest<T extends TSchema[], Acc extends TSchema[] = []> = (T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? TFromRest<R, [...Acc, TRequired<L>]> : Acc);
13
13
  type TFromProperties<T extends TProperties> = Evaluate<{
14
14
  [K in keyof T]: T[K] extends (TReadonlyOptional<infer S>) ? TReadonly<S> : T[K] extends (TReadonly<infer S>) ? TReadonly<S> : T[K] extends (TOptional<infer S>) ? S : T[K];
15
15
  }>;
16
- type TRequiredResolve<T extends TSchema> = (T extends TRecursive<infer S> ? TRecursive<TRequiredResolve<S>> : T extends TIntersect<infer S> ? TIntersect<TFromRest<S>> : T extends TUnion<infer S> ? TUnion<TFromRest<S>> : T extends TObject<infer S> ? TObject<TFromProperties<S>> : TObject<{}>);
17
- export type TRequired<T extends TSchema> = TRequiredResolve<T>;
16
+ export type TRequired<T extends TSchema> = (T extends TRecursive<infer S> ? TRecursive<TRequired<S>> : T extends TIntersect<infer S> ? TIntersect<TFromRest<S>> : T extends TUnion<infer S> ? TUnion<TFromRest<S>> : T extends TObject<infer S> ? TObject<TFromProperties<S>> : TObject<{}>);
18
17
  /** `[Json]` Constructs a type where all properties are required */
19
18
  export declare function Required<T extends TMappedResult>(T: T, options?: SchemaOptions): TRequiredFromMappedResult<T>;
20
19
  /** `[Json]` Constructs a type where all properties are required */
@@ -23,6 +23,9 @@ function FromProperties(T) {
23
23
  return { ...Acc, [K]: (0, index_5.Discard)(T[K], [index_4.OptionalKind]) };
24
24
  }, {});
25
25
  }
26
+ // ------------------------------------------------------------------
27
+ // RequiredResolve
28
+ // ------------------------------------------------------------------
26
29
  // prettier-ignore
27
30
  function RequiredResolve(T) {
28
31
  return ((0, type_2.IsIntersect)(T) ? (0, index_1.Intersect)(FromRest(T.allOf)) :
@@ -1,24 +1,28 @@
1
1
  export type TSetIncludes<T extends PropertyKey[], S extends PropertyKey> = (T extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? S extends L ? true : TSetIncludes<R, S> : false);
2
- /** Returns true if element S is in the set of T */
2
+ /** Returns true if element right is in the set of left */
3
3
  export declare function SetIncludes<T extends PropertyKey[], S extends PropertyKey>(T: [...T], S: S): TSetIncludes<T, S>;
4
- export type SetIsSubset<T extends PropertyKey[], S extends PropertyKey[]> = (T extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? TSetIncludes<S, L> extends true ? SetIsSubset<R, S> : false : true);
5
- /** Returns true if T is a subset of S */
6
- export declare function SetIsSubset<T extends PropertyKey[], S extends PropertyKey[]>(T: [...T], S: [...S]): SetIsSubset<T, S>;
4
+ export type TSetIsSubset<T extends PropertyKey[], S extends PropertyKey[]> = (T extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? TSetIncludes<S, L> extends true ? TSetIsSubset<R, S> : false : true);
5
+ /** Returns true if left is a subset of right */
6
+ export declare function SetIsSubset<T extends PropertyKey[], S extends PropertyKey[]>(T: [...T], S: [...S]): TSetIsSubset<T, S>;
7
7
  export type TSetDistinct<T extends PropertyKey[], Acc extends PropertyKey[] = []> = T extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? TSetIncludes<Acc, L> extends false ? TSetDistinct<R, [...Acc, L]> : TSetDistinct<R, [...Acc]> : Acc;
8
8
  /** Returns a distinct set of elements */
9
9
  export declare function SetDistinct<T extends PropertyKey[]>(T: [...T]): TSetDistinct<T>;
10
- export type TSetIntersect<T extends PropertyKey[], S extends PropertyKey[], Acc extends PropertyKey[] = []> = (T extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? TSetIncludes<S, L> extends true ? TSetIntersect<R, S, [L, ...Acc]> : TSetIntersect<R, S, [...Acc]> : Acc);
10
+ export type TSetIntersect<T extends PropertyKey[], S extends PropertyKey[], Acc extends PropertyKey[] = []> = (T extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? TSetIncludes<S, L> extends true ? TSetIntersect<R, S, [...Acc, L]> : TSetIntersect<R, S, [...Acc]> : Acc);
11
11
  /** Returns the Intersect of the given sets */
12
12
  export declare function SetIntersect<T extends PropertyKey[], S extends PropertyKey[]>(T: [...T], S: [...S]): TSetIntersect<T, S>;
13
- export type TSetUnion<T extends PropertyKey[], S extends PropertyKey[], Acc extends PropertyKey[] = S> = (T extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? TSetUnion<R, S, [...Acc, L]> : Acc);
13
+ export type TSetUnion<T extends PropertyKey[], S extends PropertyKey[]> = ([
14
+ ...T,
15
+ ...S
16
+ ]);
14
17
  /** Returns the Union of the given sets */
15
18
  export declare function SetUnion<T extends PropertyKey[], S extends PropertyKey[]>(T: [...T], S: [...S]): TSetUnion<T, S>;
16
19
  export type TSetComplement<T extends PropertyKey[], S extends PropertyKey[], Acc extends PropertyKey[] = []> = (T extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? TSetIncludes<S, L> extends true ? TSetComplement<R, S, [...Acc]> : TSetComplement<R, S, [...Acc, L]> : Acc);
17
20
  /** Returns the Complement by omitting elements in T that are in S */
18
21
  export declare function SetComplement<T extends PropertyKey[], S extends PropertyKey[]>(T: [...T], S: [...S]): TSetComplement<T, S>;
19
- export type TSetIntersectMany<T extends PropertyKey[][], Acc extends PropertyKey[] = []> = (T extends [infer L extends PropertyKey[]] ? L : T extends [infer L extends PropertyKey[], ...infer R extends PropertyKey[][]] ? TSetIntersectMany<R, TSetIntersect<Acc, L>> : Acc);
20
- /** Returns the Intersect of multiple sets */
22
+ type TSetIntersectManyResolve<T extends PropertyKey[][], Acc extends PropertyKey[]> = (T extends [infer L extends PropertyKey[], ...infer R extends PropertyKey[][]] ? TSetIntersectManyResolve<R, TSetIntersect<Acc, L>> : Acc);
23
+ export type TSetIntersectMany<T extends PropertyKey[][]> = (T extends [infer L extends PropertyKey[]] ? L : T extends [infer L extends PropertyKey[], ...infer R extends PropertyKey[][]] ? TSetIntersectManyResolve<R, L> : []);
21
24
  export declare function SetIntersectMany<T extends PropertyKey[][]>(T: [...T]): TSetIntersectMany<T>;
22
25
  export type TSetUnionMany<T extends PropertyKey[][], Acc extends PropertyKey[] = []> = (T extends [infer L extends PropertyKey[], ...infer R extends PropertyKey[][]] ? TSetUnionMany<R, TSetUnion<Acc, L>> : Acc);
23
26
  /** Returns the Union of multiple sets */
24
27
  export declare function SetUnionMany<T extends PropertyKey[][]>(T: [...T]): TSetUnionMany<T>;
28
+ export {};
@@ -2,13 +2,13 @@
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.SetUnionMany = exports.SetIntersectMany = exports.SetComplement = exports.SetUnion = exports.SetIntersect = exports.SetDistinct = exports.SetIsSubset = exports.SetIncludes = void 0;
5
- /** Returns true if element S is in the set of T */
5
+ /** Returns true if element right is in the set of left */
6
6
  // prettier-ignore
7
7
  function SetIncludes(T, S) {
8
8
  return T.includes(S);
9
9
  }
10
10
  exports.SetIncludes = SetIncludes;
11
- /** Returns true if T is a subset of S */
11
+ /** Returns true if left is a subset of right */
12
12
  function SetIsSubset(T, S) {
13
13
  return T.every((L) => SetIncludes(S, L));
14
14
  }
@@ -34,10 +34,20 @@ function SetComplement(T, S) {
34
34
  return T.filter(L => !S.includes(L));
35
35
  }
36
36
  exports.SetComplement = SetComplement;
37
- /** Returns the Intersect of multiple sets */
37
+ // prettier-ignore
38
+ function SetIntersectManyResolve(T, Init) {
39
+ return T.reduce((Acc, L) => {
40
+ return SetIntersect(Acc, L);
41
+ }, Init);
42
+ }
38
43
  // prettier-ignore
39
44
  function SetIntersectMany(T) {
40
- return (T.length === 1 ? T[0] : T.reduce((Acc, L) => [...SetIntersect(Acc, L)], []));
45
+ return (T.length === 1
46
+ ? T[0]
47
+ // Use left to initialize the accumulator for resolve
48
+ : T.length > 1
49
+ ? SetIntersectManyResolve(T.slice(1), T[0])
50
+ : []);
41
51
  }
42
52
  exports.SetIntersectMany = SetIntersectMany;
43
53
  /** Returns the Union of multiple sets */
@@ -71,7 +71,7 @@ export declare class JsonTypeBuilder {
71
71
  /** `[Json]` Intrinsic function to Capitalize LiteralString types */
72
72
  Capitalize<T extends TSchema>(schema: T, options?: SchemaOptions): TCapitalize<T>;
73
73
  /** `[Json]` Creates a Composite object type */
74
- Composite<T extends TObject[]>(objects: [...T], options?: ObjectOptions): TComposite<T>;
74
+ Composite<T extends TSchema[]>(schemas: [...T], options?: ObjectOptions): TComposite<T>;
75
75
  /** `[JavaScript]` Creates a readonly const type from the given value. */
76
76
  Const</* const (not supported in 4.0) */ T>(value: T, options?: SchemaOptions): TConst<T>;
77
77
  /** `[Json]` Creates a dereferenced type */
@@ -87,8 +87,8 @@ class JsonTypeBuilder {
87
87
  return (0, index_14.Capitalize)(schema, options);
88
88
  }
89
89
  /** `[Json]` Creates a Composite object type */
90
- Composite(objects, options) {
91
- return (0, index_4.Composite)(objects, options); // (error) TS 5.4.0-dev - review TComposite implementation
90
+ Composite(schemas, options) {
91
+ return (0, index_4.Composite)(schemas, options); // (error) TS 5.4.0-dev - review TComposite implementation
92
92
  }
93
93
  /** `[JavaScript]` Creates a readonly const type from the given value. */
94
94
  Const(value, options = {}) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sinclair/typebox",
3
- "version": "0.32.8",
3
+ "version": "0.32.10",
4
4
  "description": "Json Schema Type Builder with Static Type Resolution for TypeScript",
5
5
  "keywords": [
6
6
  "typescript",
package/readme.md CHANGED
@@ -53,7 +53,7 @@ type T = Static<typeof T> // type T = {
53
53
 
54
54
  TypeBox is a runtime type builder that creates in-memory Json Schema objects that infer as TypeScript types. The schematics produced by this library are designed to match the static type checking rules of the TypeScript compiler. TypeBox offers a unified type that can be statically checked by TypeScript and runtime asserted using standard Json Schema validation.
55
55
 
56
- This library is designed to be a runtime type system providing similar capabilities to TypeScript's programmable type system. It can be used as a simple tool to build up complex schematics or integrated into REST and RPC services to help validate data received over the wire.
56
+ This library is designed to allow Json Schema to compose with the same flexibility as TypeScript's programmable type system. It can be used as a simple tool to build up complex schematics or integrated into REST and RPC services to help validate data received over the wire.
57
57
 
58
58
  License MIT
59
59
 
@@ -1814,4 +1814,4 @@ The following table lists esbuild compiled and minified sizes for each TypeBox m
1814
1814
 
1815
1815
  ## Contribute
1816
1816
 
1817
- TypeBox is open to community contribution. Please ensure you submit an open issue before submitting your pull request. The TypeBox project preferences open community discussion prior to accepting new features.
1817
+ TypeBox is open to community contribution. Please ensure you submit an open issue before submitting your pull request. The TypeBox project prefers open community discussion before accepting new features.