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/http.ts CHANGED
@@ -1,1040 +1,972 @@
1
- import { NoTransformConfigurationError } from "./transformers/NoTransformConfigurationError";
2
-
3
- import { Atomic } from "./typings/Atomic";
4
-
5
- import { IReadableURLSearchParams } from "./IReadableURLSearchParams";
6
- import { IValidation } from "./IValidation";
7
- import { Resolved } from "./Resolved";
8
- import { TypeGuardError } from "./TypeGuardError";
9
-
10
- /* ===========================================================
11
- HTTP
12
- - FORM-DATA
13
- - QUERY
14
- - HEADERS
15
- - PARAMETER
16
- - FACTORY FUNCTIONS
17
- ==============================================================
18
- FORM-DATA
19
- ----------------------------------------------------------- */
20
- /**
21
- * Form data decoder.
22
- *
23
- * `typia.http.formData()` is a function decoding `FormData` instance, with
24
- * automatic type casting to the expected type. When property type is defined
25
- * as `boolean` or `Blob` type, `typia.http.formData()` will cast the value to
26
- * the expected type when decoding.
27
- *
28
- * By the way, as `FormData` is not enough to express complex data structures,
29
- * `typia.http.formData()` function has some limitations. If target type `T` is
30
- * not following those restrictions, compilation errors would be occurred.
31
- *
32
- * 1. Type `T` must be an object type
33
- * 2. Do not allow dynamic property
34
- * 3. Only `boolean`, `bigint`, `number`, `string`, `Blob`, `File` or their array types are allowed
35
- * 4. Union types are never allowed
36
- *
37
- * Also, `typia.http.formData()` function does not perform validation about the
38
- * decoded value. Therefore, if you can't sure that input data is following the
39
- * `T` type, it would better to call one of below functions instead.
40
- *
41
- * @template T Expected type of decoded value
42
- * @param input FormData instance
43
- * @returns Decoded form FormData
44
- *
45
- * @author Jeongho Nam - https://github.com/samchon
46
- */
47
- export function formData<T extends object>(input: FormData): Resolved<T>;
48
-
49
- /**
50
- * @internal
51
- */
52
- export function formData(): never {
53
- NoTransformConfigurationError("http.formData");
54
- }
55
-
56
- /**
57
- * Form data decoder with type assertion.
58
- *
59
- * `typia.http.assertFormData()` is a function decoding `FormData` instance, with
60
- * automatic type casting to the expected type. When property type is defined
61
- * as `boolean` or `Blob` type, `typia.http.assertFormData()` will cast the value
62
- * to the expected type when decoding.
63
- *
64
- * Also, after decoding, `typia.http.assertFormData()` performs type assertion to
65
- * the decoded value by combining with {@link assert} function. Therefore, when
66
- * the decoded value is not following the `T` type, {@link TypeGuardError} or
67
- * custom error generated by *errorFactory* would be thrown.
68
- *
69
- * By the way, as `FormData` is not enough to express complex data structures,
70
- * `typia.http.assertFormData()` function has some limitations. If target type `T`
71
- * is not following those restrictions, compilation errors would be occurred.
72
- *
73
- * 1. Type `T` must be an object type
74
- * 2. Do not allow dynamic property
75
- * 3. Only `boolean`, `bigint`, `number`, `string`, `Blob`, `File` or their array types are allowed
76
- * 4. Union types are never allowed
77
- *
78
- * @template T Expected type of decoded value
79
- * @param input FormData instance
80
- * @param errorFactory Custom error factory. Default is `TypeGuardError`
81
- * @returns Decoded form FormData
82
- *
83
- * @author Jeongho Nam - https://github.com/samchon
84
- */
85
- export function assertFormData<T extends object>(
86
- input: FormData,
87
- errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
88
- ): Resolved<T>;
89
-
90
- /**
91
- * @internal
92
- */
93
- export function assertFormData(): never {
94
- NoTransformConfigurationError("http.assertFormData");
95
- }
96
-
97
- /**
98
- * Form data decoder with type checking.
99
- *
100
- * `typia.http.isFormData()` is a function decoding `FormData` instance, with
101
- * automatic type casting to the expected type. When property type is defined
102
- * as `boolean` or `Blob` type, `typia.http.isFormData()` will cast the value
103
- * to the expected type when decoding.
104
- *
105
- * Also, after decoding, `typia.http.isFormData()` performs type checking to the
106
- * decoded value by combining with {@link is} function. Therefore, when the
107
- * decoded value is not following the `T` type, `null` value would be returned.
108
- *
109
- * By the way, as `FormData` is not enough to express complex data structures,
110
- * `typia.http.isFormData()` function has some limitations. If target type `T` is
111
- * not following those restrictions, compilation errors would be occurred.
112
- *
113
- * 1. Type `T` must be an object type
114
- * 2. Do not allow dynamic property
115
- * 3. Only `boolean`, `bigint`, `number`, `string`, `Blob`, `File` or their array types are allowed
116
- * 4. Union types are never allowed
117
- *
118
- * @template T Expected type of decoded value
119
- * @param input FormData instance
120
- * @returns Decoded form FormData or `null` value
121
- *
122
- * @author Jeongho Nam - https://github.com/samchon
123
- */
124
- export function isFormData<T extends object>(
125
- input: FormData,
126
- ): Resolved<T> | null;
127
-
128
- /**
129
- * @internal
130
- */
131
- export function isFormData(): never {
132
- NoTransformConfigurationError("http.isFormData");
133
- }
134
-
135
- /**
136
- * Form data decoder with type validation.
137
- *
138
- * `typia.http.validateFormData()` is a function decoding `FormData` instance,
139
- * with automatic type casting to the expected type. When property type is defined
140
- * as `boolean` or `Blob` type, `typia.http.validateFormData()` will cast the
141
- * value to the expected type when decoding.
142
- *
143
- * Also, after decoding, `typia.http.validateFormData()` performs type validation
144
- * to the decoded value by combining with {@link validate} function. Therefore,
145
- * when the decoded value is not following the `T` type,
146
- * {@link IValidation.IFailure} would be returned. Otherwise,
147
- * x@xxxx IValidation.ISuccess} would be returned.
148
- *
149
- * By the way, as `FormData` is not enough to express complex data structures,
150
- * `typia.http.validateFormData()` function has some limitations. If target type
151
- * `T` is not following those restrictions, compilation errors would be occurred.
152
- *
153
- * 1. Type `T` must be an object type
154
- * 2. Do not allow dynamic property
155
- * 3. Only `boolean`, `bigint`, `number`, `string`, `Blob`, `File` or their array types are allowed
156
- * 4. Union types are never allowed
157
- *
158
- * @template T Expected type of decoded value
159
- * @param input FormData instance
160
- * @returns Validation result with decoded form FormData
161
- *
162
- * @author Jeongho Nam - https://github.com/samchon
163
- */
164
- export function validateFormData<T extends object>(
165
- input: FormData,
166
- ): IValidation<Resolved<T>>;
167
-
168
- /**
169
- * @internal
170
- */
171
- export function validateFormData(): never {
172
- NoTransformConfigurationError("http.validateFormData");
173
- }
174
-
175
- /* -----------------------------------------------------------
176
- QUERY
177
- ----------------------------------------------------------- */
178
- /**
179
- * URL query decoder.
180
- *
181
- * `typia.http.query()` is a function decoding a query string or an `URLSearchParams`
182
- * instance, with automatic type casting to the expected type. When property type be
183
- * defined as `boolean` or `number` type, `typia.http.query()` will cast the value to
184
- * the expected type when decoding.
185
- *
186
- * By the way, as URL query is not enough to express complex data structures,
187
- * `typia.http.query()` function has some limitations. If target type `T` is not
188
- * following those restrictions, compilation errors would be occurred.
189
- *
190
- * 1. Type `T` must be an object type
191
- * 2. Do not allow dynamic property
192
- * 3. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
193
- * 4. Union types are never allowed
194
- *
195
- * Also, `typia.http.query()` function does not perform validation about the decoded
196
- * value. Therefore, if you can't sure that input data is following the `T` type,
197
- * it would better to call one of below functions instead.
198
- *
199
- * - {@link assertQuery}
200
- * - {@link isQuery}
201
- * - {@link validateQuery}
202
- *
203
- * @template T Expected type of decoded value
204
- * @param input Query string or URLSearchParams instance
205
- * @returns Decoded query object
206
- *
207
- * @author Jeongho Nam - https://github.com/samchon
208
- */
209
- export function query<T extends object>(
210
- input: string | IReadableURLSearchParams,
211
- ): Resolved<T>;
212
-
213
- /**
214
- * @internal
215
- */
216
- export function query(): never {
217
- NoTransformConfigurationError("http.query");
218
- }
219
-
220
- /**
221
- * URL query decoder with type assertion.
222
- *
223
- * `typia.http.assertQuery()` is a function decoding a query string or an
224
- * `URLSearchParams` instance, with automatic type casting to the expected type.
225
- * When property type is defined as `boolean` or `number` type,
226
- * `typia.http.assertQuery()` will cast the value to the expected type when decoding.
227
- *
228
- * Also, after decoding, `typia.http.assertQuery()` performs type assertion to the
229
- * decoded value by combining with {@link assert} function. Therefore, when the
230
- * decoded value is not following the `T` type, {@link TypeGuardError} or custom
231
- * error generated by *errorFactory* would be thrown.
232
- *
233
- * By the way, as URL query is not enough to express complex data structures,
234
- * `typia.http.assertQuery()` function has some limitations. If target type `T` is
235
- * notfollowing those restrictions, compilation errors would be occurred.
236
- *
237
- * 1. Type `T` must be an object type
238
- * 2. Do not allow dynamic property
239
- * 3. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
240
- * 4. Union types are never allowed
241
- *
242
- * @template T Expected type of decoded value
243
- * @param input Query string or URLSearchParams instance
244
- * @param errorFactory Custom error factory. Default is `TypeGuardError`
245
- * @returns Decoded query object
246
- *
247
- * @author Jeongho Nam - https://github.com/samchon
248
- */
249
- export function assertQuery<T extends object>(
250
- input: string | IReadableURLSearchParams,
251
- errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
252
- ): Resolved<T>;
253
-
254
- /**
255
- * @internal
256
- */
257
- export function assertQuery(): never {
258
- NoTransformConfigurationError("http.assertQuery");
259
- }
260
-
261
- /**
262
- * URL query decoder with type checking.
263
- *
264
- * `typia.http.isQuery()` is a function decoding a query string or an
265
- * `URLSearchParams` instance, with automatic type casting to the expected type.
266
- * When property type is defined as `boolean` or `number` type,
267
- * `typia.http.isQuery()` will cast the value to the expected type when decoding.
268
- *
269
- * Also, after decoding, `typia.http.isQuery()` performs type checking to the
270
- * decoded value by combining with {@link is} function. Therefore, when the
271
- * decoded value is not following the `T` type, `null` value would be returned.
272
- *
273
- * By the way, as URL query is not enough to express complex data structures,
274
- * `typia.http.isQuery()` function has some limitations. If target type `T` is
275
- * notfollowing those restrictions, compilation errors would be occurred.
276
- *
277
- * 1. Type `T` must be an object type
278
- * 2. Do not allow dynamic property
279
- * 3. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
280
- * 4. Union types are never allowed
281
- *
282
- * @template T Expected type of decoded value
283
- * @param input Query string or URLSearchParams instance
284
- * @returns Decoded query object or `null` value
285
- *
286
- * @author Jeongho Nam - https://github.com/samchon
287
- */
288
- export function isQuery<T extends object>(
289
- input: string | IReadableURLSearchParams,
290
- ): Resolved<T> | null;
291
-
292
- /**
293
- * @internal
294
- */
295
- export function isQuery(): never {
296
- NoTransformConfigurationError("http.isQuery");
297
- }
298
-
299
- /**
300
- * URL query decoder with type validation.
301
- *
302
- * `typia.http.validateQuery()` is a function decoding a query string or an
303
- * `URLSearchParams` instance, with automatic type casting to the expected type.
304
- * When property type is defined as `boolean` or `number` type,
305
- * `typia.http.validateQuery()` will cast the value to the expected type when decoding.
306
- *
307
- * Also, after decoding, `typia.http.validateQuery()` performs type validation to the
308
- * decoded value by combining with {@link validate} function. Therefore, when the
309
- * decoded value is not following the `T` type, {@link IValidation.IFailure} would
310
- * be returned. Otherwise, {@link IValidation.ISuccess} would be returned.
311
- *
312
- * By the way, as URL query is not enough to express complex data structures,
313
- * `typia.http.validateQuery()` function has some limitations. If target type `T` is
314
- * notfollowing those restrictions, compilation errors would be occurred.
315
- *
316
- * 1. Type `T` must be an object type
317
- * 2. Do not allow dynamic property
318
- * 3. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
319
- * 4. Union types are never allowed
320
- *
321
- * @template T Expected type of decoded value
322
- * @param input Query string or URLSearchParams instance
323
- * @returns Validation result with decoded query object
324
- *
325
- * @author Jeongho Nam - https://github.com/samchon
326
- */
327
- export function validateQuery<T extends object>(
328
- input: string | IReadableURLSearchParams,
329
- ): IValidation<Resolved<T>>;
330
-
331
- /**
332
- * @internal
333
- */
334
- export function validateQuery(): never {
335
- NoTransformConfigurationError("http.validateQuery");
336
- }
337
-
338
- /* -----------------------------------------------------------
339
- HEADERS
340
- ----------------------------------------------------------- */
341
- /**
342
- * Headers decoder (for express and fastify).
343
- *
344
- * `typia.http.headers()` is a function decoding an header instance, with automatic
345
- * type casting to the expected type. When property type is defined as `boolean` or
346
- * `number` type, `typia.http.headers()` will cast the value to the expected type.
347
- *
348
- * By the way, as HTTP headers are not enough to express complex data structures,
349
- * `typia.http.headers()` function has some limitations. If target type `T` is not
350
- * following those restrictions, compilation errors would be occurred.
351
- *
352
- * 1. Type `T` must be an object type
353
- * 2. Do not allow dynamic property
354
- * 3. Property key must be lower case
355
- * 4. Property value cannot be `null`, but `undefined` is possible
356
- * 5. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
357
- * 6. Union types are never allowed
358
- * 7. Property `set-cookie` must be array type
359
- * 8. Those properties cannot be array type
360
- * - age
361
- * - authorization
362
- * - content-length
363
- * - content-type
364
- * - etag
365
- * - expires
366
- * - from
367
- * - host
368
- * - if-modified-since
369
- * - if-unmodified-since
370
- * - last-modified
371
- * - location
372
- * - max-forwards
373
- * - proxy-authorization
374
- * - referer
375
- * - retry-after
376
- * - server
377
- * - user-agent
378
- *
379
- * Also, `typia.http.headers()` function does not perform validation about the decoded
380
- * value. Therefore, if you can't sure that input data is following the `T` type,
381
- * it would better to call one of below functions instead.
382
- *
383
- * - {@link assertHeaders}
384
- * - {@link isHeaders}
385
- * - {@link validateHeaders}
386
- *
387
- * @template T Expected type of decoded value
388
- * @param input Query string or URLSearchParams instance
389
- * @returns Decoded headers object
390
- *
391
- * @author Jeongho Nam - https://github.com/samchon
392
- */
393
- export function headers<T extends object>(
394
- input: Record<string, string | string[] | undefined>,
395
- ): Resolved<T>;
396
-
397
- /**
398
- * @internal
399
- */
400
- export function headers(): never {
401
- NoTransformConfigurationError("http.headers");
402
- }
403
-
404
- /**
405
- * Headers decoder with type assertion (for express and fastify).
406
- *
407
- * `typia.http.assertHeaders()` is a function decoding an header instance, with
408
- * automatic type casting to the expected type. When property type is defined as
409
- * `boolean` or `number` type, `typia.http.headers()` will cast the value to the
410
- * expected type.
411
- *
412
- * Also, after decoding, `typia.http.assertHeaders()` performs type assertion to the
413
- * decoded value by combining with {@link assert} function. Therefore, when the
414
- * decoded value is not following the `T` type, {@link TypeGuardError} or custom
415
- * error generated by *errorFactory* would be thrown.
416
- *
417
- * By the way, as HTTP headers are not enough to express complex data structures,
418
- * `typia.http.headers()` function has some limitations. If target type `T` is not
419
- * following those restrictions, compilation errors would be occurred.
420
- *
421
- * 1. Type `T` must be an object type
422
- * 2. Do not allow dynamic property
423
- * 3. Property key must be lower case
424
- * 4. Property value cannot be `null`, but `undefined` is possible
425
- * 5. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
426
- * 6. Union types are never allowed
427
- * 7. Property `set-cookie` must be array type
428
- * 8. Those properties cannot be array type
429
- * - age
430
- * - authorization
431
- * - content-length
432
- * - content-type
433
- * - etag
434
- * - expires
435
- * - from
436
- * - host
437
- * - if-modified-since
438
- * - if-unmodified-since
439
- * - last-modified
440
- * - location
441
- * - max-forwards
442
- * - proxy-authorization
443
- * - referer
444
- * - retry-after
445
- * - server
446
- * - user-agent
447
- *
448
- * @template T Expected type of decoded value
449
- * @param input Query string or URLSearchParams instance
450
- * @param errorFactory Custom error factory. Default is `TypeGuardError`
451
- * @returns Decoded headers object
452
- *
453
- * @author Jeongho Nam - https://github.com/samchon
454
- */
455
- export function assertHeaders<T extends object>(
456
- input: Record<string, string | string[] | undefined>,
457
- errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
458
- ): Resolved<T>;
459
-
460
- /**
461
- * @internal
462
- */
463
- export function assertHeaders(): never {
464
- NoTransformConfigurationError("http.assertHeaders");
465
- }
466
-
467
- /**
468
- * > You must configure the generic argument `T`.
469
- *
470
- * Headers decoder with type checking (for express and fastify).
471
- *
472
- * `typia.http.isHeaders()` is a function decoding an header instance, with
473
- * automatic type casting to the expected type. When property type is defined as
474
- * `boolean` or `number` type, `typia.http.headers()` will cast the value to the
475
- * expected type.
476
- *
477
- * Also, after decoding, `typia.http.isHeaders()` performs type checking to the
478
- * decoded value by combining with {@link is} function. Therefore, when the
479
- * decoded value is not following the `T` type, `null` value would be returned.
480
- *
481
- * By the way, as HTTP headers are not enough to express complex data structures,
482
- * `typia.http.headers()` function has some limitations. If target type `T` is not
483
- * following those restrictions, compilation errors would be occurred.
484
- *
485
- * 1. Type `T` must be an object type
486
- * 2. Do not allow dynamic property
487
- * 3. Property key must be lower case
488
- * 4. Property value cannot be `null`, but `undefined` is possible
489
- * 5. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
490
- * 6. Union types are never allowed
491
- * 7. Property `set-cookie` must be array type
492
- * 8. Those properties cannot be array type
493
- * - age
494
- * - authorization
495
- * - content-length
496
- * - content-type
497
- * - etag
498
- * - expires
499
- * - from
500
- * - host
501
- * - if-modified-since
502
- * - if-unmodified-since
503
- * - last-modified
504
- * - location
505
- * - max-forwards
506
- * - proxy-authorization
507
- * - referer
508
- * - retry-after
509
- * - server
510
- * - user-agent
511
- *
512
- * @template T Expected type of decoded value
513
- * @param input Query string or URLSearchParams instance
514
- * @returns Decoded headers object or `null` value
515
- *
516
- * @author Jeongho Nam - https://github.com/samchon
517
- */
518
- export function isHeaders<T extends object>(
519
- input: Record<string, string | string[] | undefined>,
520
- ): Resolved<T> | null;
521
-
522
- /**
523
- * @internal
524
- */
525
- export function isHeaders(): never {
526
- NoTransformConfigurationError("http.isHeaders");
527
- }
528
-
529
- /**
530
- * Headers decoder with type validation (for express and fastify).
531
- *
532
- * `typia.http.validateHeaders()` is a function decoding an header instance, with
533
- * automatic type casting to the expected type. When property type is defined as
534
- * `boolean` or `number` type, `typia.http.headers()` will cast the value to the
535
- * expected type.
536
- *
537
- * Also, after decoding, `typia.http.validateHeaders()` performs type assertion to the
538
- * decoded value by combining with {@link validate} function. Therefore, when the
539
- * decoded value is not following the `T` type, {@link IValidation.IError} would be
540
- * returned. Otherwise, {@link IValidation.ISuccess} be returned.
541
- *
542
- * By the way, as HTTP headers are not enough to express complex data structures,
543
- * `typia.http.headers()` function has some limitations. If target type `T` is not
544
- * following those restrictions, compilation errors would be occurred.
545
- *
546
- * 1. Type `T` must be an object type
547
- * 2. Do not allow dynamic property
548
- * 3. Property key must be lower case
549
- * 4. Property value cannot be `null`, but `undefined` is possible
550
- * 5. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
551
- * 6. Union types are never allowed
552
- * 7. Property `set-cookie` must be array type
553
- * 8. Those properties cannot be array type
554
- * - age
555
- * - authorization
556
- * - content-length
557
- * - content-type
558
- * - etag
559
- * - expires
560
- * - from
561
- * - host
562
- * - if-modified-since
563
- * - if-unmodified-since
564
- * - last-modified
565
- * - location
566
- * - max-forwards
567
- * - proxy-authorization
568
- * - referer
569
- * - retry-after
570
- * - server
571
- * - user-agent
572
- *
573
- * @template T Expected type of decoded value
574
- * @param input Query string or URLSearchParams instance
575
- * @returns Decoded headers object
576
- *
577
- * @author Jeongho Nam - https://github.com/samchon
578
- */
579
- export function validateHeaders<T extends object>(
580
- input: Record<string, string | string[] | undefined>,
581
- ): IValidation<Resolved<T>>;
582
-
583
- /**
584
- * @internal
585
- */
586
- export function validateHeaders(): never {
587
- NoTransformConfigurationError("http.validateHeaders");
588
- }
589
-
590
- /* -----------------------------------------------------------
591
- PARAMETER
592
- ----------------------------------------------------------- */
593
- /**
594
- * URL path parameter decoder.
595
- *
596
- * `typia.http.parameter()` is a function decoding a path parameter, with automatic
597
- * type casting to the expected type. When type `T` has been defined as `boolean` or
598
- * `number` type, `typia.http.parameter()` will cast the value to the expected type.
599
- *
600
- * Also, `typia.http.parameter()` performs type assertion to the decoded value by
601
- * combining with {@link assert} function. Therefore, when the decoded value is not
602
- * following the `T` type, {@link TypeGuardError} would be thrown.
603
- *
604
- * @template T Expected type of decoded value
605
- * @param input Path parameter string
606
- * @returns Decoded path parameter value
607
- */
608
- export function parameter<T extends Atomic.Type | null>(
609
- input: string,
610
- ): Resolved<T>;
611
-
612
- /**
613
- * @internal
614
- */
615
- export function parameter(): never {
616
- NoTransformConfigurationError("http.parameter");
617
- }
618
-
619
- /* -----------------------------------------------------------
620
- FACTORY FUNCTIONS
621
- ----------------------------------------------------------- */
622
- /**
623
- * Creates a reusable {@link formdata} function.
624
- *
625
- * @danger You must configure the generic argument `T`
626
- * @template T The type of the formdata object
627
- * @throws compile error
628
- *
629
- * @author Jeongho Nam - https://github.com/samchon
630
- */
631
- export function createFormData(): never;
632
-
633
- /**
634
- * Creates a reusable {@link formdata} function.
635
- *
636
- * @template T The type of the formdata object
637
- * @returns A reusable `formdata` function
638
- *
639
- * @author Jeongho Nam - https://github.com/samchon
640
- */
641
- export function createFormData<T extends object>(): (input: FormData) => T;
642
-
643
- /**
644
- * @internal
645
- */
646
- export function createFormData<T>(): (input: FormData) => T {
647
- NoTransformConfigurationError("http.createFormData");
648
- }
649
-
650
- /**
651
- * Creates a reusable {@link assertFormData} function.
652
- *
653
- * @danger You must configure the generic argument `T`
654
- * @template T The type of the formdata object
655
- * @param errorFactory Custom error factory. Default is `TypeGuardError`
656
- * @throws compile error
657
- *
658
- * @author Jeongho Nam - https://github.com/samchon
659
- */
660
- export function createAssertFormData(
661
- errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
662
- ): never;
663
-
664
- /**
665
- * Creates a reusable {@link assertFormData} function.
666
- *
667
- * @template T The type of the formdata object
668
- * @param errorFactory Custom error factory. Default is `TypeGuardError`
669
- * @returns A reusable `assertFormData` function
670
- *
671
- * @author Jeongho Nam - https://github.com/samchon
672
- */
673
- export function createAssertFormData<T extends object>(
674
- errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
675
- ): (input: FormData) => T;
676
-
677
- /**
678
- * @internal
679
- */
680
- export function createAssertFormData<T>(): (input: FormData) => T {
681
- NoTransformConfigurationError("http.createAssertFormData");
682
- }
683
-
684
- /**
685
- * Creates a reusable {@link isFormData} function.
686
- *
687
- * @danger You must configure the generic argument `T`
688
- * @template T The type of the formdata object
689
- * @throws compile error
690
- *
691
- * @author Jeongho Nam - https://github.com/samchon
692
- */
693
- export function createIsFormData(): never;
694
-
695
- /**
696
- * Creates a reusable {@link isFormData} function.
697
- *
698
- * @template T The type of the formdata object
699
- * @returns A reusable `isFormData` function
700
- *
701
- * @author Jeongho Nam - https://github.com/samchon
702
- */
703
- export function createIsFormData<T extends object>(): (
704
- input: FormData,
705
- ) => T | null;
706
-
707
- /**
708
- * @internal
709
- */
710
- export function createIsFormData<T>(): (input: FormData) => T | null {
711
- NoTransformConfigurationError("http.createIsFormData");
712
- }
713
-
714
- /**
715
- * Creates a reusable {@link validateFormData} function.
716
- *
717
- * @danger You must configure the generic argument `T`
718
- * @template T The type of the formdata object
719
- * @throws compile error
720
- *
721
- * @author Jeongho Nam - https://github.com/samchon
722
- */
723
- export function createValidateFormData(): never;
724
-
725
- /**
726
- * Creates a reusable {@link validateFormData} function.
727
- *
728
- * @template T The type of the formdata object
729
- * @returns A reusable `validateFormData` function
730
- *
731
- * @author Jeongho Nam - https://github.com/samchon
732
- */
733
- export function createValidateFormData<T extends object>(): (
734
- input: FormData,
735
- ) => IValidation<Resolved<T>>;
736
-
737
- /**
738
- * @internal
739
- */
740
- export function createValidateFormData<T>(): (
741
- input: FormData,
742
- ) => IValidation<Resolved<T>> {
743
- NoTransformConfigurationError("http.createValidateFormData");
744
- }
745
-
746
- /**
747
- * Creates a reusable {@link query} function.
748
- *
749
- * @danger You must configure the generic argument `T`
750
- * @template T The type of the query object
751
- * @throws compile error
752
- *
753
- * @author Jeongho Nam - https://github.com/samchon
754
- */
755
- export function createQuery(): never;
756
-
757
- /**
758
- * Creates a reusable {@link query} function.
759
- *
760
- * @template T The type of the query object
761
- * @returns A reusable `query` function
762
- *
763
- * @author Jeongho Nam - https://github.com/samchon
764
- */
765
- export function createQuery<T extends object>(): (
766
- input: string | IReadableURLSearchParams,
767
- ) => T;
768
-
769
- /**
770
- * @internal
771
- */
772
- export function createQuery<T>(): (
773
- input: string | IReadableURLSearchParams,
774
- ) => T {
775
- NoTransformConfigurationError("http.createQuery");
776
- }
777
-
778
- /**
779
- * Creates a reusable {@link assertQuery} function.
780
- *
781
- * @danger You must configure the generic argument `T`
782
- * @template T The type of the query object
783
- * @param errorFactory Custom error factory. Default is `TypeGuardError`
784
- * @throws compile error
785
- *
786
- * @author Jeongho Nam - https://github.com/samchon
787
- */
788
- export function createAssertQuery(
789
- errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
790
- ): never;
791
-
792
- /**
793
- * Creates a reusable {@link assertQuery} function.
794
- *
795
- * @template T The type of the query object
796
- * @param errorFactory Custom error factory. Default is `TypeGuardError`
797
- * @returns A reusable `assertQuery` function
798
- *
799
- * @author Jeongho Nam - https://github.com/samchon
800
- */
801
- export function createAssertQuery<T extends object>(
802
- errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
803
- ): (input: string | IReadableURLSearchParams) => T;
804
-
805
- /**
806
- * @internal
807
- */
808
- export function createAssertQuery<T>(): (
809
- input: string | IReadableURLSearchParams,
810
- ) => T {
811
- NoTransformConfigurationError("http.createAssertQuery");
812
- }
813
-
814
- /**
815
- * Creates a reusable {@link isQuery} function.
816
- *
817
- * @danger You must configure the generic argument `T`
818
- * @template T The type of the query object
819
- * @throws compile error
820
- *
821
- * @author Jeongho Nam - https://github.com/samchon
822
- */
823
- export function createIsQuery(): never;
824
-
825
- /**
826
- * Creates a reusable {@link isQuery} function.
827
- *
828
- * @template T The type of the query object
829
- * @returns A reusable `isQuery` function
830
- *
831
- * @author Jeongho Nam - https://github.com/samchon
832
- */
833
- export function createIsQuery<T extends object>(): (
834
- input: string | IReadableURLSearchParams,
835
- ) => T | null;
836
-
837
- /**
838
- * @internal
839
- */
840
- export function createIsQuery<T>(): (
841
- input: string | IReadableURLSearchParams,
842
- ) => T | null {
843
- NoTransformConfigurationError("http.createIsQuery");
844
- }
845
-
846
- /**
847
- * Creates a reusable {@link validateQuery} function.
848
- *
849
- * @danger You must configure the generic argument `T`
850
- * @template T The type of the query object
851
- * @throws compile error
852
- *
853
- * @author Jeongho Nam - https://github.com/samchon
854
- */
855
- export function createValidateQuery(): never;
856
-
857
- /**
858
- * Creates a reusable {@link validateQuery} function.
859
- *
860
- * @template T The type of the query object
861
- * @returns A reusable `validateQuery` function
862
- *
863
- * @author Jeongho Nam - https://github.com/samchon
864
- */
865
- export function createValidateQuery<T extends object>(): (
866
- input: string | IReadableURLSearchParams,
867
- ) => IValidation<Resolved<T>>;
868
-
869
- /**
870
- * @internal
871
- */
872
- export function createValidateQuery<T>(): (
873
- input: string | IReadableURLSearchParams,
874
- ) => IValidation<Resolved<T>> {
875
- NoTransformConfigurationError("http.createValidateQuery");
876
- }
877
-
878
- /**
879
- * Creates a reusable {@link headers} function.
880
- *
881
- * @danger You must configure the generic argument `T`
882
- * @template T The type of the headers object
883
- * @throws compile error
884
- *
885
- * @author Jeongho Nam - https://github.com/samchon
886
- */
887
- export function createHeaders(): never;
888
-
889
- /**
890
- * Creates a reusable {@link headers} function.
891
- *
892
- * @template T The type of the headers object
893
- * @returns A reusable `headers` function
894
- *
895
- * @author Jeongho Nam - https://github.com/samchon
896
- */
897
- export function createHeaders<T extends object>(): (
898
- input: Record<string, string | string[] | undefined>,
899
- ) => T;
900
-
901
- /**
902
- * @internal
903
- */
904
- export function createHeaders<T>(): (
905
- input: Record<string, string | string[] | undefined>,
906
- ) => T {
907
- NoTransformConfigurationError("http.createHeaders");
908
- }
909
-
910
- /**
911
- * Creates a reusable {@link assertHeaders} function.
912
- *
913
- * @danger You must configure the generic argument `T`
914
- * @template T The type of the headers object
915
- * @param errorFactory Custom error factory. Default is `TypeGuardError`
916
- * @throws compile error
917
- *
918
- * @author Jeongho Nam - https://github.com/samchon
919
- */
920
- export function createAssertHeaders(
921
- errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
922
- ): never;
923
-
924
- /**
925
- * Creates a reusable {@link assertHeaders} function.
926
- *
927
- * @template T The type of the headers object
928
- * @param errorFactory Custom error factory. Default is `TypeGuardError`
929
- * @returns A reusable `assertHeaders` function
930
- *
931
- * @author Jeongho Nam - https://github.com/samchon
932
- */
933
- export function createAssertHeaders<T extends object>(
934
- errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
935
- ): (input: Record<string, string | string[] | undefined>) => T;
936
-
937
- /**
938
- * @internal
939
- */
940
- export function createAssertHeaders<T>(): (
941
- input: Record<string, string | string[] | undefined>,
942
- ) => T {
943
- NoTransformConfigurationError("http.createAssertHeaders");
944
- }
945
-
946
- /**
947
- * Creates a reusable {@link isHeaders} function.
948
- *
949
- * @danger You must configure the generic argument `T`
950
- * @template T The type of the headers object
951
- * @throws compile error
952
- *
953
- * @author Jeongho Nam - https://github.com/samchon
954
- */
955
- export function createIsHeaders(): never;
956
-
957
- /**
958
- * Creates a reusable {@link isHeaders} function.
959
- *
960
- * @template T The type of the headers object
961
- * @returns A reusable `isHeaders` function
962
- *
963
- * @author Jeongho Nam - https://github.com/samchon
964
- */
965
- export function createIsHeaders<T extends object>(): (
966
- input: Record<string, string | string[] | undefined>,
967
- ) => T | null;
968
-
969
- /**
970
- * @internal
971
- */
972
- export function createIsHeaders<T>(): (
973
- input: Record<string, string | string[] | undefined>,
974
- ) => T | null {
975
- NoTransformConfigurationError("http.createIsHeaders");
976
- }
977
-
978
- /**
979
- * Creates a reusable {@link validateHeaders} function.
980
- *
981
- * @danger You must configure the generic argument `T`
982
- * @template T The type of the headers object
983
- * @throws compile error
984
- *
985
- * @author Jeongho Nam - https://github.com/samchon
986
- */
987
- export function createValidateHeaders(): never;
988
-
989
- /**
990
- * Creates a reusable {@link validateHeaders} function.
991
- *
992
- * @template T The type of the headers object
993
- * @returns A reusable `validateHeaders` function
994
- *
995
- * @author Jeongho Nam - https://github.com/samchon
996
- */
997
- export function createValidateHeaders<T extends object>(): (
998
- input: Record<string, string | string[] | undefined>,
999
- ) => IValidation<Resolved<T>>;
1000
-
1001
- /**
1002
- * @internal
1003
- */
1004
- export function createValidateHeaders<T>(): (
1005
- input: Record<string, string | string[] | undefined>,
1006
- ) => IValidation<Resolved<T>> {
1007
- NoTransformConfigurationError("http.createValidateHeaders");
1008
- }
1009
-
1010
- /**
1011
- * Creates a reusable {@link parameter} function.
1012
- *
1013
- * @danger You must configure the generic argument `T`
1014
- * @template T The type of the parameter value
1015
- * @throws compile error
1016
- *
1017
- * @author Jeongho Nam - https://github.com/samchon
1018
- */
1019
- export function createParameter(): never;
1020
-
1021
- /**
1022
- * Creates a reusable {@link parameter} function.
1023
- *
1024
- * @template T The type of the parameter value
1025
- * @returns A reusable `parameter` function
1026
- *
1027
- * @author Jeongho Nam - https://github.com/samchon
1028
- */
1029
- export function createParameter<T extends Atomic.Type | null>(): (
1030
- input: string,
1031
- ) => T;
1032
-
1033
- /**
1034
- * @internal
1035
- */
1036
- export function createParameter<T extends Atomic.Type | null>(): (
1037
- input: string,
1038
- ) => T {
1039
- NoTransformConfigurationError("http.createParameter");
1040
- }
1
+ import { NoTransformConfigurationError } from "./transformers/NoTransformConfigurationError";
2
+
3
+ import { Atomic } from "./typings/Atomic";
4
+
5
+ import { IReadableURLSearchParams } from "./IReadableURLSearchParams";
6
+ import { IValidation } from "./IValidation";
7
+ import { Resolved } from "./Resolved";
8
+ import { TypeGuardError } from "./TypeGuardError";
9
+
10
+ /* ===========================================================
11
+ HTTP
12
+ - FORM-DATA
13
+ - QUERY
14
+ - HEADERS
15
+ - PARAMETER
16
+ - FACTORY FUNCTIONS
17
+ ==============================================================
18
+ FORM-DATA
19
+ ----------------------------------------------------------- */
20
+ /**
21
+ * Form data decoder.
22
+ *
23
+ * `typia.http.formData()` is a function decoding `FormData` instance, with
24
+ * automatic type casting to the expected type. When property type is defined as
25
+ * `boolean` or `Blob` type, `typia.http.formData()` will cast the value to the
26
+ * expected type when decoding.
27
+ *
28
+ * By the way, as `FormData` is not enough to express complex data structures,
29
+ * `typia.http.formData()` function has some limitations. If target type `T` is
30
+ * not following those restrictions, compilation errors would be occurred.
31
+ *
32
+ * 1. Type `T` must be an object type
33
+ * 2. Do not allow dynamic property
34
+ * 3. Only `boolean`, `bigint`, `number`, `string`, `Blob`, `File` or their array
35
+ * types are allowed
36
+ * 4. Union types are never allowed
37
+ *
38
+ * Also, `typia.http.formData()` function does not perform validation about the
39
+ * decoded value. Therefore, if you can't sure that input data is following the
40
+ * `T` type, it would better to call one of below functions instead.
41
+ *
42
+ * @author Jeongho Nam - https://github.com/samchon
43
+ * @template T Expected type of decoded value
44
+ * @param input FormData instance
45
+ * @returns Decoded form FormData
46
+ */
47
+ export function formData<T extends object>(input: FormData): Resolved<T>;
48
+
49
+ /** @internal */
50
+ export function formData(): never {
51
+ NoTransformConfigurationError("http.formData");
52
+ }
53
+
54
+ /**
55
+ * Form data decoder with type assertion.
56
+ *
57
+ * `typia.http.assertFormData()` is a function decoding `FormData` instance,
58
+ * with automatic type casting to the expected type. When property type is
59
+ * defined as `boolean` or `Blob` type, `typia.http.assertFormData()` will cast
60
+ * the value to the expected type when decoding.
61
+ *
62
+ * Also, after decoding, `typia.http.assertFormData()` performs type assertion
63
+ * to the decoded value by combining with {@link assert} function. Therefore,
64
+ * when the decoded value is not following the `T` type, {@link TypeGuardError}
65
+ * or custom error generated by _errorFactory_ would be thrown.
66
+ *
67
+ * By the way, as `FormData` is not enough to express complex data structures,
68
+ * `typia.http.assertFormData()` function has some limitations. If target type
69
+ * `T` is not following those restrictions, compilation errors would be
70
+ * occurred.
71
+ *
72
+ * 1. Type `T` must be an object type
73
+ * 2. Do not allow dynamic property
74
+ * 3. Only `boolean`, `bigint`, `number`, `string`, `Blob`, `File` or their array
75
+ * types are allowed
76
+ * 4. Union types are never allowed
77
+ *
78
+ * @author Jeongho Nam - https://github.com/samchon
79
+ * @template T Expected type of decoded value
80
+ * @param input FormData instance
81
+ * @param errorFactory Custom error factory. Default is `TypeGuardError`
82
+ * @returns Decoded form FormData
83
+ */
84
+ export function assertFormData<T extends object>(
85
+ input: FormData,
86
+ errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
87
+ ): Resolved<T>;
88
+
89
+ /** @internal */
90
+ export function assertFormData(): never {
91
+ NoTransformConfigurationError("http.assertFormData");
92
+ }
93
+
94
+ /**
95
+ * Form data decoder with type checking.
96
+ *
97
+ * `typia.http.isFormData()` is a function decoding `FormData` instance, with
98
+ * automatic type casting to the expected type. When property type is defined as
99
+ * `boolean` or `Blob` type, `typia.http.isFormData()` will cast the value to
100
+ * the expected type when decoding.
101
+ *
102
+ * Also, after decoding, `typia.http.isFormData()` performs type checking to the
103
+ * decoded value by combining with {@link is} function. Therefore, when the
104
+ * decoded value is not following the `T` type, `null` value would be returned.
105
+ *
106
+ * By the way, as `FormData` is not enough to express complex data structures,
107
+ * `typia.http.isFormData()` function has some limitations. If target type `T`
108
+ * is not following those restrictions, compilation errors would be occurred.
109
+ *
110
+ * 1. Type `T` must be an object type
111
+ * 2. Do not allow dynamic property
112
+ * 3. Only `boolean`, `bigint`, `number`, `string`, `Blob`, `File` or their array
113
+ * types are allowed
114
+ * 4. Union types are never allowed
115
+ *
116
+ * @author Jeongho Nam - https://github.com/samchon
117
+ * @template T Expected type of decoded value
118
+ * @param input FormData instance
119
+ * @returns Decoded form FormData or `null` value
120
+ */
121
+ export function isFormData<T extends object>(
122
+ input: FormData,
123
+ ): Resolved<T> | null;
124
+
125
+ /** @internal */
126
+ export function isFormData(): never {
127
+ NoTransformConfigurationError("http.isFormData");
128
+ }
129
+
130
+ /**
131
+ * Form data decoder with type validation.
132
+ *
133
+ * `typia.http.validateFormData()` is a function decoding `FormData` instance,
134
+ * with automatic type casting to the expected type. When property type is
135
+ * defined as `boolean` or `Blob` type, `typia.http.validateFormData()` will
136
+ * cast the value to the expected type when decoding.
137
+ *
138
+ * Also, after decoding, `typia.http.validateFormData()` performs type
139
+ * validation to the decoded value by combining with {@link validate} function.
140
+ * Therefore, when the decoded value is not following the `T` type,
141
+ * {@link IValidation.IFailure} would be returned. Otherwise, x@xxxx
142
+ * IValidation.ISuccess} would be returned.
143
+ *
144
+ * By the way, as `FormData` is not enough to express complex data structures,
145
+ * `typia.http.validateFormData()` function has some limitations. If target type
146
+ * `T` is not following those restrictions, compilation errors would be
147
+ * occurred.
148
+ *
149
+ * 1. Type `T` must be an object type
150
+ * 2. Do not allow dynamic property
151
+ * 3. Only `boolean`, `bigint`, `number`, `string`, `Blob`, `File` or their array
152
+ * types are allowed
153
+ * 4. Union types are never allowed
154
+ *
155
+ * @author Jeongho Nam - https://github.com/samchon
156
+ * @template T Expected type of decoded value
157
+ * @param input FormData instance
158
+ * @returns Validation result with decoded form FormData
159
+ */
160
+ export function validateFormData<T extends object>(
161
+ input: FormData,
162
+ ): IValidation<Resolved<T>>;
163
+
164
+ /** @internal */
165
+ export function validateFormData(): never {
166
+ NoTransformConfigurationError("http.validateFormData");
167
+ }
168
+
169
+ /* -----------------------------------------------------------
170
+ QUERY
171
+ ----------------------------------------------------------- */
172
+ /**
173
+ * URL query decoder.
174
+ *
175
+ * `typia.http.query()` is a function decoding a query string or an
176
+ * `URLSearchParams` instance, with automatic type casting to the expected type.
177
+ * When property type be defined as `boolean` or `number` type,
178
+ * `typia.http.query()` will cast the value to the expected type when decoding.
179
+ *
180
+ * By the way, as URL query is not enough to express complex data structures,
181
+ * `typia.http.query()` function has some limitations. If target type `T` is not
182
+ * following those restrictions, compilation errors would be occurred.
183
+ *
184
+ * 1. Type `T` must be an object type
185
+ * 2. Do not allow dynamic property
186
+ * 3. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
187
+ * 4. Union types are never allowed
188
+ *
189
+ * Also, `typia.http.query()` function does not perform validation about the
190
+ * decoded value. Therefore, if you can't sure that input data is following the
191
+ * `T` type, it would better to call one of below functions instead.
192
+ *
193
+ * - {@link assertQuery}
194
+ * - {@link isQuery}
195
+ * - {@link validateQuery}
196
+ *
197
+ * @author Jeongho Nam - https://github.com/samchon
198
+ * @template T Expected type of decoded value
199
+ * @param input Query string or URLSearchParams instance
200
+ * @returns Decoded query object
201
+ */
202
+ export function query<T extends object>(
203
+ input: string | IReadableURLSearchParams,
204
+ ): Resolved<T>;
205
+
206
+ /** @internal */
207
+ export function query(): never {
208
+ NoTransformConfigurationError("http.query");
209
+ }
210
+
211
+ /**
212
+ * URL query decoder with type assertion.
213
+ *
214
+ * `typia.http.assertQuery()` is a function decoding a query string or an
215
+ * `URLSearchParams` instance, with automatic type casting to the expected type.
216
+ * When property type is defined as `boolean` or `number` type,
217
+ * `typia.http.assertQuery()` will cast the value to the expected type when
218
+ * decoding.
219
+ *
220
+ * Also, after decoding, `typia.http.assertQuery()` performs type assertion to
221
+ * the decoded value by combining with {@link assert} function. Therefore, when
222
+ * the decoded value is not following the `T` type, {@link TypeGuardError} or
223
+ * custom error generated by _errorFactory_ would be thrown.
224
+ *
225
+ * By the way, as URL query is not enough to express complex data structures,
226
+ * `typia.http.assertQuery()` function has some limitations. If target type `T`
227
+ * is notfollowing those restrictions, compilation errors would be occurred.
228
+ *
229
+ * 1. Type `T` must be an object type
230
+ * 2. Do not allow dynamic property
231
+ * 3. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
232
+ * 4. Union types are never allowed
233
+ *
234
+ * @author Jeongho Nam - https://github.com/samchon
235
+ * @template T Expected type of decoded value
236
+ * @param input Query string or URLSearchParams instance
237
+ * @param errorFactory Custom error factory. Default is `TypeGuardError`
238
+ * @returns Decoded query object
239
+ */
240
+ export function assertQuery<T extends object>(
241
+ input: string | IReadableURLSearchParams,
242
+ errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
243
+ ): Resolved<T>;
244
+
245
+ /** @internal */
246
+ export function assertQuery(): never {
247
+ NoTransformConfigurationError("http.assertQuery");
248
+ }
249
+
250
+ /**
251
+ * URL query decoder with type checking.
252
+ *
253
+ * `typia.http.isQuery()` is a function decoding a query string or an
254
+ * `URLSearchParams` instance, with automatic type casting to the expected type.
255
+ * When property type is defined as `boolean` or `number` type,
256
+ * `typia.http.isQuery()` will cast the value to the expected type when
257
+ * decoding.
258
+ *
259
+ * Also, after decoding, `typia.http.isQuery()` performs type checking to the
260
+ * decoded value by combining with {@link is} function. Therefore, when the
261
+ * decoded value is not following the `T` type, `null` value would be returned.
262
+ *
263
+ * By the way, as URL query is not enough to express complex data structures,
264
+ * `typia.http.isQuery()` function has some limitations. If target type `T` is
265
+ * notfollowing those restrictions, compilation errors would be occurred.
266
+ *
267
+ * 1. Type `T` must be an object type
268
+ * 2. Do not allow dynamic property
269
+ * 3. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
270
+ * 4. Union types are never allowed
271
+ *
272
+ * @author Jeongho Nam - https://github.com/samchon
273
+ * @template T Expected type of decoded value
274
+ * @param input Query string or URLSearchParams instance
275
+ * @returns Decoded query object or `null` value
276
+ */
277
+ export function isQuery<T extends object>(
278
+ input: string | IReadableURLSearchParams,
279
+ ): Resolved<T> | null;
280
+
281
+ /** @internal */
282
+ export function isQuery(): never {
283
+ NoTransformConfigurationError("http.isQuery");
284
+ }
285
+
286
+ /**
287
+ * URL query decoder with type validation.
288
+ *
289
+ * `typia.http.validateQuery()` is a function decoding a query string or an
290
+ * `URLSearchParams` instance, with automatic type casting to the expected type.
291
+ * When property type is defined as `boolean` or `number` type,
292
+ * `typia.http.validateQuery()` will cast the value to the expected type when
293
+ * decoding.
294
+ *
295
+ * Also, after decoding, `typia.http.validateQuery()` performs type validation
296
+ * to the decoded value by combining with {@link validate} function. Therefore,
297
+ * when the decoded value is not following the `T` type,
298
+ * {@link IValidation.IFailure} would be returned. Otherwise,
299
+ * {@link IValidation.ISuccess} would be returned.
300
+ *
301
+ * By the way, as URL query is not enough to express complex data structures,
302
+ * `typia.http.validateQuery()` function has some limitations. If target type
303
+ * `T` is notfollowing those restrictions, compilation errors would be
304
+ * occurred.
305
+ *
306
+ * 1. Type `T` must be an object type
307
+ * 2. Do not allow dynamic property
308
+ * 3. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
309
+ * 4. Union types are never allowed
310
+ *
311
+ * @author Jeongho Nam - https://github.com/samchon
312
+ * @template T Expected type of decoded value
313
+ * @param input Query string or URLSearchParams instance
314
+ * @returns Validation result with decoded query object
315
+ */
316
+ export function validateQuery<T extends object>(
317
+ input: string | IReadableURLSearchParams,
318
+ ): IValidation<Resolved<T>>;
319
+
320
+ /** @internal */
321
+ export function validateQuery(): never {
322
+ NoTransformConfigurationError("http.validateQuery");
323
+ }
324
+
325
+ /* -----------------------------------------------------------
326
+ HEADERS
327
+ ----------------------------------------------------------- */
328
+ /**
329
+ * Headers decoder (for express and fastify).
330
+ *
331
+ * `typia.http.headers()` is a function decoding an header instance, with
332
+ * automatic type casting to the expected type. When property type is defined as
333
+ * `boolean` or `number` type, `typia.http.headers()` will cast the value to the
334
+ * expected type.
335
+ *
336
+ * By the way, as HTTP headers are not enough to express complex data
337
+ * structures, `typia.http.headers()` function has some limitations. If target
338
+ * type `T` is not following those restrictions, compilation errors would be
339
+ * occurred.
340
+ *
341
+ * 1. Type `T` must be an object type
342
+ * 2. Do not allow dynamic property
343
+ * 3. Property key must be lower case
344
+ * 4. Property value cannot be `null`, but `undefined` is possible
345
+ * 5. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
346
+ * 6. Union types are never allowed
347
+ * 7. Property `set-cookie` must be array type
348
+ * 8. Those properties cannot be array type
349
+ *
350
+ * - Age
351
+ * - Authorization
352
+ * - Content-length
353
+ * - Content-type
354
+ * - Etag
355
+ * - Expires
356
+ * - From
357
+ * - Host
358
+ * - If-modified-since
359
+ * - If-unmodified-since
360
+ * - Last-modified
361
+ * - Location
362
+ * - Max-forwards
363
+ * - Proxy-authorization
364
+ * - Referer
365
+ * - Retry-after
366
+ * - Server
367
+ * - User-agent
368
+ *
369
+ * Also, `typia.http.headers()` function does not perform validation about the
370
+ * decoded value. Therefore, if you can't sure that input data is following the
371
+ * `T` type, it would better to call one of below functions instead.
372
+ *
373
+ * - {@link assertHeaders}
374
+ * - {@link isHeaders}
375
+ * - {@link validateHeaders}
376
+ *
377
+ * @author Jeongho Nam - https://github.com/samchon
378
+ * @template T Expected type of decoded value
379
+ * @param input Query string or URLSearchParams instance
380
+ * @returns Decoded headers object
381
+ */
382
+ export function headers<T extends object>(
383
+ input: Record<string, string | string[] | undefined>,
384
+ ): Resolved<T>;
385
+
386
+ /** @internal */
387
+ export function headers(): never {
388
+ NoTransformConfigurationError("http.headers");
389
+ }
390
+
391
+ /**
392
+ * Headers decoder with type assertion (for express and fastify).
393
+ *
394
+ * `typia.http.assertHeaders()` is a function decoding an header instance, with
395
+ * automatic type casting to the expected type. When property type is defined as
396
+ * `boolean` or `number` type, `typia.http.headers()` will cast the value to the
397
+ * expected type.
398
+ *
399
+ * Also, after decoding, `typia.http.assertHeaders()` performs type assertion to
400
+ * the decoded value by combining with {@link assert} function. Therefore, when
401
+ * the decoded value is not following the `T` type, {@link TypeGuardError} or
402
+ * custom error generated by _errorFactory_ would be thrown.
403
+ *
404
+ * By the way, as HTTP headers are not enough to express complex data
405
+ * structures, `typia.http.headers()` function has some limitations. If target
406
+ * type `T` is not following those restrictions, compilation errors would be
407
+ * occurred.
408
+ *
409
+ * 1. Type `T` must be an object type
410
+ * 2. Do not allow dynamic property
411
+ * 3. Property key must be lower case
412
+ * 4. Property value cannot be `null`, but `undefined` is possible
413
+ * 5. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
414
+ * 6. Union types are never allowed
415
+ * 7. Property `set-cookie` must be array type
416
+ * 8. Those properties cannot be array type
417
+ *
418
+ * - Age
419
+ * - Authorization
420
+ * - Content-length
421
+ * - Content-type
422
+ * - Etag
423
+ * - Expires
424
+ * - From
425
+ * - Host
426
+ * - If-modified-since
427
+ * - If-unmodified-since
428
+ * - Last-modified
429
+ * - Location
430
+ * - Max-forwards
431
+ * - Proxy-authorization
432
+ * - Referer
433
+ * - Retry-after
434
+ * - Server
435
+ * - User-agent
436
+ *
437
+ * @author Jeongho Nam - https://github.com/samchon
438
+ * @template T Expected type of decoded value
439
+ * @param input Query string or URLSearchParams instance
440
+ * @param errorFactory Custom error factory. Default is `TypeGuardError`
441
+ * @returns Decoded headers object
442
+ */
443
+ export function assertHeaders<T extends object>(
444
+ input: Record<string, string | string[] | undefined>,
445
+ errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
446
+ ): Resolved<T>;
447
+
448
+ /** @internal */
449
+ export function assertHeaders(): never {
450
+ NoTransformConfigurationError("http.assertHeaders");
451
+ }
452
+
453
+ /**
454
+ * > You must configure the generic argument `T`.
455
+ *
456
+ * Headers decoder with type checking (for express and fastify).
457
+ *
458
+ * `typia.http.isHeaders()` is a function decoding an header instance, with
459
+ * automatic type casting to the expected type. When property type is defined as
460
+ * `boolean` or `number` type, `typia.http.headers()` will cast the value to the
461
+ * expected type.
462
+ *
463
+ * Also, after decoding, `typia.http.isHeaders()` performs type checking to the
464
+ * decoded value by combining with {@link is} function. Therefore, when the
465
+ * decoded value is not following the `T` type, `null` value would be returned.
466
+ *
467
+ * By the way, as HTTP headers are not enough to express complex data
468
+ * structures, `typia.http.headers()` function has some limitations. If target
469
+ * type `T` is not following those restrictions, compilation errors would be
470
+ * occurred.
471
+ *
472
+ * 1. Type `T` must be an object type
473
+ * 2. Do not allow dynamic property
474
+ * 3. Property key must be lower case
475
+ * 4. Property value cannot be `null`, but `undefined` is possible
476
+ * 5. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
477
+ * 6. Union types are never allowed
478
+ * 7. Property `set-cookie` must be array type
479
+ * 8. Those properties cannot be array type
480
+ *
481
+ * - Age
482
+ * - Authorization
483
+ * - Content-length
484
+ * - Content-type
485
+ * - Etag
486
+ * - Expires
487
+ * - From
488
+ * - Host
489
+ * - If-modified-since
490
+ * - If-unmodified-since
491
+ * - Last-modified
492
+ * - Location
493
+ * - Max-forwards
494
+ * - Proxy-authorization
495
+ * - Referer
496
+ * - Retry-after
497
+ * - Server
498
+ * - User-agent
499
+ *
500
+ * @author Jeongho Nam - https://github.com/samchon
501
+ * @template T Expected type of decoded value
502
+ * @param input Query string or URLSearchParams instance
503
+ * @returns Decoded headers object or `null` value
504
+ */
505
+ export function isHeaders<T extends object>(
506
+ input: Record<string, string | string[] | undefined>,
507
+ ): Resolved<T> | null;
508
+
509
+ /** @internal */
510
+ export function isHeaders(): never {
511
+ NoTransformConfigurationError("http.isHeaders");
512
+ }
513
+
514
+ /**
515
+ * Headers decoder with type validation (for express and fastify).
516
+ *
517
+ * `typia.http.validateHeaders()` is a function decoding an header instance,
518
+ * with automatic type casting to the expected type. When property type is
519
+ * defined as `boolean` or `number` type, `typia.http.headers()` will cast the
520
+ * value to the expected type.
521
+ *
522
+ * Also, after decoding, `typia.http.validateHeaders()` performs type assertion
523
+ * to the decoded value by combining with {@link validate} function. Therefore,
524
+ * when the decoded value is not following the `T` type,
525
+ * {@link IValidation.IError} would be returned. Otherwise,
526
+ * {@link IValidation.ISuccess} be returned.
527
+ *
528
+ * By the way, as HTTP headers are not enough to express complex data
529
+ * structures, `typia.http.headers()` function has some limitations. If target
530
+ * type `T` is not following those restrictions, compilation errors would be
531
+ * occurred.
532
+ *
533
+ * 1. Type `T` must be an object type
534
+ * 2. Do not allow dynamic property
535
+ * 3. Property key must be lower case
536
+ * 4. Property value cannot be `null`, but `undefined` is possible
537
+ * 5. Only `boolean`, `bigint`, `number`, `string` or their array types are allowed
538
+ * 6. Union types are never allowed
539
+ * 7. Property `set-cookie` must be array type
540
+ * 8. Those properties cannot be array type
541
+ *
542
+ * - Age
543
+ * - Authorization
544
+ * - Content-length
545
+ * - Content-type
546
+ * - Etag
547
+ * - Expires
548
+ * - From
549
+ * - Host
550
+ * - If-modified-since
551
+ * - If-unmodified-since
552
+ * - Last-modified
553
+ * - Location
554
+ * - Max-forwards
555
+ * - Proxy-authorization
556
+ * - Referer
557
+ * - Retry-after
558
+ * - Server
559
+ * - User-agent
560
+ *
561
+ * @author Jeongho Nam - https://github.com/samchon
562
+ * @template T Expected type of decoded value
563
+ * @param input Query string or URLSearchParams instance
564
+ * @returns Decoded headers object
565
+ */
566
+ export function validateHeaders<T extends object>(
567
+ input: Record<string, string | string[] | undefined>,
568
+ ): IValidation<Resolved<T>>;
569
+
570
+ /** @internal */
571
+ export function validateHeaders(): never {
572
+ NoTransformConfigurationError("http.validateHeaders");
573
+ }
574
+
575
+ /* -----------------------------------------------------------
576
+ PARAMETER
577
+ ----------------------------------------------------------- */
578
+ /**
579
+ * URL path parameter decoder.
580
+ *
581
+ * `typia.http.parameter()` is a function decoding a path parameter, with
582
+ * automatic type casting to the expected type. When type `T` has been defined
583
+ * as `boolean` or `number` type, `typia.http.parameter()` will cast the value
584
+ * to the expected type.
585
+ *
586
+ * Also, `typia.http.parameter()` performs type assertion to the decoded value
587
+ * by combining with {@link assert} function. Therefore, when the decoded value
588
+ * is not following the `T` type, {@link TypeGuardError} would be thrown.
589
+ *
590
+ * @template T Expected type of decoded value
591
+ * @param input Path parameter string
592
+ * @returns Decoded path parameter value
593
+ */
594
+ export function parameter<T extends Atomic.Type | null>(
595
+ input: string,
596
+ ): Resolved<T>;
597
+
598
+ /** @internal */
599
+ export function parameter(): never {
600
+ NoTransformConfigurationError("http.parameter");
601
+ }
602
+
603
+ /* -----------------------------------------------------------
604
+ FACTORY FUNCTIONS
605
+ ----------------------------------------------------------- */
606
+ /**
607
+ * Creates a reusable {@link formdata} function.
608
+ *
609
+ * @author Jeongho Nam - https://github.com/samchon
610
+ * @template T The type of the formdata object
611
+ * @throws Compile error
612
+ * @danger You must configure the generic argument `T`
613
+ */
614
+ export function createFormData(): never;
615
+
616
+ /**
617
+ * Creates a reusable {@link formdata} function.
618
+ *
619
+ * @author Jeongho Nam - https://github.com/samchon
620
+ * @template T The type of the formdata object
621
+ * @returns A reusable `formdata` function
622
+ */
623
+ export function createFormData<T extends object>(): (input: FormData) => T;
624
+
625
+ /** @internal */
626
+ export function createFormData<T>(): (input: FormData) => T {
627
+ NoTransformConfigurationError("http.createFormData");
628
+ }
629
+
630
+ /**
631
+ * Creates a reusable {@link assertFormData} function.
632
+ *
633
+ * @author Jeongho Nam - https://github.com/samchon
634
+ * @template T The type of the formdata object
635
+ * @param errorFactory Custom error factory. Default is `TypeGuardError`
636
+ * @throws Compile error
637
+ * @danger You must configure the generic argument `T`
638
+ */
639
+ export function createAssertFormData(
640
+ errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
641
+ ): never;
642
+
643
+ /**
644
+ * Creates a reusable {@link assertFormData} function.
645
+ *
646
+ * @author Jeongho Nam - https://github.com/samchon
647
+ * @template T The type of the formdata object
648
+ * @param errorFactory Custom error factory. Default is `TypeGuardError`
649
+ * @returns A reusable `assertFormData` function
650
+ */
651
+ export function createAssertFormData<T extends object>(
652
+ errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
653
+ ): (input: FormData) => T;
654
+
655
+ /** @internal */
656
+ export function createAssertFormData<T>(): (input: FormData) => T {
657
+ NoTransformConfigurationError("http.createAssertFormData");
658
+ }
659
+
660
+ /**
661
+ * Creates a reusable {@link isFormData} function.
662
+ *
663
+ * @author Jeongho Nam - https://github.com/samchon
664
+ * @template T The type of the formdata object
665
+ * @throws Compile error
666
+ * @danger You must configure the generic argument `T`
667
+ */
668
+ export function createIsFormData(): never;
669
+
670
+ /**
671
+ * Creates a reusable {@link isFormData} function.
672
+ *
673
+ * @author Jeongho Nam - https://github.com/samchon
674
+ * @template T The type of the formdata object
675
+ * @returns A reusable `isFormData` function
676
+ */
677
+ export function createIsFormData<T extends object>(): (
678
+ input: FormData,
679
+ ) => T | null;
680
+
681
+ /** @internal */
682
+ export function createIsFormData<T>(): (input: FormData) => T | null {
683
+ NoTransformConfigurationError("http.createIsFormData");
684
+ }
685
+
686
+ /**
687
+ * Creates a reusable {@link validateFormData} function.
688
+ *
689
+ * @author Jeongho Nam - https://github.com/samchon
690
+ * @template T The type of the formdata object
691
+ * @throws Compile error
692
+ * @danger You must configure the generic argument `T`
693
+ */
694
+ export function createValidateFormData(): never;
695
+
696
+ /**
697
+ * Creates a reusable {@link validateFormData} function.
698
+ *
699
+ * @author Jeongho Nam - https://github.com/samchon
700
+ * @template T The type of the formdata object
701
+ * @returns A reusable `validateFormData` function
702
+ */
703
+ export function createValidateFormData<T extends object>(): (
704
+ input: FormData,
705
+ ) => IValidation<Resolved<T>>;
706
+
707
+ /** @internal */
708
+ export function createValidateFormData<T>(): (
709
+ input: FormData,
710
+ ) => IValidation<Resolved<T>> {
711
+ NoTransformConfigurationError("http.createValidateFormData");
712
+ }
713
+
714
+ /**
715
+ * Creates a reusable {@link query} function.
716
+ *
717
+ * @author Jeongho Nam - https://github.com/samchon
718
+ * @template T The type of the query object
719
+ * @throws Compile error
720
+ * @danger You must configure the generic argument `T`
721
+ */
722
+ export function createQuery(): never;
723
+
724
+ /**
725
+ * Creates a reusable {@link query} function.
726
+ *
727
+ * @author Jeongho Nam - https://github.com/samchon
728
+ * @template T The type of the query object
729
+ * @returns A reusable `query` function
730
+ */
731
+ export function createQuery<T extends object>(): (
732
+ input: string | IReadableURLSearchParams,
733
+ ) => T;
734
+
735
+ /** @internal */
736
+ export function createQuery<T>(): (
737
+ input: string | IReadableURLSearchParams,
738
+ ) => T {
739
+ NoTransformConfigurationError("http.createQuery");
740
+ }
741
+
742
+ /**
743
+ * Creates a reusable {@link assertQuery} function.
744
+ *
745
+ * @author Jeongho Nam - https://github.com/samchon
746
+ * @template T The type of the query object
747
+ * @param errorFactory Custom error factory. Default is `TypeGuardError`
748
+ * @throws Compile error
749
+ * @danger You must configure the generic argument `T`
750
+ */
751
+ export function createAssertQuery(
752
+ errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
753
+ ): never;
754
+
755
+ /**
756
+ * Creates a reusable {@link assertQuery} function.
757
+ *
758
+ * @author Jeongho Nam - https://github.com/samchon
759
+ * @template T The type of the query object
760
+ * @param errorFactory Custom error factory. Default is `TypeGuardError`
761
+ * @returns A reusable `assertQuery` function
762
+ */
763
+ export function createAssertQuery<T extends object>(
764
+ errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
765
+ ): (input: string | IReadableURLSearchParams) => T;
766
+
767
+ /** @internal */
768
+ export function createAssertQuery<T>(): (
769
+ input: string | IReadableURLSearchParams,
770
+ ) => T {
771
+ NoTransformConfigurationError("http.createAssertQuery");
772
+ }
773
+
774
+ /**
775
+ * Creates a reusable {@link isQuery} function.
776
+ *
777
+ * @author Jeongho Nam - https://github.com/samchon
778
+ * @template T The type of the query object
779
+ * @throws Compile error
780
+ * @danger You must configure the generic argument `T`
781
+ */
782
+ export function createIsQuery(): never;
783
+
784
+ /**
785
+ * Creates a reusable {@link isQuery} function.
786
+ *
787
+ * @author Jeongho Nam - https://github.com/samchon
788
+ * @template T The type of the query object
789
+ * @returns A reusable `isQuery` function
790
+ */
791
+ export function createIsQuery<T extends object>(): (
792
+ input: string | IReadableURLSearchParams,
793
+ ) => T | null;
794
+
795
+ /** @internal */
796
+ export function createIsQuery<T>(): (
797
+ input: string | IReadableURLSearchParams,
798
+ ) => T | null {
799
+ NoTransformConfigurationError("http.createIsQuery");
800
+ }
801
+
802
+ /**
803
+ * Creates a reusable {@link validateQuery} function.
804
+ *
805
+ * @author Jeongho Nam - https://github.com/samchon
806
+ * @template T The type of the query object
807
+ * @throws Compile error
808
+ * @danger You must configure the generic argument `T`
809
+ */
810
+ export function createValidateQuery(): never;
811
+
812
+ /**
813
+ * Creates a reusable {@link validateQuery} function.
814
+ *
815
+ * @author Jeongho Nam - https://github.com/samchon
816
+ * @template T The type of the query object
817
+ * @returns A reusable `validateQuery` function
818
+ */
819
+ export function createValidateQuery<T extends object>(): (
820
+ input: string | IReadableURLSearchParams,
821
+ ) => IValidation<Resolved<T>>;
822
+
823
+ /** @internal */
824
+ export function createValidateQuery<T>(): (
825
+ input: string | IReadableURLSearchParams,
826
+ ) => IValidation<Resolved<T>> {
827
+ NoTransformConfigurationError("http.createValidateQuery");
828
+ }
829
+
830
+ /**
831
+ * Creates a reusable {@link headers} function.
832
+ *
833
+ * @author Jeongho Nam - https://github.com/samchon
834
+ * @template T The type of the headers object
835
+ * @throws Compile error
836
+ * @danger You must configure the generic argument `T`
837
+ */
838
+ export function createHeaders(): never;
839
+
840
+ /**
841
+ * Creates a reusable {@link headers} function.
842
+ *
843
+ * @author Jeongho Nam - https://github.com/samchon
844
+ * @template T The type of the headers object
845
+ * @returns A reusable `headers` function
846
+ */
847
+ export function createHeaders<T extends object>(): (
848
+ input: Record<string, string | string[] | undefined>,
849
+ ) => T;
850
+
851
+ /** @internal */
852
+ export function createHeaders<T>(): (
853
+ input: Record<string, string | string[] | undefined>,
854
+ ) => T {
855
+ NoTransformConfigurationError("http.createHeaders");
856
+ }
857
+
858
+ /**
859
+ * Creates a reusable {@link assertHeaders} function.
860
+ *
861
+ * @author Jeongho Nam - https://github.com/samchon
862
+ * @template T The type of the headers object
863
+ * @param errorFactory Custom error factory. Default is `TypeGuardError`
864
+ * @throws Compile error
865
+ * @danger You must configure the generic argument `T`
866
+ */
867
+ export function createAssertHeaders(
868
+ errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
869
+ ): never;
870
+
871
+ /**
872
+ * Creates a reusable {@link assertHeaders} function.
873
+ *
874
+ * @author Jeongho Nam - https://github.com/samchon
875
+ * @template T The type of the headers object
876
+ * @param errorFactory Custom error factory. Default is `TypeGuardError`
877
+ * @returns A reusable `assertHeaders` function
878
+ */
879
+ export function createAssertHeaders<T extends object>(
880
+ errorFactory?: undefined | ((props: TypeGuardError.IProps) => Error),
881
+ ): (input: Record<string, string | string[] | undefined>) => T;
882
+
883
+ /** @internal */
884
+ export function createAssertHeaders<T>(): (
885
+ input: Record<string, string | string[] | undefined>,
886
+ ) => T {
887
+ NoTransformConfigurationError("http.createAssertHeaders");
888
+ }
889
+
890
+ /**
891
+ * Creates a reusable {@link isHeaders} function.
892
+ *
893
+ * @author Jeongho Nam - https://github.com/samchon
894
+ * @template T The type of the headers object
895
+ * @throws Compile error
896
+ * @danger You must configure the generic argument `T`
897
+ */
898
+ export function createIsHeaders(): never;
899
+
900
+ /**
901
+ * Creates a reusable {@link isHeaders} function.
902
+ *
903
+ * @author Jeongho Nam - https://github.com/samchon
904
+ * @template T The type of the headers object
905
+ * @returns A reusable `isHeaders` function
906
+ */
907
+ export function createIsHeaders<T extends object>(): (
908
+ input: Record<string, string | string[] | undefined>,
909
+ ) => T | null;
910
+
911
+ /** @internal */
912
+ export function createIsHeaders<T>(): (
913
+ input: Record<string, string | string[] | undefined>,
914
+ ) => T | null {
915
+ NoTransformConfigurationError("http.createIsHeaders");
916
+ }
917
+
918
+ /**
919
+ * Creates a reusable {@link validateHeaders} function.
920
+ *
921
+ * @author Jeongho Nam - https://github.com/samchon
922
+ * @template T The type of the headers object
923
+ * @throws Compile error
924
+ * @danger You must configure the generic argument `T`
925
+ */
926
+ export function createValidateHeaders(): never;
927
+
928
+ /**
929
+ * Creates a reusable {@link validateHeaders} function.
930
+ *
931
+ * @author Jeongho Nam - https://github.com/samchon
932
+ * @template T The type of the headers object
933
+ * @returns A reusable `validateHeaders` function
934
+ */
935
+ export function createValidateHeaders<T extends object>(): (
936
+ input: Record<string, string | string[] | undefined>,
937
+ ) => IValidation<Resolved<T>>;
938
+
939
+ /** @internal */
940
+ export function createValidateHeaders<T>(): (
941
+ input: Record<string, string | string[] | undefined>,
942
+ ) => IValidation<Resolved<T>> {
943
+ NoTransformConfigurationError("http.createValidateHeaders");
944
+ }
945
+
946
+ /**
947
+ * Creates a reusable {@link parameter} function.
948
+ *
949
+ * @author Jeongho Nam - https://github.com/samchon
950
+ * @template T The type of the parameter value
951
+ * @throws Compile error
952
+ * @danger You must configure the generic argument `T`
953
+ */
954
+ export function createParameter(): never;
955
+
956
+ /**
957
+ * Creates a reusable {@link parameter} function.
958
+ *
959
+ * @author Jeongho Nam - https://github.com/samchon
960
+ * @template T The type of the parameter value
961
+ * @returns A reusable `parameter` function
962
+ */
963
+ export function createParameter<T extends Atomic.Type | null>(): (
964
+ input: string,
965
+ ) => T;
966
+
967
+ /** @internal */
968
+ export function createParameter<T extends Atomic.Type | null>(): (
969
+ input: string,
970
+ ) => T {
971
+ NoTransformConfigurationError("http.createParameter");
972
+ }