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

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 (124) hide show
  1. package/build/import/index.d.mts +5 -5
  2. package/build/import/index.mjs +3 -3
  3. package/build/import/type/composite/composite.d.mts +2 -2
  4. package/build/import/type/extends/extends-mapped-result-from-result.d.mts +13 -0
  5. package/build/import/type/extends/extends-mapped-result-from-result.mjs +14 -0
  6. package/build/import/type/extends/extends-mapped-result.d.mts +13 -9
  7. package/build/import/type/extends/extends-mapped-result.mjs +15 -8
  8. package/build/import/type/extends/extends.d.mts +4 -4
  9. package/build/import/type/extends/extends.mjs +4 -4
  10. package/build/import/type/extends/index.d.mts +1 -1
  11. package/build/import/type/extends/index.mjs +1 -1
  12. package/build/import/type/indexed/index.d.mts +2 -2
  13. package/build/import/type/indexed/index.mjs +2 -2
  14. package/build/import/type/indexed/{indexed-mapped.d.mts → indexed-mapped-result.d.mts} +4 -4
  15. package/build/import/type/indexed/{indexed-mapped.mjs → indexed-mapped-result.mjs} +3 -3
  16. package/build/import/type/indexed/indexed-property-keys.d.mts +3 -3
  17. package/build/import/type/indexed/indexed-property-keys.mjs +2 -2
  18. package/build/import/type/indexed/{indexed-type.d.mts → indexed-result.d.mts} +2 -2
  19. package/build/import/type/indexed/{indexed-type.mjs → indexed-result.mjs} +1 -1
  20. package/build/import/type/indexed/indexed.d.mts +6 -6
  21. package/build/import/type/indexed/indexed.mjs +6 -6
  22. package/build/import/type/intrinsic/capitalize.d.mts +4 -0
  23. package/build/import/type/intrinsic/capitalize.mjs +5 -0
  24. package/build/import/type/intrinsic/index.d.mts +5 -0
  25. package/build/import/type/intrinsic/index.mjs +5 -0
  26. package/build/import/type/intrinsic/intrinsic-mapped-result.d.mts +15 -0
  27. package/build/import/type/intrinsic/intrinsic-mapped-result.mjs +21 -0
  28. package/build/import/type/intrinsic/intrinsic.d.mts +9 -14
  29. package/build/import/type/intrinsic/intrinsic.mjs +10 -21
  30. package/build/import/type/intrinsic/lowercase.d.mts +4 -0
  31. package/build/import/type/intrinsic/lowercase.mjs +5 -0
  32. package/build/import/type/intrinsic/uncapitalize.d.mts +4 -0
  33. package/build/import/type/intrinsic/uncapitalize.mjs +5 -0
  34. package/build/import/type/intrinsic/uppercase.d.mts +4 -0
  35. package/build/import/type/intrinsic/uppercase.mjs +5 -0
  36. package/build/import/type/mapped/index.d.mts +2 -0
  37. package/build/import/type/mapped/index.mjs +2 -0
  38. package/build/import/type/mapped/mapped-key.d.mts +8 -0
  39. package/build/import/type/mapped/mapped-key.mjs +7 -0
  40. package/build/import/type/mapped/mapped-result.d.mts +9 -0
  41. package/build/import/type/mapped/mapped-result.mjs +7 -0
  42. package/build/import/type/mapped/mapped.d.mts +17 -27
  43. package/build/import/type/mapped/mapped.mjs +22 -32
  44. package/build/import/type/omit/index.d.mts +1 -0
  45. package/build/import/type/omit/index.mjs +1 -0
  46. package/build/import/type/omit/omit-mapped-result.d.mts +15 -0
  47. package/build/import/type/omit/omit-mapped-result.mjs +20 -0
  48. package/build/import/type/omit/omit.d.mts +5 -2
  49. package/build/import/type/omit/omit.mjs +12 -6
  50. package/build/import/type/pick/index.d.mts +1 -0
  51. package/build/import/type/pick/index.mjs +1 -0
  52. package/build/import/type/pick/pick-mapped-result.d.mts +15 -0
  53. package/build/import/type/pick/pick-mapped-result.mjs +20 -0
  54. package/build/import/type/pick/pick.d.mts +5 -2
  55. package/build/import/type/pick/pick.mjs +12 -6
  56. package/build/import/type/record/record.mjs +4 -4
  57. package/build/import/type/type/json.d.mts +15 -13
  58. package/build/import/value/transform/decode.mjs +2 -2
  59. package/build/import/value/transform/encode.mjs +2 -2
  60. package/build/require/index.d.ts +5 -5
  61. package/build/require/index.js +7 -6
  62. package/build/require/type/composite/composite.d.ts +2 -2
  63. package/build/require/type/extends/extends-mapped-result-from-result.d.ts +13 -0
  64. package/build/require/type/extends/extends-mapped-result-from-result.js +18 -0
  65. package/build/require/type/extends/extends-mapped-result.d.ts +13 -9
  66. package/build/require/type/extends/extends-mapped-result.js +17 -10
  67. package/build/require/type/extends/extends.d.ts +4 -4
  68. package/build/require/type/extends/extends.js +3 -3
  69. package/build/require/type/extends/index.d.ts +1 -1
  70. package/build/require/type/extends/index.js +1 -1
  71. package/build/require/type/indexed/index.d.ts +2 -2
  72. package/build/require/type/indexed/index.js +2 -2
  73. package/build/require/type/indexed/{indexed-mapped.d.ts → indexed-mapped-result.d.ts} +4 -4
  74. package/build/require/type/indexed/{indexed-mapped.js → indexed-mapped-result.js} +5 -5
  75. package/build/require/type/indexed/indexed-property-keys.d.ts +3 -3
  76. package/build/require/type/indexed/indexed-property-keys.js +4 -4
  77. package/build/require/type/indexed/{indexed-type.d.ts → indexed-result.d.ts} +2 -2
  78. package/build/require/type/indexed/{indexed-type.js → indexed-result.js} +3 -3
  79. package/build/require/type/indexed/indexed.d.ts +6 -6
  80. package/build/require/type/indexed/indexed.js +5 -5
  81. package/build/require/type/intrinsic/capitalize.d.ts +4 -0
  82. package/build/require/type/intrinsic/capitalize.js +9 -0
  83. package/build/require/type/intrinsic/index.d.ts +5 -0
  84. package/build/require/type/intrinsic/index.js +5 -0
  85. package/build/require/type/intrinsic/intrinsic-mapped-result.d.ts +15 -0
  86. package/build/require/type/intrinsic/intrinsic-mapped-result.js +25 -0
  87. package/build/require/type/intrinsic/intrinsic.d.ts +9 -14
  88. package/build/require/type/intrinsic/intrinsic.js +10 -25
  89. package/build/require/type/intrinsic/lowercase.d.ts +4 -0
  90. package/build/require/type/intrinsic/lowercase.js +9 -0
  91. package/build/require/type/intrinsic/uncapitalize.d.ts +4 -0
  92. package/build/require/type/intrinsic/uncapitalize.js +9 -0
  93. package/build/require/type/intrinsic/uppercase.d.ts +4 -0
  94. package/build/require/type/intrinsic/uppercase.js +9 -0
  95. package/build/require/type/mapped/index.d.ts +2 -0
  96. package/build/require/type/mapped/index.js +2 -0
  97. package/build/require/type/mapped/mapped-key.d.ts +8 -0
  98. package/build/require/type/mapped/mapped-key.js +11 -0
  99. package/build/require/type/mapped/mapped-result.d.ts +9 -0
  100. package/build/require/type/mapped/mapped-result.js +11 -0
  101. package/build/require/type/mapped/mapped.d.ts +17 -27
  102. package/build/require/type/mapped/mapped.js +31 -45
  103. package/build/require/type/omit/index.d.ts +1 -0
  104. package/build/require/type/omit/index.js +1 -0
  105. package/build/require/type/omit/omit-mapped-result.d.ts +15 -0
  106. package/build/require/type/omit/omit-mapped-result.js +24 -0
  107. package/build/require/type/omit/omit.d.ts +5 -2
  108. package/build/require/type/omit/omit.js +10 -4
  109. package/build/require/type/pick/index.d.ts +1 -0
  110. package/build/require/type/pick/index.js +1 -0
  111. package/build/require/type/pick/pick-mapped-result.d.ts +15 -0
  112. package/build/require/type/pick/pick-mapped-result.js +24 -0
  113. package/build/require/type/pick/pick.d.ts +5 -2
  114. package/build/require/type/pick/pick.js +10 -4
  115. package/build/require/type/record/record.js +2 -2
  116. package/build/require/type/type/json.d.ts +15 -13
  117. package/build/require/value/transform/decode.js +1 -1
  118. package/build/require/value/transform/encode.js +1 -1
  119. package/package.json +1 -1
  120. package/readme.md +115 -47
  121. package/build/import/type/extends/extends-mapped.d.mts +0 -17
  122. package/build/import/type/extends/extends-mapped.mjs +0 -21
  123. package/build/require/type/extends/extends-mapped.d.ts +0 -17
  124. package/build/require/type/extends/extends-mapped.js +0 -25
@@ -0,0 +1,7 @@
1
+ import { Kind } from '../symbols/index.mjs';
2
+ export function MappedResult(properties) {
3
+ return {
4
+ [Kind]: 'MappedResult',
5
+ properties
6
+ };
7
+ }
@@ -1,11 +1,10 @@
1
1
  import type { TSchema } from '../schema/index.mjs';
2
2
  import type { Ensure, Evaluate } from '../helpers/index.mjs';
3
- import { IndexedPropertyKeys } from '../indexed/index.mjs';
4
- import { Kind } from '../symbols/index.mjs';
5
3
  import { type TArray } from '../array/index.mjs';
6
4
  import { type TAsyncIterator } from '../async-iterator/index.mjs';
7
5
  import { type TConstructor } from '../constructor/index.mjs';
8
6
  import { type TFunction } from '../function/index.mjs';
7
+ import { type TIndexPropertyKeys } from '../indexed/index.mjs';
9
8
  import { type TIntersect } from '../intersect/index.mjs';
10
9
  import { type TIterator } from '../iterator/index.mjs';
11
10
  import { type TLiteral, type TLiteralValue } from '../literal/index.mjs';
@@ -14,37 +13,28 @@ import { type TObject, type TProperties, type ObjectOptions } from '../object/in
14
13
  import { type TOptional } from '../optional/index.mjs';
15
14
  import { type TPromise } from '../promise/index.mjs';
16
15
  import { type TReadonly } from '../readonly/index.mjs';
16
+ import { type TTuple } from '../tuple/index.mjs';
17
17
  import { type TUnion } from '../union/index.mjs';
18
- export interface TMappedKey<T extends PropertyKey[] = PropertyKey[]> extends TSchema {
19
- [Kind]: 'MappedKey';
20
- static: T[number];
21
- keys: T;
22
- }
23
- export declare function MappedKey<T extends PropertyKey[]>(T: [...T]): TMappedKey<T>;
24
- export type MappedFunction<K extends PropertyKey[], I = TMappedKey<K>> = (T: I) => TSchema;
25
- type FromMappedResult<K extends PropertyKey, P extends TProperties> = (K extends keyof P ? FromMappedPropertyKey<K, P[K]> : TNever);
18
+ import type { TMappedResult } from './mapped-result.mjs';
19
+ import type { TMappedKey } from './mapped-key.mjs';
20
+ type FromMappedResult<K extends PropertyKey, P extends TProperties> = (K extends keyof P ? FromSchemaType<K, P[K]> : TNever);
26
21
  declare function FromMappedResult<K extends PropertyKey, P extends TProperties>(K: K, P: P): FromMappedResult<K, P>;
27
22
  type FromMappedKey<K extends PropertyKey, _ extends PropertyKey[]> = (K extends TLiteralValue ? TLiteral<K> : TLiteral<'never'>);
28
23
  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>] : [];
24
+ type FromRest<K extends PropertyKey, T extends TSchema[]> = T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? [FromSchemaType<K, L>, ...FromRest<K, R>] : [];
30
25
  declare function FromRest<K extends PropertyKey, T extends TSchema[]>(K: K, T: [...T]): FromRest<K, T>;
31
26
  type FromProperties<K extends PropertyKey, T extends TProperties, R extends TProperties = Evaluate<{
32
- [K2 in keyof T]: FromMappedPropertyKey<K, T[K2]>;
27
+ [K2 in keyof T]: FromSchemaType<K, T[K2]>;
33
28
  }>> = R;
34
29
  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 {
42
- [Kind]: 'MappedResult';
43
- properties: T;
44
- static: unknown;
45
- }
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;
30
+ type FromSchemaType<K extends PropertyKey, T extends TSchema> = (T extends TReadonly<infer S> ? TReadonly<FromSchemaType<K, S>> : T extends TOptional<infer S> ? TOptional<FromSchemaType<K, S>> : T extends TMappedResult<infer P> ? FromMappedResult<K, P> : T extends TMappedKey<infer P> ? FromMappedKey<K, P> : T extends TConstructor<infer S extends TSchema[], infer R extends TSchema> ? TConstructor<FromRest<K, S>, FromSchemaType<K, R>> : T extends TFunction<infer S extends TSchema[], infer R extends TSchema> ? TFunction<FromRest<K, S>, FromSchemaType<K, R>> : T extends TAsyncIterator<infer S> ? TAsyncIterator<FromSchemaType<K, S>> : T extends TIterator<infer S> ? TIterator<FromSchemaType<K, S>> : T extends TIntersect<infer S> ? TIntersect<FromRest<K, S>> : T extends TUnion<infer S> ? TUnion<FromRest<K, S>> : T extends TTuple<infer S> ? TTuple<FromRest<K, S>> : T extends TObject<infer S> ? TObject<FromProperties<K, S>> : T extends TArray<infer S> ? TArray<FromSchemaType<K, S>> : T extends TPromise<infer S> ? TPromise<FromSchemaType<K, S>> : T);
31
+ declare function FromSchemaType<K extends PropertyKey, T extends TSchema>(K: K, T: T): FromSchemaType<K, T>;
32
+ type FromMappedFunctionReturnType<K extends PropertyKey[], T extends TSchema> = (K extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? {
33
+ [_ in L]: FromSchemaType<L, T>;
34
+ } & FromMappedFunctionReturnType<R, T> : {});
35
+ declare function FromMappedFunctionReturnType<K extends PropertyKey[], T extends TSchema>(K: [...K], T: T): FromMappedFunctionReturnType<K, T>;
36
+ export type TMappedFunction<K extends PropertyKey[], I = TMappedKey<K>> = (T: I) => TSchema;
37
+ export type TMapped<K extends PropertyKey[], F extends TMappedFunction<K>, R extends TProperties = Evaluate<FromMappedFunctionReturnType<K, ReturnType<F>>>> = Ensure<TObject<R>>;
38
+ export declare function Mapped<K extends TSchema, I extends PropertyKey[] = TIndexPropertyKeys<K>, F extends TMappedFunction<I> = TMappedFunction<I>, R extends TMapped<I, F> = TMapped<I, F>>(key: K, map: F, options?: ObjectOptions): R;
39
+ export declare function Mapped<K extends PropertyKey[], F extends TMappedFunction<K> = TMappedFunction<K>, R extends TMapped<K, F> = TMapped<K, F>>(key: [...K], map: F, options?: ObjectOptions): R;
50
40
  export {};
@@ -1,4 +1,3 @@
1
- import { IndexedPropertyKeys } from '../indexed/index.mjs';
2
1
  import { TSchema as IsSchemaType } from '../guard/type.mjs';
3
2
  import { Kind, OptionalKind, ReadonlyKind } from '../symbols/index.mjs';
4
3
  import { CloneType } from '../clone/type.mjs';
@@ -7,6 +6,7 @@ import { Array } from '../array/index.mjs';
7
6
  import { AsyncIterator } from '../async-iterator/index.mjs';
8
7
  import { Constructor } from '../constructor/index.mjs';
9
8
  import { Function as FunctionType } from '../function/index.mjs';
9
+ import { IndexPropertyKeys } from '../indexed/index.mjs';
10
10
  import { Intersect } from '../intersect/index.mjs';
11
11
  import { Iterator } from '../iterator/index.mjs';
12
12
  import { Literal } from '../literal/index.mjs';
@@ -15,17 +15,12 @@ import { Object } from '../object/index.mjs';
15
15
  import { Optional } from '../optional/index.mjs';
16
16
  import { Promise } from '../promise/index.mjs';
17
17
  import { Readonly } from '../readonly/index.mjs';
18
+ import { Tuple } from '../tuple/index.mjs';
18
19
  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
- }
20
+ import { TArray as IsArrayType, TAsyncIterator as IsAsyncIteratorType, TConstructor as IsConstructorType, TFunction as IsFunctionType, TIntersect as IsIntersectType, TIterator as IsIteratorType, TReadonly as IsReadonlyType, TMappedResult as IsMappedResultType, TMappedKey as IsMappedKeyType, TObject as IsObjectType, TOptional as IsOptionalType, TPromise as IsPromiseType, TTuple as IsTupleType, TUnion as IsUnionType, } from '../guard/type.mjs';
26
21
  function FromMappedResult(K, P) {
27
22
  return (K in P
28
- ? FromMappedPropertyKey(K, P[K])
23
+ ? FromSchemaType(K, P[K])
29
24
  : Never());
30
25
  }
31
26
  function FromMappedKey(K, _) {
@@ -34,45 +29,40 @@ function FromMappedKey(K, _) {
34
29
  function FromRest(K, T) {
35
30
  const [L, ...R] = T;
36
31
  return (T.length > 0
37
- ? [FromMappedPropertyKey(K, L), ...FromRest(K, R)]
32
+ ? [FromSchemaType(K, L), ...FromRest(K, R)]
38
33
  : []);
39
34
  }
40
35
  function FromProperties(K, T) {
41
36
  return globalThis.Object.getOwnPropertyNames(T).reduce((Acc, K2) => {
42
- return { ...Acc, [K2]: FromMappedPropertyKey(K, T[K2]) };
37
+ return { ...Acc, [K2]: FromSchemaType(K, T[K2]) };
43
38
  }, {});
44
39
  }
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]))) :
40
+ function FromSchemaType(K, T) {
41
+ return (IsOptionalType(T) ? Optional(FromSchemaType(K, Discard(T, [OptionalKind]))) :
42
+ IsReadonlyType(T) ? Readonly(FromSchemaType(K, Discard(T, [ReadonlyKind]))) :
48
43
  IsMappedResultType(T) ? FromMappedResult(K, T.properties) :
49
44
  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)) :
45
+ IsConstructorType(T) ? Constructor(FromRest(K, T.parameters), FromSchemaType(K, T.returns)) :
46
+ IsFunctionType(T) ? FunctionType(FromRest(K, T.parameters), FromSchemaType(K, T.returns)) :
47
+ IsAsyncIteratorType(T) ? AsyncIterator(FromSchemaType(K, T.items)) :
48
+ IsIteratorType(T) ? Iterator(FromSchemaType(K, T.items)) :
54
49
  IsIntersectType(T) ? Intersect(FromRest(K, T.allOf)) :
55
50
  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);
51
+ IsTupleType(T) ? Tuple(FromRest(K, T.items ?? [])) :
52
+ IsObjectType(T) ? Object(FromProperties(K, T.properties)) :
53
+ IsArrayType(T) ? Array(FromSchemaType(K, T.items)) :
54
+ IsPromiseType(T) ? Promise(FromSchemaType(K, T.item)) :
55
+ T);
60
56
  }
61
- export function FromMappedPropertyKeys(K, T) {
57
+ function FromMappedFunctionReturnType(K, T) {
62
58
  const [L, ...R] = K;
63
59
  return (K.length > 0
64
- ? { [L]: FromMappedPropertyKey(L, T), ...FromMappedPropertyKeys(R, T) }
60
+ ? { [L]: FromSchemaType(L, T), ...FromMappedFunctionReturnType(R, T) }
65
61
  : {});
66
62
  }
67
- export function MappedResult(properties) {
68
- return {
69
- [Kind]: 'MappedResult',
70
- properties
71
- };
72
- }
73
63
  export function Mapped(key, map, options = {}) {
74
- const K = IsSchemaType(key) ? IndexedPropertyKeys(key) : key;
64
+ const K = IsSchemaType(key) ? IndexPropertyKeys(key) : key;
75
65
  const RT = map({ [Kind]: 'MappedKey', keys: K });
76
- const R = FromMappedPropertyKeys(K, RT);
66
+ const R = FromMappedFunctionReturnType(K, RT);
77
67
  return CloneType(Object(R), options);
78
68
  }
@@ -1 +1,2 @@
1
+ export * from './omit-mapped-result.mjs';
1
2
  export * from './omit.mjs';
@@ -1 +1,2 @@
1
+ export * from './omit-mapped-result.mjs';
1
2
  export * from './omit.mjs';
@@ -0,0 +1,15 @@
1
+ import type { TSchema } from '../schema/index.mjs';
2
+ import type { TProperties } from '../object/index.mjs';
3
+ import { type TMappedResult, type TMappedKey } from '../mapped/index.mjs';
4
+ import { type TOmit } from './omit.mjs';
5
+ type MappedOmitPropertyKey<T extends TSchema, K extends PropertyKey> = {
6
+ [_ in K]: TOmit<T, [K]>;
7
+ };
8
+ declare function MappedOmitPropertyKey<T extends TSchema, K extends PropertyKey>(T: T, K: K): MappedOmitPropertyKey<T, K>;
9
+ type MappedOmitPropertyKeys<T extends TSchema, K extends PropertyKey[]> = (K extends [infer LK extends PropertyKey, ...infer RK extends PropertyKey[]] ? MappedOmitPropertyKey<T, LK> & MappedOmitPropertyKeys<T, RK> : {});
10
+ declare function MappedOmitPropertyKeys<T extends TSchema, K extends PropertyKey[]>(T: T, K: [...K]): MappedOmitPropertyKeys<T, K>;
11
+ type MappedOmitProperties<T extends TSchema, K extends TMappedKey> = (MappedOmitPropertyKeys<T, K['keys']>);
12
+ declare function MappedOmitProperties<T extends TSchema, K extends TMappedKey>(T: T, K: K): MappedOmitProperties<T, K>;
13
+ export type TOmitMappedResult<T extends TSchema, K extends TMappedKey, P extends TProperties = MappedOmitProperties<T, K>> = (TMappedResult<P>);
14
+ export declare function OmitMappedResult<T extends TSchema, K extends TMappedKey, P extends TProperties = MappedOmitProperties<T, K>>(T: T, K: K): TMappedResult<P>;
15
+ export {};
@@ -0,0 +1,20 @@
1
+ import { MappedResult } from '../mapped/index.mjs';
2
+ import { Omit } from './omit.mjs';
3
+ function MappedOmitPropertyKey(T, K) {
4
+ return {
5
+ [K]: Omit(T, [K])
6
+ };
7
+ }
8
+ function MappedOmitPropertyKeys(T, K) {
9
+ const [LK, ...RK] = K;
10
+ return (K.length > 0
11
+ ? { ...MappedOmitPropertyKey(T, LK), ...MappedOmitPropertyKeys(T, RK) }
12
+ : {});
13
+ }
14
+ function MappedOmitProperties(T, K) {
15
+ return MappedOmitPropertyKeys(T, K.keys);
16
+ }
17
+ export function OmitMappedResult(T, K) {
18
+ const P = MappedOmitProperties(T, K);
19
+ return MappedResult(P);
20
+ }
@@ -4,7 +4,9 @@ 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 { IndexedPropertyKeys } from '../indexed/index.mjs';
7
+ import { type TIndexPropertyKeys } from '../indexed/index.mjs';
8
+ import { TMappedKey } from '../mapped/index.mjs';
9
+ import { type TOmitMappedResult } from './omit-mapped-result.mjs';
8
10
  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
11
  declare function FromIntersect<T extends TSchema[], K extends PropertyKey[]>(T: T, K: K): FromIntersect<T, K>;
10
12
  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 +16,7 @@ declare function FromProperties<T extends TProperties, K extends PropertyKey[]>(
14
16
  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
17
  export declare function OmitResolve<T extends TSchema, K extends PropertyKey[]>(T: T, K: [...K]): OmitResolve<T, K>;
16
18
  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[] = IndexedPropertyKeys<K>>(T: T, K: K, options?: SchemaOptions): TOmit<T, I>;
19
+ export declare function Omit<T extends TSchema, K extends TMappedKey>(T: T, K: K): TOmitMappedResult<T, K>;
20
+ export declare function Omit<T extends TSchema, K extends TSchema, I extends PropertyKey[] = TIndexPropertyKeys<K>>(T: T, K: K, options?: SchemaOptions): TOmit<T, I>;
18
21
  export declare function Omit<T extends TSchema, K extends PropertyKey[]>(T: T, K: readonly [...K], options?: SchemaOptions): TOmit<T, K>;
19
22
  export {};
@@ -1,11 +1,12 @@
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 { IndexedPropertyKeys } from '../indexed/index.mjs';
4
+ import { IndexPropertyKeys } 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';
8
- import { TIntersect as IsIntersectType, TUnion as IsUnionType, TObject as IsObjectType, TSchema as IsSchemaType } from '../guard/type.mjs';
8
+ import { OmitMappedResult } from './omit-mapped-result.mjs';
9
+ import { TMappedKey as IsMappedKeyType, TIntersect as IsIntersectType, TUnion as IsUnionType, TObject as IsObjectType, TSchema as IsSchemaType } from '../guard/type.mjs';
9
10
  function FromIntersect(T, K) {
10
11
  return T.map((T) => OmitResolve(T, K));
11
12
  }
@@ -28,8 +29,13 @@ export function OmitResolve(T, K) {
28
29
  Object({}));
29
30
  }
30
31
  export function Omit(T, K, options = {}) {
31
- const I = IsSchemaType(K) ? IndexedPropertyKeys(K) : K;
32
- const D = Discard(T, [TransformKind, '$id', 'required']);
33
- const R = CloneType(OmitResolve(T, I), options);
34
- return { ...D, ...R };
32
+ if (IsMappedKeyType(K)) {
33
+ return OmitMappedResult(T, K);
34
+ }
35
+ else {
36
+ const I = IsSchemaType(K) ? IndexPropertyKeys(K) : K;
37
+ const D = Discard(T, [TransformKind, '$id', 'required']);
38
+ const R = CloneType(OmitResolve(T, I), options);
39
+ return { ...D, ...R };
40
+ }
35
41
  }
@@ -1 +1,2 @@
1
+ export * from './pick-mapped-result.mjs';
1
2
  export * from './pick.mjs';
@@ -1 +1,2 @@
1
+ export * from './pick-mapped-result.mjs';
1
2
  export * from './pick.mjs';
@@ -0,0 +1,15 @@
1
+ import type { TSchema } from '../schema/index.mjs';
2
+ import type { TProperties } from '../object/index.mjs';
3
+ import { type TMappedResult, type TMappedKey } from '../mapped/index.mjs';
4
+ import { type TPick } from './pick.mjs';
5
+ type MappedPickPropertyKey<T extends TSchema, K extends PropertyKey> = {
6
+ [_ in K]: TPick<T, [K]>;
7
+ };
8
+ declare function MappedPickPropertyKey<T extends TSchema, K extends PropertyKey>(T: T, K: K): MappedPickPropertyKey<T, K>;
9
+ type MappedPickPropertyKeys<T extends TSchema, K extends PropertyKey[]> = (K extends [infer LK extends PropertyKey, ...infer RK extends PropertyKey[]] ? MappedPickPropertyKey<T, LK> & MappedPickPropertyKeys<T, RK> : {});
10
+ declare function MappedPickPropertyKeys<T extends TSchema, K extends PropertyKey[]>(T: T, K: [...K]): MappedPickPropertyKeys<T, K>;
11
+ type MappedPickProperties<T extends TSchema, K extends TMappedKey> = (MappedPickPropertyKeys<T, K['keys']>);
12
+ declare function MappedPickProperties<T extends TSchema, K extends TMappedKey>(T: T, K: K): MappedPickProperties<T, K>;
13
+ export type TPickMappedResult<T extends TSchema, K extends TMappedKey, P extends TProperties = MappedPickProperties<T, K>> = (TMappedResult<P>);
14
+ export declare function PickMappedResult<T extends TSchema, K extends TMappedKey, P extends TProperties = MappedPickProperties<T, K>>(T: T, K: K): TMappedResult<P>;
15
+ export {};
@@ -0,0 +1,20 @@
1
+ import { MappedResult } from '../mapped/index.mjs';
2
+ import { Pick } from './pick.mjs';
3
+ function MappedPickPropertyKey(T, K) {
4
+ return {
5
+ [K]: Pick(T, [K])
6
+ };
7
+ }
8
+ function MappedPickPropertyKeys(T, K) {
9
+ const [LK, ...RK] = K;
10
+ return (K.length > 0
11
+ ? { ...MappedPickPropertyKey(T, LK), ...MappedPickPropertyKeys(T, RK) }
12
+ : {});
13
+ }
14
+ function MappedPickProperties(T, K) {
15
+ return MappedPickPropertyKeys(T, K.keys);
16
+ }
17
+ export function PickMappedResult(T, K) {
18
+ const P = MappedPickProperties(T, K);
19
+ return MappedResult(P);
20
+ }
@@ -4,7 +4,9 @@ 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 { IndexedPropertyKeys } from '../indexed/index.mjs';
7
+ import { type TIndexPropertyKeys } from '../indexed/index.mjs';
8
+ import { TMappedKey } from '../mapped/index.mjs';
9
+ import { type TPickMappedResult } from './pick-mapped-result.mjs';
8
10
  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
11
  declare function FromIntersect<T extends TSchema[], K extends PropertyKey[]>(T: T, K: K): FromIntersect<T, K>;
10
12
  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 +16,7 @@ declare function FromProperties<T extends TProperties, K extends PropertyKey[]>(
14
16
  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
17
  export declare function PickResolve<T extends TSchema, K extends PropertyKey[]>(T: T, K: [...K]): PickResolve<T, K>;
16
18
  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[] = IndexedPropertyKeys<K>>(T: T, K: K, options?: SchemaOptions): TPick<T, I>;
19
+ export declare function Pick<T extends TSchema, K extends TMappedKey>(T: T, K: K): TPickMappedResult<T, K>;
20
+ export declare function Pick<T extends TSchema, K extends TSchema, I extends PropertyKey[] = TIndexPropertyKeys<K>>(T: T, K: K, options?: SchemaOptions): TPick<T, I>;
18
21
  export declare function Pick<T extends TSchema, K extends PropertyKey[]>(T: T, K: readonly [...K], options?: SchemaOptions): TPick<T, K>;
19
22
  export {};
@@ -1,11 +1,12 @@
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 { IndexedPropertyKeys } from '../indexed/index.mjs';
4
+ import { IndexPropertyKeys } 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';
8
- import { TIntersect as IsIntersectType, TUnion as IsUnionType, TObject as IsObjectType, TSchema as IsSchemaType } from '../guard/type.mjs';
8
+ import { PickMappedResult } from './pick-mapped-result.mjs';
9
+ import { TMappedKey as IsMappedKeyType, TIntersect as IsIntersectType, TUnion as IsUnionType, TObject as IsObjectType, TSchema as IsSchemaType, } from '../guard/type.mjs';
9
10
  function FromIntersect(T, K) {
10
11
  return T.map((T) => PickResolve(T, K));
11
12
  }
@@ -24,8 +25,13 @@ export function PickResolve(T, K) {
24
25
  Object({}));
25
26
  }
26
27
  export function Pick(T, K, options = {}) {
27
- const I = IsSchemaType(K) ? IndexedPropertyKeys(K) : K;
28
- const D = Discard(T, [TransformKind, '$id', 'required']);
29
- const R = CloneType(PickResolve(T, I), options);
30
- return { ...D, ...R };
28
+ if (IsMappedKeyType(K)) {
29
+ return PickMappedResult(T, K);
30
+ }
31
+ else {
32
+ const I = IsSchemaType(K) ? IndexPropertyKeys(K) : K;
33
+ const D = Discard(T, [TransformKind, '$id', 'required']);
34
+ const R = CloneType(PickResolve(T, I), options);
35
+ return { ...D, ...R };
36
+ }
31
37
  }
@@ -3,11 +3,11 @@ 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 { IndexedPropertyKeys } from '../indexed/index.mjs';
6
+ import { IndexPropertyKeys } 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';
10
- import { TUnion as IsUnionType, TTemplateLiteral as IsTemplateLiteralType, TLiteral as IsLiteralType, TString as IsStringType, TInteger as IsIntegerType, TNumber as IsNumberType } from '../guard/type.mjs';
10
+ import { TInteger as IsIntegerType, TLiteral as IsLiteralType, TNumber as IsNumberType, TString as IsStringType, TTemplateLiteral as IsTemplateLiteralType, TUnion as IsUnionType, } from '../guard/type.mjs';
11
11
  function FromPattern(pattern, T) {
12
12
  return { [Kind]: 'Record', type: 'object', patternProperties: { [pattern]: CloneType(T) } };
13
13
  }
@@ -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(IndexedPropertyKeys(K), T)
21
+ ? FromKeys(IndexPropertyKeys(K), T)
22
22
  : FromPattern(K.pattern, T));
23
23
  }
24
24
  function FromUnionKey(K, T) {
25
- return FromKeys(IndexedPropertyKeys(Union(K)), T);
25
+ return FromKeys(IndexPropertyKeys(Union(K)), T);
26
26
  }
27
27
  function FromLiteralKey(K, T) {
28
28
  return FromKeys([K.toString()], T);
@@ -6,25 +6,25 @@ 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, type MappedExtends, type MappedResultExtends } from '../extends/index.mjs';
9
+ import { type TExtends, type TExtendsMappedResult, type TExtendsMappedResultFromResult } from '../extends/index.mjs';
10
10
  import { type TExtract } from '../extract/index.mjs';
11
- import { TIndex, type IndexedPropertyKeys, type TMappedIndex } from '../indexed/index.mjs';
11
+ import { TIndex, type TIndexPropertyKeys, type TIndexMappedResult } 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
+ import { type TMappedFunction, type TMapped, type TMappedResult } from '../mapped/index.mjs';
18
18
  import { type TNever } from '../never/index.mjs';
19
19
  import { type TNot } from '../not/index.mjs';
20
20
  import { type TNull } from '../null/index.mjs';
21
21
  import { type TMappedKey } from '../mapped/index.mjs';
22
22
  import { type TNumber, type NumberOptions } from '../number/index.mjs';
23
23
  import { type TObject, type TProperties, type ObjectOptions } from '../object/index.mjs';
24
- import { type TOmit } from '../omit/index.mjs';
24
+ import { type TOmit, type TOmitMappedResult } from '../omit/index.mjs';
25
25
  import { type TOptional } from '../optional/index.mjs';
26
26
  import { type TPartial } from '../partial/index.mjs';
27
- import { type TPick } from '../pick/index.mjs';
27
+ import { type TPick, type TPickMappedResult } from '../pick/index.mjs';
28
28
  import { type TReadonly } from '../readonly/index.mjs';
29
29
  import { type TReadonlyOptional } from '../readonly-optional/index.mjs';
30
30
  import { type RecordResolve } from '../record/index.mjs';
@@ -53,30 +53,32 @@ export declare class JsonTypeBuilder {
53
53
  Const<T>(value: T, options?: SchemaOptions): TConst<T>;
54
54
  Deref<T extends TSchema>(schema: T, references: TSchema[]): TDeref<T>;
55
55
  Enum<V extends TEnumValue, T extends Record<TEnumKey, V>>(item: T, options?: SchemaOptions): TEnum<T>;
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>;
56
+ Extends<L extends TMappedResult, R extends TSchema, T extends TSchema, F extends TSchema>(L: L, R: R, T: T, F: F, options?: SchemaOptions): TExtendsMappedResultFromResult<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): TExtendsMappedResult<L, R, T, F>;
58
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>;
59
59
  Exclude<L extends TSchema, R extends TSchema>(unionType: L, excludedMembers: R, options?: SchemaOptions): TExclude<L, R>;
60
60
  Extract<L extends TSchema, R extends TSchema>(type: L, union: R, options?: SchemaOptions): TExtract<L, R>;
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>;
61
+ Index<T extends TSchema, K extends TMappedKey>(T: T, K: K): TIndexMappedResult<T, K>;
62
+ Index<T extends TSchema, K extends TSchema, I extends PropertyKey[] = TIndexPropertyKeys<K>>(T: T, K: K, options?: SchemaOptions): TIndex<T, I>;
63
63
  Index<T extends TSchema, K extends PropertyKey[]>(T: T, K: readonly [...K], options?: SchemaOptions): TIndex<T, K>;
64
64
  Integer(options?: IntegerOptions): TInteger;
65
65
  Intersect<T extends TSchema[]>(T: [...T], options?: IntersectOptions): IntersectResolve<T>;
66
66
  KeyOf<T extends TSchema>(schema: T, options?: SchemaOptions): TKeyOf<T>;
67
67
  Literal<T extends TLiteralValue>(value: T, options?: SchemaOptions): TLiteral<T>;
68
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;
69
+ Mapped<K extends TSchema, I extends PropertyKey[] = TIndexPropertyKeys<K>, F extends TMappedFunction<I> = TMappedFunction<I>, R extends TMapped<I, F> = TMapped<I, F>>(key: K, map: F, options?: ObjectOptions): R;
70
+ Mapped<K extends PropertyKey[], F extends TMappedFunction<K> = TMappedFunction<K>, R extends TMapped<K, F> = TMapped<K, F>>(key: [...K], map: F, options?: ObjectOptions): R;
71
71
  Never(options?: SchemaOptions): TNever;
72
72
  Not<T extends TSchema>(schema: T, options?: SchemaOptions): TNot<T>;
73
73
  Null(options?: SchemaOptions): TNull;
74
74
  Number(options?: NumberOptions): TNumber;
75
75
  Object<T extends TProperties>(properties: T, options?: ObjectOptions): TObject<T>;
76
- Omit<T extends TSchema, K extends TSchema, I extends PropertyKey[] = IndexedPropertyKeys<K>>(T: T, K: K, options?: SchemaOptions): TOmit<T, I>;
76
+ Omit<T extends TSchema, K extends TMappedKey>(T: T, K: K): TOmitMappedResult<T, K>;
77
+ Omit<T extends TSchema, K extends TSchema, I extends PropertyKey[] = TIndexPropertyKeys<K>>(T: T, K: K, options?: SchemaOptions): TOmit<T, I>;
77
78
  Omit<T extends TSchema, K extends PropertyKey[]>(T: T, K: readonly [...K], options?: SchemaOptions): TOmit<T, K>;
78
79
  Partial<T extends TSchema>(schema: T, options?: ObjectOptions): TPartial<T>;
79
- Pick<T extends TSchema, K extends TSchema, I extends PropertyKey[] = IndexedPropertyKeys<K>>(T: T, K: K, options?: SchemaOptions): TPick<T, I>;
80
+ Pick<T extends TSchema, K extends TMappedKey>(T: T, K: K): TPickMappedResult<T, K>;
81
+ Pick<T extends TSchema, K extends TSchema, I extends PropertyKey[] = TIndexPropertyKeys<K>>(T: T, K: K, options?: SchemaOptions): TPick<T, I>;
80
82
  Pick<T extends TSchema, K extends PropertyKey[]>(T: T, K: readonly [...K], options?: SchemaOptions): TPick<T, K>;
81
83
  Record<K extends TSchema, T extends TSchema>(key: K, schema: T, options?: ObjectOptions): RecordResolve<K, T>;
82
84
  Recursive<T extends TSchema>(callback: (thisType: TThis) => T, options?: SchemaOptions): TRecursive<T>;
@@ -2,7 +2,7 @@ import { TTransform as IsTransformType, TSchema as IsSchemaType } from '../../ty
2
2
  import { Kind, TransformKind } from '../../type/symbols/index.mjs';
3
3
  import { IsPlainObject, IsArray, IsValueType } from '../guard/index.mjs';
4
4
  import { KeyOfPropertyKeys } from '../../type/keyof/index.mjs';
5
- import { IndexedType } from '../../type/indexed/index.mjs';
5
+ import { Index } 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 {
@@ -44,7 +44,7 @@ function TIntersect(schema, references, value) {
44
44
  const knownKeys = KeyOfPropertyKeys(schema);
45
45
  const knownProperties = knownKeys.reduce((value, key) => {
46
46
  return (key in value)
47
- ? { ...value, [key]: Visit(IndexedType(schema, [key]), references, value[key]) }
47
+ ? { ...value, [key]: Visit(Index(schema, [key]), references, value[key]) }
48
48
  : value;
49
49
  }, value);
50
50
  if (!IsTransformType(schema.unevaluatedProperties)) {
@@ -2,7 +2,7 @@ import { TTransform as IsTransformType, TSchema as IsSchemaType } from '../../ty
2
2
  import { Kind, TransformKind } from '../../type/symbols/index.mjs';
3
3
  import { IsPlainObject, IsArray, IsValueType } from '../guard/index.mjs';
4
4
  import { KeyOfPropertyKeys } from '../../type/keyof/index.mjs';
5
- import { IndexedType } from '../../type/indexed/index.mjs';
5
+ import { Index } 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 {
@@ -46,7 +46,7 @@ function TIntersect(schema, references, value) {
46
46
  const knownKeys = KeyOfPropertyKeys(schema);
47
47
  const knownProperties = knownKeys.reduce((value, key) => {
48
48
  return key in defaulted
49
- ? { ...value, [key]: Visit(IndexedType(schema, [key]), references, value[key]) }
49
+ ? { ...value, [key]: Visit(Index(schema, [key]), references, value[key]) }
50
50
  : value;
51
51
  }, defaulted);
52
52
  if (!IsTransformType(schema.unevaluatedProperties)) {
@@ -21,25 +21,25 @@ 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, type TMappedIndex, IndexedPropertyKeys, IndexedType, MappedIndex } from './type/indexed/index';
24
+ export { Index, IndexPropertyKeys, IndexMappedResult, type TIndex, type TIndexPropertyKeys, type TIndexMappedResult } 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
- export { Capitalize, type TCapitalize, Lowercase, type TLowercase, Uncapitalize, type TUncapitalize, Uppercase, type TUppercase, IntrinsicResolve } from './type/intrinsic/index';
29
+ export { Intrinsic, type TIntrinsic, Capitalize, type TCapitalize, Lowercase, type TLowercase, Uncapitalize, type TUncapitalize, Uppercase, type TUppercase } from './type/intrinsic/index';
30
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 MappedKey as TMappedKey, type MappedFunction, type TMapped as TMappedResult } from './type/mapped/index';
32
+ export { Mapped, MappedKey, MappedResult, type TMapped, type TMappedKey, type TMappedResult, type TMappedFunction } 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';
36
36
  export { Number, type TNumber, type NumberOptions } from './type/number/index';
37
37
  export { Object, type TObject, type TProperties, type ObjectOptions } from './type/object/index';
38
- export { Omit, type TOmit } from './type/omit/index';
38
+ export { Omit, type TOmit, type TOmitMappedResult } from './type/omit/index';
39
39
  export { Optional, type TOptional } from './type/optional/index';
40
40
  export { Parameters, type TParameters } from './type/parameters/index';
41
41
  export { Partial, type TPartial } from './type/partial/index';
42
- export { Pick, type TPick } from './type/pick/index';
42
+ export { Pick, type TPick, type TPickMappedResult } from './type/pick/index';
43
43
  export { Promise, type TPromise } from './type/promise/index';
44
44
  export { Readonly, type TReadonly } from './type/readonly/index';
45
45
  export { ReadonlyOptional, type TReadonlyOptional } from './type/readonly-optional/index';