@sinclair/typebox 0.32.0-dev-11 → 0.32.0-dev-12

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 (95) hide show
  1. package/build/import/compiler/compiler.mjs +3 -3
  2. package/build/import/errors/errors.mjs +3 -3
  3. package/build/import/index.d.mts +3 -3
  4. package/build/import/index.mjs +2 -2
  5. package/build/import/type/composite/composite.d.mts +2 -2
  6. package/build/import/type/composite/composite.mjs +2 -2
  7. package/build/import/type/extends/extends-mapped-result.d.mts +13 -0
  8. package/build/import/type/extends/extends-mapped-result.mjs +14 -0
  9. package/build/import/type/extends/extends-mapped.d.mts +17 -0
  10. package/build/import/type/extends/extends-mapped.mjs +21 -0
  11. package/build/import/type/extends/extends.d.mts +8 -2
  12. package/build/import/type/extends/extends.mjs +7 -3
  13. package/build/import/type/extends/index.d.mts +2 -0
  14. package/build/import/type/extends/index.mjs +2 -0
  15. package/build/import/type/guard/type.d.mts +5 -1
  16. package/build/import/type/guard/type.mjs +18 -2
  17. package/build/import/type/indexed/index.d.mts +2 -1
  18. package/build/import/type/indexed/index.mjs +2 -1
  19. package/build/import/type/indexed/indexed-mapped.d.mts +16 -0
  20. package/build/import/type/indexed/indexed-mapped.mjs +18 -0
  21. package/build/import/type/indexed/{indexed-key.d.mts → indexed-property-keys.d.mts} +3 -3
  22. package/build/import/type/indexed/{indexed-key.mjs → indexed-property-keys.mjs} +2 -2
  23. package/build/import/type/indexed/indexed-type.d.mts +2 -2
  24. package/build/import/type/indexed/indexed-type.mjs +1 -1
  25. package/build/import/type/indexed/indexed.d.mts +7 -4
  26. package/build/import/type/indexed/indexed.mjs +7 -6
  27. package/build/import/type/keyof/index.d.mts +1 -2
  28. package/build/import/type/keyof/index.mjs +1 -2
  29. package/build/import/type/keyof/{keyof-string.d.mts → keyof-property-keys.d.mts} +4 -4
  30. package/build/import/type/keyof/{keyof-string.mjs → keyof-property-keys.mjs} +4 -4
  31. package/build/import/type/keyof/keyof.d.mts +12 -4
  32. package/build/import/type/keyof/keyof.mjs +14 -3
  33. package/build/import/type/mapped/mapped.d.mts +41 -15
  34. package/build/import/type/mapped/mapped.mjs +75 -11
  35. package/build/import/type/omit/omit.d.mts +2 -2
  36. package/build/import/type/omit/omit.mjs +2 -2
  37. package/build/import/type/pick/pick.d.mts +2 -2
  38. package/build/import/type/pick/pick.mjs +2 -2
  39. package/build/import/type/record/record.mjs +3 -3
  40. package/build/import/type/type/json.d.mts +13 -6
  41. package/build/import/type/type/json.mjs +6 -2
  42. package/build/import/value/check/check.mjs +3 -3
  43. package/build/import/value/clean/clean.mjs +2 -2
  44. package/build/import/value/transform/decode.mjs +5 -5
  45. package/build/import/value/transform/encode.mjs +5 -5
  46. package/build/require/compiler/compiler.js +2 -2
  47. package/build/require/errors/errors.js +2 -2
  48. package/build/require/index.d.ts +3 -3
  49. package/build/require/index.js +7 -7
  50. package/build/require/type/composite/composite.d.ts +2 -2
  51. package/build/require/type/composite/composite.js +1 -1
  52. package/build/require/type/extends/extends-mapped-result.d.ts +13 -0
  53. package/build/require/type/extends/extends-mapped-result.js +18 -0
  54. package/build/require/type/extends/extends-mapped.d.ts +17 -0
  55. package/build/require/type/extends/extends-mapped.js +25 -0
  56. package/build/require/type/extends/extends.d.ts +8 -2
  57. package/build/require/type/extends/extends.js +8 -5
  58. package/build/require/type/extends/index.d.ts +2 -0
  59. package/build/require/type/extends/index.js +2 -0
  60. package/build/require/type/guard/type.d.ts +5 -1
  61. package/build/require/type/guard/type.js +53 -34
  62. package/build/require/type/indexed/index.d.ts +2 -1
  63. package/build/require/type/indexed/index.js +2 -1
  64. package/build/require/type/indexed/indexed-mapped.d.ts +16 -0
  65. package/build/require/type/indexed/indexed-mapped.js +22 -0
  66. package/build/require/type/indexed/{indexed-key.d.ts → indexed-property-keys.d.ts} +3 -3
  67. package/build/require/type/indexed/{indexed-key.js → indexed-property-keys.js} +4 -4
  68. package/build/require/type/indexed/indexed-type.d.ts +2 -2
  69. package/build/require/type/indexed/indexed-type.js +3 -3
  70. package/build/require/type/indexed/indexed.d.ts +7 -4
  71. package/build/require/type/indexed/indexed.js +7 -6
  72. package/build/require/type/keyof/index.d.ts +1 -2
  73. package/build/require/type/keyof/index.js +1 -2
  74. package/build/require/type/keyof/{keyof-string.d.ts → keyof-property-keys.d.ts} +4 -4
  75. package/build/require/type/keyof/{keyof-string.js → keyof-property-keys.js} +7 -7
  76. package/build/require/type/keyof/keyof.d.ts +12 -4
  77. package/build/require/type/keyof/keyof.js +14 -3
  78. package/build/require/type/mapped/mapped.d.ts +41 -15
  79. package/build/require/type/mapped/mapped.js +80 -12
  80. package/build/require/type/omit/omit.d.ts +2 -2
  81. package/build/require/type/omit/omit.js +1 -1
  82. package/build/require/type/pick/pick.d.ts +2 -2
  83. package/build/require/type/pick/pick.js +1 -1
  84. package/build/require/type/record/record.js +2 -2
  85. package/build/require/type/type/json.d.ts +13 -6
  86. package/build/require/type/type/json.js +54 -50
  87. package/build/require/value/check/check.js +2 -2
  88. package/build/require/value/clean/clean.js +15 -15
  89. package/build/require/value/transform/decode.js +3 -3
  90. package/build/require/value/transform/encode.js +3 -3
  91. package/package.json +1 -1
  92. package/build/import/type/keyof/keyof-type.d.mts +0 -11
  93. package/build/import/type/keyof/keyof-type.mjs +0 -15
  94. package/build/require/type/keyof/keyof-type.d.ts +0 -11
  95. package/build/require/type/keyof/keyof-type.js +0 -19
@@ -1,24 +1,50 @@
1
1
  import type { TSchema } from '../schema/index.mjs';
2
- import type { Evaluate } from '../helpers/index.mjs';
3
- import type { Static } from '../static/index.mjs';
4
- import { type TObject, type TProperties } from '../object/index.mjs';
5
- import { IndexedKeyResolve } from '../indexed/indexed-key.mjs';
2
+ import type { Ensure, Evaluate } from '../helpers/index.mjs';
3
+ import { IndexedPropertyKeys } from '../indexed/index.mjs';
6
4
  import { Kind } from '../symbols/index.mjs';
5
+ import { type TArray } from '../array/index.mjs';
6
+ import { type TAsyncIterator } from '../async-iterator/index.mjs';
7
+ import { type TConstructor } from '../constructor/index.mjs';
8
+ import { type TFunction } from '../function/index.mjs';
9
+ import { type TIntersect } from '../intersect/index.mjs';
10
+ import { type TIterator } from '../iterator/index.mjs';
11
+ import { type TLiteral, type TLiteralValue } from '../literal/index.mjs';
12
+ import { type TNever } from '../never/index.mjs';
13
+ import { type TObject, type TProperties, type ObjectOptions } from '../object/index.mjs';
14
+ import { type TOptional } from '../optional/index.mjs';
15
+ import { type TPromise } from '../promise/index.mjs';
16
+ import { type TReadonly } from '../readonly/index.mjs';
17
+ import { type TUnion } from '../union/index.mjs';
7
18
  export interface TMappedKey<T extends PropertyKey[] = PropertyKey[]> extends TSchema {
8
19
  [Kind]: 'MappedKey';
9
20
  static: T[number];
10
- anyOf: [];
21
+ keys: T;
11
22
  }
23
+ export declare function MappedKey<T extends PropertyKey[]>(T: [...T]): TMappedKey<T>;
12
24
  export type MappedFunction<K extends PropertyKey[], I = TMappedKey<K>> = (T: I) => TSchema;
13
- export type MappedResultProperties<K extends PropertyKey[], T extends TSchema> = K extends [infer L extends string, ...infer R extends PropertyKey[]] ? {
14
- [_ in `${L}`]: T;
15
- } & MappedResultProperties<R, T> : {};
16
- export type UnevaluatedMappedResult<T extends TSchema> = T;
17
- export type EvaluatedMappedResult<K extends PropertyKey[], T extends TSchema> = T;
18
- export interface TMappedResult<K extends PropertyKey[], F extends MappedFunction<K>, S extends TSchema = ReturnType<F>, R extends TSchema = EvaluatedMappedResult<K, S>, P extends TProperties = Evaluate<MappedResultProperties<K, R>>, O extends TObject = TObject<P>> extends TSchema {
25
+ type FromMappedResult<K extends PropertyKey, P extends TProperties> = (K extends keyof P ? FromMappedPropertyKey<K, P[K]> : TNever);
26
+ declare function FromMappedResult<K extends PropertyKey, P extends TProperties>(K: K, P: P): FromMappedResult<K, P>;
27
+ type FromMappedKey<K extends PropertyKey, _ extends PropertyKey[]> = (K extends TLiteralValue ? TLiteral<K> : TLiteral<'never'>);
28
+ declare function FromMappedKey<K extends PropertyKey, P extends PropertyKey[]>(K: K, _: [...P]): TLiteral<TLiteralValue>;
29
+ type FromRest<K extends PropertyKey, T extends TSchema[]> = T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? [FromMappedPropertyKey<K, L>, ...FromRest<K, R>] : [];
30
+ declare function FromRest<K extends PropertyKey, T extends TSchema[]>(K: K, T: [...T]): FromRest<K, T>;
31
+ type FromProperties<K extends PropertyKey, T extends TProperties, R extends TProperties = Evaluate<{
32
+ [K2 in keyof T]: FromMappedPropertyKey<K, T[K2]>;
33
+ }>> = R;
34
+ declare function FromProperties<K extends PropertyKey, T extends TProperties>(K: K, T: T): FromProperties<K, T>;
35
+ export type FromMappedPropertyKey<K extends PropertyKey, T extends TSchema> = (T extends TReadonly<infer S> ? TReadonly<FromMappedPropertyKey<K, S>> : T extends TOptional<infer S> ? TOptional<FromMappedPropertyKey<K, S>> : T extends TMappedResult<infer P> ? FromMappedResult<K, P> : T extends TMappedKey<infer S> ? FromMappedKey<K, S> : T extends TConstructor<infer S extends TSchema[], infer R extends TSchema> ? TConstructor<FromRest<K, S>, FromMappedPropertyKey<K, R>> : T extends TFunction<infer S extends TSchema[], infer R extends TSchema> ? TFunction<FromRest<K, S>, FromMappedPropertyKey<K, R>> : T extends TAsyncIterator<infer S> ? TAsyncIterator<FromMappedPropertyKey<K, S>> : T extends TIterator<infer S> ? TIterator<FromMappedPropertyKey<K, S>> : T extends TIntersect<infer S> ? TIntersect<FromRest<K, S>> : T extends TUnion<infer S> ? TUnion<FromRest<K, S>> : T extends TObject<infer S> ? TObject<FromProperties<K, S>> : T extends TArray<infer S> ? TArray<FromMappedPropertyKey<K, S>> : T extends TPromise<infer S> ? TPromise<FromMappedPropertyKey<K, S>> : T);
36
+ export declare function FromMappedPropertyKey<K extends PropertyKey, T extends TSchema>(K: K, T: T): FromMappedPropertyKey<K, T>;
37
+ export type FromMappedPropertyKeys<K extends PropertyKey[], T extends TSchema> = (K extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? {
38
+ [_ in L]: FromMappedPropertyKey<L, T>;
39
+ } & FromMappedPropertyKeys<R, T> : {});
40
+ export declare function FromMappedPropertyKeys<K extends PropertyKey[], T extends TSchema>(K: [...K], T: T): FromMappedPropertyKeys<K, T>;
41
+ export interface TMappedResult<T extends TProperties = TProperties> extends TSchema {
19
42
  [Kind]: 'MappedResult';
20
- static: Static<O, this['params']>;
21
- properties: P;
43
+ properties: T;
44
+ static: unknown;
22
45
  }
23
- export declare function Mapped<K extends TSchema, I extends PropertyKey[] = IndexedKeyResolve<K>, F extends MappedFunction<I> = MappedFunction<I>, R extends TMappedResult<I, F> = TMappedResult<I, F>>(key: K, map: F): R;
24
- export declare function Mapped<K extends PropertyKey[], F extends MappedFunction<K> = MappedFunction<K>, R extends TMappedResult<K, F> = TMappedResult<K, F>>(key: [...K], map: F): R;
46
+ export declare function MappedResult<T extends TProperties>(properties: T): TMappedResult<T>;
47
+ export type TMapped<K extends PropertyKey[], F extends MappedFunction<K>, R extends TProperties = Evaluate<FromMappedPropertyKeys<K, ReturnType<F>>>> = Ensure<TObject<R>>;
48
+ export declare function Mapped<K extends TSchema, I extends PropertyKey[] = IndexedPropertyKeys<K>, F extends MappedFunction<I> = MappedFunction<I>, R extends TMapped<I, F> = TMapped<I, F>>(key: K, map: F, options?: ObjectOptions): R;
49
+ export declare function Mapped<K extends PropertyKey[], F extends MappedFunction<K> = MappedFunction<K>, R extends TMapped<K, F> = TMapped<K, F>>(key: [...K], map: F, options?: ObjectOptions): R;
50
+ export {};
@@ -1,14 +1,78 @@
1
- import { Object } from '../object/index.mjs';
2
- import { Literal } from '../literal/index.mjs';
3
- import { IndexedKeyResolve } from '../indexed/indexed-key.mjs';
1
+ import { IndexedPropertyKeys } from '../indexed/index.mjs';
4
2
  import { TSchema as IsSchemaType } from '../guard/type.mjs';
5
- import { Kind } from '../symbols/index.mjs';
6
- export function Mapped(key, map) {
7
- const keys = IsSchemaType(key) ? IndexedKeyResolve(key) : key;
8
- const anyOf = keys.map(key => Literal(key));
9
- const mapped = { [Kind]: 'MappedKey', anyOf };
10
- const properties = keys.reduce((acc, key) => {
11
- return { ...acc, [key]: map(mapped) };
3
+ import { Kind, OptionalKind, ReadonlyKind } from '../symbols/index.mjs';
4
+ import { CloneType } from '../clone/type.mjs';
5
+ import { Discard } from '../discard/index.mjs';
6
+ import { Array } from '../array/index.mjs';
7
+ import { AsyncIterator } from '../async-iterator/index.mjs';
8
+ import { Constructor } from '../constructor/index.mjs';
9
+ import { Function as FunctionType } from '../function/index.mjs';
10
+ import { Intersect } from '../intersect/index.mjs';
11
+ import { Iterator } from '../iterator/index.mjs';
12
+ import { Literal } from '../literal/index.mjs';
13
+ import { Never } from '../never/index.mjs';
14
+ import { Object } from '../object/index.mjs';
15
+ import { Optional } from '../optional/index.mjs';
16
+ import { Promise } from '../promise/index.mjs';
17
+ import { Readonly } from '../readonly/index.mjs';
18
+ import { Union } from '../union/index.mjs';
19
+ import { TOptional as IsOptionalType, TReadonly as IsReadonlyType, TMappedResult as IsMappedResultType, TMappedKey as IsMappedKeyType, TConstructor as IsConstructorType, TFunction as IsFunctionType, TAsyncIterator as IsAsyncIteratorType, TIterator as IsIteratorType, TIntersect as IsIntersectType, TUnion as IsUnionType, TObject as IsObjectType, TArray as IsArrayType, TPromise as IsPromiseType, } from '../guard/type.mjs';
20
+ export function MappedKey(T) {
21
+ return {
22
+ [Kind]: 'MappedKey',
23
+ keys: T
24
+ };
25
+ }
26
+ function FromMappedResult(K, P) {
27
+ return (K in P
28
+ ? FromMappedPropertyKey(K, P[K])
29
+ : Never());
30
+ }
31
+ function FromMappedKey(K, _) {
32
+ return Literal(K);
33
+ }
34
+ function FromRest(K, T) {
35
+ const [L, ...R] = T;
36
+ return (T.length > 0
37
+ ? [FromMappedPropertyKey(K, L), ...FromRest(K, R)]
38
+ : []);
39
+ }
40
+ function FromProperties(K, T) {
41
+ return globalThis.Object.getOwnPropertyNames(T).reduce((Acc, K2) => {
42
+ return { ...Acc, [K2]: FromMappedPropertyKey(K, T[K2]) };
12
43
  }, {});
13
- return Object(properties);
44
+ }
45
+ export function FromMappedPropertyKey(K, T) {
46
+ return (IsOptionalType(T) ? Optional(FromMappedPropertyKey(K, Discard(T, [OptionalKind]))) :
47
+ IsReadonlyType(T) ? Readonly(FromMappedPropertyKey(K, Discard(T, [ReadonlyKind]))) :
48
+ IsMappedResultType(T) ? FromMappedResult(K, T.properties) :
49
+ IsMappedKeyType(T) ? FromMappedKey(K, T.keys) :
50
+ IsConstructorType(T) ? Constructor(FromRest(K, T.parameters), FromMappedPropertyKey(K, T.returns)) :
51
+ IsFunctionType(T) ? FunctionType(FromRest(K, T.parameters), FromMappedPropertyKey(K, T.returns)) :
52
+ IsAsyncIteratorType(T) ? AsyncIterator(FromMappedPropertyKey(K, T.items)) :
53
+ IsIteratorType(T) ? Iterator(FromMappedPropertyKey(K, T.items)) :
54
+ IsIntersectType(T) ? Intersect(FromRest(K, T.allOf)) :
55
+ IsUnionType(T) ? Union(FromRest(K, T.anyOf)) :
56
+ IsObjectType(T) ? Object(FromProperties(K, T.properties)) :
57
+ IsArrayType(T) ? Array(FromMappedPropertyKey(K, T.items)) :
58
+ IsPromiseType(T) ? Promise(FromMappedPropertyKey(K, T.item)) :
59
+ T);
60
+ }
61
+ export function FromMappedPropertyKeys(K, T) {
62
+ const [L, ...R] = K;
63
+ return (K.length > 0
64
+ ? { [L]: FromMappedPropertyKey(L, T), ...FromMappedPropertyKeys(R, T) }
65
+ : {});
66
+ }
67
+ export function MappedResult(properties) {
68
+ return {
69
+ [Kind]: 'MappedResult',
70
+ properties
71
+ };
72
+ }
73
+ export function Mapped(key, map, options = {}) {
74
+ const K = IsSchemaType(key) ? IndexedPropertyKeys(key) : key;
75
+ const RT = map({ [Kind]: 'MappedKey', keys: K });
76
+ const R = FromMappedPropertyKeys(K, RT);
77
+ return CloneType(Object(R), options);
14
78
  }
@@ -4,7 +4,7 @@ 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';
6
6
  import { type TObject, type TProperties } from '../object/index.mjs';
7
- import { IndexedKeyResolve } from '../indexed/index.mjs';
7
+ import { IndexedPropertyKeys } from '../indexed/index.mjs';
8
8
  type FromIntersect<T extends TSchema[], K extends PropertyKey[]> = T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? [OmitResolve<L, K>, ...FromIntersect<R, K>] : [];
9
9
  declare function FromIntersect<T extends TSchema[], K extends PropertyKey[]>(T: T, K: K): FromIntersect<T, K>;
10
10
  type FromUnion<T extends TSchema[], K extends PropertyKey[]> = T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? [OmitResolve<L, K>, ...FromUnion<R, K>] : [];
@@ -14,6 +14,6 @@ declare function FromProperties<T extends TProperties, K extends PropertyKey[]>(
14
14
  export type OmitResolve<T extends TProperties, K extends PropertyKey[]> = T extends TRecursive<infer S> ? TRecursive<OmitResolve<S, K>> : T extends TIntersect<infer S> ? TIntersect<FromIntersect<S, K>> : T extends TUnion<infer S> ? TUnion<FromUnion<S, K>> : T extends TObject<infer S> ? TObject<FromProperties<S, K>> : TObject<{}>;
15
15
  export declare function OmitResolve<T extends TSchema, K extends PropertyKey[]>(T: T, K: [...K]): OmitResolve<T, K>;
16
16
  export type TOmit<T extends TSchema, K extends PropertyKey[]> = OmitResolve<T, K>;
17
- export declare function Omit<T extends TSchema, K extends TSchema, I extends PropertyKey[] = IndexedKeyResolve<K>>(T: T, K: K, options?: SchemaOptions): TOmit<T, I>;
17
+ export declare function Omit<T extends TSchema, K extends TSchema, I extends PropertyKey[] = IndexedPropertyKeys<K>>(T: T, K: K, options?: SchemaOptions): TOmit<T, I>;
18
18
  export declare function Omit<T extends TSchema, K extends PropertyKey[]>(T: T, K: readonly [...K], options?: SchemaOptions): TOmit<T, K>;
19
19
  export {};
@@ -1,7 +1,7 @@
1
1
  import { Intersect } from '../intersect/index.mjs';
2
2
  import { Union } from '../union/index.mjs';
3
3
  import { Object } from '../object/index.mjs';
4
- import { IndexedKeyResolve } from '../indexed/index.mjs';
4
+ import { IndexedPropertyKeys } from '../indexed/index.mjs';
5
5
  import { Discard } from '../discard/index.mjs';
6
6
  import { TransformKind } from '../symbols/index.mjs';
7
7
  import { CloneType } from '../clone/type.mjs';
@@ -28,7 +28,7 @@ export function OmitResolve(T, K) {
28
28
  Object({}));
29
29
  }
30
30
  export function Omit(T, K, options = {}) {
31
- const I = IsSchemaType(K) ? IndexedKeyResolve(K) : K;
31
+ const I = IsSchemaType(K) ? IndexedPropertyKeys(K) : K;
32
32
  const D = Discard(T, [TransformKind, '$id', 'required']);
33
33
  const R = CloneType(OmitResolve(T, I), options);
34
34
  return { ...D, ...R };
@@ -4,7 +4,7 @@ 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';
6
6
  import { type TObject, type TProperties } from '../object/index.mjs';
7
- import { IndexedKeyResolve } from '../indexed/index.mjs';
7
+ import { IndexedPropertyKeys } from '../indexed/index.mjs';
8
8
  type FromIntersect<T extends TSchema[], K extends PropertyKey[]> = T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? [PickResolve<L, K>, ...FromIntersect<R, K>] : [];
9
9
  declare function FromIntersect<T extends TSchema[], K extends PropertyKey[]>(T: T, K: K): FromIntersect<T, K>;
10
10
  type FromUnion<T extends TSchema[], K extends PropertyKey[]> = T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? [PickResolve<L, K>, ...FromUnion<R, K>] : [];
@@ -14,6 +14,6 @@ declare function FromProperties<T extends TProperties, K extends PropertyKey[]>(
14
14
  export type PickResolve<T extends TProperties, K extends PropertyKey[]> = T extends TRecursive<infer S> ? TRecursive<PickResolve<S, K>> : T extends TIntersect<infer S> ? TIntersect<FromIntersect<S, K>> : T extends TUnion<infer S> ? TUnion<FromUnion<S, K>> : T extends TObject<infer S> ? TObject<FromProperties<S, K>> : TObject<{}>;
15
15
  export declare function PickResolve<T extends TSchema, K extends PropertyKey[]>(T: T, K: [...K]): PickResolve<T, K>;
16
16
  export type TPick<T extends TSchema, K extends PropertyKey[]> = PickResolve<T, K>;
17
- export declare function Pick<T extends TSchema, K extends TSchema, I extends PropertyKey[] = IndexedKeyResolve<K>>(T: T, K: K, options?: SchemaOptions): TPick<T, I>;
17
+ export declare function Pick<T extends TSchema, K extends TSchema, I extends PropertyKey[] = IndexedPropertyKeys<K>>(T: T, K: K, options?: SchemaOptions): TPick<T, I>;
18
18
  export declare function Pick<T extends TSchema, K extends PropertyKey[]>(T: T, K: readonly [...K], options?: SchemaOptions): TPick<T, K>;
19
19
  export {};
@@ -1,7 +1,7 @@
1
1
  import { Intersect } from '../intersect/index.mjs';
2
2
  import { Union } from '../union/index.mjs';
3
3
  import { Object } from '../object/index.mjs';
4
- import { IndexedKeyResolve } from '../indexed/index.mjs';
4
+ import { IndexedPropertyKeys } from '../indexed/index.mjs';
5
5
  import { Discard } from '../discard/index.mjs';
6
6
  import { TransformKind } from '../symbols/index.mjs';
7
7
  import { CloneType } from '../clone/type.mjs';
@@ -24,7 +24,7 @@ export function PickResolve(T, K) {
24
24
  Object({}));
25
25
  }
26
26
  export function Pick(T, K, options = {}) {
27
- const I = IsSchemaType(K) ? IndexedKeyResolve(K) : K;
27
+ const I = IsSchemaType(K) ? IndexedPropertyKeys(K) : K;
28
28
  const D = Discard(T, [TransformKind, '$id', 'required']);
29
29
  const R = CloneType(PickResolve(T, I), options);
30
30
  return { ...D, ...R };
@@ -3,7 +3,7 @@ import { Never } from '../never/index.mjs';
3
3
  import { Union } from '../union/index.mjs';
4
4
  import { IsTemplateLiteralFinite, TemplateLiteralParseExact } from '../template-literal/index.mjs';
5
5
  import { PatternStringExact, PatternNumberExact } from '../patterns/index.mjs';
6
- import { IndexedKeyResolve } from '../indexed/index.mjs';
6
+ import { IndexedPropertyKeys } from '../indexed/index.mjs';
7
7
  import { Kind, Hint } from '../symbols/index.mjs';
8
8
  import { CloneType } from '../clone/type.mjs';
9
9
  import { IsUndefined } from '../guard/value.mjs';
@@ -18,11 +18,11 @@ function FromKeys(keys, T) {
18
18
  function FromTemplateLiteralKey(K, T) {
19
19
  const expression = TemplateLiteralParseExact(K.pattern);
20
20
  return (IsTemplateLiteralFinite(expression)
21
- ? FromKeys(IndexedKeyResolve(K), T)
21
+ ? FromKeys(IndexedPropertyKeys(K), T)
22
22
  : FromPattern(K.pattern, T));
23
23
  }
24
24
  function FromUnionKey(K, T) {
25
- return FromKeys(IndexedKeyResolve(Union(K)), T);
25
+ return FromKeys(IndexedPropertyKeys(Union(K)), T);
26
26
  }
27
27
  function FromLiteralKey(K, T) {
28
28
  return FromKeys([K.toString()], T);
@@ -6,17 +6,19 @@ import { type TConst } from '../const/index.mjs';
6
6
  import { type TDeref } from '../deref/index.mjs';
7
7
  import { type TEnum, type TEnumKey, type TEnumValue } from '../enum/index.mjs';
8
8
  import { type TExclude } from '../exclude/index.mjs';
9
- import { type TExtends } from '../extends/index.mjs';
9
+ import { type TExtends, type MappedExtends, type MappedResultExtends } from '../extends/index.mjs';
10
10
  import { type TExtract } from '../extract/index.mjs';
11
- import { TIndex, type IndexedKeyResolve } from '../indexed/index.mjs';
11
+ import { TIndex, type IndexedPropertyKeys, type TMappedIndex } from '../indexed/index.mjs';
12
12
  import { type IntegerOptions, type TInteger } from '../integer/index.mjs';
13
13
  import { type IntersectOptions, type IntersectResolve } from '../intersect/index.mjs';
14
14
  import { type TCapitalize, type TUncapitalize, type TLowercase, type TUppercase } from '../intrinsic/index.mjs';
15
15
  import { type TKeyOf } from '../keyof/index.mjs';
16
16
  import { type TLiteral, type TLiteralValue } from '../literal/index.mjs';
17
+ import { type MappedFunction, type TMapped, type TMappedResult } from '../mapped/index.mjs';
17
18
  import { type TNever } from '../never/index.mjs';
18
19
  import { type TNot } from '../not/index.mjs';
19
20
  import { type TNull } from '../null/index.mjs';
21
+ import { type TMappedKey } from '../mapped/index.mjs';
20
22
  import { type TNumber, type NumberOptions } from '../number/index.mjs';
21
23
  import { type TObject, type TProperties, type ObjectOptions } from '../object/index.mjs';
22
24
  import { type TOmit } from '../omit/index.mjs';
@@ -51,25 +53,30 @@ export declare class JsonTypeBuilder {
51
53
  Const<T>(value: T, options?: SchemaOptions): TConst<T>;
52
54
  Deref<T extends TSchema>(schema: T, references: TSchema[]): TDeref<T>;
53
55
  Enum<V extends TEnumValue, T extends Record<TEnumKey, V>>(item: T, options?: SchemaOptions): TEnum<T>;
54
- Extends<L extends TSchema, R extends TSchema, T extends TSchema, U extends TSchema>(left: L, right: R, trueType: T, falseType: U, options?: SchemaOptions): TExtends<L, R, T, U>;
56
+ Extends<L extends TMappedResult, R extends TSchema, T extends TSchema, F extends TSchema>(L: L, R: R, T: T, F: F, options?: SchemaOptions): MappedResultExtends<L, R, T, F>;
57
+ Extends<L extends TMappedKey, R extends TSchema, T extends TSchema, F extends TSchema>(L: L, R: R, T: T, F: F, options?: SchemaOptions): MappedExtends<L, R, T, F>;
58
+ Extends<L extends TSchema, R extends TSchema, T extends TSchema, F extends TSchema>(L: L, R: R, T: T, F: F, options?: SchemaOptions): TExtends<L, R, T, F>;
55
59
  Exclude<L extends TSchema, R extends TSchema>(unionType: L, excludedMembers: R, options?: SchemaOptions): TExclude<L, R>;
56
60
  Extract<L extends TSchema, R extends TSchema>(type: L, union: R, options?: SchemaOptions): TExtract<L, R>;
57
- Index<T extends TSchema, K extends TSchema, I extends PropertyKey[] = IndexedKeyResolve<K>>(T: T, K: K, options?: SchemaOptions): TIndex<T, I>;
61
+ Index<T extends TSchema, K extends TMappedKey>(T: T, K: K): TMappedIndex<T, K>;
62
+ Index<T extends TSchema, K extends TSchema, I extends PropertyKey[] = IndexedPropertyKeys<K>>(T: T, K: K, options?: SchemaOptions): TIndex<T, I>;
58
63
  Index<T extends TSchema, K extends PropertyKey[]>(T: T, K: readonly [...K], options?: SchemaOptions): TIndex<T, K>;
59
64
  Integer(options?: IntegerOptions): TInteger;
60
65
  Intersect<T extends TSchema[]>(T: [...T], options?: IntersectOptions): IntersectResolve<T>;
61
66
  KeyOf<T extends TSchema>(schema: T, options?: SchemaOptions): TKeyOf<T>;
62
67
  Literal<T extends TLiteralValue>(value: T, options?: SchemaOptions): TLiteral<T>;
63
68
  Lowercase<T extends TSchema>(schema: T, options?: SchemaOptions): TLowercase<T>;
69
+ Mapped<K extends TSchema, I extends PropertyKey[] = IndexedPropertyKeys<K>, F extends MappedFunction<I> = MappedFunction<I>, R extends TMapped<I, F> = TMapped<I, F>>(key: K, map: F, options?: ObjectOptions): R;
70
+ Mapped<K extends PropertyKey[], F extends MappedFunction<K> = MappedFunction<K>, R extends TMapped<K, F> = TMapped<K, F>>(key: [...K], map: F, options?: ObjectOptions): R;
64
71
  Never(options?: SchemaOptions): TNever;
65
72
  Not<T extends TSchema>(schema: T, options?: SchemaOptions): TNot<T>;
66
73
  Null(options?: SchemaOptions): TNull;
67
74
  Number(options?: NumberOptions): TNumber;
68
75
  Object<T extends TProperties>(properties: T, options?: ObjectOptions): TObject<T>;
69
- Omit<T extends TSchema, K extends TSchema, I extends PropertyKey[] = IndexedKeyResolve<K>>(T: T, K: K, options?: SchemaOptions): TOmit<T, I>;
76
+ Omit<T extends TSchema, K extends TSchema, I extends PropertyKey[] = IndexedPropertyKeys<K>>(T: T, K: K, options?: SchemaOptions): TOmit<T, I>;
70
77
  Omit<T extends TSchema, K extends PropertyKey[]>(T: T, K: readonly [...K], options?: SchemaOptions): TOmit<T, K>;
71
78
  Partial<T extends TSchema>(schema: T, options?: ObjectOptions): TPartial<T>;
72
- Pick<T extends TSchema, K extends TSchema, I extends PropertyKey[] = IndexedKeyResolve<K>>(T: T, K: K, options?: SchemaOptions): TPick<T, I>;
79
+ Pick<T extends TSchema, K extends TSchema, I extends PropertyKey[] = IndexedPropertyKeys<K>>(T: T, K: K, options?: SchemaOptions): TPick<T, I>;
73
80
  Pick<T extends TSchema, K extends PropertyKey[]>(T: T, K: readonly [...K], options?: SchemaOptions): TPick<T, K>;
74
81
  Record<K extends TSchema, T extends TSchema>(key: K, schema: T, options?: ObjectOptions): RecordResolve<K, T>;
75
82
  Recursive<T extends TSchema>(callback: (thisType: TThis) => T, options?: SchemaOptions): TRecursive<T>;
@@ -14,6 +14,7 @@ import { Intersect } from '../intersect/index.mjs';
14
14
  import { Capitalize, Uncapitalize, Lowercase, Uppercase } from '../intrinsic/index.mjs';
15
15
  import { KeyOf } from '../keyof/index.mjs';
16
16
  import { Literal } from '../literal/index.mjs';
17
+ import { Mapped } from '../mapped/index.mjs';
17
18
  import { Never } from '../never/index.mjs';
18
19
  import { Not } from '../not/index.mjs';
19
20
  import { Null } from '../null/index.mjs';
@@ -75,8 +76,8 @@ export class JsonTypeBuilder {
75
76
  Enum(item, options = {}) {
76
77
  return Enum(item, options);
77
78
  }
78
- Extends(left, right, trueType, falseType, options = {}) {
79
- return Extends(left, right, trueType, falseType, options);
79
+ Extends(L, R, T, F, options = {}) {
80
+ return Extends(L, R, T, F, options);
80
81
  }
81
82
  Exclude(unionType, excludedMembers, options = {}) {
82
83
  return Exclude(unionType, excludedMembers, options);
@@ -102,6 +103,9 @@ export class JsonTypeBuilder {
102
103
  Lowercase(schema, options = {}) {
103
104
  return Lowercase(schema, options);
104
105
  }
106
+ Mapped(key, map, options = {}) {
107
+ return Mapped(key, map, options);
108
+ }
105
109
  Never(options = {}) {
106
110
  return Never(options);
107
111
  }
@@ -3,7 +3,7 @@ import { TypeSystemPolicy } from '../../system/index.mjs';
3
3
  import { Deref } from '../deref/index.mjs';
4
4
  import { Hash } from '../hash/index.mjs';
5
5
  import { Kind } from '../../type/symbols/index.mjs';
6
- import { KeyOfStringResolvePattern } from '../../type/keyof/index.mjs';
6
+ import { KeyOfPattern } from '../../type/keyof/index.mjs';
7
7
  import { ExtendsUndefinedCheck } from '../../type/extends/index.mjs';
8
8
  import { TSchema as IsSchemaType } from '../../type/guard/type.mjs';
9
9
  import { TypeRegistry, FormatRegistry } from '../../type/registry/index.mjs';
@@ -139,12 +139,12 @@ function TInteger(schema, references, value) {
139
139
  function TIntersect(schema, references, value) {
140
140
  const check1 = schema.allOf.every((schema) => Visit(schema, references, value));
141
141
  if (schema.unevaluatedProperties === false) {
142
- const keyPattern = new RegExp(KeyOfStringResolvePattern(schema));
142
+ const keyPattern = new RegExp(KeyOfPattern(schema));
143
143
  const check2 = Object.getOwnPropertyNames(value).every((key) => keyPattern.test(key));
144
144
  return check1 && check2;
145
145
  }
146
146
  else if (IsSchemaType(schema.unevaluatedProperties)) {
147
- const keyCheck = new RegExp(KeyOfStringResolvePattern(schema));
147
+ const keyCheck = new RegExp(KeyOfPattern(schema));
148
148
  const check2 = Object.getOwnPropertyNames(value).every((key) => keyCheck.test(key) || Visit(schema.unevaluatedProperties, references, value[key]));
149
149
  return check1 && check2;
150
150
  }
@@ -1,6 +1,6 @@
1
1
  import { IsString, IsObject, IsArray, IsUndefined } from '../guard/index.mjs';
2
2
  import { TSchema as IsSchemaType } from '../../type/guard/type.mjs';
3
- import { KeyOfStringResolve } from '../../type/keyof/keyof-string.mjs';
3
+ import { KeyOfPropertyKeys } from '../../type/keyof/index.mjs';
4
4
  import { Check } from '../check/index.mjs';
5
5
  import { Clone } from '../clone/index.mjs';
6
6
  import { Deref } from '../deref/index.mjs';
@@ -22,7 +22,7 @@ function TIntersect(schema, references, value) {
22
22
  const composite = intersections.reduce((acc, value) => (IsObject(value) ? { ...acc, ...value } : value), {});
23
23
  if (!IsObject(value) || !IsObject(composite) || !IsSchema(unevaluatedProperties))
24
24
  return composite;
25
- const knownkeys = KeyOfStringResolve(schema);
25
+ const knownkeys = KeyOfPropertyKeys(schema);
26
26
  for (const key of Object.getOwnPropertyNames(value)) {
27
27
  if (knownkeys.includes(key))
28
28
  continue;
@@ -1,8 +1,8 @@
1
1
  import { TTransform as IsTransformType, TSchema as IsSchemaType } from '../../type/guard/type.mjs';
2
2
  import { Kind, TransformKind } from '../../type/symbols/index.mjs';
3
3
  import { IsPlainObject, IsArray, IsValueType } from '../guard/index.mjs';
4
- import { KeyOfStringResolve } from '../../type/keyof/index.mjs';
5
- import { IndexedTypeResolve } from '../../type/indexed/index.mjs';
4
+ import { KeyOfPropertyKeys } from '../../type/keyof/index.mjs';
5
+ import { IndexedType } from '../../type/indexed/index.mjs';
6
6
  import { Deref } from '../deref/index.mjs';
7
7
  import { Check } from '../check/index.mjs';
8
8
  export class TransformDecodeCheckError extends Error {
@@ -41,10 +41,10 @@ function TArray(schema, references, value) {
41
41
  function TIntersect(schema, references, value) {
42
42
  if (!IsPlainObject(value) || IsValueType(value))
43
43
  return Default(schema, value);
44
- const knownKeys = KeyOfStringResolve(schema);
44
+ const knownKeys = KeyOfPropertyKeys(schema);
45
45
  const knownProperties = knownKeys.reduce((value, key) => {
46
46
  return (key in value)
47
- ? { ...value, [key]: Visit(IndexedTypeResolve(schema, [key]), references, value[key]) }
47
+ ? { ...value, [key]: Visit(IndexedType(schema, [key]), references, value[key]) }
48
48
  : value;
49
49
  }, value);
50
50
  if (!IsTransformType(schema.unevaluatedProperties)) {
@@ -65,7 +65,7 @@ function TNot(schema, references, value) {
65
65
  function TObject(schema, references, value) {
66
66
  if (!IsPlainObject(value))
67
67
  return Default(schema, value);
68
- const knownKeys = KeyOfStringResolve(schema);
68
+ const knownKeys = KeyOfPropertyKeys(schema);
69
69
  const knownProperties = knownKeys.reduce((value, key) => {
70
70
  return (key in value)
71
71
  ? { ...value, [key]: Visit(schema.properties[key], references, value[key]) }
@@ -1,8 +1,8 @@
1
1
  import { TTransform as IsTransformType, TSchema as IsSchemaType } from '../../type/guard/type.mjs';
2
2
  import { Kind, TransformKind } from '../../type/symbols/index.mjs';
3
3
  import { IsPlainObject, IsArray, IsValueType } from '../guard/index.mjs';
4
- import { KeyOfStringResolve } from '../../type/keyof/index.mjs';
5
- import { IndexedTypeResolve } from '../../type/indexed/index.mjs';
4
+ import { KeyOfPropertyKeys } from '../../type/keyof/index.mjs';
5
+ import { IndexedType } from '../../type/indexed/index.mjs';
6
6
  import { Deref } from '../deref/index.mjs';
7
7
  import { Check } from '../check/index.mjs';
8
8
  export class TransformEncodeCheckError extends Error {
@@ -43,10 +43,10 @@ function TIntersect(schema, references, value) {
43
43
  const defaulted = Default(schema, value);
44
44
  if (!IsPlainObject(value) || IsValueType(value))
45
45
  return defaulted;
46
- const knownKeys = KeyOfStringResolve(schema);
46
+ const knownKeys = KeyOfPropertyKeys(schema);
47
47
  const knownProperties = knownKeys.reduce((value, key) => {
48
48
  return key in defaulted
49
- ? { ...value, [key]: Visit(IndexedTypeResolve(schema, [key]), references, value[key]) }
49
+ ? { ...value, [key]: Visit(IndexedType(schema, [key]), references, value[key]) }
50
50
  : value;
51
51
  }, defaulted);
52
52
  if (!IsTransformType(schema.unevaluatedProperties)) {
@@ -67,7 +67,7 @@ function TObject(schema, references, value) {
67
67
  const defaulted = Default(schema, value);
68
68
  if (!IsPlainObject(value))
69
69
  return defaulted;
70
- const knownKeys = KeyOfStringResolve(schema);
70
+ const knownKeys = KeyOfPropertyKeys(schema);
71
71
  const knownProperties = knownKeys.reduce((value, key) => {
72
72
  return key in value
73
73
  ? { ...value, [key]: Visit(schema.properties[key], references, value[key]) }
@@ -237,12 +237,12 @@ var TypeCompiler;
237
237
  function* TIntersect(schema, references, value) {
238
238
  const check1 = schema.allOf.map((schema) => CreateExpression(schema, references, value)).join(' && ');
239
239
  if (schema.unevaluatedProperties === false) {
240
- const keyCheck = CreateVariable(`${new RegExp((0, index_9.KeyOfStringResolvePattern)(schema))};`);
240
+ const keyCheck = CreateVariable(`${new RegExp((0, index_9.KeyOfPattern)(schema))};`);
241
241
  const check2 = `Object.getOwnPropertyNames(${value}).every(key => ${keyCheck}.test(key))`;
242
242
  yield `(${check1} && ${check2})`;
243
243
  }
244
244
  else if ((0, type_1.TSchema)(schema.unevaluatedProperties)) {
245
- const keyCheck = CreateVariable(`${new RegExp((0, index_9.KeyOfStringResolvePattern)(schema))};`);
245
+ const keyCheck = CreateVariable(`${new RegExp((0, index_9.KeyOfPattern)(schema))};`);
246
246
  const check2 = `Object.getOwnPropertyNames(${value}).every(key => ${keyCheck}.test(key) || ${CreateExpression(schema.unevaluatedProperties, references, `${value}[key]`)})`;
247
247
  yield `(${check1} && ${check2})`;
248
248
  }
@@ -227,7 +227,7 @@ function* TIntersect(schema, references, path, value) {
227
227
  }
228
228
  }
229
229
  if (schema.unevaluatedProperties === false) {
230
- const keyCheck = new RegExp((0, index_3.KeyOfStringResolvePattern)(schema));
230
+ const keyCheck = new RegExp((0, index_3.KeyOfPattern)(schema));
231
231
  for (const valueKey of Object.getOwnPropertyNames(value)) {
232
232
  if (!keyCheck.test(valueKey)) {
233
233
  yield Create(ValueErrorType.IntersectUnevaluatedProperties, schema, `${path}/${valueKey}`, value);
@@ -235,7 +235,7 @@ function* TIntersect(schema, references, path, value) {
235
235
  }
236
236
  }
237
237
  if (typeof schema.unevaluatedProperties === 'object') {
238
- const keyCheck = new RegExp((0, index_3.KeyOfStringResolvePattern)(schema));
238
+ const keyCheck = new RegExp((0, index_3.KeyOfPattern)(schema));
239
239
  for (const valueKey of Object.getOwnPropertyNames(value)) {
240
240
  if (!keyCheck.test(valueKey)) {
241
241
  const next = Visit(schema.unevaluatedProperties, references, `${path}/${valueKey}`, value[valueKey]).next();
@@ -21,15 +21,15 @@ export { Extends, type TExtends, ExtendsCheck, ExtendsResult, ExtendsUndefinedCh
21
21
  export { Extract, type TExtract } from './type/extract/index';
22
22
  export { Function, type TFunction } from './type/function/index';
23
23
  export { Increment, type Assert, type AssertType, type AssertRest, type AssertProperties, type Ensure, type Evaluate, type TupleToIntersect, type TupleToUnion, type UnionToTuple } from './type/helpers/index';
24
- export { Index, type TIndex, IndexedKeyResolve, IndexedTypeResolve } from './type/indexed/index';
24
+ export { Index, type TIndex, type TMappedIndex, IndexedPropertyKeys, IndexedType, MappedIndex } from './type/indexed/index';
25
25
  export { InstanceType, type TInstanceType } from './type/instance-type/index';
26
26
  export { Integer, type TInteger, type IntegerOptions } from './type/integer/index';
27
27
  export { Intersect, type TIntersect, type IntersectOptions } from './type/intersect/index';
28
28
  export { Iterator, type TIterator } from './type/iterator/index';
29
29
  export { Capitalize, type TCapitalize, Lowercase, type TLowercase, Uncapitalize, type TUncapitalize, Uppercase, type TUppercase, IntrinsicResolve } from './type/intrinsic/index';
30
- export { KeyOf, type TKeyOf, KeyOfStringResolve, KeyOfStringResolvePattern, KeyOfTypeResolve } from './type/keyof/index';
30
+ export { KeyOf, type TKeyOf, KeyOfPropertyKeys, KeyOfPattern } from './type/keyof/index';
31
31
  export { Literal, type TLiteral } from './type/literal/index';
32
- export { Mapped, type TMappedKey, type MappedFunction, type TMappedResult } from './type/mapped/index';
32
+ export { Mapped, type MappedKey as TMappedKey, type MappedFunction, type TMapped as TMappedResult } from './type/mapped/index';
33
33
  export { Never, type TNever } from './type/never/index';
34
34
  export { Not, type TNot } from './type/not/index';
35
35
  export { Null, type TNull } from './type/null/index';
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.IntrinsicResolve = exports.Uppercase = exports.Uncapitalize = exports.Lowercase = exports.Capitalize = exports.Iterator = exports.Intersect = exports.Integer = exports.InstanceType = exports.IndexedTypeResolve = exports.IndexedKeyResolve = 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.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;
4
- exports.JavaScriptTypeBuilder = exports.JsonTypeBuilder = exports.Type = exports.Void = exports.Unsafe = exports.Unknown = exports.Union = exports.Undefined = exports.Uint8Array = exports.Tuple = exports.TransformEncodeBuilder = exports.TransformDecodeBuilder = exports.Transform = exports.TemplateLiteralGenerate = exports.TemplateLiteralParseExact = exports.TemplateLiteralParse = exports.IsTemplateLiteralFinite = 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.Readonly = exports.Promise = exports.Pick = exports.Partial = exports.Parameters = exports.Optional = exports.Omit = exports.Object = exports.Number = exports.Null = exports.Not = exports.Never = exports.Mapped = exports.Literal = exports.KeyOfTypeResolve = exports.KeyOfStringResolvePattern = exports.KeyOfStringResolve = exports.KeyOf = void 0;
3
+ exports.Uppercase = exports.Uncapitalize = exports.Lowercase = exports.Capitalize = exports.Iterator = exports.Intersect = exports.Integer = exports.InstanceType = exports.MappedIndex = exports.IndexedType = exports.IndexedPropertyKeys = 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.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;
4
+ exports.JavaScriptTypeBuilder = exports.JsonTypeBuilder = exports.Type = exports.Void = exports.Unsafe = exports.Unknown = exports.Union = exports.Undefined = exports.Uint8Array = exports.Tuple = exports.TransformEncodeBuilder = exports.TransformDecodeBuilder = exports.Transform = exports.TemplateLiteralGenerate = exports.TemplateLiteralParseExact = exports.TemplateLiteralParse = exports.IsTemplateLiteralFinite = 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.Readonly = exports.Promise = exports.Pick = exports.Partial = exports.Parameters = exports.Optional = exports.Omit = exports.Object = exports.Number = exports.Null = exports.Not = exports.Never = exports.Mapped = exports.Literal = exports.KeyOfPattern = exports.KeyOfPropertyKeys = exports.KeyOf = exports.IntrinsicResolve = void 0;
5
5
  var index_1 = require("./type/symbols/index");
6
6
  Object.defineProperty(exports, "Kind", { enumerable: true, get: function () { return index_1.Kind; } });
7
7
  Object.defineProperty(exports, "Hint", { enumerable: true, get: function () { return index_1.Hint; } });
@@ -65,8 +65,9 @@ var index_22 = require("./type/helpers/index");
65
65
  Object.defineProperty(exports, "Increment", { enumerable: true, get: function () { return index_22.Increment; } });
66
66
  var index_23 = require("./type/indexed/index");
67
67
  Object.defineProperty(exports, "Index", { enumerable: true, get: function () { return index_23.Index; } });
68
- Object.defineProperty(exports, "IndexedKeyResolve", { enumerable: true, get: function () { return index_23.IndexedKeyResolve; } });
69
- Object.defineProperty(exports, "IndexedTypeResolve", { enumerable: true, get: function () { return index_23.IndexedTypeResolve; } });
68
+ Object.defineProperty(exports, "IndexedPropertyKeys", { enumerable: true, get: function () { return index_23.IndexedPropertyKeys; } });
69
+ Object.defineProperty(exports, "IndexedType", { enumerable: true, get: function () { return index_23.IndexedType; } });
70
+ Object.defineProperty(exports, "MappedIndex", { enumerable: true, get: function () { return index_23.MappedIndex; } });
70
71
  var index_24 = require("./type/instance-type/index");
71
72
  Object.defineProperty(exports, "InstanceType", { enumerable: true, get: function () { return index_24.InstanceType; } });
72
73
  var index_25 = require("./type/integer/index");
@@ -83,9 +84,8 @@ Object.defineProperty(exports, "Uppercase", { enumerable: true, get: function ()
83
84
  Object.defineProperty(exports, "IntrinsicResolve", { enumerable: true, get: function () { return index_28.IntrinsicResolve; } });
84
85
  var index_29 = require("./type/keyof/index");
85
86
  Object.defineProperty(exports, "KeyOf", { enumerable: true, get: function () { return index_29.KeyOf; } });
86
- Object.defineProperty(exports, "KeyOfStringResolve", { enumerable: true, get: function () { return index_29.KeyOfStringResolve; } });
87
- Object.defineProperty(exports, "KeyOfStringResolvePattern", { enumerable: true, get: function () { return index_29.KeyOfStringResolvePattern; } });
88
- Object.defineProperty(exports, "KeyOfTypeResolve", { enumerable: true, get: function () { return index_29.KeyOfTypeResolve; } });
87
+ Object.defineProperty(exports, "KeyOfPropertyKeys", { enumerable: true, get: function () { return index_29.KeyOfPropertyKeys; } });
88
+ Object.defineProperty(exports, "KeyOfPattern", { enumerable: true, get: function () { return index_29.KeyOfPattern; } });
89
89
  var index_30 = require("./type/literal/index");
90
90
  Object.defineProperty(exports, "Literal", { enumerable: true, get: function () { return index_30.Literal; } });
91
91
  var index_31 = require("./type/mapped/index");
@@ -1,10 +1,10 @@
1
1
  import type { UnionToTuple, Assert, Evaluate } from '../helpers/index';
2
2
  import { type TObject, type ObjectOptions } from '../object/index';
3
3
  import { type TIntersect } from '../intersect/index';
4
- import { IndexedTypeResolve } from '../indexed/index';
4
+ import { IndexedType } from '../indexed/index';
5
5
  type CompositeKeys<T extends TObject[]> = T extends [infer L extends TObject, ...infer R extends TObject[]] ? keyof L['properties'] | CompositeKeys<R> : never;
6
6
  type CompositeIndex<T extends TIntersect<TObject[]>, K extends string[]> = K extends [infer L extends string, ...infer R extends string[]] ? {
7
- [_ in L]: IndexedTypeResolve<T, [L]>;
7
+ [_ in L]: IndexedType<T, [L]>;
8
8
  } & CompositeIndex<T, R> : {};
9
9
  type CompositeReduce<T extends TObject[]> = UnionToTuple<CompositeKeys<T>> extends infer K ? Evaluate<CompositeIndex<TIntersect<T>, Assert<K, string[]>>> : {};
10
10
  export type CompositeResolve<T extends TObject[]> = TIntersect<T> extends TIntersect ? TObject<CompositeReduce<T>> : TObject<{}>;
@@ -8,7 +8,7 @@ const index_4 = require("../indexed/index");
8
8
  const type_1 = require("../clone/type");
9
9
  function CompositeResolve(T) {
10
10
  const intersect = (0, index_2.Intersect)(T, {});
11
- const keys = (0, index_3.KeyOfStringResolve)(intersect);
11
+ const keys = (0, index_3.KeyOfPropertyKeys)(intersect);
12
12
  const properties = keys.reduce((acc, key) => ({ ...acc, [key]: (0, index_4.Index)(intersect, [key]) }), {});
13
13
  return (0, index_1.Object)(properties);
14
14
  }
@@ -0,0 +1,13 @@
1
+ import type { TSchema } from '../schema/index';
2
+ import type { TProperties } from '../object/index';
3
+ import { type TMappedResult } from '../mapped/index';
4
+ import { type TExtends } from './extends';
5
+ type MappedResultExtendsPropertyKeys<K extends TProperties, U extends TSchema, L extends TSchema, R extends TSchema> = ({
6
+ [K2 in keyof K]: TExtends<K[K2], U, L, R>;
7
+ });
8
+ declare function MappedResultExtendsPropertyKeys<K extends TProperties, U extends TSchema, L extends TSchema, R extends TSchema>(K: K, U: U, L: L, R: R): MappedResultExtendsPropertyKeys<K, U, L, R>;
9
+ type MappedResultExtendsProperties<K extends TMappedResult, U extends TSchema, L extends TSchema, R extends TSchema> = (MappedResultExtendsPropertyKeys<K['properties'], U, L, R>);
10
+ declare function MappedResultExtendsProperties<K extends TMappedResult, U extends TSchema, L extends TSchema, R extends TSchema>(K: K, U: U, L: L, R: R): MappedResultExtendsProperties<K, U, L, R>;
11
+ export type MappedResultExtends<T extends TMappedResult, U extends TSchema, L extends TSchema, R extends TSchema, P extends TProperties = MappedResultExtendsProperties<T, U, L, R>> = (TMappedResult<P>);
12
+ export declare function MappedResultExtends<T extends TMappedResult, U extends TSchema, L extends TSchema, R extends TSchema, P extends TProperties = MappedResultExtendsProperties<T, U, L, R>>(T: T, U: U, L: L, R: R): TMappedResult<P>;
13
+ export {};