@typia/interface 12.0.0-dev.20260225

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 (311) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +23 -0
  3. package/lib/http/IHttpConnection.d.ts +163 -0
  4. package/lib/http/IHttpConnection.js +4 -0
  5. package/lib/http/IHttpConnection.js.map +1 -0
  6. package/lib/http/IHttpLlmApplication.d.ts +73 -0
  7. package/lib/http/IHttpLlmApplication.js +3 -0
  8. package/lib/http/IHttpLlmApplication.js.map +1 -0
  9. package/lib/http/IHttpLlmController.d.ts +86 -0
  10. package/lib/http/IHttpLlmController.js +3 -0
  11. package/lib/http/IHttpLlmController.js.map +1 -0
  12. package/lib/http/IHttpLlmFunction.d.ts +79 -0
  13. package/lib/http/IHttpLlmFunction.js +3 -0
  14. package/lib/http/IHttpLlmFunction.js.map +1 -0
  15. package/lib/http/IHttpMigrateApplication.d.ts +42 -0
  16. package/lib/http/IHttpMigrateApplication.js +3 -0
  17. package/lib/http/IHttpMigrateApplication.js.map +1 -0
  18. package/lib/http/IHttpMigrateRoute.d.ts +121 -0
  19. package/lib/http/IHttpMigrateRoute.js +3 -0
  20. package/lib/http/IHttpMigrateRoute.js.map +1 -0
  21. package/lib/http/IHttpResponse.d.ts +40 -0
  22. package/lib/http/IHttpResponse.js +3 -0
  23. package/lib/http/IHttpResponse.js.map +1 -0
  24. package/lib/http/index.d.ts +7 -0
  25. package/lib/http/index.js +24 -0
  26. package/lib/http/index.js.map +1 -0
  27. package/lib/index.d.ts +8 -0
  28. package/lib/index.js +48 -0
  29. package/lib/index.js.map +1 -0
  30. package/lib/metadata/IJsDocTagInfo.d.ts +23 -0
  31. package/lib/metadata/IJsDocTagInfo.js +3 -0
  32. package/lib/metadata/IJsDocTagInfo.js.map +1 -0
  33. package/lib/metadata/IMetadataComponents.d.ts +20 -0
  34. package/lib/metadata/IMetadataComponents.js +3 -0
  35. package/lib/metadata/IMetadataComponents.js.map +1 -0
  36. package/lib/metadata/IMetadataSchema.d.ts +219 -0
  37. package/lib/metadata/IMetadataSchema.js +3 -0
  38. package/lib/metadata/IMetadataSchema.js.map +1 -0
  39. package/lib/metadata/IMetadataSchemaCollection.d.ts +18 -0
  40. package/lib/metadata/IMetadataSchemaCollection.js +3 -0
  41. package/lib/metadata/IMetadataSchemaCollection.js.map +1 -0
  42. package/lib/metadata/IMetadataSchemaUnit.d.ts +18 -0
  43. package/lib/metadata/IMetadataSchemaUnit.js +3 -0
  44. package/lib/metadata/IMetadataSchemaUnit.js.map +1 -0
  45. package/lib/metadata/IMetadataTypeTag.d.ts +28 -0
  46. package/lib/metadata/IMetadataTypeTag.js +3 -0
  47. package/lib/metadata/IMetadataTypeTag.js.map +1 -0
  48. package/lib/metadata/index.d.ts +6 -0
  49. package/lib/metadata/index.js +23 -0
  50. package/lib/metadata/index.js.map +1 -0
  51. package/lib/openapi/OpenApi.d.ts +454 -0
  52. package/lib/openapi/OpenApi.js +3 -0
  53. package/lib/openapi/OpenApi.js.map +1 -0
  54. package/lib/openapi/OpenApiV3.d.ts +420 -0
  55. package/lib/openapi/OpenApiV3.js +3 -0
  56. package/lib/openapi/OpenApiV3.js.map +1 -0
  57. package/lib/openapi/OpenApiV3_1.d.ts +463 -0
  58. package/lib/openapi/OpenApiV3_1.js +3 -0
  59. package/lib/openapi/OpenApiV3_1.js.map +1 -0
  60. package/lib/openapi/SwaggerV2.d.ts +343 -0
  61. package/lib/openapi/SwaggerV2.js +3 -0
  62. package/lib/openapi/SwaggerV2.js.map +1 -0
  63. package/lib/openapi/index.d.ts +4 -0
  64. package/lib/openapi/index.js +21 -0
  65. package/lib/openapi/index.js.map +1 -0
  66. package/lib/protobuf/ProtobufWire.d.ts +46 -0
  67. package/lib/protobuf/ProtobufWire.js +3 -0
  68. package/lib/protobuf/ProtobufWire.js.map +1 -0
  69. package/lib/protobuf/index.d.ts +1 -0
  70. package/lib/protobuf/index.js +18 -0
  71. package/lib/protobuf/index.js.map +1 -0
  72. package/lib/schema/IJsonSchemaApplication.d.ts +232 -0
  73. package/lib/schema/IJsonSchemaApplication.js +3 -0
  74. package/lib/schema/IJsonSchemaApplication.js.map +1 -0
  75. package/lib/schema/IJsonSchemaAttribute.d.ts +152 -0
  76. package/lib/schema/IJsonSchemaAttribute.js +3 -0
  77. package/lib/schema/IJsonSchemaAttribute.js.map +1 -0
  78. package/lib/schema/IJsonSchemaCollection.d.ts +109 -0
  79. package/lib/schema/IJsonSchemaCollection.js +3 -0
  80. package/lib/schema/IJsonSchemaCollection.js.map +1 -0
  81. package/lib/schema/IJsonSchemaTransformError.d.ts +81 -0
  82. package/lib/schema/IJsonSchemaTransformError.js +3 -0
  83. package/lib/schema/IJsonSchemaTransformError.js.map +1 -0
  84. package/lib/schema/IJsonSchemaUnit.d.ts +106 -0
  85. package/lib/schema/IJsonSchemaUnit.js +3 -0
  86. package/lib/schema/IJsonSchemaUnit.js.map +1 -0
  87. package/lib/schema/ILlmApplication.d.ts +95 -0
  88. package/lib/schema/ILlmApplication.js +3 -0
  89. package/lib/schema/ILlmApplication.js.map +1 -0
  90. package/lib/schema/ILlmController.d.ts +53 -0
  91. package/lib/schema/ILlmController.js +3 -0
  92. package/lib/schema/ILlmController.js.map +1 -0
  93. package/lib/schema/ILlmFunction.d.ts +134 -0
  94. package/lib/schema/ILlmFunction.js +3 -0
  95. package/lib/schema/ILlmFunction.js.map +1 -0
  96. package/lib/schema/ILlmSchema.d.ts +412 -0
  97. package/lib/schema/ILlmSchema.js +3 -0
  98. package/lib/schema/ILlmSchema.js.map +1 -0
  99. package/lib/schema/IResult.d.ts +81 -0
  100. package/lib/schema/IResult.js +3 -0
  101. package/lib/schema/IResult.js.map +1 -0
  102. package/lib/schema/IValidation.d.ts +123 -0
  103. package/lib/schema/IValidation.js +3 -0
  104. package/lib/schema/IValidation.js.map +1 -0
  105. package/lib/schema/index.d.ts +11 -0
  106. package/lib/schema/index.js +28 -0
  107. package/lib/schema/index.js.map +1 -0
  108. package/lib/tags/Constant.d.ts +44 -0
  109. package/lib/tags/Constant.js +3 -0
  110. package/lib/tags/Constant.js.map +1 -0
  111. package/lib/tags/ContentMediaType.d.ts +39 -0
  112. package/lib/tags/ContentMediaType.js +3 -0
  113. package/lib/tags/ContentMediaType.js.map +1 -0
  114. package/lib/tags/Default.d.ts +42 -0
  115. package/lib/tags/Default.js +3 -0
  116. package/lib/tags/Default.js.map +1 -0
  117. package/lib/tags/Example.d.ts +38 -0
  118. package/lib/tags/Example.js +3 -0
  119. package/lib/tags/Example.js.map +1 -0
  120. package/lib/tags/Examples.d.ts +44 -0
  121. package/lib/tags/Examples.js +3 -0
  122. package/lib/tags/Examples.js.map +1 -0
  123. package/lib/tags/ExclusiveMaximum.d.ts +39 -0
  124. package/lib/tags/ExclusiveMaximum.js +3 -0
  125. package/lib/tags/ExclusiveMaximum.js.map +1 -0
  126. package/lib/tags/ExclusiveMinimum.d.ts +39 -0
  127. package/lib/tags/ExclusiveMinimum.js +3 -0
  128. package/lib/tags/ExclusiveMinimum.js.map +1 -0
  129. package/lib/tags/Format.d.ts +43 -0
  130. package/lib/tags/Format.js +3 -0
  131. package/lib/tags/Format.js.map +1 -0
  132. package/lib/tags/JsonSchemaPlugin.d.ts +44 -0
  133. package/lib/tags/JsonSchemaPlugin.js +3 -0
  134. package/lib/tags/JsonSchemaPlugin.js.map +1 -0
  135. package/lib/tags/MaxItems.d.ts +38 -0
  136. package/lib/tags/MaxItems.js +3 -0
  137. package/lib/tags/MaxItems.js.map +1 -0
  138. package/lib/tags/MaxLength.d.ts +36 -0
  139. package/lib/tags/MaxLength.js +3 -0
  140. package/lib/tags/MaxLength.js.map +1 -0
  141. package/lib/tags/Maximum.d.ts +41 -0
  142. package/lib/tags/Maximum.js +3 -0
  143. package/lib/tags/Maximum.js.map +1 -0
  144. package/lib/tags/MinItems.d.ts +38 -0
  145. package/lib/tags/MinItems.js +3 -0
  146. package/lib/tags/MinItems.js.map +1 -0
  147. package/lib/tags/MinLength.d.ts +36 -0
  148. package/lib/tags/MinLength.js +3 -0
  149. package/lib/tags/MinLength.js.map +1 -0
  150. package/lib/tags/Minimum.d.ts +41 -0
  151. package/lib/tags/Minimum.js +3 -0
  152. package/lib/tags/Minimum.js.map +1 -0
  153. package/lib/tags/MultipleOf.d.ts +49 -0
  154. package/lib/tags/MultipleOf.js +3 -0
  155. package/lib/tags/MultipleOf.js.map +1 -0
  156. package/lib/tags/Pattern.d.ts +51 -0
  157. package/lib/tags/Pattern.js +3 -0
  158. package/lib/tags/Pattern.js.map +1 -0
  159. package/lib/tags/Sequence.d.ts +42 -0
  160. package/lib/tags/Sequence.js +3 -0
  161. package/lib/tags/Sequence.js.map +1 -0
  162. package/lib/tags/TagBase.d.ts +109 -0
  163. package/lib/tags/TagBase.js +3 -0
  164. package/lib/tags/TagBase.js.map +1 -0
  165. package/lib/tags/Type.d.ts +53 -0
  166. package/lib/tags/Type.js +3 -0
  167. package/lib/tags/Type.js.map +1 -0
  168. package/lib/tags/UniqueItems.d.ts +41 -0
  169. package/lib/tags/UniqueItems.js +3 -0
  170. package/lib/tags/UniqueItems.js.map +1 -0
  171. package/lib/tags/index.d.ts +21 -0
  172. package/lib/tags/index.js +38 -0
  173. package/lib/tags/index.js.map +1 -0
  174. package/lib/typings/AssertionGuard.d.ts +12 -0
  175. package/lib/typings/AssertionGuard.js +3 -0
  176. package/lib/typings/AssertionGuard.js.map +1 -0
  177. package/lib/typings/Atomic.d.ts +19 -0
  178. package/lib/typings/Atomic.js +3 -0
  179. package/lib/typings/Atomic.js.map +1 -0
  180. package/lib/typings/CamelCase.d.ts +26 -0
  181. package/lib/typings/CamelCase.js +3 -0
  182. package/lib/typings/CamelCase.js.map +1 -0
  183. package/lib/typings/ClassProperties.d.ts +14 -0
  184. package/lib/typings/ClassProperties.js +3 -0
  185. package/lib/typings/ClassProperties.js.map +1 -0
  186. package/lib/typings/OmitNever.d.ts +11 -0
  187. package/lib/typings/OmitNever.js +3 -0
  188. package/lib/typings/OmitNever.js.map +1 -0
  189. package/lib/typings/PascalCase.d.ts +25 -0
  190. package/lib/typings/PascalCase.js +3 -0
  191. package/lib/typings/PascalCase.js.map +1 -0
  192. package/lib/typings/Primitive.d.ts +29 -0
  193. package/lib/typings/Primitive.js +3 -0
  194. package/lib/typings/Primitive.js.map +1 -0
  195. package/lib/typings/ProtobufAtomic.d.ts +15 -0
  196. package/lib/typings/ProtobufAtomic.js +3 -0
  197. package/lib/typings/ProtobufAtomic.js.map +1 -0
  198. package/lib/typings/Resolved.d.ts +23 -0
  199. package/lib/typings/Resolved.js +3 -0
  200. package/lib/typings/Resolved.js.map +1 -0
  201. package/lib/typings/SnakeCase.d.ts +31 -0
  202. package/lib/typings/SnakeCase.js +3 -0
  203. package/lib/typings/SnakeCase.js.map +1 -0
  204. package/lib/typings/SpecialFields.d.ts +13 -0
  205. package/lib/typings/SpecialFields.js +3 -0
  206. package/lib/typings/SpecialFields.js.map +1 -0
  207. package/lib/typings/ValidationPipe.d.ts +18 -0
  208. package/lib/typings/ValidationPipe.js +3 -0
  209. package/lib/typings/ValidationPipe.js.map +1 -0
  210. package/lib/typings/index.d.ts +12 -0
  211. package/lib/typings/index.js +29 -0
  212. package/lib/typings/index.js.map +1 -0
  213. package/lib/typings/internal/Equal.d.ts +11 -0
  214. package/lib/typings/internal/Equal.js +3 -0
  215. package/lib/typings/internal/Equal.js.map +1 -0
  216. package/lib/typings/internal/IsTuple.d.ts +13 -0
  217. package/lib/typings/internal/IsTuple.js +3 -0
  218. package/lib/typings/internal/IsTuple.js.map +1 -0
  219. package/lib/typings/internal/NativeClass.d.ts +9 -0
  220. package/lib/typings/internal/NativeClass.js +3 -0
  221. package/lib/typings/internal/NativeClass.js.map +1 -0
  222. package/lib/typings/internal/ValueOf.d.ts +15 -0
  223. package/lib/typings/internal/ValueOf.js +3 -0
  224. package/lib/typings/internal/ValueOf.js.map +1 -0
  225. package/lib/utils/IRandomGenerator.d.ts +68 -0
  226. package/lib/utils/IRandomGenerator.js +3 -0
  227. package/lib/utils/IRandomGenerator.js.map +1 -0
  228. package/lib/utils/IReadableURLSearchParams.d.ts +22 -0
  229. package/lib/utils/IReadableURLSearchParams.js +3 -0
  230. package/lib/utils/IReadableURLSearchParams.js.map +1 -0
  231. package/lib/utils/index.d.ts +2 -0
  232. package/lib/utils/index.js +19 -0
  233. package/lib/utils/index.js.map +1 -0
  234. package/package.json +79 -0
  235. package/src/http/IHttpConnection.ts +200 -0
  236. package/src/http/IHttpLlmApplication.ts +83 -0
  237. package/src/http/IHttpLlmController.ts +96 -0
  238. package/src/http/IHttpLlmFunction.ts +93 -0
  239. package/src/http/IHttpMigrateApplication.ts +48 -0
  240. package/src/http/IHttpMigrateRoute.ts +165 -0
  241. package/src/http/IHttpResponse.ts +42 -0
  242. package/src/http/index.ts +7 -0
  243. package/src/index.ts +9 -0
  244. package/src/metadata/IJsDocTagInfo.ts +25 -0
  245. package/src/metadata/IMetadataComponents.ts +24 -0
  246. package/src/metadata/IMetadataSchema.ts +293 -0
  247. package/src/metadata/IMetadataSchemaCollection.ts +20 -0
  248. package/src/metadata/IMetadataSchemaUnit.ts +20 -0
  249. package/src/metadata/IMetadataTypeTag.ts +39 -0
  250. package/src/metadata/index.ts +6 -0
  251. package/src/openapi/OpenApi.ts +643 -0
  252. package/src/openapi/OpenApiV3.ts +655 -0
  253. package/src/openapi/OpenApiV3_1.ts +735 -0
  254. package/src/openapi/SwaggerV2.ts +559 -0
  255. package/src/openapi/index.ts +4 -0
  256. package/src/protobuf/ProtobufWire.ts +51 -0
  257. package/src/protobuf/index.ts +1 -0
  258. package/src/schema/IJsonSchemaApplication.ts +274 -0
  259. package/src/schema/IJsonSchemaAttribute.ts +158 -0
  260. package/src/schema/IJsonSchemaCollection.ts +123 -0
  261. package/src/schema/IJsonSchemaTransformError.ts +86 -0
  262. package/src/schema/IJsonSchemaUnit.ts +120 -0
  263. package/src/schema/ILlmApplication.ts +103 -0
  264. package/src/schema/ILlmController.ts +57 -0
  265. package/src/schema/ILlmFunction.ts +144 -0
  266. package/src/schema/ILlmSchema.ts +484 -0
  267. package/src/schema/IResult.ts +84 -0
  268. package/src/schema/IValidation.ts +134 -0
  269. package/src/schema/index.ts +13 -0
  270. package/src/tags/Constant.ts +49 -0
  271. package/src/tags/ContentMediaType.ts +40 -0
  272. package/src/tags/Default.ts +50 -0
  273. package/src/tags/Example.ts +48 -0
  274. package/src/tags/Examples.ts +50 -0
  275. package/src/tags/ExclusiveMaximum.ts +46 -0
  276. package/src/tags/ExclusiveMinimum.ts +46 -0
  277. package/src/tags/Format.ts +76 -0
  278. package/src/tags/JsonSchemaPlugin.ts +45 -0
  279. package/src/tags/MaxItems.ts +39 -0
  280. package/src/tags/MaxLength.ts +37 -0
  281. package/src/tags/Maximum.ts +44 -0
  282. package/src/tags/MinItems.ts +39 -0
  283. package/src/tags/MinLength.ts +37 -0
  284. package/src/tags/Minimum.ts +44 -0
  285. package/src/tags/MultipleOf.ts +54 -0
  286. package/src/tags/Pattern.ts +59 -0
  287. package/src/tags/Sequence.ts +43 -0
  288. package/src/tags/TagBase.ts +131 -0
  289. package/src/tags/Type.ts +70 -0
  290. package/src/tags/UniqueItems.ts +44 -0
  291. package/src/tags/index.ts +21 -0
  292. package/src/typings/AssertionGuard.ts +12 -0
  293. package/src/typings/Atomic.ts +21 -0
  294. package/src/typings/CamelCase.ts +75 -0
  295. package/src/typings/ClassProperties.ts +15 -0
  296. package/src/typings/OmitNever.ts +12 -0
  297. package/src/typings/PascalCase.ts +71 -0
  298. package/src/typings/Primitive.ts +71 -0
  299. package/src/typings/ProtobufAtomic.ts +30 -0
  300. package/src/typings/Resolved.ts +58 -0
  301. package/src/typings/SnakeCase.ts +126 -0
  302. package/src/typings/SpecialFields.ts +13 -0
  303. package/src/typings/ValidationPipe.ts +20 -0
  304. package/src/typings/index.ts +13 -0
  305. package/src/typings/internal/Equal.ts +14 -0
  306. package/src/typings/internal/IsTuple.ts +17 -0
  307. package/src/typings/internal/NativeClass.ts +31 -0
  308. package/src/typings/internal/ValueOf.ts +29 -0
  309. package/src/utils/IRandomGenerator.ts +105 -0
  310. package/src/utils/IReadableURLSearchParams.ts +25 -0
  311. package/src/utils/index.ts +2 -0
@@ -0,0 +1,42 @@
1
+ /**
2
+ * HTTP response structure returned from server communication.
3
+ *
4
+ * `IHttpResponse` represents the complete HTTP response received from a remote
5
+ * server, containing the status code, response headers, and body. This
6
+ * interface is used by `@nestia/fetcher` to return structured response data
7
+ * from API calls.
8
+ *
9
+ * The {@link status} property contains the HTTP status code (e.g., 200, 404),
10
+ * {@link headers} contains all response headers (some may have multiple values),
11
+ * and {@link body} contains the parsed response body (typically JSON-decoded).
12
+ *
13
+ * @author Jeongho Nam - https://github.com/samchon
14
+ */
15
+ export interface IHttpResponse {
16
+ /**
17
+ * HTTP status code of the response.
18
+ *
19
+ * Standard HTTP status codes indicating the result of the request. Common
20
+ * values: 200 (OK), 201 (Created), 400 (Bad Request), 401 (Unauthorized), 404
21
+ * (Not Found), 500 (Internal Server Error).
22
+ */
23
+ status: number;
24
+
25
+ /**
26
+ * Response headers from the server.
27
+ *
28
+ * Contains all HTTP headers returned by the server. Header values can be
29
+ * either a single string or an array of strings for headers that appear
30
+ * multiple times (e.g., `Set-Cookie`).
31
+ */
32
+ headers: Record<string, string | string[]>;
33
+
34
+ /**
35
+ * Parsed body content of the response.
36
+ *
37
+ * The response body after parsing. For JSON responses, this is the decoded
38
+ * JavaScript object. The actual type depends on the endpoint and response
39
+ * content-type.
40
+ */
41
+ body: unknown;
42
+ }
@@ -0,0 +1,7 @@
1
+ export * from "./IHttpConnection";
2
+ export * from "./IHttpLlmController";
3
+ export * from "./IHttpLlmApplication";
4
+ export * from "./IHttpLlmFunction";
5
+ export * from "./IHttpMigrateApplication";
6
+ export * from "./IHttpMigrateRoute";
7
+ export * from "./IHttpResponse";
package/src/index.ts ADDED
@@ -0,0 +1,9 @@
1
+ export * from "./http/index";
2
+ export * from "./schema/index";
3
+ export * from "./openapi/index";
4
+ export * from "./typings/index";
5
+ export * from "./utils/index";
6
+ export * from "./metadata/index";
7
+ export * from "./protobuf/index";
8
+
9
+ export * as tags from "./tags/index";
@@ -0,0 +1,25 @@
1
+ /**
2
+ * JSDoc tag information extracted from TypeScript source.
3
+ *
4
+ * Represents a single JSDoc tag like `@param`, `@returns`, `@deprecated`, etc.
5
+ * Used throughout typia's metadata system to preserve documentation.
6
+ *
7
+ * @author Jeongho Nam - https://github.com/samchon
8
+ */
9
+ export interface IJsDocTagInfo {
10
+ /** Tag name without `@` prefix (e.g., `"param"`, `"returns"`). */
11
+ name: string;
12
+
13
+ /** Tag text content, if any. */
14
+ text?: IJsDocTagInfo.IText[];
15
+ }
16
+ export namespace IJsDocTagInfo {
17
+ /** Text segment within a JSDoc tag. */
18
+ export interface IText {
19
+ /** Text content. */
20
+ text: string;
21
+
22
+ /** Text kind (e.g., `"text"`, `"parameterName"`). */
23
+ kind: string;
24
+ }
25
+ }
@@ -0,0 +1,24 @@
1
+ import { IMetadataSchema } from "./IMetadataSchema";
2
+
3
+ /**
4
+ * Shared type definitions for metadata schemas.
5
+ *
6
+ * `IMetadataComponents` stores reusable type definitions that can be referenced
7
+ * from {@link IMetadataSchema} via {@link IMetadataSchema.IReference}. This
8
+ * enables deduplication of complex types across multiple schemas.
9
+ *
10
+ * @author Jeongho Nam - https://github.com/samchon
11
+ */
12
+ export interface IMetadataComponents {
13
+ /** Object type definitions. */
14
+ objects: IMetadataSchema.IObjectType[];
15
+
16
+ /** Type alias definitions. */
17
+ aliases: IMetadataSchema.IAliasType[];
18
+
19
+ /** Array type definitions. */
20
+ arrays: IMetadataSchema.IArrayType[];
21
+
22
+ /** Tuple type definitions. */
23
+ tuples: IMetadataSchema.ITupleType[];
24
+ }
@@ -0,0 +1,293 @@
1
+ import { Atomic } from "../typings/Atomic";
2
+ import { IJsDocTagInfo } from "./IJsDocTagInfo";
3
+ import { IMetadataTypeTag } from "./IMetadataTypeTag";
4
+
5
+ /**
6
+ * Metadata schema representing a TypeScript type's structure.
7
+ *
8
+ * `IMetadataSchema` is typia's internal type representation, capturing full
9
+ * TypeScript type information including unions, optionality, nullability, and
10
+ * type constraints. Used by `typia.reflect.schema<T>()` for runtime type
11
+ * introspection.
12
+ *
13
+ * Type categories:
14
+ *
15
+ * - Primitives: {@link atomics} (boolean, bigint, number, string)
16
+ * - Literals: {@link constants} (literal values like `"hello"` or `42`)
17
+ * - Templates: {@link templates} (template literal types)
18
+ * - Collections: {@link arrays}, {@link tuples}, {@link sets}, {@link maps}
19
+ * - Objects: {@link objects} (named object types)
20
+ * - Aliases: {@link aliases} (type aliases)
21
+ * - Natives: {@link natives} (built-in classes like Date, Uint8Array)
22
+ * - Functions: {@link functions} (function types)
23
+ *
24
+ * @author Jeongho Nam - https://github.com/samchon
25
+ */
26
+ export interface IMetadataSchema {
27
+ /** Whether the type is `any`. */
28
+ any: boolean;
29
+
30
+ /** Whether the type is required (not `undefined`). */
31
+ required: boolean;
32
+
33
+ /** Whether the type is optional (`?` modifier). */
34
+ optional: boolean;
35
+
36
+ /** Whether the type is nullable (`null` included). */
37
+ nullable: boolean;
38
+
39
+ /** Function types in the union. */
40
+ functions: IMetadataSchema.IFunction[];
41
+
42
+ /** Primitive types (boolean, bigint, number, string) in the union. */
43
+ atomics: IMetadataSchema.IAtomic[];
44
+
45
+ /** Literal constant values in the union. */
46
+ constants: IMetadataSchema.IConstant[];
47
+
48
+ /** Template literal types in the union. */
49
+ templates: IMetadataSchema.ITemplate[];
50
+
51
+ /** Escaped type info (original and transformed). */
52
+ escaped: IMetadataSchema.IEscaped | null;
53
+
54
+ /** Rest element type for variadic tuples. */
55
+ rest: IMetadataSchema | null;
56
+
57
+ /** Array type references in the union. */
58
+ arrays: IMetadataSchema.IReference[];
59
+
60
+ /** Tuple type references in the union. */
61
+ tuples: IMetadataSchema.IReference[];
62
+
63
+ /** Object type references in the union. */
64
+ objects: IMetadataSchema.IReference[];
65
+
66
+ /** Type alias references in the union. */
67
+ aliases: IMetadataSchema.IReference[];
68
+
69
+ /** Native class references (Date, Uint8Array, etc.) in the union. */
70
+ natives: IMetadataSchema.IReference[];
71
+
72
+ /** Set types in the union. */
73
+ sets: IMetadataSchema.ISet[];
74
+
75
+ /** Map types in the union. */
76
+ maps: IMetadataSchema.IMap[];
77
+ }
78
+ export namespace IMetadataSchema {
79
+ /** Function type metadata. */
80
+ export interface IFunction {
81
+ /** Whether the function is async. */
82
+ async: boolean;
83
+
84
+ /** Function parameters. */
85
+ parameters: IParameter[];
86
+
87
+ /** Return type schema. */
88
+ output: IMetadataSchema;
89
+ }
90
+
91
+ /** Function parameter metadata. */
92
+ export interface IParameter {
93
+ /** Parameter name. */
94
+ name: string;
95
+
96
+ /** Parameter type schema. */
97
+ type: IMetadataSchema;
98
+
99
+ /** JSDoc description. */
100
+ description: string | null;
101
+
102
+ /** JSDoc tags. */
103
+ jsDocTags: IJsDocTagInfo[];
104
+ }
105
+
106
+ /** Primitive atomic type metadata. */
107
+ export interface IAtomic {
108
+ /** Primitive type kind. */
109
+ type: "boolean" | "bigint" | "number" | "string";
110
+
111
+ /** Type constraint tags (e.g., `@minimum`, `@format`). */
112
+ tags: IMetadataTypeTag[][];
113
+ }
114
+
115
+ /** Literal constant type metadata. */
116
+ export type IConstant =
117
+ | IConstant.IBase<"boolean">
118
+ | IConstant.IBase<"number">
119
+ | IConstant.IBase<"string">
120
+ | IConstant.IBase<"bigint">;
121
+ export namespace IConstant {
122
+ /** Base interface for constant types. */
123
+ export interface IBase<Type extends Atomic.Literal> {
124
+ /** Constant type kind. */
125
+ type: Type;
126
+
127
+ /** Literal values in the union. */
128
+ values: IValue<Atomic.Mapper[Type]>[];
129
+ }
130
+
131
+ /** Single constant value metadata. */
132
+ export interface IValue<T extends Atomic.Type> {
133
+ /** The literal value. */
134
+ value: T;
135
+
136
+ /** Type constraint tags. */
137
+ tags: IMetadataTypeTag[][];
138
+
139
+ /** JSDoc description. */
140
+ description?: string | null;
141
+
142
+ /** JSDoc tags. */
143
+ jsDocTags?: IJsDocTagInfo[];
144
+ }
145
+ }
146
+
147
+ /** Template literal type metadata. */
148
+ export interface ITemplate {
149
+ /** Template parts as schemas. */
150
+ row: IMetadataSchema[];
151
+
152
+ /** Type constraint tags. */
153
+ tags: IMetadataTypeTag[][];
154
+ }
155
+
156
+ /** Escaped type metadata (for special transformations). */
157
+ export interface IEscaped {
158
+ /** Original type before escaping. */
159
+ original: IMetadataSchema;
160
+
161
+ /** Transformed return type. */
162
+ returns: IMetadataSchema;
163
+ }
164
+
165
+ /** Type alias definition. */
166
+ export interface IAliasType {
167
+ /** Alias name. */
168
+ name: string;
169
+
170
+ /** Underlying type schema. */
171
+ value: IMetadataSchema;
172
+
173
+ /** Nullability per reference site. */
174
+ nullables: boolean[];
175
+
176
+ /** JSDoc description. */
177
+ description: string | null;
178
+
179
+ /** JSDoc tags. */
180
+ jsDocTags: IJsDocTagInfo[];
181
+
182
+ /** Whether the alias is recursive. */
183
+ recursive: boolean;
184
+ }
185
+
186
+ /** Array type definition. */
187
+ export interface IArrayType {
188
+ /** Array type name. */
189
+ name: string;
190
+
191
+ /** Element type schema. */
192
+ value: IMetadataSchema;
193
+
194
+ /** Nullability per reference site. */
195
+ nullables: boolean[];
196
+
197
+ /** Whether the array type is recursive. */
198
+ recursive: boolean;
199
+
200
+ /** Index in components (for deduplication). */
201
+ index: number | null;
202
+ }
203
+
204
+ /** Tuple type definition. */
205
+ export interface ITupleType {
206
+ /** Tuple type name. */
207
+ name: string;
208
+
209
+ /** Element schemas in order. */
210
+ elements: IMetadataSchema[];
211
+
212
+ /** Index in components (for deduplication). */
213
+ index: number | null;
214
+
215
+ /** Whether the tuple type is recursive. */
216
+ recursive: boolean;
217
+
218
+ /** Nullability per reference site. */
219
+ nullables: boolean[];
220
+ }
221
+
222
+ /** Object type definition. */
223
+ export interface IObjectType {
224
+ /** Object type name. */
225
+ name: string;
226
+
227
+ /** Object properties. */
228
+ properties: IProperty[];
229
+
230
+ /** JSDoc description. */
231
+ description?: undefined | string;
232
+
233
+ /** JSDoc tags. */
234
+ jsDocTags: IJsDocTagInfo[];
235
+
236
+ /** Index in components (for deduplication). */
237
+ index: number;
238
+
239
+ /** Whether the object type is recursive. */
240
+ recursive: boolean;
241
+
242
+ /** Nullability per reference site. */
243
+ nullables: boolean[];
244
+ }
245
+
246
+ /** Object property metadata. */
247
+ export interface IProperty {
248
+ /** Property key schema (string or symbol). */
249
+ key: IMetadataSchema;
250
+
251
+ /** Property value schema. */
252
+ value: IMetadataSchema;
253
+
254
+ /** JSDoc description. */
255
+ description: string | null;
256
+
257
+ /** JSDoc tags. */
258
+ jsDocTags: IJsDocTagInfo[];
259
+
260
+ /** Property mutability (`readonly` or mutable). */
261
+ mutability?: "readonly" | null | undefined;
262
+ }
263
+
264
+ /** Map type metadata. */
265
+ export interface IMap {
266
+ /** Key type schema. */
267
+ key: IMetadataSchema;
268
+
269
+ /** Value type schema. */
270
+ value: IMetadataSchema;
271
+
272
+ /** Type constraint tags. */
273
+ tags: IMetadataTypeTag[][];
274
+ }
275
+
276
+ /** Set type metadata. */
277
+ export interface ISet {
278
+ /** Element type schema. */
279
+ value: IMetadataSchema;
280
+
281
+ /** Type constraint tags. */
282
+ tags: IMetadataTypeTag[][];
283
+ }
284
+
285
+ /** Reference to a named type in components. */
286
+ export interface IReference {
287
+ /** Referenced type name. */
288
+ name: string;
289
+
290
+ /** Type constraint tags. */
291
+ tags: IMetadataTypeTag[][];
292
+ }
293
+ }
@@ -0,0 +1,20 @@
1
+ import { IMetadataComponents } from "./IMetadataComponents";
2
+ import { IMetadataSchema } from "./IMetadataSchema";
3
+
4
+ /**
5
+ * Collection of metadata schemas for multiple types.
6
+ *
7
+ * `IMetadataSchemaCollection` contains metadata schemas generated from multiple
8
+ * TypeScript types via `typia.reflect.schemas<[T1, T2, ...]>()`. Each schema in
9
+ * {@link schemas} corresponds to one input type, while shared type definitions
10
+ * (objects, aliases, arrays, tuples) are stored in {@link components}.
11
+ *
12
+ * @author Jeongho Nam - https://github.com/samchon
13
+ */
14
+ export interface IMetadataSchemaCollection {
15
+ /** Array of metadata schemas, one per input type. */
16
+ schemas: IMetadataSchema[];
17
+
18
+ /** Shared type definitions referenced by schemas. */
19
+ components: IMetadataComponents;
20
+ }
@@ -0,0 +1,20 @@
1
+ import { IMetadataComponents } from "./IMetadataComponents";
2
+ import { IMetadataSchema } from "./IMetadataSchema";
3
+
4
+ /**
5
+ * Single unit of metadata schema for one type.
6
+ *
7
+ * `IMetadataSchemaUnit` contains a metadata schema generated from a single
8
+ * TypeScript type via `typia.reflect.schema<T>()`. The main schema is in
9
+ * {@link schema}, while shared type definitions (objects, aliases, arrays,
10
+ * tuples) are stored in {@link components}.
11
+ *
12
+ * @author Jeongho Nam - https://github.com/samchon
13
+ */
14
+ export interface IMetadataSchemaUnit {
15
+ /** Metadata schema for the target type. */
16
+ schema: IMetadataSchema;
17
+
18
+ /** Shared type definitions referenced by the schema. */
19
+ components: IMetadataComponents;
20
+ }
@@ -0,0 +1,39 @@
1
+ import type ts from "typescript";
2
+
3
+ /**
4
+ * Type constraint tag metadata.
5
+ *
6
+ * Represents constraint tags like `@minimum`, `@format`, `@pattern` that are
7
+ * applied to types via typia's tag system. Used for validation and JSON schema
8
+ * generation.
9
+ *
10
+ * @author Jeongho Nam - https://github.com/samchon
11
+ */
12
+ export interface IMetadataTypeTag {
13
+ /** Target type this tag applies to. */
14
+ target: "boolean" | "bigint" | "number" | "string" | "array" | "object";
15
+
16
+ /** Full tag name (e.g., `"@typia/tag/Minimum"`). */
17
+ name: string;
18
+
19
+ /** Tag kind identifier (e.g., `"minimum"`, `"format"`). */
20
+ kind: string;
21
+
22
+ /**
23
+ * Exclusivity: `true` for unique tags, or array of mutually exclusive tag
24
+ * kinds.
25
+ */
26
+ exclusive: boolean | string[];
27
+
28
+ /** Tag value (e.g., `0` for `Minimum<0>`, `"email"` for `Format<"email">`). */
29
+ value?: any;
30
+
31
+ /** Validation expression template. */
32
+ validate?: string | undefined;
33
+
34
+ /** JSON schema fragment to merge. */
35
+ schema?: object | undefined;
36
+
37
+ /** @internal */
38
+ predicate?: (input: ts.Expression) => ts.Expression;
39
+ }
@@ -0,0 +1,6 @@
1
+ export * from "./IJsDocTagInfo";
2
+ export * from "./IMetadataComponents";
3
+ export * from "./IMetadataSchema";
4
+ export * from "./IMetadataSchemaCollection";
5
+ export * from "./IMetadataSchemaUnit";
6
+ export * from "./IMetadataTypeTag";