typia 9.7.1 → 10.0.0-dev.20251107

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 (424) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +153 -153
  3. package/lib/AssertionGuard.d.mts +27 -25
  4. package/lib/AssertionGuard.d.ts +27 -25
  5. package/lib/CamelCase.d.mts +1 -1
  6. package/lib/CamelCase.d.ts +1 -1
  7. package/lib/IRandomGenerator.d.mts +44 -42
  8. package/lib/IRandomGenerator.d.ts +44 -42
  9. package/lib/IReadableURLSearchParams.d.mts +2 -2
  10. package/lib/IReadableURLSearchParams.d.ts +2 -2
  11. package/lib/PascalCase.d.mts +1 -1
  12. package/lib/PascalCase.d.ts +1 -1
  13. package/lib/Primitive.d.mts +20 -22
  14. package/lib/Primitive.d.ts +20 -22
  15. package/lib/Resolved.d.mts +16 -18
  16. package/lib/Resolved.d.ts +16 -18
  17. package/lib/SnakeCase.d.mts +3 -2
  18. package/lib/SnakeCase.d.ts +3 -2
  19. package/lib/TypeGuardError.d.mts +88 -61
  20. package/lib/TypeGuardError.d.ts +88 -61
  21. package/lib/TypeGuardError.js +40 -29
  22. package/lib/TypeGuardError.js.map +1 -1
  23. package/lib/TypeGuardError.mjs +70 -48
  24. package/lib/factories/MetadataCollection.js +4 -12
  25. package/lib/factories/MetadataCollection.js.map +1 -1
  26. package/lib/factories/MetadataCollection.mjs +4 -12
  27. package/lib/factories/MetadataCommentTagFactory.js +5 -15
  28. package/lib/factories/MetadataCommentTagFactory.js.map +1 -1
  29. package/lib/factories/MetadataCommentTagFactory.mjs +5 -15
  30. package/lib/factories/MetadataFactory.js +1 -3
  31. package/lib/factories/MetadataFactory.js.map +1 -1
  32. package/lib/factories/MetadataFactory.mjs +1 -3
  33. package/lib/factories/ProtobufFactory.js +2 -4
  34. package/lib/factories/ProtobufFactory.js.map +1 -1
  35. package/lib/factories/ProtobufFactory.mjs +2 -4
  36. package/lib/functional.d.mts +196 -195
  37. package/lib/functional.d.ts +196 -195
  38. package/lib/functional.js +18 -54
  39. package/lib/functional.js.map +1 -1
  40. package/lib/functional.mjs +18 -54
  41. package/lib/http.d.mts +303 -319
  42. package/lib/http.d.ts +303 -319
  43. package/lib/http.js +26 -78
  44. package/lib/http.js.map +1 -1
  45. package/lib/http.mjs +26 -78
  46. package/lib/internal/_ProtobufReader.d.mts +3 -9
  47. package/lib/internal/_ProtobufReader.d.ts +3 -9
  48. package/lib/internal/_ProtobufReader.js.map +1 -1
  49. package/lib/internal/_ProtobufReader.mjs +3 -9
  50. package/lib/internal/_ProtobufSizer.d.mts +4 -12
  51. package/lib/internal/_ProtobufSizer.d.ts +4 -12
  52. package/lib/internal/_ProtobufSizer.js.map +1 -1
  53. package/lib/internal/_ProtobufSizer.mjs +4 -12
  54. package/lib/internal/_ProtobufWriter.d.mts +5 -15
  55. package/lib/internal/_ProtobufWriter.d.ts +5 -15
  56. package/lib/internal/_ProtobufWriter.js.map +1 -1
  57. package/lib/internal/_ProtobufWriter.mjs +5 -15
  58. package/lib/internal/_jsonStringifyString.d.mts +4 -4
  59. package/lib/internal/_jsonStringifyString.d.ts +4 -4
  60. package/lib/internal/_jsonStringifyString.js +4 -4
  61. package/lib/internal/_jsonStringifyString.mjs +4 -4
  62. package/lib/json.d.mts +174 -195
  63. package/lib/json.d.ts +174 -195
  64. package/lib/json.js +16 -48
  65. package/lib/json.js.map +1 -1
  66. package/lib/json.mjs +16 -48
  67. package/lib/llm.d.mts +275 -192
  68. package/lib/llm.d.ts +275 -192
  69. package/lib/llm.js +4 -12
  70. package/lib/llm.js.map +1 -1
  71. package/lib/llm.mjs +4 -12
  72. package/lib/misc.d.mts +149 -172
  73. package/lib/misc.d.ts +149 -172
  74. package/lib/misc.js +17 -51
  75. package/lib/misc.js.map +1 -1
  76. package/lib/misc.mjs +17 -51
  77. package/lib/module.d.mts +263 -275
  78. package/lib/module.d.ts +263 -275
  79. package/lib/module.js +18 -54
  80. package/lib/module.js.map +1 -1
  81. package/lib/module.mjs +18 -54
  82. package/lib/notations.d.mts +153 -174
  83. package/lib/notations.d.ts +153 -174
  84. package/lib/notations.js +24 -72
  85. package/lib/notations.js.map +1 -1
  86. package/lib/notations.mjs +24 -72
  87. package/lib/programmers/FeatureProgrammer.d.mts +19 -41
  88. package/lib/programmers/FeatureProgrammer.d.ts +19 -41
  89. package/lib/programmers/FeatureProgrammer.js.map +1 -1
  90. package/lib/programmers/ImportProgrammer.js +3 -9
  91. package/lib/programmers/ImportProgrammer.js.map +1 -1
  92. package/lib/programmers/ImportProgrammer.mjs +3 -9
  93. package/lib/programmers/RandomProgrammer.js +6 -0
  94. package/lib/programmers/RandomProgrammer.js.map +1 -1
  95. package/lib/programmers/RandomProgrammer.mjs +6 -0
  96. package/lib/programmers/helpers/ProtobufWire.d.mts +13 -13
  97. package/lib/programmers/helpers/ProtobufWire.d.ts +13 -13
  98. package/lib/programmers/internal/check_array_length.js +2 -6
  99. package/lib/programmers/internal/check_array_length.js.map +1 -1
  100. package/lib/programmers/internal/check_array_length.mjs +2 -6
  101. package/lib/programmers/internal/check_bigint.js +2 -6
  102. package/lib/programmers/internal/check_bigint.js.map +1 -1
  103. package/lib/programmers/internal/check_bigint.mjs +2 -6
  104. package/lib/programmers/internal/check_dynamic_key.js +2 -6
  105. package/lib/programmers/internal/check_dynamic_key.js.map +1 -1
  106. package/lib/programmers/internal/check_dynamic_key.mjs +2 -6
  107. package/lib/programmers/internal/check_dynamic_properties.js +3 -9
  108. package/lib/programmers/internal/check_dynamic_properties.js.map +1 -1
  109. package/lib/programmers/internal/check_dynamic_properties.mjs +3 -9
  110. package/lib/programmers/internal/check_everything.js +1 -3
  111. package/lib/programmers/internal/check_everything.js.map +1 -1
  112. package/lib/programmers/internal/check_everything.mjs +1 -3
  113. package/lib/programmers/internal/check_native.js +2 -6
  114. package/lib/programmers/internal/check_native.js.map +1 -1
  115. package/lib/programmers/internal/check_native.mjs +2 -6
  116. package/lib/programmers/internal/check_number.js +2 -6
  117. package/lib/programmers/internal/check_number.js.map +1 -1
  118. package/lib/programmers/internal/check_number.mjs +2 -6
  119. package/lib/programmers/internal/check_object.js +2 -6
  120. package/lib/programmers/internal/check_object.js.map +1 -1
  121. package/lib/programmers/internal/check_object.mjs +2 -6
  122. package/lib/programmers/internal/check_string.js +2 -6
  123. package/lib/programmers/internal/check_string.js.map +1 -1
  124. package/lib/programmers/internal/check_string.mjs +2 -6
  125. package/lib/programmers/internal/check_template.js +1 -3
  126. package/lib/programmers/internal/check_template.js.map +1 -1
  127. package/lib/programmers/internal/check_template.mjs +1 -3
  128. package/lib/programmers/internal/check_union_array_like.js +1 -3
  129. package/lib/programmers/internal/check_union_array_like.js.map +1 -1
  130. package/lib/programmers/internal/check_union_array_like.mjs +1 -3
  131. package/lib/programmers/internal/decode_union_object.js +2 -6
  132. package/lib/programmers/internal/decode_union_object.js.map +1 -1
  133. package/lib/programmers/internal/decode_union_object.mjs +2 -6
  134. package/lib/programmers/internal/feature_object_entries.js +1 -3
  135. package/lib/programmers/internal/feature_object_entries.js.map +1 -1
  136. package/lib/programmers/internal/feature_object_entries.mjs +1 -3
  137. package/lib/programmers/internal/json_schema_escaped.js +2 -6
  138. package/lib/programmers/internal/json_schema_escaped.js.map +1 -1
  139. package/lib/programmers/internal/json_schema_escaped.mjs +2 -6
  140. package/lib/programmers/internal/json_schema_object.js +3 -9
  141. package/lib/programmers/internal/json_schema_object.js.map +1 -1
  142. package/lib/programmers/internal/json_schema_object.mjs +3 -9
  143. package/lib/programmers/internal/json_schema_station.d.mts +2 -2
  144. package/lib/programmers/internal/json_schema_station.d.ts +2 -2
  145. package/lib/programmers/internal/metadata_to_pattern.js +1 -3
  146. package/lib/programmers/internal/metadata_to_pattern.js.map +1 -1
  147. package/lib/programmers/internal/metadata_to_pattern.mjs +1 -3
  148. package/lib/programmers/internal/postfix_of_tuple.js +1 -3
  149. package/lib/programmers/internal/postfix_of_tuple.js.map +1 -1
  150. package/lib/programmers/internal/postfix_of_tuple.mjs +1 -3
  151. package/lib/programmers/internal/prune_object_properties.js +1 -3
  152. package/lib/programmers/internal/prune_object_properties.js.map +1 -1
  153. package/lib/programmers/internal/prune_object_properties.mjs +1 -3
  154. package/lib/programmers/internal/stringify_dynamic_properties.js +2 -6
  155. package/lib/programmers/internal/stringify_dynamic_properties.js.map +1 -1
  156. package/lib/programmers/internal/stringify_dynamic_properties.mjs +2 -6
  157. package/lib/programmers/internal/stringify_native.js +1 -3
  158. package/lib/programmers/internal/stringify_native.js.map +1 -1
  159. package/lib/programmers/internal/stringify_native.mjs +1 -3
  160. package/lib/programmers/internal/stringify_regular_properties.js +2 -6
  161. package/lib/programmers/internal/stringify_regular_properties.js.map +1 -1
  162. package/lib/programmers/internal/stringify_regular_properties.mjs +2 -6
  163. package/lib/programmers/internal/template_to_pattern.js +1 -3
  164. package/lib/programmers/internal/template_to_pattern.js.map +1 -1
  165. package/lib/programmers/internal/template_to_pattern.mjs +1 -3
  166. package/lib/programmers/internal/wrap_metadata_rest_tuple.js +1 -3
  167. package/lib/programmers/internal/wrap_metadata_rest_tuple.js.map +1 -1
  168. package/lib/programmers/internal/wrap_metadata_rest_tuple.mjs +1 -3
  169. package/lib/programmers/json/JsonStringifyProgrammer.js +2 -2
  170. package/lib/programmers/json/JsonStringifyProgrammer.js.map +1 -1
  171. package/lib/programmers/json/JsonStringifyProgrammer.mjs +2 -2
  172. package/lib/programmers/llm/LlmApplicationProgrammer.js +5 -1
  173. package/lib/programmers/llm/LlmApplicationProgrammer.js.map +1 -1
  174. package/lib/programmers/llm/LlmApplicationProgrammer.mjs +5 -1
  175. package/lib/programmers/llm/LlmSchemaProgrammer.js +1 -4
  176. package/lib/programmers/llm/LlmSchemaProgrammer.js.map +1 -1
  177. package/lib/programmers/llm/LlmSchemaProgrammer.mjs +1 -35
  178. package/lib/protobuf.d.mts +290 -297
  179. package/lib/protobuf.d.ts +290 -297
  180. package/lib/protobuf.js +17 -51
  181. package/lib/protobuf.js.map +1 -1
  182. package/lib/protobuf.mjs +17 -51
  183. package/lib/reflect.d.mts +2 -4
  184. package/lib/reflect.d.ts +2 -4
  185. package/lib/reflect.js +1 -3
  186. package/lib/reflect.js.map +1 -1
  187. package/lib/reflect.mjs +1 -3
  188. package/lib/schemas/json/IJsonApplication.d.mts +4 -4
  189. package/lib/schemas/json/IJsonApplication.d.ts +4 -4
  190. package/lib/schemas/json/IJsonSchemaCollection.d.mts +73 -56
  191. package/lib/schemas/json/IJsonSchemaCollection.d.ts +73 -56
  192. package/lib/schemas/json/IJsonSchemaUnit.d.mts +83 -70
  193. package/lib/schemas/json/IJsonSchemaUnit.d.ts +83 -70
  194. package/lib/schemas/metadata/Metadata.d.mts +1 -3
  195. package/lib/schemas/metadata/Metadata.d.ts +1 -3
  196. package/lib/schemas/metadata/Metadata.js +9 -27
  197. package/lib/schemas/metadata/Metadata.js.map +1 -1
  198. package/lib/schemas/metadata/Metadata.mjs +9 -27
  199. package/lib/schemas/metadata/MetadataAliasType.d.mts +1 -3
  200. package/lib/schemas/metadata/MetadataAliasType.d.ts +1 -3
  201. package/lib/schemas/metadata/MetadataAliasType.js +3 -9
  202. package/lib/schemas/metadata/MetadataAliasType.js.map +1 -1
  203. package/lib/schemas/metadata/MetadataAliasType.mjs +3 -9
  204. package/lib/schemas/metadata/MetadataApplication.d.mts +1 -3
  205. package/lib/schemas/metadata/MetadataApplication.d.ts +1 -3
  206. package/lib/schemas/metadata/MetadataApplication.js +2 -6
  207. package/lib/schemas/metadata/MetadataApplication.js.map +1 -1
  208. package/lib/schemas/metadata/MetadataApplication.mjs +2 -6
  209. package/lib/schemas/metadata/MetadataArray.d.mts +1 -3
  210. package/lib/schemas/metadata/MetadataArray.d.ts +1 -3
  211. package/lib/schemas/metadata/MetadataArray.js +1 -3
  212. package/lib/schemas/metadata/MetadataArray.js.map +1 -1
  213. package/lib/schemas/metadata/MetadataArray.mjs +1 -3
  214. package/lib/schemas/metadata/MetadataArrayType.d.mts +1 -3
  215. package/lib/schemas/metadata/MetadataArrayType.d.ts +1 -3
  216. package/lib/schemas/metadata/MetadataArrayType.js +3 -9
  217. package/lib/schemas/metadata/MetadataArrayType.js.map +1 -1
  218. package/lib/schemas/metadata/MetadataArrayType.mjs +3 -9
  219. package/lib/schemas/metadata/MetadataAtomic.js +1 -3
  220. package/lib/schemas/metadata/MetadataAtomic.js.map +1 -1
  221. package/lib/schemas/metadata/MetadataAtomic.mjs +1 -3
  222. package/lib/schemas/metadata/MetadataEscaped.d.mts +1 -3
  223. package/lib/schemas/metadata/MetadataEscaped.d.ts +1 -3
  224. package/lib/schemas/metadata/MetadataEscaped.js +3 -9
  225. package/lib/schemas/metadata/MetadataEscaped.js.map +1 -1
  226. package/lib/schemas/metadata/MetadataEscaped.mjs +3 -9
  227. package/lib/schemas/metadata/MetadataFunction.d.mts +1 -3
  228. package/lib/schemas/metadata/MetadataFunction.d.ts +1 -3
  229. package/lib/schemas/metadata/MetadataFunction.js +2 -6
  230. package/lib/schemas/metadata/MetadataFunction.js.map +1 -1
  231. package/lib/schemas/metadata/MetadataFunction.mjs +2 -6
  232. package/lib/schemas/metadata/MetadataObject.d.mts +1 -3
  233. package/lib/schemas/metadata/MetadataObject.d.ts +1 -3
  234. package/lib/schemas/metadata/MetadataObject.js +1 -3
  235. package/lib/schemas/metadata/MetadataObject.js.map +1 -1
  236. package/lib/schemas/metadata/MetadataObject.mjs +1 -3
  237. package/lib/schemas/metadata/MetadataObjectType.d.mts +1 -3
  238. package/lib/schemas/metadata/MetadataObjectType.d.ts +1 -3
  239. package/lib/schemas/metadata/MetadataObjectType.js +5 -15
  240. package/lib/schemas/metadata/MetadataObjectType.js.map +1 -1
  241. package/lib/schemas/metadata/MetadataObjectType.mjs +6 -18
  242. package/lib/schemas/metadata/MetadataParameter.js +1 -3
  243. package/lib/schemas/metadata/MetadataParameter.js.map +1 -1
  244. package/lib/schemas/metadata/MetadataParameter.mjs +1 -3
  245. package/lib/schemas/metadata/MetadataProperty.d.mts +1 -3
  246. package/lib/schemas/metadata/MetadataProperty.d.ts +1 -3
  247. package/lib/schemas/metadata/MetadataProperty.js +3 -9
  248. package/lib/schemas/metadata/MetadataProperty.js.map +1 -1
  249. package/lib/schemas/metadata/MetadataProperty.mjs +3 -9
  250. package/lib/schemas/metadata/MetadataTemplate.js +1 -3
  251. package/lib/schemas/metadata/MetadataTemplate.js.map +1 -1
  252. package/lib/schemas/metadata/MetadataTemplate.mjs +1 -3
  253. package/lib/schemas/metadata/MetadataTuple.d.mts +1 -3
  254. package/lib/schemas/metadata/MetadataTuple.d.ts +1 -3
  255. package/lib/schemas/metadata/MetadataTuple.js +2 -6
  256. package/lib/schemas/metadata/MetadataTuple.js.map +1 -1
  257. package/lib/schemas/metadata/MetadataTuple.mjs +2 -6
  258. package/lib/schemas/metadata/MetadataTupleType.js +2 -6
  259. package/lib/schemas/metadata/MetadataTupleType.js.map +1 -1
  260. package/lib/schemas/metadata/MetadataTupleType.mjs +3 -9
  261. package/lib/tags/Constant.d.mts +16 -16
  262. package/lib/tags/Constant.d.ts +16 -16
  263. package/lib/tags/ContentMediaType.d.mts +7 -7
  264. package/lib/tags/ContentMediaType.d.ts +7 -7
  265. package/lib/tags/Default.d.mts +19 -19
  266. package/lib/tags/Default.d.ts +19 -19
  267. package/lib/tags/Example.d.mts +18 -18
  268. package/lib/tags/Example.d.ts +18 -18
  269. package/lib/tags/Examples.d.mts +23 -23
  270. package/lib/tags/Examples.d.ts +23 -23
  271. package/lib/tags/ExclusiveMaximum.d.mts +8 -5
  272. package/lib/tags/ExclusiveMaximum.d.ts +8 -5
  273. package/lib/tags/ExclusiveMinimum.d.mts +8 -5
  274. package/lib/tags/ExclusiveMinimum.d.ts +8 -5
  275. package/lib/tags/Format.d.mts +12 -8
  276. package/lib/tags/Format.d.ts +12 -8
  277. package/lib/tags/JsonSchemaPlugin.d.mts +20 -18
  278. package/lib/tags/JsonSchemaPlugin.d.ts +20 -18
  279. package/lib/tags/MaxItems.d.mts +9 -9
  280. package/lib/tags/MaxItems.d.ts +9 -9
  281. package/lib/tags/MaxLength.d.mts +6 -5
  282. package/lib/tags/MaxLength.d.ts +6 -5
  283. package/lib/tags/Maximum.d.mts +9 -7
  284. package/lib/tags/Maximum.d.ts +9 -7
  285. package/lib/tags/MinItems.d.mts +9 -9
  286. package/lib/tags/MinItems.d.ts +9 -9
  287. package/lib/tags/MinLength.d.mts +6 -5
  288. package/lib/tags/MinLength.d.ts +6 -5
  289. package/lib/tags/Minimum.d.mts +9 -7
  290. package/lib/tags/Minimum.d.ts +9 -7
  291. package/lib/tags/MultipleOf.d.mts +10 -7
  292. package/lib/tags/MultipleOf.d.ts +10 -7
  293. package/lib/tags/Pattern.d.mts +7 -4
  294. package/lib/tags/Pattern.d.ts +7 -4
  295. package/lib/tags/Sequence.d.mts +19 -17
  296. package/lib/tags/Sequence.d.ts +19 -17
  297. package/lib/tags/TagBase.d.mts +21 -28
  298. package/lib/tags/TagBase.d.ts +21 -28
  299. package/lib/tags/Type.d.mts +12 -11
  300. package/lib/tags/Type.d.ts +12 -11
  301. package/lib/tags/UniqueItems.d.mts +10 -9
  302. package/lib/tags/UniqueItems.d.ts +10 -9
  303. package/lib/tags/internal/FormatCheatSheet.d.mts +1 -3
  304. package/lib/tags/internal/FormatCheatSheet.d.ts +1 -3
  305. package/lib/tags/internal/FormatCheatSheet.js +1 -3
  306. package/lib/tags/internal/FormatCheatSheet.js.map +1 -1
  307. package/lib/tags/internal/FormatCheatSheet.mjs +1 -3
  308. package/lib/transformers/ITransformOptions.d.mts +27 -19
  309. package/lib/transformers/ITransformOptions.d.ts +27 -19
  310. package/lib/transformers/ImportTransformer.js +5 -10
  311. package/lib/transformers/ImportTransformer.js.map +1 -1
  312. package/lib/transformers/ImportTransformer.mjs +5 -10
  313. package/lib/transformers/NoTransformConfigurationError.js +1 -3
  314. package/lib/transformers/NoTransformConfigurationError.js.map +1 -1
  315. package/lib/transformers/NoTransformConfigurationError.mjs +1 -3
  316. package/lib/transformers/features/llm/LlmApplicationTransformer.js +1 -3
  317. package/lib/transformers/features/llm/LlmApplicationTransformer.js.map +1 -1
  318. package/lib/transformers/features/llm/LlmApplicationTransformer.mjs +1 -3
  319. package/lib/typings/Equal.d.mts +6 -6
  320. package/lib/typings/Equal.d.ts +6 -6
  321. package/package.json +121 -120
  322. package/src/AssertionGuard.ts +41 -39
  323. package/src/CamelCase.ts +75 -75
  324. package/src/IRandomGenerator.ts +337 -335
  325. package/src/IReadableURLSearchParams.ts +9 -9
  326. package/src/PascalCase.ts +71 -71
  327. package/src/Primitive.ts +90 -92
  328. package/src/Resolved.ts +72 -74
  329. package/src/SnakeCase.ts +127 -126
  330. package/src/TypeGuardError.ts +216 -179
  331. package/src/factories/MetadataCollection.ts +270 -278
  332. package/src/factories/MetadataCommentTagFactory.ts +632 -648
  333. package/src/factories/MetadataFactory.ts +402 -404
  334. package/src/factories/ProtobufFactory.ts +873 -875
  335. package/src/functional.ts +705 -740
  336. package/src/http.ts +972 -1040
  337. package/src/internal/_ProtobufReader.ts +188 -194
  338. package/src/internal/_ProtobufSizer.ts +137 -145
  339. package/src/internal/_ProtobufWriter.ts +135 -145
  340. package/src/internal/_jsonStringifyString.ts +42 -42
  341. package/src/json.ts +643 -696
  342. package/src/llm.ts +615 -540
  343. package/src/misc.ts +594 -651
  344. package/src/module.ts +889 -937
  345. package/src/notations.ts +751 -820
  346. package/src/programmers/FeatureProgrammer.ts +605 -627
  347. package/src/programmers/ImportProgrammer.ts +179 -185
  348. package/src/programmers/RandomProgrammer.ts +1195 -1190
  349. package/src/programmers/helpers/ProtobufWire.ts +34 -34
  350. package/src/programmers/internal/check_array_length.ts +43 -47
  351. package/src/programmers/internal/check_bigint.ts +46 -50
  352. package/src/programmers/internal/check_dynamic_key.ts +197 -201
  353. package/src/programmers/internal/check_dynamic_properties.ts +231 -237
  354. package/src/programmers/internal/check_everything.ts +21 -23
  355. package/src/programmers/internal/check_native.ts +23 -27
  356. package/src/programmers/internal/check_number.ts +108 -112
  357. package/src/programmers/internal/check_object.ts +72 -78
  358. package/src/programmers/internal/check_string.ts +46 -50
  359. package/src/programmers/internal/check_template.ts +46 -48
  360. package/src/programmers/internal/check_union_array_like.ts +331 -335
  361. package/src/programmers/internal/decode_union_object.ts +110 -116
  362. package/src/programmers/internal/feature_object_entries.ts +59 -61
  363. package/src/programmers/internal/json_schema_escaped.ts +78 -82
  364. package/src/programmers/internal/json_schema_object.ts +150 -158
  365. package/src/programmers/internal/json_schema_station.ts +2 -2
  366. package/src/programmers/internal/metadata_to_pattern.ts +40 -42
  367. package/src/programmers/internal/postfix_of_tuple.ts +3 -5
  368. package/src/programmers/internal/prune_object_properties.ts +69 -71
  369. package/src/programmers/internal/stringify_dynamic_properties.ts +158 -162
  370. package/src/programmers/internal/stringify_native.ts +5 -7
  371. package/src/programmers/internal/stringify_regular_properties.ts +77 -81
  372. package/src/programmers/internal/template_to_pattern.ts +21 -23
  373. package/src/programmers/internal/wrap_metadata_rest_tuple.ts +21 -23
  374. package/src/programmers/json/JsonStringifyProgrammer.ts +1124 -1124
  375. package/src/programmers/llm/LlmApplicationProgrammer.ts +10 -1
  376. package/src/programmers/llm/LlmSchemaProgrammer.ts +2 -7
  377. package/src/protobuf.ts +820 -861
  378. package/src/reflect.ts +46 -50
  379. package/src/schemas/json/IJsonApplication.ts +77 -77
  380. package/src/schemas/json/IJsonSchemaCollection.ts +212 -195
  381. package/src/schemas/json/IJsonSchemaUnit.ts +263 -250
  382. package/src/schemas/metadata/IMetadataTypeTag.ts +14 -16
  383. package/src/schemas/metadata/Metadata.ts +669 -687
  384. package/src/schemas/metadata/MetadataAliasType.ts +57 -63
  385. package/src/schemas/metadata/MetadataApplication.ts +40 -44
  386. package/src/schemas/metadata/MetadataArray.ts +47 -49
  387. package/src/schemas/metadata/MetadataArrayType.ts +51 -57
  388. package/src/schemas/metadata/MetadataAtomic.ts +85 -87
  389. package/src/schemas/metadata/MetadataEscaped.ts +45 -51
  390. package/src/schemas/metadata/MetadataFunction.ts +45 -49
  391. package/src/schemas/metadata/MetadataObject.ts +46 -48
  392. package/src/schemas/metadata/MetadataObjectType.ts +137 -149
  393. package/src/schemas/metadata/MetadataParameter.ts +52 -54
  394. package/src/schemas/metadata/MetadataProperty.ts +53 -59
  395. package/src/schemas/metadata/MetadataTemplate.ts +78 -80
  396. package/src/schemas/metadata/MetadataTuple.ts +28 -32
  397. package/src/schemas/metadata/MetadataTupleType.ts +61 -67
  398. package/src/tags/Constant.ts +47 -47
  399. package/src/tags/ContentMediaType.ts +27 -27
  400. package/src/tags/Default.ts +52 -52
  401. package/src/tags/Example.ts +56 -56
  402. package/src/tags/Examples.ts +56 -56
  403. package/src/tags/ExclusiveMaximum.ts +44 -41
  404. package/src/tags/ExclusiveMinimum.ts +44 -41
  405. package/src/tags/Format.ts +78 -74
  406. package/src/tags/JsonSchemaPlugin.ts +36 -34
  407. package/src/tags/MaxItems.ts +31 -31
  408. package/src/tags/MaxLength.ts +25 -24
  409. package/src/tags/Maximum.ts +39 -37
  410. package/src/tags/MinItems.ts +31 -31
  411. package/src/tags/MinLength.ts +25 -24
  412. package/src/tags/Minimum.ts +39 -37
  413. package/src/tags/MultipleOf.ts +42 -39
  414. package/src/tags/Pattern.ts +49 -46
  415. package/src/tags/Sequence.ts +37 -35
  416. package/src/tags/TagBase.ts +102 -109
  417. package/src/tags/Type.ts +64 -63
  418. package/src/tags/UniqueItems.ts +34 -33
  419. package/src/tags/internal/FormatCheatSheet.ts +71 -73
  420. package/src/transformers/ITransformOptions.ts +70 -62
  421. package/src/transformers/ImportTransformer.ts +253 -258
  422. package/src/transformers/NoTransformConfigurationError.ts +16 -18
  423. package/src/transformers/features/llm/LlmApplicationTransformer.ts +224 -226
  424. package/src/typings/Equal.ts +18 -18
package/src/module.ts CHANGED
@@ -1,937 +1,889 @@
1
- import { StandardSchemaV1 } from "@standard-schema/spec";
2
-
3
- import { NoTransformConfigurationError } from "./transformers/NoTransformConfigurationError";
4
-
5
- import { AssertionGuard } from "./AssertionGuard";
6
- import { IRandomGenerator } from "./IRandomGenerator";
7
- import { IValidation } from "./IValidation";
8
- import { Resolved } from "./Resolved";
9
- import { TypeGuardError } from "./TypeGuardError";
10
-
11
- export * as functional from "./functional";
12
- export * as http from "./http";
13
- export * as llm from "./llm";
14
- export * as json from "./json";
15
- export * as misc from "./misc";
16
- export * as notations from "./notations";
17
- export * as protobuf from "./protobuf";
18
- export * as reflect from "./reflect";
19
- export * as tags from "./tags";
20
-
21
- export * from "./schemas/metadata/IJsDocTagInfo";
22
- export * from "./schemas/json/IJsonApplication";
23
- export * from "./schemas/json/IJsonSchemaCollection";
24
- export * from "./schemas/json/IJsonSchemaUnit";
25
- export * from "./AssertionGuard";
26
- export * from "./IRandomGenerator";
27
- export * from "./IValidation";
28
- export * from "./TypeGuardError";
29
-
30
- export * from "./Primitive";
31
- export * from "./Resolved";
32
- export * from "./CamelCase";
33
- export * from "./PascalCase";
34
- export * from "./SnakeCase";
35
- export * from "./IReadableURLSearchParams";
36
-
37
- /* -----------------------------------------------------------
38
- BASIC VALIDATORS
39
- ----------------------------------------------------------- */
40
- /**
41
- * Asserts a value type.
42
- *
43
- * Asserts a parametric value type and throws a {@link TypeGuardError} with a detailed
44
- * reason, if the parametric value is not following the type `T`. Otherwise, if the
45
- * value is following the type `T`, the input parameter will be returned.
46
- *
47
- * If what you want is not asserting but just knowing whether the parametric value is
48
- * following the type `T` or not, you can choose the {@link is} function instead.
49
- * Otherwise, if you want to know all the errors, {@link validate} is the way to go.
50
- * Also, if you want to automatically cast the parametric value to the type `T`
51
- * when there is no problem (perform the assertion guard of type).
52
- *
53
- * On the other hand, if you don't want to allow any superfluous property that is not
54
- * enrolled to the type `T`, you can use {@link assertEquals} function instead.
55
- *
56
- * @template T Type of the input value
57
- * @param input A value to be asserted
58
- * @param errorFactory Custom error factory. Default is `TypeGuardError`
59
- * @returns Parametric input value
60
- * @throws A {@link TypeGuardError} instance with a detailed reason
61
- *
62
- * @author Jeongho Nam - https://github.com/samchon
63
- */
64
- export function assert<T>(
65
- input: T,
66
- errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
67
- ): T;
68
-
69
- /**
70
- * Asserts a value type.
71
- *
72
- * Asserts a parametric value type and throws a {@link TypeGuardError} with a detailed
73
- * reason, if the parametric value is not following the type `T`. Otherwise, if the
74
- * value is following the type `T`, the input parameter will be returned.
75
- *
76
- * If what you want is not asserting but just knowing whether the parametric value is
77
- * following the type `T` or not, you can choose the {@link is} function instead.
78
- * Otherwise, if you want to know all the errors, {@link validate} is the way to go.
79
- *
80
- * On the other hand, if you don't want to allow any superfluous property that is not
81
- * enrolled to the type `T`, you can use {@link assertEquals} function instead.
82
- *
83
- * @template T Type of the input value
84
- * @param input A value to be asserted
85
- * @param errorFactory Custom error factory. Default is `TypeGuardError`
86
- * @returns Parametric input value casted as `T`
87
- * @throws A {@link TypeGuardError} instance with a detailed reason
88
- *
89
- * @author Jeongho Nam - https://github.com/samchon
90
- */
91
- export function assert<T>(
92
- input: unknown,
93
- errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
94
- ): T;
95
-
96
- /**
97
- * @internal
98
- */
99
- export function assert(): never {
100
- NoTransformConfigurationError("assert");
101
- }
102
-
103
- /**
104
- * Assertion guard of a value type.
105
- *
106
- * Asserts a parametric value type and throws a {@link TypeGuardError} with a detailed
107
- * reason, if the parametric value is not following the type `T`. Otherwise, if the
108
- * value is following the type `T`, nothing will be returned, but the input value
109
- * will be automatically casted to the type `T`. This is the concept of
110
- * "Assertion Guard" of a value type.
111
- *
112
- * If what you want is not asserting but just knowing whether the parametric value is
113
- * following the type `T` or not, you can choose the {@link is} function instead.
114
- * Otherwise, if you want to know all the errors, {@link validate} is the way to go.
115
- * Also, if you want to return the parametric value when there is no problem, you can use
116
- * {@link assert} function instead.
117
- *
118
- * On the other hand, if you don't want to allow any superfluous property that is not
119
- * enrolled to the type `T`, you can use {@link assertGuardEquals} function instead.
120
- *
121
- * @template T Type of the input value
122
- * @param input A value to be asserted
123
- * @param errorFactory Custom error factory. Default is `TypeGuardError`
124
- * @throws A {@link TypeGuardError} instance with a detailed reason
125
- *
126
- * @author Jeongho Nam - https://github.com/samchon
127
- */
128
- export function assertGuard<T>(
129
- input: T,
130
- errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
131
- ): asserts input is T;
132
-
133
- /**
134
- * Assertion guard of a value type.
135
- *
136
- * Asserts a parametric value type and throws a {@link TypeGuardError} with a detailed
137
- * reason, if the parametric value is not following the type `T`. Otherwise, if the
138
- * value is following the type `T`, nothing will be returned, but the input value
139
- * will be automatically casted to the type `T`. This is the concept of
140
- * "Assertion Guard" of a value type.
141
- *
142
- * If what you want is not asserting but just knowing whether the parametric value is
143
- * following the type `T` or not, you can choose the {@link is} function instead.
144
- * Otherwise, if you want to know all the errors, {@link validate} is the way to go.
145
- * Also, if you want to return the parametric value when there is no problem, you can use
146
- * {@link assert} function instead.
147
- *
148
- * On the other hand, if you don't want to allow any superfluous property that is not
149
- * enrolled to the type `T`, you can use {@link assertGuardEquals} function instead.
150
- *
151
- * @template T Type of the input value
152
- * @param input A value to be asserted
153
- * @param errorFactory Custom error factory. Default is `TypeGuardError`
154
- * @throws A {@link TypeGuardError} instance with a detailed reason
155
- *
156
- * @author Jeongho Nam - https://github.com/samchon
157
- */
158
- export function assertGuard<T>(
159
- input: unknown,
160
- errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
161
- ): asserts input is T;
162
-
163
- /**
164
- * @internal
165
- */
166
- export function assertGuard(): never {
167
- NoTransformConfigurationError("assertGuard");
168
- }
169
-
170
- /**
171
- * Tests a value type.
172
- *
173
- * Tests a parametric value type and returns whether it's following the type `T` or not.
174
- * If the parametric value is matched with the type `T`, `true` value will be returned.
175
- * Otherwise, if the parametric value is not following the type `T`, `false` value will be
176
- * returned.
177
- *
178
- * If what you want is not just knowing whether the parametric value is following the
179
- * type `T` or not, but throwing an exception with a detailed reason, you can choose
180
- * {@link assert} function instead. Also, if you want to know all the errors with
181
- * detailed reasons, {@link validate} function will be useful.
182
- *
183
- * On the other hand, if you don't want to allow any superfluous property that is not
184
- * enrolled to the type `T`, you can use {@link equals} function instead.
185
- *
186
- * @template T Type of the input value
187
- * @param input A value to be tested
188
- * @param errorFactory Custom error factory. Default is `TypeGuardError`
189
- * @returns Whether the parametric value is following the type `T` or not
190
- *
191
- * @author Jeongho Nam - https://github.com/samchon
192
- */
193
- export function is<T>(input: T): input is T;
194
-
195
- /**
196
- * Tests a value type.
197
- *
198
- * Tests a parametric value type and returns whether it's following the type `T` or not.
199
- * If the parametric value is matched with the type `T`, `true` value will be returned.
200
- * Otherwise, if the parametric value is not following the type `T`, `false` value will be
201
- * returned.
202
- *
203
- * If what you want is not just knowing whether the parametric value is following the
204
- * type `T` or not, but throwing an exception with a detailed reason, you can choose
205
- * {@link assert} function instead. Also, if you want to know all the errors with
206
- * detailed reasons, {@link validate} function will be useful.
207
- *
208
- * On the other hand, if you don't want to allow any superfluous property that is not
209
- * enrolled to the type `T`, you can use {@link equals} function instead.
210
- *
211
- * @template T Type of the input value
212
- * @param input A value to be tested
213
- * @returns Whether the parametric value is following the type `T` or not
214
- *
215
- * @author Jeongho Nam - https://github.com/samchon
216
- */
217
- export function is<T>(input: unknown): input is T;
218
-
219
- /**
220
- * @internal
221
- */
222
- export function is(): never {
223
- NoTransformConfigurationError("is");
224
- }
225
-
226
- /**
227
- * Validates a value type.
228
- *
229
- * Validates a parametric value type and archives all the type errors into an
230
- * {@link IValidation.errors} array, if the parametric value is not following the
231
- * type `T`. Of course, if the parametric value is following the type `T`, the
232
- * {@link IValidation.errors} array will be empty and {@link IValidation.success}
233
- * will have the `true` value.
234
- *
235
- * If what you want is not finding all the errors, but asserting the parametric value
236
- * type with exception throwing, you can choose {@link assert} function instead.
237
- * Otherwise, if you just want to know whether the parametric value is matched with the
238
- * type `T`, {@link is} function is the way to go.
239
- *
240
- * On the other hand, if you don't want to allow any superfluous property that is not
241
- * enrolled to the type `T`, you can use {@link validateEquals} function instead.
242
- *
243
- * @template T Type of the input value
244
- * @param input A value to be validated
245
- * @returns Validation result
246
- *
247
- * @author Jeongho Nam - https://github.com/samchon
248
- */
249
- export function validate<T>(input: T): IValidation<T>;
250
-
251
- /**
252
- * Validates a value type.
253
- *
254
- * Validates a parametric value type and archives all the type errors into an
255
- * {@link IValidation.errors} array, if the parametric value is not following the
256
- * type `T`. Of course, if the parametric value is following the type `T`, the
257
- * {@link IValidation.errors} array will be empty and {@link IValidation.success}
258
- * will have the `true` value.
259
- *
260
- * If what you want is not finding all the errors, but asserting the parametric value
261
- * type with exception throwing, you can choose {@link assert} function instead.
262
- * Otherwise, if you just want to know whether the parametric value is matched with the
263
- * type `T`, {@link is} function is the way to go.
264
- *
265
- * On the other hand, if you don't want to allow any superfluous property that is not
266
- * enrolled to the type `T`, you can use {@link validateEquals} function instead.
267
- *
268
- * @template T Type of the input value
269
- * @param input A value to be validated
270
- * @returns Validation result
271
- *
272
- * @author Jeongho Nam - https://github.com/samchon
273
- */
274
- export function validate<T>(input: unknown): IValidation<T>;
275
-
276
- /**
277
- * @internal
278
- */
279
- export function validate(): never {
280
- NoTransformConfigurationError("validate");
281
- }
282
-
283
- /* -----------------------------------------------------------
284
- STRICT VALIDATORS
285
- ----------------------------------------------------------- */
286
- /**
287
- * Asserts equality between a value and its type.
288
- *
289
- * Asserts a parametric value type and throws a {@link TypeGuardError} with detailed
290
- * reason, if the parametric value is not following the type `T` or some superfluous
291
- * property that is not listed on the type `T` has been found. Otherwise, the value is
292
- * following the type `T` without any superfluous property, just input parameter would
293
- * be returned.
294
- *
295
- * If what you want is not asserting but just knowing whether the parametric value is
296
- * following the type `T` or not, you can choose the {@link equals} function instead.
297
- * Otherwise, if you want to know all the errors, {@link validateEquals} is the way to go.
298
- *
299
- * On the other hand, if you want to allow superfluous property that is not enrolled
300
- * to the type `T`, you can use {@link assert} function instead.
301
- *
302
- * @template T Type of the input value
303
- * @param input A value to be asserted
304
- * @param errorFactory Custom error factory. Default is `TypeGuardError`
305
- * @returns Parametric input value
306
- * @throws A {@link TypeGuardError} instance with a detailed reason
307
- *
308
- * @author Jeongho Nam - https://github.com/samchon
309
- */
310
- export function assertEquals<T>(
311
- input: T,
312
- errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
313
- ): T;
314
-
315
- /**
316
- * Asserts equality between a value and its type.
317
- *
318
- * Asserts a parametric value type and throws a {@link TypeGuardError} with detailed
319
- * reason, if the parametric value is not following the type `T` or some superfluous
320
- * property that is not listed on the type `T` has been found. Otherwise, the value is
321
- * following the type `T` without any superfluous property, just input parameter would
322
- * be returned.
323
- *
324
- * If what you want is not asserting but just knowing whether the parametric value is
325
- * following the type `T` or not, you can choose the {@link equals} function instead.
326
- * Otherwise, if you want to know all the errors, {@link validateEquals} is the way to go.
327
- *
328
- * On the other hand, if you want to allow superfluous property that is not enrolled
329
- * to the type `T`, you can use {@link assert} function instead.
330
- *
331
- * @template T Type of the input value
332
- * @param input A value to be asserted
333
- * @param errorFactory Custom error factory. Default is `TypeGuardError`
334
- * @returns Parametric input value casted as `T`
335
- * @throws A {@link TypeGuardError} instance with a detailed reason
336
- *
337
- * @author Jeongho Nam - https://github.com/samchon
338
- */
339
- export function assertEquals<T>(
340
- input: unknown,
341
- errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
342
- ): T;
343
-
344
- /**
345
- * @internal
346
- */
347
- export function assertEquals(): never {
348
- NoTransformConfigurationError("assertEquals");
349
- }
350
-
351
- /**
352
- * Assertion guard of a type with equality.
353
- *
354
- * Asserts a parametric value type and throws a {@link TypeGuardError} with detailed
355
- * reason, if the parametric value is not following the type `T` or some superfluous
356
- * property that is not listed on the type `T` has been found.
357
- *
358
- * Otherwise, the value is following the type `T` without any superfluous property,
359
- * nothing will be returned, but the input value would be automatically casted to
360
- * the type `T`. This is the concept of "Assertion Guard" of a value type.
361
- *
362
- * If what you want is not asserting but just knowing whether the parametric value is
363
- * following the type `T` or not, you can choose the {@link equals} function instead.
364
- * Otherwise, if you want to know all the errors, {@link validateEquals} is the way to go.
365
- * Also, if you want to returns the parametric value when no problem, you can use
366
- * {@link assert} function instead.
367
- *
368
- * On the other hand, if you want to allow superfluous property that is not enrolled
369
- * to the type `T`, you can use {@link assertEquals} function instead.
370
- *
371
- * @template T Type of the input value
372
- * @param input A value to be asserted
373
- * @param errorFactory Custom error factory. Default is `TypeGuardError`
374
- * @returns Parametric input value casted as `T`
375
- * @throws A {@link TypeGuardError} instance with a detailed reason
376
- *
377
- * @author Jeongho Nam - https://github.com/samchon
378
- */
379
- export function assertGuardEquals<T>(
380
- input: T,
381
- errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
382
- ): asserts input is T;
383
-
384
- /**
385
- * Assertion guard of a type with equality.
386
- *
387
- * Asserts a parametric value type and throws a {@link TypeGuardError} with detailed
388
- * reason, if the parametric value is not following the type `T` or some superfluous
389
- * property that is not listed on the type `T` has been found.
390
- *
391
- * Otherwise, the value is following the type `T` without any superfluous property,
392
- * nothing will be returned, but the input value would be automatically casted to
393
- * the type `T`. This is the concept of "Assertion Guard" of a value type.
394
- *
395
- * If what you want is not asserting but just knowing whether the parametric value is
396
- * following the type `T` or not, you can choose the {@link equals} function instead.
397
- * Otherwise, if you want to know all the errors, {@link validateEquals} is the way to go.
398
- * Also, if you want to returns the parametric value when no problem, you can use
399
- * {@link assertEquals} function instead.
400
- *
401
- * On the other hand, if you want to allow superfluous property that is not enrolled
402
- * to the type `T`, you can use {@link assertGuard} function instead.
403
- *
404
- * @template T Type of the input value
405
- * @param input A value to be asserted
406
- * @param errorFactory Custom error factory. Default is `TypeGuardError`
407
- * @returns Parametric input value casted as `T`
408
- * @throws A {@link TypeGuardError} instance with a detailed reason
409
- *
410
- * @author Jeongho Nam - https://github.com/samchon
411
- */
412
- export function assertGuardEquals<T>(
413
- input: unknown,
414
- errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
415
- ): asserts input is T;
416
-
417
- /**
418
- * @internal
419
- */
420
- export function assertGuardEquals(): never {
421
- NoTransformConfigurationError("assertGuardEquals");
422
- }
423
-
424
- /**
425
- * Tests equality between a value and its type.
426
- *
427
- * Tests a parametric value type and returns whether it's equivalent to the type `T`
428
- * or not. If the parametric value is matched with the type `T` and there's not any
429
- * superfluous property that is not listed on the type `T`, `true` value will be
430
- * returned. Otherwise, if the parametric value is not following the type `T` or some
431
- * superfluous property exists, `false` value will be returned.
432
- *
433
- * If what you want is not just knowing whether the parametric value is following the
434
- * type `T` or not, but throwing an exception with a detailed reason, you can choose
435
- * {@link assertEquals} function instead. Also, if you want to know all the errors with
436
- * detailed reasons, {@link validateEquals} function will be useful.
437
- *
438
- * On the other hand, if you want to allow superfluous property that is not enrolled
439
- * to the type `T`, you can use {@link is} function instead.
440
- *
441
- * @template T Type of the input value
442
- * @param input A value to be tested
443
- * @returns Whether the parametric value is equivalent to the type `T` or not
444
- *
445
- * @author Jeongho Nam - https://github.com/samchon
446
- */
447
- export function equals<T>(input: T): input is T;
448
-
449
- /**
450
- * Tests equality between a value and its type.
451
- *
452
- * Tests a parametric value type and returns whether it's equivalent to the type `T`
453
- * or not. If the parametric value is matched with the type `T` and there's not any
454
- * superfluous property that is not listed on the type `T`, `true` value will be
455
- * returned. Otherwise, if the parametric value is not following the type `T` or some
456
- * superfluous property exists, `false` value will be returned.
457
- *
458
- * If what you want is not just knowing whether the parametric value is following the
459
- * type `T` or not, but throwing an exception with a detailed reason, you can choose
460
- * {@link assertEquals} function instead. Also, if you want to know all the errors with
461
- * detailed reasons, {@link validateEquals} function will be useful.
462
- *
463
- * On the other hand, if you want to allow superfluous property that is not enrolled
464
- * to the type `T`, you can use {@link is} function instead.
465
- *
466
- * @template T Type of the input value
467
- * @param input A value to be tested
468
- * @returns Whether the parametric value is equivalent to the type `T` or not
469
- *
470
- * @author Jeongho Nam - https://github.com/samchon
471
- */
472
- export function equals<T>(input: unknown): input is T;
473
-
474
- /**
475
- * @internal
476
- */
477
- export function equals(): never {
478
- NoTransformConfigurationError("equals");
479
- }
480
-
481
- /**
482
- * Validates equality between a value and its type.
483
- *
484
- * Validates a parametric value type and archives all the type errors into an
485
- * {@link IValidation.errors} array, if the parametric value is not following the
486
- * type `T` or some superfluous property that is not listed on the type `T` has been
487
- * found. Of course, if the parametric value is following the type `T` and no
488
- * superfluous property exists, the {@link IValidation.errors} array would be empty
489
- * and {@link IValidation.success} would have the `true` value.
490
- *
491
- * If what you want is not finding all the error, but asserting the parametric value
492
- * type with exception throwing, you can choose {@link assert} function instead.
493
- * Otherwise, you just want to know whether the parametric value is matched with the
494
- * type `T`, {@link is} function is the way to go.
495
- *
496
- * On the other hand, if you don't want to allow any superfluous property that is not
497
- * enrolled to the type `T`, you can use {@link validateEquals} function instead.
498
- *
499
- * @template Type of the input value
500
- * @param input A value to be validated
501
- * @returns Validation result
502
- *
503
- * @author Jeongho Nam - https://github.com/samchon
504
- */
505
- export function validateEquals<T>(input: T): IValidation<T>;
506
-
507
- /**
508
- * Validates equality between a value and its type.
509
- *
510
- * Validates a parametric value type and archives all the type errors into an
511
- * {@link IValidation.errors} array, if the parametric value is not following the
512
- * type `T` or some superfluous property that is not listed on the type `T` has been
513
- * found. Of course, if the parametric value is following the type `T` and no
514
- * superfluous property exists, the {@link IValidation.errors} array would be empty
515
- * and {@link IValidation.success} would have the `true` value.
516
- *
517
- * If what you want is not finding all the error, but asserting the parametric value
518
- * type with exception throwing, you can choose {@link assert} function instead.
519
- * Otherwise, you just want to know whether the parametric value is matched with the
520
- * type `T`, {@link is} function is the way to go.
521
- *
522
- * On the other hand, if you don't want to allow any superfluous property that is not
523
- * enrolled to the type `T`, you can use {@link validateEquals} function instead.
524
- *
525
- * @template Type of the input value
526
- * @param input A value to be validated
527
- * @returns Validation result
528
- *
529
- * @author Jeongho Nam - https://github.com/samchon
530
- */
531
- export function validateEquals<T>(input: unknown): IValidation<T>;
532
-
533
- /**
534
- * @internal
535
- */
536
- export function validateEquals(): never {
537
- NoTransformConfigurationError("validateEquals");
538
- }
539
-
540
- /* -----------------------------------------------------------
541
- RANDOM
542
- ----------------------------------------------------------- */
543
- /**
544
- * > You must configure the generic argument `T`.
545
- *
546
- * Generate random data.
547
- *
548
- * Generates a random data following type the `T`.
549
- *
550
- * For reference, this `typia.random()` function generates only primitive type.
551
- * If there're some methods in the type `T` or its nested instances, those would
552
- * be ignored. Also, when the type `T` has a `toJSON()` method, its return type
553
- * will be generated instead.
554
- *
555
- * @template T Type of data to generate
556
- * @param generator Random data generator
557
- * @return Randomly generated data
558
- *
559
- * @author Jeongho Nam - https://github.com/samchon
560
- */
561
- export function random(generator?: Partial<IRandomGenerator>): never;
562
-
563
- /**
564
- * Generate random data.
565
- *
566
- * Generates a random data following type the `T`.
567
- *
568
- * For reference, this `typia.random()` function generates only primitive type.
569
- * If there're some methods in the type `T` or its nested instances, those would
570
- * be ignored. Also, when the type `T` has a `toJSON()` method, its return type
571
- * will be generated instead.
572
- *
573
- * @template T Type of data to generate
574
- * @param generator Random data generator
575
- * @return Randomly generated data
576
- *
577
- * @author Jeongho Nam - https://github.com/samchon
578
- */
579
- export function random<T>(generator?: Partial<IRandomGenerator>): Resolved<T>;
580
-
581
- /**
582
- * @internal
583
- */
584
- export function random(): never {
585
- NoTransformConfigurationError("random");
586
- }
587
-
588
- /* -----------------------------------------------------------
589
- FACTORY FUNCTIONS
590
- ----------------------------------------------------------- */
591
- /**
592
- * Creates a reusable {@link assert} function.
593
- *
594
- * @danger You must configure the generic argument `T`
595
- * @param errorFactory Custom error factory. Default is `TypeGuardError`
596
- * @returns Nothing until you configure the generic argument `T`
597
- * @throws compile error
598
- *
599
- * @author Jeongho Nam - https://github.com/samchon
600
- */
601
- export function createAssert(
602
- errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
603
- ): never;
604
-
605
- /**
606
- * Creates a reusable {@link assert} function.
607
- *
608
- * @template T Type of the input value
609
- * @param errorFactory Custom error factory. Default is `TypeGuardError`
610
- * @returns A reusable `assert` function
611
- *
612
- * @author Jeongho Nam - https://github.com/samchon
613
- */
614
- export function createAssert<T>(
615
- errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
616
- ): (input: unknown) => T;
617
-
618
- /**
619
- * @internal
620
- */
621
- export function createAssert<T>(): (input: unknown) => T {
622
- NoTransformConfigurationError("createAssert");
623
- }
624
-
625
- /**
626
- * Creates a reusable {@link assertGuard} function.
627
- *
628
- * Note that, you've to declare the variable type of the factory function caller
629
- * like below. If you don't declare the variable type, compilation error be thrown.
630
- * This is the special rule of the TypeScript compiler.
631
- *
632
- * ```typescript
633
- * // MUST DECLARE THE VARIABLE TYPE
634
- * const func: typia.AssertionGuard<number> = typia.createAssertGuard<number>();
635
- *
636
- * // IF NOT, COMPILATION ERROR BE OCCURRED
637
- * const func = typia.createAssertGuard<number>();
638
- * ```
639
- *
640
- * > *Assertions require every name in the call target to be declared with an*
641
- * > *explicit type annotation.*
642
- *
643
- * @danger You must configure the generic argument `T`
644
- * @param errorFactory Custom error factory. Default is `TypeGuardError`
645
- * @returns Nothing until you configure the generic argument `T`
646
- * @throws compile error
647
- *
648
- * @author Jeongho Nam - https://github.com/samchon
649
- */
650
- export function createAssertGuard(
651
- errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
652
- ): never;
653
-
654
- /**
655
- * Creates a reusable {@link assertGuard} function.
656
- *
657
- * Note that, you've to declare the variable type of the factory function caller
658
- * like below. If you don't declare the variable type, compilation error be thrown.
659
- * This is the special rule of the TypeScript compiler.
660
- *
661
- * ```typescript
662
- * // MUST DECLARE THE VARIABLE TYPE
663
- * const func: typia.AssertionGuard<number> = typia.createAssertGuard<number>();
664
- *
665
- * // IF NOT, COMPILATION ERROR BE OCCURRED
666
- * const func = typia.createAssertGuard<number>();
667
- * ```
668
- *
669
- * > *Assertions require every name in the call target to be declared with an*
670
- * > *explicit type annotation.*
671
- *
672
- * @returns Nothing until you configure the generic argument `T`
673
- * @param errorFactory Custom error factory. Default is `TypeGuardError`
674
- * @throws compile error
675
- *
676
- * @author Jeongho Nam - https://github.com/samchon
677
- */
678
- export function createAssertGuard<T>(
679
- errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
680
- ): (input: unknown) => AssertionGuard<T>;
681
-
682
- /**
683
- * @internal
684
- */
685
- export function createAssertGuard<T>(): (input: unknown) => AssertionGuard<T> {
686
- NoTransformConfigurationError("createAssertGuard");
687
- }
688
-
689
- /**
690
- * Creates a reusable {@link is} function.
691
- *
692
- * @danger You must configure the generic argument `T`
693
- * @returns Nothing until you configure the generic argument `T`
694
- * @throws compile error
695
- *
696
- * @author Jeongho Nam - https://github.com/samchon
697
- */
698
- export function createIs(): never;
699
-
700
- /**
701
- * Creates a reusable {@link is} function.
702
- *
703
- * @template T Type of the input value
704
- * @returns A reusable `is` function
705
- *
706
- * @author Jeongho Nam - https://github.com/samchon
707
- */
708
- export function createIs<T>(): (input: unknown) => input is T;
709
-
710
- /**
711
- * @internal
712
- */
713
- export function createIs<T>(): (input: unknown) => input is T {
714
- NoTransformConfigurationError("createIs");
715
- }
716
-
717
- /**
718
- * Creates a reusable {@link validate} function.
719
- *
720
- * @danger You must configure the generic argument `T`
721
- * @returns Nothing until you configure the generic argument `T`
722
- * @throws compile error
723
- *
724
- * @author Jeongho Nam - https://github.com/samchon
725
- */
726
- export function createValidate(): never;
727
-
728
- /**
729
- * Creates a reusable {@link validate} function.
730
- *
731
- * @template T Type of the input value
732
- * @returns A reusable `validate` function
733
- *
734
- * @author Jeongho Nam - https://github.com/samchon
735
- */
736
- export function createValidate<T>(): ((input: unknown) => IValidation<T>) &
737
- StandardSchemaV1<unknown, T>;
738
-
739
- /**
740
- * @internal
741
- */
742
- export function createValidate(): ((input: unknown) => IValidation) &
743
- StandardSchemaV1<unknown, unknown> {
744
- NoTransformConfigurationError("createValidate");
745
- }
746
-
747
- /**
748
- * Creates a reusable {@link assertEquals} function.
749
- *
750
- * @danger You must configure the generic argument `T`
751
- * @param errorFactory Custom error factory. Default is `TypeGuardError`
752
- * @returns Nothing until you configure the generic argument `T`
753
- * @throws compile error
754
- *
755
- * @author Jeongho Nam - https://github.com/samchon
756
- */
757
- export function createAssertEquals(
758
- errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
759
- ): never;
760
-
761
- /**
762
- * Creates a reusable {@link assertEquals} function.
763
- *
764
- * @template T Type of the input value
765
- * @param errorFactory Custom error factory. Default is `TypeGuardError`
766
- * @returns A reusable `assertEquals` function
767
- *
768
- * @author Jeongho Nam - https://github.com/samchon
769
- */
770
- export function createAssertEquals<T>(
771
- errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
772
- ): (input: unknown) => T;
773
-
774
- /**
775
- * @internal
776
- */
777
- export function createAssertEquals<T>(): (input: unknown) => T {
778
- NoTransformConfigurationError("createAssertEquals");
779
- }
780
-
781
- /**
782
- * Creates a reusable {@link assertGuardEquals} function.
783
- *
784
- * Note that, you've to declare the variable type of the factory function caller
785
- * like below. If you don't declare the variable type, compilation error be thrown.
786
- * This is the special rule of the TypeScript compiler.
787
- *
788
- * ```typescript
789
- * // MUST DECLARE THE VARIABLE TYPE
790
- * const func: typia.AssertionGuard<number> = typia.createAssertGuardEquals<number>();
791
- *
792
- * // IF NOT, COMPILATION ERROR BE OCCURRED
793
- * const func = typia.createAssertGuardEquals<number>();
794
- * ```
795
- *
796
- * > *Assertions require every name in the call target to be declared with an*
797
- * > *explicit type annotation.*
798
- *
799
- * @danger You must configure the generic argument `T`
800
- * @param errorFactory Custom error factory. Default is `TypeGuardError`
801
- * @returns Nothing until you configure the generic argument `T`
802
- * @throws compile error
803
- *
804
- * @author Jeongho Nam - https://github.com/samchon
805
- */
806
- export function createAssertGuardEquals(
807
- errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
808
- ): never;
809
-
810
- /**
811
- * Creates a reusable {@link assertGuardEquals} function.
812
- *
813
- * Note that, you've to declare the variable type of the factory function caller
814
- * like below. If you don't declare the variable type, compilation error be thrown.
815
- * This is the special rule of the TypeScript compiler.
816
- *
817
- * ```typescript
818
- * // MUST DECLARE THE VARIABLE TYPE
819
- * const func: typia.AssertionGuard<number> = typia.createAssertGuardEquals<number>();
820
- *
821
- * // IF NOT, COMPILATION ERROR BE OCCURRED
822
- * const func = typia.createAssertGuardEquals<number>();
823
- * ```
824
- *
825
- * > *Assertions require every name in the call target to be declared with an*
826
- * > *explicit type annotation.*
827
- *
828
- * @param errorFactory Custom error factory. Default is `TypeGuardError`
829
- * @returns Nothing until you configure the generic argument `T`
830
- * @throws compile error
831
- *
832
- * @author Jeongho Nam - https://github.com/samchon
833
- */
834
- export function createAssertGuardEquals<T>(
835
- errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
836
- ): (input: unknown) => AssertionGuard<T>;
837
-
838
- /**
839
- * @internal
840
- */
841
- export function createAssertGuardEquals<T>(): (
842
- input: unknown,
843
- ) => AssertionGuard<T> {
844
- NoTransformConfigurationError("createAssertGuardEquals");
845
- }
846
-
847
- /**
848
- * Creates a reusable {@link equals} function.
849
- *
850
- * @danger You must configure the generic argument `T`
851
- * @returns Nothing until you configure the generic argument `T`
852
- * @throws compile error
853
- *
854
- * @author Jeongho Nam - https://github.com/samchon
855
- */
856
- export function createEquals(): never;
857
-
858
- /**
859
- * Creates a reusable {@link equals} function.
860
- *
861
- * @template T Type of the input value
862
- * @returns A reusable `equals` function
863
- *
864
- * @author Jeongho Nam - https://github.com/samchon
865
- */
866
- export function createEquals<T>(): (input: unknown) => input is T;
867
-
868
- /**
869
- * @internal
870
- */
871
- export function createEquals<T>(): (input: unknown) => input is T {
872
- NoTransformConfigurationError("createEquals");
873
- }
874
-
875
- /**
876
- * Creates a reusable {@link validateEquals} function.
877
- *
878
- * @danger You must configure the generic argument `T`
879
- * @returns Nothing until you configure the generic argument `T`
880
- * @throws compile error
881
- *
882
- * @author Jeongho Nam - https://github.com/samchon
883
- */
884
- export function createValidateEquals(): never;
885
-
886
- /**
887
- * Creates a reusable {@link validateEquals} function.
888
- *
889
- * @template T Type of the input value
890
- * @returns A reusable `validateEquals` function
891
- *
892
- * @author Jeongho Nam - https://github.com/samchon
893
- */
894
- export function createValidateEquals<T>(): ((
895
- input: unknown,
896
- ) => IValidation<T>) &
897
- StandardSchemaV1<unknown, T>;
898
-
899
- /**
900
- * @internal
901
- */
902
- export function createValidateEquals(): ((input: unknown) => IValidation) &
903
- StandardSchemaV1<unknown, unknown> {
904
- NoTransformConfigurationError("createValidateEquals");
905
- }
906
-
907
- /**
908
- * Creates a reusable {@link random} function.
909
- *
910
- * @danger You must configure the generic argument `T`
911
- * @param generator Random data generator
912
- * @returns Nothing until you configure the generic argument `T`
913
- * @throws compile error
914
- *
915
- * @author Jeongho Nam - https://github.com/samchon
916
- */
917
- export function createRandom(generator?: Partial<IRandomGenerator>): never;
918
-
919
- /**
920
- * Creates a reusable {@link random} function.
921
- *
922
- * @template T Type of the input value
923
- * @param generator Random data generator
924
- * @returns A reusable `random` function
925
- *
926
- * @author Jeongho Nam - https://github.com/samchon
927
- */
928
- export function createRandom<T>(
929
- generator?: Partial<IRandomGenerator>,
930
- ): () => Resolved<T>;
931
-
932
- /**
933
- * @internal
934
- */
935
- export function createRandom(): never {
936
- NoTransformConfigurationError("createRandom");
937
- }
1
+ import { StandardSchemaV1 } from "@standard-schema/spec";
2
+
3
+ import { NoTransformConfigurationError } from "./transformers/NoTransformConfigurationError";
4
+
5
+ import { AssertionGuard } from "./AssertionGuard";
6
+ import { IRandomGenerator } from "./IRandomGenerator";
7
+ import { IValidation } from "./IValidation";
8
+ import { Resolved } from "./Resolved";
9
+ import { TypeGuardError } from "./TypeGuardError";
10
+
11
+ export * as functional from "./functional";
12
+ export * as http from "./http";
13
+ export * as llm from "./llm";
14
+ export * as json from "./json";
15
+ export * as misc from "./misc";
16
+ export * as notations from "./notations";
17
+ export * as protobuf from "./protobuf";
18
+ export * as reflect from "./reflect";
19
+ export * as tags from "./tags";
20
+
21
+ export * from "./schemas/metadata/IJsDocTagInfo";
22
+ export * from "./schemas/json/IJsonApplication";
23
+ export * from "./schemas/json/IJsonSchemaCollection";
24
+ export * from "./schemas/json/IJsonSchemaUnit";
25
+ export * from "./AssertionGuard";
26
+ export * from "./IRandomGenerator";
27
+ export * from "./IValidation";
28
+ export * from "./TypeGuardError";
29
+
30
+ export * from "./Primitive";
31
+ export * from "./Resolved";
32
+ export * from "./CamelCase";
33
+ export * from "./PascalCase";
34
+ export * from "./SnakeCase";
35
+ export * from "./IReadableURLSearchParams";
36
+
37
+ /* -----------------------------------------------------------
38
+ BASIC VALIDATORS
39
+ ----------------------------------------------------------- */
40
+ /**
41
+ * Asserts a value type.
42
+ *
43
+ * Asserts a parametric value type and throws a {@link TypeGuardError} with a
44
+ * detailed reason, if the parametric value is not following the type `T`.
45
+ * Otherwise, if the value is following the type `T`, the input parameter will
46
+ * be returned.
47
+ *
48
+ * If what you want is not asserting but just knowing whether the parametric
49
+ * value is following the type `T` or not, you can choose the {@link is} function
50
+ * instead. Otherwise, if you want to know all the errors, {@link validate} is
51
+ * the way to go. Also, if you want to automatically cast the parametric value
52
+ * to the type `T` when there is no problem (perform the assertion guard of
53
+ * type).
54
+ *
55
+ * On the other hand, if you don't want to allow any superfluous property that
56
+ * is not enrolled to the type `T`, you can use {@link assertEquals} function
57
+ * instead.
58
+ *
59
+ * @author Jeongho Nam - https://github.com/samchon
60
+ * @template T Type of the input value
61
+ * @param input A value to be asserted
62
+ * @param errorFactory Custom error factory. Default is `TypeGuardError`
63
+ * @returns Parametric input value
64
+ * @throws A {@link TypeGuardError} instance with a detailed reason
65
+ */
66
+ export function assert<T>(
67
+ input: T,
68
+ errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
69
+ ): T;
70
+
71
+ /**
72
+ * Asserts a value type.
73
+ *
74
+ * Asserts a parametric value type and throws a {@link TypeGuardError} with a
75
+ * detailed reason, if the parametric value is not following the type `T`.
76
+ * Otherwise, if the value is following the type `T`, the input parameter will
77
+ * be returned.
78
+ *
79
+ * If what you want is not asserting but just knowing whether the parametric
80
+ * value is following the type `T` or not, you can choose the {@link is} function
81
+ * instead. Otherwise, if you want to know all the errors, {@link validate} is
82
+ * the way to go.
83
+ *
84
+ * On the other hand, if you don't want to allow any superfluous property that
85
+ * is not enrolled to the type `T`, you can use {@link assertEquals} function
86
+ * instead.
87
+ *
88
+ * @author Jeongho Nam - https://github.com/samchon
89
+ * @template T Type of the input value
90
+ * @param input A value to be asserted
91
+ * @param errorFactory Custom error factory. Default is `TypeGuardError`
92
+ * @returns Parametric input value casted as `T`
93
+ * @throws A {@link TypeGuardError} instance with a detailed reason
94
+ */
95
+ export function assert<T>(
96
+ input: unknown,
97
+ errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
98
+ ): T;
99
+
100
+ /** @internal */
101
+ export function assert(): never {
102
+ NoTransformConfigurationError("assert");
103
+ }
104
+
105
+ /**
106
+ * Assertion guard of a value type.
107
+ *
108
+ * Asserts a parametric value type and throws a {@link TypeGuardError} with a
109
+ * detailed reason, if the parametric value is not following the type `T`.
110
+ * Otherwise, if the value is following the type `T`, nothing will be returned,
111
+ * but the input value will be automatically casted to the type `T`. This is the
112
+ * concept of "Assertion Guard" of a value type.
113
+ *
114
+ * If what you want is not asserting but just knowing whether the parametric
115
+ * value is following the type `T` or not, you can choose the {@link is} function
116
+ * instead. Otherwise, if you want to know all the errors, {@link validate} is
117
+ * the way to go. Also, if you want to return the parametric value when there is
118
+ * no problem, you can use {@link assert} function instead.
119
+ *
120
+ * On the other hand, if you don't want to allow any superfluous property that
121
+ * is not enrolled to the type `T`, you can use {@link assertGuardEquals}
122
+ * function instead.
123
+ *
124
+ * @author Jeongho Nam - https://github.com/samchon
125
+ * @template T Type of the input value
126
+ * @param input A value to be asserted
127
+ * @param errorFactory Custom error factory. Default is `TypeGuardError`
128
+ * @throws A {@link TypeGuardError} instance with a detailed reason
129
+ */
130
+ export function assertGuard<T>(
131
+ input: T,
132
+ errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
133
+ ): asserts input is T;
134
+
135
+ /**
136
+ * Assertion guard of a value type.
137
+ *
138
+ * Asserts a parametric value type and throws a {@link TypeGuardError} with a
139
+ * detailed reason, if the parametric value is not following the type `T`.
140
+ * Otherwise, if the value is following the type `T`, nothing will be returned,
141
+ * but the input value will be automatically casted to the type `T`. This is the
142
+ * concept of "Assertion Guard" of a value type.
143
+ *
144
+ * If what you want is not asserting but just knowing whether the parametric
145
+ * value is following the type `T` or not, you can choose the {@link is} function
146
+ * instead. Otherwise, if you want to know all the errors, {@link validate} is
147
+ * the way to go. Also, if you want to return the parametric value when there is
148
+ * no problem, you can use {@link assert} function instead.
149
+ *
150
+ * On the other hand, if you don't want to allow any superfluous property that
151
+ * is not enrolled to the type `T`, you can use {@link assertGuardEquals}
152
+ * function instead.
153
+ *
154
+ * @author Jeongho Nam - https://github.com/samchon
155
+ * @template T Type of the input value
156
+ * @param input A value to be asserted
157
+ * @param errorFactory Custom error factory. Default is `TypeGuardError`
158
+ * @throws A {@link TypeGuardError} instance with a detailed reason
159
+ */
160
+ export function assertGuard<T>(
161
+ input: unknown,
162
+ errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
163
+ ): asserts input is T;
164
+
165
+ /** @internal */
166
+ export function assertGuard(): never {
167
+ NoTransformConfigurationError("assertGuard");
168
+ }
169
+
170
+ /**
171
+ * Tests a value type.
172
+ *
173
+ * Tests a parametric value type and returns whether it's following the type `T`
174
+ * or not. If the parametric value is matched with the type `T`, `true` value
175
+ * will be returned. Otherwise, if the parametric value is not following the
176
+ * type `T`, `false` value will be returned.
177
+ *
178
+ * If what you want is not just knowing whether the parametric value is
179
+ * following the type `T` or not, but throwing an exception with a detailed
180
+ * reason, you can choose {@link assert} function instead. Also, if you want to
181
+ * know all the errors with detailed reasons, {@link validate} function will be
182
+ * useful.
183
+ *
184
+ * On the other hand, if you don't want to allow any superfluous property that
185
+ * is not enrolled to the type `T`, you can use {@link equals} function instead.
186
+ *
187
+ * @author Jeongho Nam - https://github.com/samchon
188
+ * @template T Type of the input value
189
+ * @param input A value to be tested
190
+ * @param errorFactory Custom error factory. Default is `TypeGuardError`
191
+ * @returns Whether the parametric value is following the type `T` or not
192
+ */
193
+ export function is<T>(input: T): input is T;
194
+
195
+ /**
196
+ * Tests a value type.
197
+ *
198
+ * Tests a parametric value type and returns whether it's following the type `T`
199
+ * or not. If the parametric value is matched with the type `T`, `true` value
200
+ * will be returned. Otherwise, if the parametric value is not following the
201
+ * type `T`, `false` value will be returned.
202
+ *
203
+ * If what you want is not just knowing whether the parametric value is
204
+ * following the type `T` or not, but throwing an exception with a detailed
205
+ * reason, you can choose {@link assert} function instead. Also, if you want to
206
+ * know all the errors with detailed reasons, {@link validate} function will be
207
+ * useful.
208
+ *
209
+ * On the other hand, if you don't want to allow any superfluous property that
210
+ * is not enrolled to the type `T`, you can use {@link equals} function instead.
211
+ *
212
+ * @author Jeongho Nam - https://github.com/samchon
213
+ * @template T Type of the input value
214
+ * @param input A value to be tested
215
+ * @returns Whether the parametric value is following the type `T` or not
216
+ */
217
+ export function is<T>(input: unknown): input is T;
218
+
219
+ /** @internal */
220
+ export function is(): never {
221
+ NoTransformConfigurationError("is");
222
+ }
223
+
224
+ /**
225
+ * Validates a value type.
226
+ *
227
+ * Validates a parametric value type and archives all the type errors into an
228
+ * {@link IValidation.errors} array, if the parametric value is not following the
229
+ * type `T`. Of course, if the parametric value is following the type `T`, the
230
+ * {@link IValidation.errors} array will be empty and {@link IValidation.success}
231
+ * will have the `true` value.
232
+ *
233
+ * If what you want is not finding all the errors, but asserting the parametric
234
+ * value type with exception throwing, you can choose {@link assert} function
235
+ * instead. Otherwise, if you just want to know whether the parametric value is
236
+ * matched with the type `T`, {@link is} function is the way to go.
237
+ *
238
+ * On the other hand, if you don't want to allow any superfluous property that
239
+ * is not enrolled to the type `T`, you can use {@link validateEquals} function
240
+ * instead.
241
+ *
242
+ * @author Jeongho Nam - https://github.com/samchon
243
+ * @template T Type of the input value
244
+ * @param input A value to be validated
245
+ * @returns Validation result
246
+ */
247
+ export function validate<T>(input: T): IValidation<T>;
248
+
249
+ /**
250
+ * Validates a value type.
251
+ *
252
+ * Validates a parametric value type and archives all the type errors into an
253
+ * {@link IValidation.errors} array, if the parametric value is not following the
254
+ * type `T`. Of course, if the parametric value is following the type `T`, the
255
+ * {@link IValidation.errors} array will be empty and {@link IValidation.success}
256
+ * will have the `true` value.
257
+ *
258
+ * If what you want is not finding all the errors, but asserting the parametric
259
+ * value type with exception throwing, you can choose {@link assert} function
260
+ * instead. Otherwise, if you just want to know whether the parametric value is
261
+ * matched with the type `T`, {@link is} function is the way to go.
262
+ *
263
+ * On the other hand, if you don't want to allow any superfluous property that
264
+ * is not enrolled to the type `T`, you can use {@link validateEquals} function
265
+ * instead.
266
+ *
267
+ * @author Jeongho Nam - https://github.com/samchon
268
+ * @template T Type of the input value
269
+ * @param input A value to be validated
270
+ * @returns Validation result
271
+ */
272
+ export function validate<T>(input: unknown): IValidation<T>;
273
+
274
+ /** @internal */
275
+ export function validate(): never {
276
+ NoTransformConfigurationError("validate");
277
+ }
278
+
279
+ /* -----------------------------------------------------------
280
+ STRICT VALIDATORS
281
+ ----------------------------------------------------------- */
282
+ /**
283
+ * Asserts equality between a value and its type.
284
+ *
285
+ * Asserts a parametric value type and throws a {@link TypeGuardError} with
286
+ * detailed reason, if the parametric value is not following the type `T` or
287
+ * some superfluous property that is not listed on the type `T` has been found.
288
+ * Otherwise, the value is following the type `T` without any superfluous
289
+ * property, just input parameter would be returned.
290
+ *
291
+ * If what you want is not asserting but just knowing whether the parametric
292
+ * value is following the type `T` or not, you can choose the {@link equals}
293
+ * function instead. Otherwise, if you want to know all the errors,
294
+ * {@link validateEquals} is the way to go.
295
+ *
296
+ * On the other hand, if you want to allow superfluous property that is not
297
+ * enrolled to the type `T`, you can use {@link assert} function instead.
298
+ *
299
+ * @author Jeongho Nam - https://github.com/samchon
300
+ * @template T Type of the input value
301
+ * @param input A value to be asserted
302
+ * @param errorFactory Custom error factory. Default is `TypeGuardError`
303
+ * @returns Parametric input value
304
+ * @throws A {@link TypeGuardError} instance with a detailed reason
305
+ */
306
+ export function assertEquals<T>(
307
+ input: T,
308
+ errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
309
+ ): T;
310
+
311
+ /**
312
+ * Asserts equality between a value and its type.
313
+ *
314
+ * Asserts a parametric value type and throws a {@link TypeGuardError} with
315
+ * detailed reason, if the parametric value is not following the type `T` or
316
+ * some superfluous property that is not listed on the type `T` has been found.
317
+ * Otherwise, the value is following the type `T` without any superfluous
318
+ * property, just input parameter would be returned.
319
+ *
320
+ * If what you want is not asserting but just knowing whether the parametric
321
+ * value is following the type `T` or not, you can choose the {@link equals}
322
+ * function instead. Otherwise, if you want to know all the errors,
323
+ * {@link validateEquals} is the way to go.
324
+ *
325
+ * On the other hand, if you want to allow superfluous property that is not
326
+ * enrolled to the type `T`, you can use {@link assert} function instead.
327
+ *
328
+ * @author Jeongho Nam - https://github.com/samchon
329
+ * @template T Type of the input value
330
+ * @param input A value to be asserted
331
+ * @param errorFactory Custom error factory. Default is `TypeGuardError`
332
+ * @returns Parametric input value casted as `T`
333
+ * @throws A {@link TypeGuardError} instance with a detailed reason
334
+ */
335
+ export function assertEquals<T>(
336
+ input: unknown,
337
+ errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
338
+ ): T;
339
+
340
+ /** @internal */
341
+ export function assertEquals(): never {
342
+ NoTransformConfigurationError("assertEquals");
343
+ }
344
+
345
+ /**
346
+ * Assertion guard of a type with equality.
347
+ *
348
+ * Asserts a parametric value type and throws a {@link TypeGuardError} with
349
+ * detailed reason, if the parametric value is not following the type `T` or
350
+ * some superfluous property that is not listed on the type `T` has been found.
351
+ *
352
+ * Otherwise, the value is following the type `T` without any superfluous
353
+ * property, nothing will be returned, but the input value would be
354
+ * automatically casted to the type `T`. This is the concept of "Assertion
355
+ * Guard" of a value type.
356
+ *
357
+ * If what you want is not asserting but just knowing whether the parametric
358
+ * value is following the type `T` or not, you can choose the {@link equals}
359
+ * function instead. Otherwise, if you want to know all the errors,
360
+ * {@link validateEquals} is the way to go. Also, if you want to returns the
361
+ * parametric value when no problem, you can use {@link assert} function
362
+ * instead.
363
+ *
364
+ * On the other hand, if you want to allow superfluous property that is not
365
+ * enrolled to the type `T`, you can use {@link assertEquals} function instead.
366
+ *
367
+ * @author Jeongho Nam - https://github.com/samchon
368
+ * @template T Type of the input value
369
+ * @param input A value to be asserted
370
+ * @param errorFactory Custom error factory. Default is `TypeGuardError`
371
+ * @returns Parametric input value casted as `T`
372
+ * @throws A {@link TypeGuardError} instance with a detailed reason
373
+ */
374
+ export function assertGuardEquals<T>(
375
+ input: T,
376
+ errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
377
+ ): asserts input is T;
378
+
379
+ /**
380
+ * Assertion guard of a type with equality.
381
+ *
382
+ * Asserts a parametric value type and throws a {@link TypeGuardError} with
383
+ * detailed reason, if the parametric value is not following the type `T` or
384
+ * some superfluous property that is not listed on the type `T` has been found.
385
+ *
386
+ * Otherwise, the value is following the type `T` without any superfluous
387
+ * property, nothing will be returned, but the input value would be
388
+ * automatically casted to the type `T`. This is the concept of "Assertion
389
+ * Guard" of a value type.
390
+ *
391
+ * If what you want is not asserting but just knowing whether the parametric
392
+ * value is following the type `T` or not, you can choose the {@link equals}
393
+ * function instead. Otherwise, if you want to know all the errors,
394
+ * {@link validateEquals} is the way to go. Also, if you want to returns the
395
+ * parametric value when no problem, you can use {@link assertEquals} function
396
+ * instead.
397
+ *
398
+ * On the other hand, if you want to allow superfluous property that is not
399
+ * enrolled to the type `T`, you can use {@link assertGuard} function instead.
400
+ *
401
+ * @author Jeongho Nam - https://github.com/samchon
402
+ * @template T Type of the input value
403
+ * @param input A value to be asserted
404
+ * @param errorFactory Custom error factory. Default is `TypeGuardError`
405
+ * @returns Parametric input value casted as `T`
406
+ * @throws A {@link TypeGuardError} instance with a detailed reason
407
+ */
408
+ export function assertGuardEquals<T>(
409
+ input: unknown,
410
+ errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
411
+ ): asserts input is T;
412
+
413
+ /** @internal */
414
+ export function assertGuardEquals(): never {
415
+ NoTransformConfigurationError("assertGuardEquals");
416
+ }
417
+
418
+ /**
419
+ * Tests equality between a value and its type.
420
+ *
421
+ * Tests a parametric value type and returns whether it's equivalent to the type
422
+ * `T` or not. If the parametric value is matched with the type `T` and there's
423
+ * not any superfluous property that is not listed on the type `T`, `true` value
424
+ * will be returned. Otherwise, if the parametric value is not following the
425
+ * type `T` or some superfluous property exists, `false` value will be
426
+ * returned.
427
+ *
428
+ * If what you want is not just knowing whether the parametric value is
429
+ * following the type `T` or not, but throwing an exception with a detailed
430
+ * reason, you can choose {@link assertEquals} function instead. Also, if you
431
+ * want to know all the errors with detailed reasons, {@link validateEquals}
432
+ * function will be useful.
433
+ *
434
+ * On the other hand, if you want to allow superfluous property that is not
435
+ * enrolled to the type `T`, you can use {@link is} function instead.
436
+ *
437
+ * @author Jeongho Nam - https://github.com/samchon
438
+ * @template T Type of the input value
439
+ * @param input A value to be tested
440
+ * @returns Whether the parametric value is equivalent to the type `T` or not
441
+ */
442
+ export function equals<T>(input: T): input is T;
443
+
444
+ /**
445
+ * Tests equality between a value and its type.
446
+ *
447
+ * Tests a parametric value type and returns whether it's equivalent to the type
448
+ * `T` or not. If the parametric value is matched with the type `T` and there's
449
+ * not any superfluous property that is not listed on the type `T`, `true` value
450
+ * will be returned. Otherwise, if the parametric value is not following the
451
+ * type `T` or some superfluous property exists, `false` value will be
452
+ * returned.
453
+ *
454
+ * If what you want is not just knowing whether the parametric value is
455
+ * following the type `T` or not, but throwing an exception with a detailed
456
+ * reason, you can choose {@link assertEquals} function instead. Also, if you
457
+ * want to know all the errors with detailed reasons, {@link validateEquals}
458
+ * function will be useful.
459
+ *
460
+ * On the other hand, if you want to allow superfluous property that is not
461
+ * enrolled to the type `T`, you can use {@link is} function instead.
462
+ *
463
+ * @author Jeongho Nam - https://github.com/samchon
464
+ * @template T Type of the input value
465
+ * @param input A value to be tested
466
+ * @returns Whether the parametric value is equivalent to the type `T` or not
467
+ */
468
+ export function equals<T>(input: unknown): input is T;
469
+
470
+ /** @internal */
471
+ export function equals(): never {
472
+ NoTransformConfigurationError("equals");
473
+ }
474
+
475
+ /**
476
+ * Validates equality between a value and its type.
477
+ *
478
+ * Validates a parametric value type and archives all the type errors into an
479
+ * {@link IValidation.errors} array, if the parametric value is not following the
480
+ * type `T` or some superfluous property that is not listed on the type `T` has
481
+ * been found. Of course, if the parametric value is following the type `T` and
482
+ * no superfluous property exists, the {@link IValidation.errors} array would be
483
+ * empty and {@link IValidation.success} would have the `true` value.
484
+ *
485
+ * If what you want is not finding all the error, but asserting the parametric
486
+ * value type with exception throwing, you can choose {@link assert} function
487
+ * instead. Otherwise, you just want to know whether the parametric value is
488
+ * matched with the type `T`, {@link is} function is the way to go.
489
+ *
490
+ * On the other hand, if you don't want to allow any superfluous property that
491
+ * is not enrolled to the type `T`, you can use {@link validateEquals} function
492
+ * instead.
493
+ *
494
+ * @author Jeongho Nam - https://github.com/samchon
495
+ * @template Type Of the input value
496
+ * @param input A value to be validated
497
+ * @returns Validation result
498
+ */
499
+ export function validateEquals<T>(input: T): IValidation<T>;
500
+
501
+ /**
502
+ * Validates equality between a value and its type.
503
+ *
504
+ * Validates a parametric value type and archives all the type errors into an
505
+ * {@link IValidation.errors} array, if the parametric value is not following the
506
+ * type `T` or some superfluous property that is not listed on the type `T` has
507
+ * been found. Of course, if the parametric value is following the type `T` and
508
+ * no superfluous property exists, the {@link IValidation.errors} array would be
509
+ * empty and {@link IValidation.success} would have the `true` value.
510
+ *
511
+ * If what you want is not finding all the error, but asserting the parametric
512
+ * value type with exception throwing, you can choose {@link assert} function
513
+ * instead. Otherwise, you just want to know whether the parametric value is
514
+ * matched with the type `T`, {@link is} function is the way to go.
515
+ *
516
+ * On the other hand, if you don't want to allow any superfluous property that
517
+ * is not enrolled to the type `T`, you can use {@link validateEquals} function
518
+ * instead.
519
+ *
520
+ * @author Jeongho Nam - https://github.com/samchon
521
+ * @template Type Of the input value
522
+ * @param input A value to be validated
523
+ * @returns Validation result
524
+ */
525
+ export function validateEquals<T>(input: unknown): IValidation<T>;
526
+
527
+ /** @internal */
528
+ export function validateEquals(): never {
529
+ NoTransformConfigurationError("validateEquals");
530
+ }
531
+
532
+ /* -----------------------------------------------------------
533
+ RANDOM
534
+ ----------------------------------------------------------- */
535
+ /**
536
+ * > You must configure the generic argument `T`.
537
+ *
538
+ * Generate random data.
539
+ *
540
+ * Generates a random data following type the `T`.
541
+ *
542
+ * For reference, this `typia.random()` function generates only primitive type.
543
+ * If there're some methods in the type `T` or its nested instances, those would
544
+ * be ignored. Also, when the type `T` has a `toJSON()` method, its return type
545
+ * will be generated instead.
546
+ *
547
+ * @author Jeongho Nam - https://github.com/samchon
548
+ * @template T Type of data to generate
549
+ * @param generator Random data generator
550
+ * @returns Randomly generated data
551
+ */
552
+ export function random(generator?: Partial<IRandomGenerator>): never;
553
+
554
+ /**
555
+ * Generate random data.
556
+ *
557
+ * Generates a random data following type the `T`.
558
+ *
559
+ * For reference, this `typia.random()` function generates only primitive type.
560
+ * If there're some methods in the type `T` or its nested instances, those would
561
+ * be ignored. Also, when the type `T` has a `toJSON()` method, its return type
562
+ * will be generated instead.
563
+ *
564
+ * @author Jeongho Nam - https://github.com/samchon
565
+ * @template T Type of data to generate
566
+ * @param generator Random data generator
567
+ * @returns Randomly generated data
568
+ */
569
+ export function random<T>(generator?: Partial<IRandomGenerator>): Resolved<T>;
570
+
571
+ /** @internal */
572
+ export function random(): never {
573
+ NoTransformConfigurationError("random");
574
+ }
575
+
576
+ /* -----------------------------------------------------------
577
+ FACTORY FUNCTIONS
578
+ ----------------------------------------------------------- */
579
+ /**
580
+ * Creates a reusable {@link assert} function.
581
+ *
582
+ * @author Jeongho Nam - https://github.com/samchon
583
+ * @param errorFactory Custom error factory. Default is `TypeGuardError`
584
+ * @returns Nothing until you configure the generic argument `T`
585
+ * @throws Compile error
586
+ * @danger You must configure the generic argument `T`
587
+ */
588
+ export function createAssert(
589
+ errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
590
+ ): never;
591
+
592
+ /**
593
+ * Creates a reusable {@link assert} function.
594
+ *
595
+ * @author Jeongho Nam - https://github.com/samchon
596
+ * @template T Type of the input value
597
+ * @param errorFactory Custom error factory. Default is `TypeGuardError`
598
+ * @returns A reusable `assert` function
599
+ */
600
+ export function createAssert<T>(
601
+ errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
602
+ ): (input: unknown) => T;
603
+
604
+ /** @internal */
605
+ export function createAssert<T>(): (input: unknown) => T {
606
+ NoTransformConfigurationError("createAssert");
607
+ }
608
+
609
+ /**
610
+ * Creates a reusable {@link assertGuard} function.
611
+ *
612
+ * Note that, you've to declare the variable type of the factory function caller
613
+ * like below. If you don't declare the variable type, compilation error be
614
+ * thrown. This is the special rule of the TypeScript compiler.
615
+ *
616
+ * ```typescript
617
+ * // MUST DECLARE THE VARIABLE TYPE
618
+ * const func: typia.AssertionGuard<number> = typia.createAssertGuard<number>();
619
+ *
620
+ * // IF NOT, COMPILATION ERROR BE OCCURRED
621
+ * const func = typia.createAssertGuard<number>();
622
+ * ```
623
+ *
624
+ * > _Assertions require every name in the call target to be declared with an_
625
+ * > _explicit type annotation._
626
+ *
627
+ * @author Jeongho Nam - https://github.com/samchon
628
+ * @param errorFactory Custom error factory. Default is `TypeGuardError`
629
+ * @returns Nothing until you configure the generic argument `T`
630
+ * @throws Compile error
631
+ * @danger You must configure the generic argument `T`
632
+ */
633
+ export function createAssertGuard(
634
+ errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
635
+ ): never;
636
+
637
+ /**
638
+ * Creates a reusable {@link assertGuard} function.
639
+ *
640
+ * Note that, you've to declare the variable type of the factory function caller
641
+ * like below. If you don't declare the variable type, compilation error be
642
+ * thrown. This is the special rule of the TypeScript compiler.
643
+ *
644
+ * ```typescript
645
+ * // MUST DECLARE THE VARIABLE TYPE
646
+ * const func: typia.AssertionGuard<number> = typia.createAssertGuard<number>();
647
+ *
648
+ * // IF NOT, COMPILATION ERROR BE OCCURRED
649
+ * const func = typia.createAssertGuard<number>();
650
+ * ```
651
+ *
652
+ * > _Assertions require every name in the call target to be declared with an_
653
+ * > _explicit type annotation._
654
+ *
655
+ * @author Jeongho Nam - https://github.com/samchon
656
+ * @param errorFactory Custom error factory. Default is `TypeGuardError`
657
+ * @returns Nothing until you configure the generic argument `T`
658
+ * @throws Compile error
659
+ */
660
+ export function createAssertGuard<T>(
661
+ errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
662
+ ): (input: unknown) => AssertionGuard<T>;
663
+
664
+ /** @internal */
665
+ export function createAssertGuard<T>(): (input: unknown) => AssertionGuard<T> {
666
+ NoTransformConfigurationError("createAssertGuard");
667
+ }
668
+
669
+ /**
670
+ * Creates a reusable {@link is} function.
671
+ *
672
+ * @author Jeongho Nam - https://github.com/samchon
673
+ * @returns Nothing until you configure the generic argument `T`
674
+ * @throws Compile error
675
+ * @danger You must configure the generic argument `T`
676
+ */
677
+ export function createIs(): never;
678
+
679
+ /**
680
+ * Creates a reusable {@link is} function.
681
+ *
682
+ * @author Jeongho Nam - https://github.com/samchon
683
+ * @template T Type of the input value
684
+ * @returns A reusable `is` function
685
+ */
686
+ export function createIs<T>(): (input: unknown) => input is T;
687
+
688
+ /** @internal */
689
+ export function createIs<T>(): (input: unknown) => input is T {
690
+ NoTransformConfigurationError("createIs");
691
+ }
692
+
693
+ /**
694
+ * Creates a reusable {@link validate} function.
695
+ *
696
+ * @author Jeongho Nam - https://github.com/samchon
697
+ * @returns Nothing until you configure the generic argument `T`
698
+ * @throws Compile error
699
+ * @danger You must configure the generic argument `T`
700
+ */
701
+ export function createValidate(): never;
702
+
703
+ /**
704
+ * Creates a reusable {@link validate} function.
705
+ *
706
+ * @author Jeongho Nam - https://github.com/samchon
707
+ * @template T Type of the input value
708
+ * @returns A reusable `validate` function
709
+ */
710
+ export function createValidate<T>(): ((input: unknown) => IValidation<T>) &
711
+ StandardSchemaV1<unknown, T>;
712
+
713
+ /** @internal */
714
+ export function createValidate(): ((input: unknown) => IValidation) &
715
+ StandardSchemaV1<unknown, unknown> {
716
+ NoTransformConfigurationError("createValidate");
717
+ }
718
+
719
+ /**
720
+ * Creates a reusable {@link assertEquals} function.
721
+ *
722
+ * @author Jeongho Nam - https://github.com/samchon
723
+ * @param errorFactory Custom error factory. Default is `TypeGuardError`
724
+ * @returns Nothing until you configure the generic argument `T`
725
+ * @throws Compile error
726
+ * @danger You must configure the generic argument `T`
727
+ */
728
+ export function createAssertEquals(
729
+ errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
730
+ ): never;
731
+
732
+ /**
733
+ * Creates a reusable {@link assertEquals} function.
734
+ *
735
+ * @author Jeongho Nam - https://github.com/samchon
736
+ * @template T Type of the input value
737
+ * @param errorFactory Custom error factory. Default is `TypeGuardError`
738
+ * @returns A reusable `assertEquals` function
739
+ */
740
+ export function createAssertEquals<T>(
741
+ errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
742
+ ): (input: unknown) => T;
743
+
744
+ /** @internal */
745
+ export function createAssertEquals<T>(): (input: unknown) => T {
746
+ NoTransformConfigurationError("createAssertEquals");
747
+ }
748
+
749
+ /**
750
+ * Creates a reusable {@link assertGuardEquals} function.
751
+ *
752
+ * Note that, you've to declare the variable type of the factory function caller
753
+ * like below. If you don't declare the variable type, compilation error be
754
+ * thrown. This is the special rule of the TypeScript compiler.
755
+ *
756
+ * ```typescript
757
+ * // MUST DECLARE THE VARIABLE TYPE
758
+ * const func: typia.AssertionGuard<number> = typia.createAssertGuardEquals<number>();
759
+ *
760
+ * // IF NOT, COMPILATION ERROR BE OCCURRED
761
+ * const func = typia.createAssertGuardEquals<number>();
762
+ * ```
763
+ *
764
+ * > _Assertions require every name in the call target to be declared with an_
765
+ * > _explicit type annotation._
766
+ *
767
+ * @author Jeongho Nam - https://github.com/samchon
768
+ * @param errorFactory Custom error factory. Default is `TypeGuardError`
769
+ * @returns Nothing until you configure the generic argument `T`
770
+ * @throws Compile error
771
+ * @danger You must configure the generic argument `T`
772
+ */
773
+ export function createAssertGuardEquals(
774
+ errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
775
+ ): never;
776
+
777
+ /**
778
+ * Creates a reusable {@link assertGuardEquals} function.
779
+ *
780
+ * Note that, you've to declare the variable type of the factory function caller
781
+ * like below. If you don't declare the variable type, compilation error be
782
+ * thrown. This is the special rule of the TypeScript compiler.
783
+ *
784
+ * ```typescript
785
+ * // MUST DECLARE THE VARIABLE TYPE
786
+ * const func: typia.AssertionGuard<number> = typia.createAssertGuardEquals<number>();
787
+ *
788
+ * // IF NOT, COMPILATION ERROR BE OCCURRED
789
+ * const func = typia.createAssertGuardEquals<number>();
790
+ * ```
791
+ *
792
+ * > _Assertions require every name in the call target to be declared with an_
793
+ * > _explicit type annotation._
794
+ *
795
+ * @author Jeongho Nam - https://github.com/samchon
796
+ * @param errorFactory Custom error factory. Default is `TypeGuardError`
797
+ * @returns Nothing until you configure the generic argument `T`
798
+ * @throws Compile error
799
+ */
800
+ export function createAssertGuardEquals<T>(
801
+ errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
802
+ ): (input: unknown) => AssertionGuard<T>;
803
+
804
+ /** @internal */
805
+ export function createAssertGuardEquals<T>(): (
806
+ input: unknown,
807
+ ) => AssertionGuard<T> {
808
+ NoTransformConfigurationError("createAssertGuardEquals");
809
+ }
810
+
811
+ /**
812
+ * Creates a reusable {@link equals} function.
813
+ *
814
+ * @author Jeongho Nam - https://github.com/samchon
815
+ * @returns Nothing until you configure the generic argument `T`
816
+ * @throws Compile error
817
+ * @danger You must configure the generic argument `T`
818
+ */
819
+ export function createEquals(): never;
820
+
821
+ /**
822
+ * Creates a reusable {@link equals} function.
823
+ *
824
+ * @author Jeongho Nam - https://github.com/samchon
825
+ * @template T Type of the input value
826
+ * @returns A reusable `equals` function
827
+ */
828
+ export function createEquals<T>(): (input: unknown) => input is T;
829
+
830
+ /** @internal */
831
+ export function createEquals<T>(): (input: unknown) => input is T {
832
+ NoTransformConfigurationError("createEquals");
833
+ }
834
+
835
+ /**
836
+ * Creates a reusable {@link validateEquals} function.
837
+ *
838
+ * @author Jeongho Nam - https://github.com/samchon
839
+ * @returns Nothing until you configure the generic argument `T`
840
+ * @throws Compile error
841
+ * @danger You must configure the generic argument `T`
842
+ */
843
+ export function createValidateEquals(): never;
844
+
845
+ /**
846
+ * Creates a reusable {@link validateEquals} function.
847
+ *
848
+ * @author Jeongho Nam - https://github.com/samchon
849
+ * @template T Type of the input value
850
+ * @returns A reusable `validateEquals` function
851
+ */
852
+ export function createValidateEquals<T>(): ((
853
+ input: unknown,
854
+ ) => IValidation<T>) &
855
+ StandardSchemaV1<unknown, T>;
856
+
857
+ /** @internal */
858
+ export function createValidateEquals(): ((input: unknown) => IValidation) &
859
+ StandardSchemaV1<unknown, unknown> {
860
+ NoTransformConfigurationError("createValidateEquals");
861
+ }
862
+
863
+ /**
864
+ * Creates a reusable {@link random} function.
865
+ *
866
+ * @author Jeongho Nam - https://github.com/samchon
867
+ * @param generator Random data generator
868
+ * @returns Nothing until you configure the generic argument `T`
869
+ * @throws Compile error
870
+ * @danger You must configure the generic argument `T`
871
+ */
872
+ export function createRandom(generator?: Partial<IRandomGenerator>): never;
873
+
874
+ /**
875
+ * Creates a reusable {@link random} function.
876
+ *
877
+ * @author Jeongho Nam - https://github.com/samchon
878
+ * @template T Type of the input value
879
+ * @param generator Random data generator
880
+ * @returns A reusable `random` function
881
+ */
882
+ export function createRandom<T>(
883
+ generator?: Partial<IRandomGenerator>,
884
+ ): () => Resolved<T>;
885
+
886
+ /** @internal */
887
+ export function createRandom(): never {
888
+ NoTransformConfigurationError("createRandom");
889
+ }