@sinclair/typebox 0.33.22 → 0.34.1

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 (202) hide show
  1. package/build/cjs/compiler/compiler.d.ts +2 -2
  2. package/build/cjs/compiler/compiler.js +13 -2
  3. package/build/cjs/errors/errors.js +7 -0
  4. package/build/cjs/index.d.ts +1 -2
  5. package/build/cjs/index.js +1 -2
  6. package/build/cjs/syntax/parse.d.ts +14 -15
  7. package/build/cjs/syntax/parse.js +6 -5
  8. package/build/cjs/syntax/runtime.d.ts +20 -4
  9. package/build/cjs/syntax/runtime.js +183 -28
  10. package/build/cjs/syntax/static.d.ts +107 -23
  11. package/build/cjs/type/array/array.d.ts +1 -1
  12. package/build/cjs/type/awaited/awaited.d.ts +8 -3
  13. package/build/cjs/type/awaited/awaited.js +20 -20
  14. package/build/cjs/type/computed/computed.d.ts +9 -0
  15. package/build/cjs/type/computed/computed.js +10 -0
  16. package/build/cjs/type/computed/index.d.ts +1 -0
  17. package/build/cjs/type/{deref → computed}/index.js +1 -1
  18. package/build/cjs/type/guard/kind.d.ts +12 -4
  19. package/build/cjs/type/guard/kind.js +15 -0
  20. package/build/cjs/type/guard/type.d.ts +9 -3
  21. package/build/cjs/type/guard/type.js +19 -0
  22. package/build/cjs/type/index.d.ts +1 -2
  23. package/build/cjs/type/index.js +1 -2
  24. package/build/cjs/type/indexed/indexed-from-mapped-key.d.ts +6 -6
  25. package/build/cjs/type/indexed/indexed-from-mapped-key.js +10 -10
  26. package/build/cjs/type/indexed/indexed-from-mapped-result.d.ts +5 -5
  27. package/build/cjs/type/indexed/indexed-from-mapped-result.js +11 -10
  28. package/build/cjs/type/indexed/indexed-property-keys.d.ts +6 -6
  29. package/build/cjs/type/indexed/indexed-property-keys.js +14 -14
  30. package/build/cjs/type/indexed/indexed.d.ts +34 -20
  31. package/build/cjs/type/indexed/indexed.js +59 -46
  32. package/build/cjs/type/intersect/intersect-evaluated.d.ts +6 -6
  33. package/build/cjs/type/intersect/intersect-evaluated.js +16 -16
  34. package/build/cjs/type/intersect/intersect.d.ts +2 -2
  35. package/build/cjs/type/intersect/intersect.js +6 -6
  36. package/build/cjs/type/keyof/keyof-from-mapped-result.d.ts +6 -6
  37. package/build/cjs/type/keyof/keyof-from-mapped-result.js +10 -10
  38. package/build/cjs/type/keyof/keyof-property-keys.d.ts +7 -7
  39. package/build/cjs/type/keyof/keyof-property-keys.js +22 -22
  40. package/build/cjs/type/keyof/keyof.d.ts +11 -6
  41. package/build/cjs/type/keyof/keyof.js +22 -13
  42. package/build/cjs/type/module/compute.d.ts +54 -0
  43. package/build/cjs/type/module/compute.js +154 -0
  44. package/build/cjs/type/module/index.d.ts +1 -0
  45. package/build/cjs/type/{strict → module}/index.js +1 -1
  46. package/build/cjs/type/module/infer.d.ts +43 -0
  47. package/build/cjs/type/module/infer.js +3 -0
  48. package/build/cjs/type/module/module.d.ts +27 -0
  49. package/build/cjs/type/module/module.js +37 -0
  50. package/build/cjs/type/not/not.d.ts +1 -1
  51. package/build/cjs/type/not/not.js +2 -2
  52. package/build/cjs/type/omit/omit-from-mapped-key.d.ts +6 -6
  53. package/build/cjs/type/omit/omit-from-mapped-key.js +10 -12
  54. package/build/cjs/type/omit/omit-from-mapped-result.d.ts +5 -5
  55. package/build/cjs/type/omit/omit-from-mapped-result.js +10 -10
  56. package/build/cjs/type/omit/omit.d.ts +26 -14
  57. package/build/cjs/type/omit/omit.js +46 -35
  58. package/build/cjs/type/partial/partial.d.ts +11 -7
  59. package/build/cjs/type/partial/partial.js +36 -24
  60. package/build/cjs/type/pick/pick-from-mapped-key.d.ts +6 -6
  61. package/build/cjs/type/pick/pick-from-mapped-key.js +10 -10
  62. package/build/cjs/type/pick/pick-from-mapped-result.d.ts +5 -5
  63. package/build/cjs/type/pick/pick-from-mapped-result.js +10 -10
  64. package/build/cjs/type/pick/pick.d.ts +25 -15
  65. package/build/cjs/type/pick/pick.js +47 -36
  66. package/build/cjs/type/record/record.d.ts +4 -2
  67. package/build/cjs/type/record/record.js +31 -28
  68. package/build/cjs/type/ref/ref.d.ts +4 -7
  69. package/build/cjs/type/ref/ref.js +3 -11
  70. package/build/cjs/type/required/required.d.ts +12 -8
  71. package/build/cjs/type/required/required.js +37 -25
  72. package/build/cjs/type/static/static.d.ts +1 -1
  73. package/build/cjs/type/tuple/tuple.d.ts +1 -1
  74. package/build/cjs/type/tuple/tuple.js +4 -4
  75. package/build/cjs/type/type/javascript.d.ts +10 -10
  76. package/build/cjs/type/type/javascript.js +6 -6
  77. package/build/cjs/type/type/json.d.ts +45 -68
  78. package/build/cjs/type/type/json.js +82 -98
  79. package/build/cjs/type/type/type.d.ts +1 -2
  80. package/build/cjs/type/type/type.js +55 -57
  81. package/build/cjs/type/union/union-evaluated.d.ts +6 -6
  82. package/build/cjs/type/union/union-evaluated.js +11 -10
  83. package/build/cjs/type/union/union.d.ts +1 -1
  84. package/build/cjs/type/union/union.js +4 -4
  85. package/build/cjs/value/cast/cast.js +8 -1
  86. package/build/cjs/value/check/check.js +11 -4
  87. package/build/cjs/value/clean/clean.js +8 -1
  88. package/build/cjs/value/convert/convert.js +7 -0
  89. package/build/cjs/value/create/create.js +7 -0
  90. package/build/cjs/value/default/default.js +7 -0
  91. package/build/cjs/value/transform/decode.js +18 -7
  92. package/build/cjs/value/transform/encode.js +18 -7
  93. package/build/cjs/value/transform/has.js +18 -18
  94. package/build/esm/compiler/compiler.d.mts +2 -2
  95. package/build/esm/compiler/compiler.mjs +13 -2
  96. package/build/esm/errors/errors.mjs +7 -0
  97. package/build/esm/index.d.mts +1 -2
  98. package/build/esm/index.mjs +1 -2
  99. package/build/esm/syntax/parse.d.mts +14 -15
  100. package/build/esm/syntax/parse.mjs +6 -5
  101. package/build/esm/syntax/runtime.d.mts +20 -4
  102. package/build/esm/syntax/runtime.mjs +183 -28
  103. package/build/esm/syntax/static.d.mts +107 -23
  104. package/build/esm/type/array/array.d.mts +1 -1
  105. package/build/esm/type/awaited/awaited.d.mts +8 -3
  106. package/build/esm/type/awaited/awaited.mjs +20 -20
  107. package/build/esm/type/computed/computed.d.mts +9 -0
  108. package/build/esm/type/computed/computed.mjs +6 -0
  109. package/build/esm/type/computed/index.d.mts +1 -0
  110. package/build/esm/type/computed/index.mjs +1 -0
  111. package/build/esm/type/guard/kind.d.mts +12 -4
  112. package/build/esm/type/guard/kind.mjs +12 -0
  113. package/build/esm/type/guard/type.d.mts +9 -3
  114. package/build/esm/type/guard/type.mjs +17 -0
  115. package/build/esm/type/index.d.mts +1 -2
  116. package/build/esm/type/index.mjs +1 -2
  117. package/build/esm/type/indexed/indexed-from-mapped-key.d.mts +6 -6
  118. package/build/esm/type/indexed/indexed-from-mapped-key.mjs +10 -10
  119. package/build/esm/type/indexed/indexed-from-mapped-result.d.mts +5 -5
  120. package/build/esm/type/indexed/indexed-from-mapped-result.mjs +11 -10
  121. package/build/esm/type/indexed/indexed-property-keys.d.mts +6 -6
  122. package/build/esm/type/indexed/indexed-property-keys.mjs +14 -14
  123. package/build/esm/type/indexed/indexed.d.mts +34 -20
  124. package/build/esm/type/indexed/indexed.mjs +55 -42
  125. package/build/esm/type/intersect/intersect-evaluated.d.mts +6 -6
  126. package/build/esm/type/intersect/intersect-evaluated.mjs +16 -16
  127. package/build/esm/type/intersect/intersect.d.mts +2 -2
  128. package/build/esm/type/intersect/intersect.mjs +6 -6
  129. package/build/esm/type/keyof/keyof-from-mapped-result.d.mts +6 -6
  130. package/build/esm/type/keyof/keyof-from-mapped-result.mjs +10 -10
  131. package/build/esm/type/keyof/keyof-property-keys.d.mts +7 -7
  132. package/build/esm/type/keyof/keyof-property-keys.mjs +22 -22
  133. package/build/esm/type/keyof/keyof.d.mts +11 -6
  134. package/build/esm/type/keyof/keyof.mjs +22 -13
  135. package/build/esm/type/module/compute.d.mts +54 -0
  136. package/build/esm/type/module/compute.mjs +148 -0
  137. package/build/esm/type/module/index.d.mts +1 -0
  138. package/build/esm/type/module/index.mjs +1 -0
  139. package/build/esm/type/module/infer.d.mts +43 -0
  140. package/build/esm/type/module/infer.mjs +1 -0
  141. package/build/esm/type/module/module.d.mts +27 -0
  142. package/build/esm/type/module/module.mjs +31 -0
  143. package/build/esm/type/not/not.d.mts +1 -1
  144. package/build/esm/type/not/not.mjs +2 -2
  145. package/build/esm/type/omit/omit-from-mapped-key.d.mts +6 -6
  146. package/build/esm/type/omit/omit-from-mapped-key.mjs +10 -12
  147. package/build/esm/type/omit/omit-from-mapped-result.d.mts +5 -5
  148. package/build/esm/type/omit/omit-from-mapped-result.mjs +10 -10
  149. package/build/esm/type/omit/omit.d.mts +26 -14
  150. package/build/esm/type/omit/omit.mjs +43 -32
  151. package/build/esm/type/partial/partial.d.mts +11 -7
  152. package/build/esm/type/partial/partial.mjs +29 -17
  153. package/build/esm/type/pick/pick-from-mapped-key.d.mts +6 -6
  154. package/build/esm/type/pick/pick-from-mapped-key.mjs +10 -10
  155. package/build/esm/type/pick/pick-from-mapped-result.d.mts +5 -5
  156. package/build/esm/type/pick/pick-from-mapped-result.mjs +10 -10
  157. package/build/esm/type/pick/pick.d.mts +25 -15
  158. package/build/esm/type/pick/pick.mjs +43 -32
  159. package/build/esm/type/record/record.d.mts +4 -2
  160. package/build/esm/type/record/record.mjs +15 -12
  161. package/build/esm/type/ref/ref.d.mts +4 -7
  162. package/build/esm/type/ref/ref.mjs +3 -11
  163. package/build/esm/type/required/required.d.mts +12 -8
  164. package/build/esm/type/required/required.mjs +33 -21
  165. package/build/esm/type/static/static.d.mts +1 -1
  166. package/build/esm/type/tuple/tuple.d.mts +1 -1
  167. package/build/esm/type/tuple/tuple.mjs +4 -4
  168. package/build/esm/type/type/javascript.d.mts +10 -10
  169. package/build/esm/type/type/javascript.mjs +6 -6
  170. package/build/esm/type/type/json.d.mts +45 -68
  171. package/build/esm/type/type/json.mjs +47 -63
  172. package/build/esm/type/type/type.d.mts +1 -2
  173. package/build/esm/type/type/type.mjs +1 -2
  174. package/build/esm/type/union/union-evaluated.d.mts +6 -6
  175. package/build/esm/type/union/union-evaluated.mjs +11 -10
  176. package/build/esm/type/union/union.d.mts +1 -1
  177. package/build/esm/type/union/union.mjs +4 -4
  178. package/build/esm/value/cast/cast.mjs +9 -2
  179. package/build/esm/value/check/check.mjs +11 -4
  180. package/build/esm/value/clean/clean.mjs +9 -2
  181. package/build/esm/value/convert/convert.mjs +7 -0
  182. package/build/esm/value/create/create.mjs +7 -0
  183. package/build/esm/value/default/default.mjs +7 -0
  184. package/build/esm/value/transform/decode.mjs +13 -2
  185. package/build/esm/value/transform/encode.mjs +13 -2
  186. package/build/esm/value/transform/has.mjs +2 -2
  187. package/package.json +1 -1
  188. package/readme.md +230 -97
  189. package/build/cjs/type/deref/deref.d.ts +0 -22
  190. package/build/cjs/type/deref/deref.js +0 -106
  191. package/build/cjs/type/deref/index.d.ts +0 -1
  192. package/build/cjs/type/strict/index.d.ts +0 -1
  193. package/build/cjs/type/strict/strict.d.ts +0 -12
  194. package/build/cjs/type/strict/strict.js +0 -16
  195. package/build/esm/type/deref/deref.d.mts +0 -22
  196. package/build/esm/type/deref/deref.mjs +0 -102
  197. package/build/esm/type/deref/index.d.mts +0 -1
  198. package/build/esm/type/deref/index.mjs +0 -1
  199. package/build/esm/type/strict/index.d.mts +0 -1
  200. package/build/esm/type/strict/index.mjs +0 -1
  201. package/build/esm/type/strict/strict.d.mts +0 -12
  202. package/build/esm/type/strict/strict.mjs +0 -12
@@ -3,28 +3,28 @@ import { type TArray, type ArrayOptions } from '../array/index';
3
3
  import { type TBoolean } from '../boolean/index';
4
4
  import { type TComposite } from '../composite/index';
5
5
  import { type TConst } from '../const/index';
6
- import { type TDeref } from '../deref/index';
7
6
  import { type TEnum, type TEnumKey, type TEnumValue } from '../enum/index';
8
7
  import { type TExclude, type TExcludeFromMappedResult, type TExcludeFromTemplateLiteral } from '../exclude/index';
9
8
  import { type TExtends, type TExtendsFromMappedKey, type TExtendsFromMappedResult } from '../extends/index';
10
9
  import { type TExtract, type TExtractFromMappedResult, type TExtractFromTemplateLiteral } from '../extract/index';
11
- import { TIndex, type TIndexPropertyKeys, type TIndexFromMappedKey, type TIndexFromMappedResult } from '../indexed/index';
10
+ import { TIndex, type TIndexPropertyKeys } from '../indexed/index';
12
11
  import { type IntegerOptions, type TInteger } from '../integer/index';
13
12
  import { Intersect, type IntersectOptions } from '../intersect/index';
14
13
  import { type TCapitalize, type TUncapitalize, type TLowercase, type TUppercase } from '../intrinsic/index';
15
- import { type TKeyOf, type TKeyOfFromMappedResult } from '../keyof/index';
14
+ import { type TKeyOf } from '../keyof/index';
16
15
  import { type TLiteral, type TLiteralValue } from '../literal/index';
17
16
  import { type TMappedFunction, type TMapped, type TMappedResult } from '../mapped/index';
18
17
  import { type TNever } from '../never/index';
19
18
  import { type TNot } from '../not/index';
20
19
  import { type TNull } from '../null/index';
21
20
  import { type TMappedKey } from '../mapped/index';
21
+ import { TModule } from '../module/index';
22
22
  import { type TNumber, type NumberOptions } from '../number/index';
23
23
  import { type TObject, type TProperties, type ObjectOptions } from '../object/index';
24
- import { type TOmit, type TOmitFromMappedKey, type TOmitFromMappedResult } from '../omit/index';
24
+ import { type TOmit } from '../omit/index';
25
25
  import { type TOptionalWithFlag, type TOptionalFromMappedResult } from '../optional/index';
26
26
  import { type TPartial, type TPartialFromMappedResult } from '../partial/index';
27
- import { type TPick, type TPickFromMappedKey, type TPickFromMappedResult } from '../pick/index';
27
+ import { type TPick } from '../pick/index';
28
28
  import { type TReadonlyWithFlag, type TReadonlyFromMappedResult } from '../readonly/index';
29
29
  import { type TReadonlyOptional } from '../readonly-optional/index';
30
30
  import { type TRecordOrObject } from '../record/index';
@@ -33,7 +33,6 @@ import { type TRef } from '../ref/index';
33
33
  import { type TRequired, type TRequiredFromMappedResult } from '../required/index';
34
34
  import { type TRest } from '../rest/index';
35
35
  import { type TSchema, type SchemaOptions } from '../schema/index';
36
- import { type TStrict } from '../strict/index';
37
36
  import { type TString, type StringOptions } from '../string/index';
38
37
  import { type TTemplateLiteral, type TTemplateLiteralKind, type TTemplateLiteralSyntax } from '../template-literal/index';
39
38
  import { TransformDecodeBuilder } from '../transform/index';
@@ -43,38 +42,28 @@ import { type TUnknown } from '../unknown/index';
43
42
  import { type TUnsafe, type UnsafeOptions } from '../unsafe/index';
44
43
  /** Json Type Builder with Static Resolution for TypeScript */
45
44
  export declare class JsonTypeBuilder {
46
- /**
47
- * @deprecated `[Json]` Omits compositing symbols from this schema. It is recommended
48
- * to use the JSON parse/stringify to remove compositing symbols if needed. This
49
- * is how Strict works internally.
50
- *
51
- * ```typescript
52
- * JSON.parse(JSON.stringify(Type.String()))
53
- * ```
54
- */
55
- Strict<T extends TSchema>(schema: T): TStrict<T>;
56
45
  /** `[Json]` Creates a Readonly and Optional property */
57
- ReadonlyOptional<T extends TSchema>(schema: T): TReadonlyOptional<T>;
46
+ ReadonlyOptional<Type extends TSchema>(type: Type): TReadonlyOptional<Type>;
58
47
  /** `[Json]` Creates a Readonly property */
59
- Readonly<T extends TMappedResult, F extends boolean>(schema: T, enable: F): TReadonlyFromMappedResult<T, F>;
48
+ Readonly<Type extends TMappedResult, Flag extends boolean>(type: Type, enable: Flag): TReadonlyFromMappedResult<Type, Flag>;
60
49
  /** `[Json]` Creates a Readonly property */
61
- Readonly<T extends TSchema, F extends boolean>(schema: T, enable: F): TReadonlyWithFlag<T, F>;
50
+ Readonly<Type extends TSchema, Flag extends boolean>(type: Type, enable: Flag): TReadonlyWithFlag<Type, Flag>;
62
51
  /** `[Json]` Creates a Optional property */
63
- Readonly<T extends TMappedResult>(schema: T): TReadonlyFromMappedResult<T, true>;
52
+ Readonly<Type extends TMappedResult>(type: Type): TReadonlyFromMappedResult<Type, true>;
64
53
  /** `[Json]` Creates a Readonly property */
65
- Readonly<T extends TSchema>(schema: T): TReadonlyWithFlag<T, true>;
54
+ Readonly<Type extends TSchema>(type: Type): TReadonlyWithFlag<Type, true>;
66
55
  /** `[Json]` Creates a Optional property */
67
- Optional<T extends TMappedResult, F extends boolean>(schema: T, enable: F): TOptionalFromMappedResult<T, F>;
56
+ Optional<Type extends TMappedResult, Flag extends boolean>(type: Type, enable: Flag): TOptionalFromMappedResult<Type, Flag>;
68
57
  /** `[Json]` Creates a Optional property */
69
- Optional<T extends TSchema, F extends boolean>(schema: T, enable: F): TOptionalWithFlag<T, F>;
58
+ Optional<Type extends TSchema, Flag extends boolean>(type: Type, enable: Flag): TOptionalWithFlag<Type, Flag>;
70
59
  /** `[Json]` Creates a Optional property */
71
- Optional<T extends TMappedResult>(schema: T): TOptionalFromMappedResult<T, true>;
60
+ Optional<Type extends TMappedResult>(type: Type): TOptionalFromMappedResult<Type, true>;
72
61
  /** `[Json]` Creates a Optional property */
73
- Optional<T extends TSchema>(schema: T): TOptionalWithFlag<T, true>;
62
+ Optional<Type extends TSchema>(type: Type): TOptionalWithFlag<Type, true>;
74
63
  /** `[Json]` Creates an Any type */
75
64
  Any(options?: SchemaOptions): TAny;
76
65
  /** `[Json]` Creates an Array type */
77
- Array<T extends TSchema>(schema: T, options?: ArrayOptions): TArray<T>;
66
+ Array<Type extends TSchema>(items: Type, options?: ArrayOptions): TArray<Type>;
78
67
  /** `[Json]` Creates a Boolean type */
79
68
  Boolean(options?: SchemaOptions): TBoolean;
80
69
  /** `[Json]` Intrinsic function to Capitalize LiteralString types */
@@ -83,8 +72,6 @@ export declare class JsonTypeBuilder {
83
72
  Composite<T extends TSchema[]>(schemas: [...T], options?: ObjectOptions): TComposite<T>;
84
73
  /** `[JavaScript]` Creates a readonly const type from the given value. */
85
74
  Const</* const (not supported in 4.0) */ T>(value: T, options?: SchemaOptions): TConst<T>;
86
- /** `[Json]` Creates a dereferenced type */
87
- Deref<T extends TSchema>(schema: T, references: TSchema[]): TDeref<T>;
88
75
  /** `[Json]` Creates a Enum type */
89
76
  Enum<V extends TEnumValue, T extends Record<TEnumKey, V>>(item: T, options?: SchemaOptions): TEnum<T>;
90
77
  /** `[Json]` Constructs a type by excluding from unionType all union members that are assignable to excludedMembers */
@@ -106,87 +93,77 @@ export declare class JsonTypeBuilder {
106
93
  /** `[Json]` Constructs a type by extracting from type all union members that are assignable to union */
107
94
  Extract<L extends TSchema, R extends TSchema>(type: L, union: R, options?: SchemaOptions): TExtract<L, R>;
108
95
  /** `[Json]` Returns an Indexed property type for the given keys */
109
- Index<T extends TSchema, K extends TMappedResult>(T: T, K: K, options?: SchemaOptions): TIndexFromMappedResult<T, K>;
96
+ Index<Type extends TSchema, PropertyKeys extends PropertyKey[]>(type: Type, key: readonly [...PropertyKeys], options?: SchemaOptions): TIndex<Type, PropertyKeys>;
110
97
  /** `[Json]` Returns an Indexed property type for the given keys */
111
- Index<T extends TSchema, K extends TMappedKey>(T: T, K: K, options?: SchemaOptions): TIndexFromMappedKey<T, K>;
98
+ Index<Type extends TSchema, Key extends TMappedKey>(type: Type, key: Key, options?: SchemaOptions): TIndex<Type, Key>;
112
99
  /** `[Json]` Returns an Indexed property type for the given keys */
113
- Index<T extends TSchema, K extends TSchema, I extends PropertyKey[] = TIndexPropertyKeys<K>>(T: T, K: K, options?: SchemaOptions): TIndex<T, I>;
100
+ Index<Type extends TSchema, Key extends TMappedResult>(type: Type, key: Key, options?: SchemaOptions): TIndex<Type, Key>;
114
101
  /** `[Json]` Returns an Indexed property type for the given keys */
115
- Index<T extends TSchema, K extends PropertyKey[]>(T: T, K: readonly [...K], options?: SchemaOptions): TIndex<T, K>;
102
+ Index<Type extends TSchema, Key extends TSchema>(type: Type, key: Key, options?: SchemaOptions): TIndex<Type, Key>;
116
103
  /** `[Json]` Creates an Integer type */
117
104
  Integer(options?: IntegerOptions): TInteger;
118
105
  /** `[Json]` Creates an Intersect type */
119
- Intersect<T extends TSchema[]>(T: [...T], options?: IntersectOptions): Intersect<T>;
106
+ Intersect<Types extends TSchema[]>(types: [...Types], options?: IntersectOptions): Intersect<Types>;
120
107
  /** `[Json]` Creates a KeyOf type */
121
- KeyOf<T extends TMappedResult>(schema: T, options?: SchemaOptions): TKeyOfFromMappedResult<T>;
122
- /** `[Json]` Creates a KeyOf type */
123
- KeyOf<T extends TSchema>(schema: T, options?: SchemaOptions): TKeyOf<T>;
108
+ KeyOf<Type extends TSchema>(type: Type, options?: SchemaOptions): TKeyOf<Type>;
124
109
  /** `[Json]` Creates a Literal type */
125
- Literal<T extends TLiteralValue>(value: T, options?: SchemaOptions): TLiteral<T>;
110
+ Literal<LiteralValue extends TLiteralValue>(literalValue: LiteralValue, options?: SchemaOptions): TLiteral<LiteralValue>;
126
111
  /** `[Json]` Intrinsic function to Lowercase LiteralString types */
127
- Lowercase<T extends TSchema>(schema: T, options?: SchemaOptions): TLowercase<T>;
112
+ Lowercase<Type extends TSchema>(type: Type, options?: SchemaOptions): TLowercase<Type>;
128
113
  /** `[Json]` Creates a Mapped object type */
129
114
  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;
130
115
  /** `[Json]` Creates a Mapped object type */
131
116
  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;
117
+ /** `[Json]` Creates a Type Definition Module. */
118
+ Module<Properties extends TProperties>(properties: Properties): TModule<Properties>;
132
119
  /** `[Json]` Creates a Never type */
133
120
  Never(options?: SchemaOptions): TNever;
134
121
  /** `[Json]` Creates a Not type */
135
- Not<T extends TSchema>(schema: T, options?: SchemaOptions): TNot<T>;
122
+ Not<T extends TSchema>(type: T, options?: SchemaOptions): TNot<T>;
136
123
  /** `[Json]` Creates a Null type */
137
124
  Null(options?: SchemaOptions): TNull;
138
125
  /** `[Json]` Creates a Number type */
139
126
  Number(options?: NumberOptions): TNumber;
140
127
  /** `[Json]` Creates an Object type */
141
128
  Object<T extends TProperties>(properties: T, options?: ObjectOptions): TObject<T>;
142
- /** `[Json]` Constructs a type whose keys are omitted from the given type */
143
- Omit<T extends TMappedResult, K extends PropertyKey[]>(T: T, K: [...K], options?: SchemaOptions): TOmitFromMappedResult<T, K>;
144
- /** `[Json]` Constructs a type whose keys are omitted from the given type */
145
- Omit<T extends TSchema, K extends TMappedKey>(T: T, K: K, options?: SchemaOptions): TOmitFromMappedKey<T, K>;
146
- /** `[Json]` Constructs a type whose keys are omitted from the given type */
147
- Omit<T extends TSchema, K extends TSchema, I extends PropertyKey[] = TIndexPropertyKeys<K>>(T: T, K: K, options?: SchemaOptions): TOmit<T, I>;
148
- /** `[Json]` Constructs a type whose keys are omitted from the given type */
149
- Omit<T extends TSchema, K extends PropertyKey[]>(T: T, K: readonly [...K], options?: SchemaOptions): TOmit<T, K>;
150
- /** `[Json]` Constructs a type where all properties are optional */
151
- Partial<T extends TMappedResult>(T: T, options?: SchemaOptions): TPartialFromMappedResult<T>;
152
- /** `[Json]` Constructs a type where all properties are optional */
153
- Partial<T extends TSchema>(schema: T, options?: SchemaOptions): TPartial<T>;
154
129
  /** `[Json]` Constructs a type whose keys are picked from the given type */
155
- Pick<T extends TMappedResult, K extends PropertyKey[]>(T: T, K: [...K], options?: SchemaOptions): TPickFromMappedResult<T, K>;
130
+ Omit<Type extends TSchema, Key extends PropertyKey[]>(type: Type, key: readonly [...Key], options?: SchemaOptions): TOmit<Type, Key>;
156
131
  /** `[Json]` Constructs a type whose keys are picked from the given type */
157
- Pick<T extends TSchema, K extends TMappedKey>(T: T, K: K, options?: SchemaOptions): TPickFromMappedKey<T, K>;
132
+ Omit<Type extends TSchema, Key extends TSchema>(type: Type, key: Key, options?: SchemaOptions): TOmit<Type, Key>;
133
+ /** `[Json]` Constructs a type where all properties are optional */
134
+ Partial<MappedResult extends TMappedResult>(type: MappedResult, options?: SchemaOptions): TPartialFromMappedResult<MappedResult>;
135
+ /** `[Json]` Constructs a type where all properties are optional */
136
+ Partial<Type extends TSchema>(type: Type, options?: SchemaOptions): TPartial<Type>;
158
137
  /** `[Json]` Constructs a type whose keys are picked from the given type */
159
- Pick<T extends TSchema, K extends TSchema, I extends PropertyKey[] = TIndexPropertyKeys<K>>(T: T, K: K, options?: SchemaOptions): TPick<T, I>;
138
+ Pick<Type extends TSchema, Key extends PropertyKey[]>(type: Type, key: readonly [...Key], options?: SchemaOptions): TPick<Type, Key>;
160
139
  /** `[Json]` Constructs a type whose keys are picked from the given type */
161
- Pick<T extends TSchema, K extends PropertyKey[]>(T: T, K: readonly [...K], options?: SchemaOptions): TPick<T, K>;
140
+ Pick<Type extends TSchema, Key extends TSchema>(type: Type, key: Key, options?: SchemaOptions): TPick<Type, Key>;
162
141
  /** `[Json]` Creates a Record type */
163
- Record<K extends TSchema, T extends TSchema>(key: K, schema: T, options?: ObjectOptions): TRecordOrObject<K, T>;
142
+ Record<Key extends TSchema, Value extends TSchema>(key: Key, value: Value, options?: ObjectOptions): TRecordOrObject<Key, Value>;
164
143
  /** `[Json]` Creates a Recursive type */
165
144
  Recursive<T extends TSchema>(callback: (thisType: TThis) => T, options?: SchemaOptions): TRecursive<T>;
166
- /** `[Json]` Creates a Ref type. The referenced type must contain a $id */
167
- Ref<T extends TSchema>(schema: T, options?: SchemaOptions): TRef<T>;
168
145
  /** `[Json]` Creates a Ref type. */
169
- Ref<T extends TSchema>($ref: string, options?: SchemaOptions): TRef<T>;
146
+ Ref<Ref extends string>($ref: Ref, options?: SchemaOptions): TRef<Ref>;
170
147
  /** `[Json]` Constructs a type where all properties are required */
171
- Required<T extends TMappedResult>(T: T, options?: SchemaOptions): TRequiredFromMappedResult<T>;
148
+ Required<MappedResult extends TMappedResult>(type: MappedResult, options?: SchemaOptions): TRequiredFromMappedResult<MappedResult>;
172
149
  /** `[Json]` Constructs a type where all properties are required */
173
- Required<T extends TSchema>(schema: T, options?: SchemaOptions): TRequired<T>;
150
+ Required<Type extends TSchema>(type: Type, options?: SchemaOptions): TRequired<Type>;
174
151
  /** `[Json]` Extracts interior Rest elements from Tuple, Intersect and Union types */
175
- Rest<T extends TSchema>(schema: T): TRest<T>;
152
+ Rest<Type extends TSchema>(type: Type): TRest<Type>;
176
153
  /** `[Json]` Creates a String type */
177
154
  String(options?: StringOptions): TString;
178
155
  /** `[Json]` Creates a TemplateLiteral type from template dsl string */
179
- TemplateLiteral<T extends string>(syntax: T, options?: SchemaOptions): TTemplateLiteralSyntax<T>;
156
+ TemplateLiteral<Syntax extends string>(syntax: Syntax, options?: SchemaOptions): TTemplateLiteralSyntax<Syntax>;
180
157
  /** `[Json]` Creates a TemplateLiteral type */
181
- TemplateLiteral<T extends TTemplateLiteralKind[]>(kinds: [...T], options?: SchemaOptions): TTemplateLiteral<T>;
158
+ TemplateLiteral<Kinds extends TTemplateLiteralKind[]>(kinds: [...Kinds], options?: SchemaOptions): TTemplateLiteral<Kinds>;
182
159
  /** `[Json]` Creates a Transform type */
183
- Transform<I extends TSchema>(schema: I): TransformDecodeBuilder<I>;
160
+ Transform<Type extends TSchema>(type: Type): TransformDecodeBuilder<Type>;
184
161
  /** `[Json]` Creates a Tuple type */
185
- Tuple<T extends TSchema[]>(items: [...T], options?: SchemaOptions): TTuple<T>;
162
+ Tuple<Types extends TSchema[]>(types: [...Types], options?: SchemaOptions): TTuple<Types>;
186
163
  /** `[Json]` Intrinsic function to Uncapitalize LiteralString types */
187
- Uncapitalize<T extends TSchema>(schema: T, options?: SchemaOptions): TUncapitalize<T>;
164
+ Uncapitalize<Type extends TSchema>(type: Type, options?: SchemaOptions): TUncapitalize<Type>;
188
165
  /** `[Json]` Creates a Union type */
189
- Union<T extends TSchema[]>(schemas: [...T], options?: SchemaOptions): Union<T>;
166
+ Union<Types extends TSchema[]>(types: [...Types], options?: SchemaOptions): Union<Types>;
190
167
  /** `[Json]` Creates an Unknown type */
191
168
  Unknown(options?: SchemaOptions): TUnknown;
192
169
  /** `[Json]` Creates a Unsafe type that will infers as the generic argument T */
@@ -7,21 +7,21 @@ const index_2 = require("../array/index");
7
7
  const index_3 = require("../boolean/index");
8
8
  const index_4 = require("../composite/index");
9
9
  const index_5 = require("../const/index");
10
- const index_6 = require("../deref/index");
11
- const index_7 = require("../enum/index");
12
- const index_8 = require("../exclude/index");
13
- const index_9 = require("../extends/index");
14
- const index_10 = require("../extract/index");
15
- const index_11 = require("../indexed/index");
16
- const index_12 = require("../integer/index");
17
- const index_13 = require("../intersect/index");
18
- const index_14 = require("../intrinsic/index");
19
- const index_15 = require("../keyof/index");
20
- const index_16 = require("../literal/index");
21
- const index_17 = require("../mapped/index");
22
- const index_18 = require("../never/index");
23
- const index_19 = require("../not/index");
24
- const index_20 = require("../null/index");
10
+ const index_6 = require("../enum/index");
11
+ const index_7 = require("../exclude/index");
12
+ const index_8 = require("../extends/index");
13
+ const index_9 = require("../extract/index");
14
+ const index_10 = require("../indexed/index");
15
+ const index_11 = require("../integer/index");
16
+ const index_12 = require("../intersect/index");
17
+ const index_13 = require("../intrinsic/index");
18
+ const index_14 = require("../keyof/index");
19
+ const index_15 = require("../literal/index");
20
+ const index_16 = require("../mapped/index");
21
+ const index_17 = require("../never/index");
22
+ const index_18 = require("../not/index");
23
+ const index_19 = require("../null/index");
24
+ const index_20 = require("../module/index");
25
25
  const index_21 = require("../number/index");
26
26
  const index_22 = require("../object/index");
27
27
  const index_23 = require("../omit/index");
@@ -35,45 +35,29 @@ const index_30 = require("../recursive/index");
35
35
  const index_31 = require("../ref/index");
36
36
  const index_32 = require("../required/index");
37
37
  const index_33 = require("../rest/index");
38
- const index_34 = require("../strict/index");
39
- const index_35 = require("../string/index");
40
- const index_36 = require("../template-literal/index");
41
- const index_37 = require("../transform/index");
42
- const index_38 = require("../tuple/index");
43
- const index_39 = require("../union/index");
44
- const index_40 = require("../unknown/index");
45
- const index_41 = require("../unsafe/index");
38
+ const index_34 = require("../string/index");
39
+ const index_35 = require("../template-literal/index");
40
+ const index_36 = require("../transform/index");
41
+ const index_37 = require("../tuple/index");
42
+ const index_38 = require("../union/index");
43
+ const index_39 = require("../unknown/index");
44
+ const index_40 = require("../unsafe/index");
46
45
  /** Json Type Builder with Static Resolution for TypeScript */
47
46
  class JsonTypeBuilder {
48
- // ------------------------------------------------------------------------
49
- // Strict
50
- // ------------------------------------------------------------------------
51
- /**
52
- * @deprecated `[Json]` Omits compositing symbols from this schema. It is recommended
53
- * to use the JSON parse/stringify to remove compositing symbols if needed. This
54
- * is how Strict works internally.
55
- *
56
- * ```typescript
57
- * JSON.parse(JSON.stringify(Type.String()))
58
- * ```
59
- */
60
- Strict(schema) {
61
- return (0, index_34.Strict)(schema);
62
- }
63
47
  // ------------------------------------------------------------------------
64
48
  // Modifiers
65
49
  // ------------------------------------------------------------------------
66
50
  /** `[Json]` Creates a Readonly and Optional property */
67
- ReadonlyOptional(schema) {
68
- return (0, index_28.ReadonlyOptional)(schema);
51
+ ReadonlyOptional(type) {
52
+ return (0, index_28.ReadonlyOptional)(type);
69
53
  }
70
54
  /** `[Json]` Creates a Readonly property */
71
- Readonly(schema, enable) {
72
- return (0, index_27.Readonly)(schema, enable ?? true);
55
+ Readonly(type, enable) {
56
+ return (0, index_27.Readonly)(type, enable ?? true);
73
57
  }
74
58
  /** `[Json]` Creates a Optional property */
75
- Optional(schema, enable) {
76
- return (0, index_24.Optional)(schema, enable ?? true);
59
+ Optional(type, enable) {
60
+ return (0, index_24.Optional)(type, enable ?? true);
77
61
  }
78
62
  // ------------------------------------------------------------------------
79
63
  // Types
@@ -83,8 +67,8 @@ class JsonTypeBuilder {
83
67
  return (0, index_1.Any)(options);
84
68
  }
85
69
  /** `[Json]` Creates an Array type */
86
- Array(schema, options) {
87
- return (0, index_2.Array)(schema, options);
70
+ Array(items, options) {
71
+ return (0, index_2.Array)(items, options);
88
72
  }
89
73
  /** `[Json]` Creates a Boolean type */
90
74
  Boolean(options) {
@@ -92,7 +76,7 @@ class JsonTypeBuilder {
92
76
  }
93
77
  /** `[Json]` Intrinsic function to Capitalize LiteralString types */
94
78
  Capitalize(schema, options) {
95
- return (0, index_14.Capitalize)(schema, options);
79
+ return (0, index_13.Capitalize)(schema, options);
96
80
  }
97
81
  /** `[Json]` Creates a Composite object type */
98
82
  Composite(schemas, options) {
@@ -102,65 +86,65 @@ class JsonTypeBuilder {
102
86
  Const(value, options) {
103
87
  return (0, index_5.Const)(value, options);
104
88
  }
105
- /** `[Json]` Creates a dereferenced type */
106
- Deref(schema, references) {
107
- return (0, index_6.Deref)(schema, references);
108
- }
109
89
  /** `[Json]` Creates a Enum type */
110
90
  Enum(item, options) {
111
- return (0, index_7.Enum)(item, options);
91
+ return (0, index_6.Enum)(item, options);
112
92
  }
113
93
  /** `[Json]` Constructs a type by excluding from unionType all union members that are assignable to excludedMembers */
114
94
  Exclude(unionType, excludedMembers, options) {
115
- return (0, index_8.Exclude)(unionType, excludedMembers, options);
95
+ return (0, index_7.Exclude)(unionType, excludedMembers, options);
116
96
  }
117
97
  /** `[Json]` Creates a Conditional type */
118
98
  Extends(L, R, T, F, options) {
119
- return (0, index_9.Extends)(L, R, T, F, options);
99
+ return (0, index_8.Extends)(L, R, T, F, options);
120
100
  }
121
101
  /** `[Json]` Constructs a type by extracting from type all union members that are assignable to union */
122
102
  Extract(type, union, options) {
123
- return (0, index_10.Extract)(type, union, options);
103
+ return (0, index_9.Extract)(type, union, options);
124
104
  }
125
105
  /** `[Json]` Returns an Indexed property type for the given keys */
126
- Index(schema, unresolved, options) {
127
- return (0, index_11.Index)(schema, unresolved, options);
106
+ Index(type, key, options) {
107
+ return (0, index_10.Index)(type, key, options);
128
108
  }
129
109
  /** `[Json]` Creates an Integer type */
130
110
  Integer(options) {
131
- return (0, index_12.Integer)(options);
111
+ return (0, index_11.Integer)(options);
132
112
  }
133
113
  /** `[Json]` Creates an Intersect type */
134
- Intersect(T, options) {
135
- return (0, index_13.Intersect)(T, options);
114
+ Intersect(types, options) {
115
+ return (0, index_12.Intersect)(types, options);
136
116
  }
137
117
  /** `[Json]` Creates a KeyOf type */
138
- KeyOf(schema, options) {
139
- return (0, index_15.KeyOf)(schema, options);
118
+ KeyOf(type, options) {
119
+ return (0, index_14.KeyOf)(type, options);
140
120
  }
141
121
  /** `[Json]` Creates a Literal type */
142
- Literal(value, options) {
143
- return (0, index_16.Literal)(value, options);
122
+ Literal(literalValue, options) {
123
+ return (0, index_15.Literal)(literalValue, options);
144
124
  }
145
125
  /** `[Json]` Intrinsic function to Lowercase LiteralString types */
146
- Lowercase(schema, options) {
147
- return (0, index_14.Lowercase)(schema, options);
126
+ Lowercase(type, options) {
127
+ return (0, index_13.Lowercase)(type, options);
148
128
  }
149
129
  /** `[Json]` Creates a Mapped object type */
150
130
  Mapped(key, map, options) {
151
- return (0, index_17.Mapped)(key, map, options);
131
+ return (0, index_16.Mapped)(key, map, options);
132
+ }
133
+ /** `[Json]` Creates a Type Definition Module. */
134
+ Module(properties) {
135
+ return (0, index_20.Module)(properties);
152
136
  }
153
137
  /** `[Json]` Creates a Never type */
154
138
  Never(options) {
155
- return (0, index_18.Never)(options);
139
+ return (0, index_17.Never)(options);
156
140
  }
157
141
  /** `[Json]` Creates a Not type */
158
- Not(schema, options) {
159
- return (0, index_19.Not)(schema, options);
142
+ Not(type, options) {
143
+ return (0, index_18.Not)(type, options);
160
144
  }
161
145
  /** `[Json]` Creates a Null type */
162
146
  Null(options) {
163
- return (0, index_20.Null)(options);
147
+ return (0, index_19.Null)(options);
164
148
  }
165
149
  /** `[Json]` Creates a Number type */
166
150
  Number(options) {
@@ -171,72 +155,72 @@ class JsonTypeBuilder {
171
155
  return (0, index_22.Object)(properties, options);
172
156
  }
173
157
  /** `[Json]` Constructs a type whose keys are omitted from the given type */
174
- Omit(schema, unresolved, options) {
175
- return (0, index_23.Omit)(schema, unresolved, options);
158
+ Omit(schema, selector, options) {
159
+ return (0, index_23.Omit)(schema, selector, options);
176
160
  }
177
161
  /** `[Json]` Constructs a type where all properties are optional */
178
- Partial(schema, options) {
179
- return (0, index_25.Partial)(schema, options);
162
+ Partial(type, options) {
163
+ return (0, index_25.Partial)(type, options);
180
164
  }
181
165
  /** `[Json]` Constructs a type whose keys are picked from the given type */
182
- Pick(schema, unresolved, options) {
183
- return (0, index_26.Pick)(schema, unresolved, options);
166
+ Pick(type, key, options) {
167
+ return (0, index_26.Pick)(type, key, options);
184
168
  }
185
169
  /** `[Json]` Creates a Record type */
186
- Record(key, schema, options) {
187
- return (0, index_29.Record)(key, schema, options);
170
+ Record(key, value, options) {
171
+ return (0, index_29.Record)(key, value, options);
188
172
  }
189
173
  /** `[Json]` Creates a Recursive type */
190
174
  Recursive(callback, options) {
191
175
  return (0, index_30.Recursive)(callback, options);
192
176
  }
193
177
  /** `[Json]` Creates a Ref type. */
194
- Ref(unresolved, options) {
195
- return (0, index_31.Ref)(unresolved, options);
178
+ Ref($ref, options) {
179
+ return (0, index_31.Ref)($ref, options);
196
180
  }
197
181
  /** `[Json]` Constructs a type where all properties are required */
198
- Required(schema, options) {
199
- return (0, index_32.Required)(schema, options);
182
+ Required(type, options) {
183
+ return (0, index_32.Required)(type, options);
200
184
  }
201
185
  /** `[Json]` Extracts interior Rest elements from Tuple, Intersect and Union types */
202
- Rest(schema) {
203
- return (0, index_33.Rest)(schema);
186
+ Rest(type) {
187
+ return (0, index_33.Rest)(type);
204
188
  }
205
189
  /** `[Json]` Creates a String type */
206
190
  String(options) {
207
- return (0, index_35.String)(options);
191
+ return (0, index_34.String)(options);
208
192
  }
209
193
  /** `[Json]` Creates a TemplateLiteral type */
210
194
  TemplateLiteral(unresolved, options) {
211
- return (0, index_36.TemplateLiteral)(unresolved, options);
195
+ return (0, index_35.TemplateLiteral)(unresolved, options);
212
196
  }
213
197
  /** `[Json]` Creates a Transform type */
214
- Transform(schema) {
215
- return (0, index_37.Transform)(schema);
198
+ Transform(type) {
199
+ return (0, index_36.Transform)(type);
216
200
  }
217
201
  /** `[Json]` Creates a Tuple type */
218
- Tuple(items, options) {
219
- return (0, index_38.Tuple)(items, options);
202
+ Tuple(types, options) {
203
+ return (0, index_37.Tuple)(types, options);
220
204
  }
221
205
  /** `[Json]` Intrinsic function to Uncapitalize LiteralString types */
222
- Uncapitalize(schema, options) {
223
- return (0, index_14.Uncapitalize)(schema, options);
206
+ Uncapitalize(type, options) {
207
+ return (0, index_13.Uncapitalize)(type, options);
224
208
  }
225
209
  /** `[Json]` Creates a Union type */
226
- Union(schemas, options) {
227
- return (0, index_39.Union)(schemas, options);
210
+ Union(types, options) {
211
+ return (0, index_38.Union)(types, options);
228
212
  }
229
213
  /** `[Json]` Creates an Unknown type */
230
214
  Unknown(options) {
231
- return (0, index_40.Unknown)(options);
215
+ return (0, index_39.Unknown)(options);
232
216
  }
233
217
  /** `[Json]` Creates a Unsafe type that will infers as the generic argument T */
234
218
  Unsafe(options) {
235
- return (0, index_41.Unsafe)(options);
219
+ return (0, index_40.Unsafe)(options);
236
220
  }
237
221
  /** `[Json]` Intrinsic function to Uppercase LiteralString types */
238
222
  Uppercase(schema, options) {
239
- return (0, index_14.Uppercase)(schema, options);
223
+ return (0, index_13.Uppercase)(schema, options);
240
224
  }
241
225
  }
242
226
  exports.JsonTypeBuilder = JsonTypeBuilder;
@@ -9,7 +9,6 @@ export { Const } from '../const/index';
9
9
  export { Constructor } from '../constructor/index';
10
10
  export { ConstructorParameters } from '../constructor-parameters/index';
11
11
  export { Date } from '../date/index';
12
- export { Deref } from '../deref/index';
13
12
  export { Enum } from '../enum/index';
14
13
  export { Exclude } from '../exclude/index';
15
14
  export { Extends } from '../extends/index';
@@ -24,6 +23,7 @@ export { Iterator } from '../iterator/index';
24
23
  export { KeyOf } from '../keyof/index';
25
24
  export { Literal } from '../literal/index';
26
25
  export { Mapped } from '../mapped/index';
26
+ export { Module } from '../module/index';
27
27
  export { Never } from '../never/index';
28
28
  export { Not } from '../not/index';
29
29
  export { Null } from '../null/index';
@@ -45,7 +45,6 @@ export { Required } from '../required/index';
45
45
  export { Rest } from '../rest/index';
46
46
  export { ReturnType } from '../return-type/index';
47
47
  export { String } from '../string/index';
48
- export { Strict } from '../strict/index';
49
48
  export { Symbol } from '../symbol/index';
50
49
  export { TemplateLiteral } from '../template-literal/index';
51
50
  export { Transform } from '../transform/index';