@tsed/schema 8.34.0 → 8.35.0

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 (256) hide show
  1. package/lib/esm/compat.js +8 -0
  2. package/lib/esm/components/index.js +37 -27
  3. package/lib/esm/components/{default → mappers/default}/anyMapper.js +5 -5
  4. package/lib/esm/components/{default → mappers/default}/classMapper.js +5 -5
  5. package/lib/esm/components/{default → mappers/default}/discriminatorMappingMapper.js +3 -3
  6. package/lib/esm/components/{default → mappers/default}/enumsMapper.js +2 -2
  7. package/lib/esm/components/{default → mappers/default}/genericsMapper.js +7 -6
  8. package/lib/esm/components/{default → mappers/default}/inheritedClassMapper.js +3 -3
  9. package/lib/esm/components/{default → mappers/default}/lazyRefMapper.js +3 -3
  10. package/lib/esm/components/{default → mappers/default}/mapMapper.js +2 -2
  11. package/lib/esm/components/{default → mappers/default}/nextMapper.js +16 -16
  12. package/lib/esm/components/{default → mappers/default}/nullableMapper.js +3 -3
  13. package/lib/esm/components/{default → mappers/default}/objectMapper.js +4 -4
  14. package/lib/esm/components/mappers/default/ofMapper.js +9 -0
  15. package/lib/esm/components/{default → mappers/default}/requiredMapper.js +3 -3
  16. package/lib/esm/components/{default → mappers/default}/schemaMapper.js +11 -6
  17. package/lib/esm/components/mappers/open-spec/discriminatorMappingMapper.js +8 -0
  18. package/lib/esm/components/mappers/open-spec/enumsMapper.js +12 -0
  19. package/lib/esm/components/{open-spec → mappers/open-spec}/generate.js +3 -4
  20. package/lib/esm/components/{open-spec → mappers/open-spec}/nullableMapper.js +3 -4
  21. package/lib/esm/components/{open-spec → mappers/open-spec}/operationInFilesMapper.js +2 -2
  22. package/lib/esm/components/{open-spec → mappers/open-spec}/operationInParameterMapper.js +3 -3
  23. package/lib/esm/components/mappers/open-spec/operationInParametersMapper.js +5 -0
  24. package/lib/esm/components/{open-spec → mappers/open-spec}/operationInQueryMapper.js +3 -3
  25. package/lib/esm/components/{open-spec → mappers/open-spec}/operationMapper.js +4 -4
  26. package/lib/esm/components/{open-spec → mappers/open-spec}/operationMediaMapper.js +2 -2
  27. package/lib/esm/components/{open-spec → mappers/open-spec}/operationRequestBodyMapper.js +4 -4
  28. package/lib/esm/components/{open-spec → mappers/open-spec}/operationResponseMapper.js +2 -2
  29. package/lib/esm/components/{open-spec → mappers/open-spec}/pathsMapper.js +10 -10
  30. package/lib/esm/{domain → components/stores}/JsonClassStore.js +8 -13
  31. package/lib/esm/{domain → components/stores}/JsonMethodStore.js +33 -28
  32. package/lib/esm/{domain → components/stores}/JsonParameterStore.js +14 -18
  33. package/lib/esm/{domain → components/stores}/JsonPropertyStore.js +15 -18
  34. package/lib/esm/components/types/arrayType.js +15 -0
  35. package/lib/esm/components/types/classType.js +8 -0
  36. package/lib/esm/components/types/genericType.js +8 -0
  37. package/lib/esm/components/types/mapType.js +15 -0
  38. package/lib/esm/components/types/primitiveType.js +21 -0
  39. package/lib/esm/components/types/setType.js +12 -0
  40. package/lib/esm/decorators/class/discriminatorValue.js +1 -1
  41. package/lib/esm/decorators/collections/collectionOf.js +2 -2
  42. package/lib/esm/decorators/collections/maxItems.js +1 -1
  43. package/lib/esm/decorators/collections/maxProperties.js +1 -1
  44. package/lib/esm/decorators/collections/minItems.js +1 -1
  45. package/lib/esm/decorators/collections/minProperties.js +1 -1
  46. package/lib/esm/decorators/collections/uniqueItems.js +1 -1
  47. package/lib/esm/decorators/common/defaultMsg.js +1 -1
  48. package/lib/esm/decorators/common/discriminatorKey.js +1 -1
  49. package/lib/esm/decorators/common/enum.js +1 -1
  50. package/lib/esm/decorators/common/exclusiveMaximum.js +1 -1
  51. package/lib/esm/decorators/common/exclusiveMinimum.js +1 -1
  52. package/lib/esm/decorators/common/format.js +1 -1
  53. package/lib/esm/decorators/common/jsonEntityFn.js +2 -2
  54. package/lib/esm/decorators/common/maxLength.js +1 -1
  55. package/lib/esm/decorators/common/maximum.js +1 -1
  56. package/lib/esm/decorators/common/minLength.js +1 -1
  57. package/lib/esm/decorators/common/minimum.js +1 -1
  58. package/lib/esm/decorators/common/multipleOf.js +1 -1
  59. package/lib/esm/decorators/common/name.js +1 -1
  60. package/lib/esm/decorators/common/nullable.js +2 -2
  61. package/lib/esm/decorators/common/pattern.js +1 -1
  62. package/lib/esm/decorators/common/required.js +1 -1
  63. package/lib/esm/decorators/common/requiredGroups.js +1 -1
  64. package/lib/esm/decorators/common/typeError.js +1 -1
  65. package/lib/esm/decorators/config/jsonEntityComponent.js +3 -2
  66. package/lib/esm/decorators/generics/genericOf.js +2 -2
  67. package/lib/esm/decorators/generics/generics.js +2 -3
  68. package/lib/esm/decorators/operations/consumes.js +1 -1
  69. package/lib/esm/decorators/operations/deprecated.js +1 -1
  70. package/lib/esm/decorators/operations/header.js +1 -1
  71. package/lib/esm/decorators/operations/in.js +5 -6
  72. package/lib/esm/decorators/operations/inFile.js +2 -2
  73. package/lib/esm/decorators/operations/operation.js +1 -1
  74. package/lib/esm/decorators/operations/produces.js +1 -1
  75. package/lib/esm/decorators/operations/publish.js +1 -1
  76. package/lib/esm/decorators/operations/returns.js +4 -4
  77. package/lib/esm/decorators/operations/route.js +1 -1
  78. package/lib/esm/decorators/operations/security.js +1 -1
  79. package/lib/esm/decorators/operations/subscribe.js +1 -1
  80. package/lib/esm/decorators/operations/tags.js +1 -1
  81. package/lib/esm/domain/DecoratorContext.js +2 -2
  82. package/lib/esm/domain/JsonEntityStore.js +7 -41
  83. package/lib/esm/domain/JsonLazyRef.js +1 -1
  84. package/lib/esm/domain/JsonMap.js +1 -1
  85. package/lib/esm/domain/JsonOperation.js +1 -1
  86. package/lib/esm/domain/JsonParameter.js +3 -3
  87. package/lib/esm/domain/JsonRequestBody.js +1 -1
  88. package/lib/esm/domain/JsonResponse.js +2 -2
  89. package/lib/esm/domain/JsonSchema.js +92 -137
  90. package/lib/esm/domain/index.js +26 -0
  91. package/lib/esm/{utils/getJsonSchema.js → fn/compile.js} +20 -7
  92. package/lib/esm/fn/enums.js +1 -1
  93. package/lib/esm/fn/from.js +32 -9
  94. package/lib/esm/fn/generic.js +9 -0
  95. package/lib/esm/fn/index.js +25 -4
  96. package/lib/esm/fn/lazyRef.js +3 -3
  97. package/lib/esm/fn/oas/compileSpec.js +9 -0
  98. package/lib/esm/{utils → fn/oas}/generateSpec.js +2 -2
  99. package/lib/esm/{utils → fn/oas}/getSpec.js +4 -4
  100. package/lib/esm/{utils → fn/oas}/getSpecType.js +1 -1
  101. package/lib/esm/{utils → fn/oas}/mapOpenSpec.js +1 -1
  102. package/lib/esm/hooks/alterOneOf.js +1 -1
  103. package/lib/esm/index.js +59 -48
  104. package/lib/esm/registries/JsonEntitiesContainer.js +38 -0
  105. package/lib/esm/registries/JsonSchemaMapperContainer.js +10 -1
  106. package/lib/esm/registries/JsonTypesContainer.js +18 -0
  107. package/lib/esm/utils/generics.js +15 -2
  108. package/lib/esm/utils/getInheritedStores.js +1 -1
  109. package/lib/esm/utils/getOperationsRoutes.js +3 -3
  110. package/lib/esm/utils/getOperationsStores.js +4 -4
  111. package/lib/esm/utils/getPropertiesStores.js +2 -2
  112. package/lib/esm/utils/ref.js +2 -2
  113. package/lib/types/compat.d.ts +17 -0
  114. package/lib/types/components/index.d.ts +37 -27
  115. package/lib/types/components/{default → mappers/default}/anyMapper.d.ts +1 -1
  116. package/lib/types/components/mappers/default/classMapper.d.ts +3 -0
  117. package/lib/types/components/{default → mappers/default}/discriminatorMappingMapper.d.ts +2 -2
  118. package/lib/types/components/mappers/default/enumsMapper.d.ts +3 -0
  119. package/lib/types/components/{default → mappers/default}/genericsMapper.d.ts +2 -2
  120. package/lib/types/components/{default → mappers/default}/inheritedClassMapper.d.ts +1 -1
  121. package/lib/types/components/mappers/default/lazyRefMapper.d.ts +3 -0
  122. package/lib/types/components/{default → mappers/default}/mapMapper.d.ts +1 -1
  123. package/lib/types/components/{default → mappers/default}/nextMapper.d.ts +2 -2
  124. package/lib/types/components/{default → mappers/default}/nullableMapper.d.ts +1 -1
  125. package/lib/types/components/{default → mappers/default}/objectMapper.d.ts +1 -1
  126. package/lib/types/components/mappers/default/ofMapper.d.ts +3 -0
  127. package/lib/types/components/mappers/default/requiredMapper.d.ts +3 -0
  128. package/lib/types/components/mappers/default/schemaMapper.d.ts +3 -0
  129. package/lib/types/components/mappers/open-spec/enumsMapper.d.ts +3 -0
  130. package/lib/types/components/mappers/open-spec/generate.d.ts +1 -0
  131. package/lib/types/components/mappers/open-spec/nullableMapper.d.ts +3 -0
  132. package/lib/types/components/{open-spec → mappers/open-spec}/operationInParameterMapper.d.ts +3 -3
  133. package/lib/types/components/mappers/open-spec/operationInParametersMapper.d.ts +3 -0
  134. package/lib/types/components/mappers/open-spec/operationMapper.d.ts +3 -0
  135. package/lib/types/components/mappers/open-spec/operationMediaMapper.d.ts +3 -0
  136. package/lib/types/components/mappers/open-spec/operationRequestBodyMapper.d.ts +3 -0
  137. package/lib/types/components/mappers/open-spec/operationResponseMapper.d.ts +3 -0
  138. package/lib/types/components/{open-spec → mappers/open-spec}/pathsMapper.d.ts +1 -1
  139. package/lib/types/{domain → components/stores}/JsonClassStore.d.ts +4 -4
  140. package/lib/types/{domain → components/stores}/JsonMethodStore.d.ts +33 -19
  141. package/lib/types/{domain → components/stores}/JsonParameterStore.d.ts +9 -5
  142. package/lib/types/{domain → components/stores}/JsonPropertyStore.d.ts +7 -4
  143. package/lib/types/components/types/arrayType.d.ts +2 -0
  144. package/lib/types/components/types/classType.d.ts +2 -0
  145. package/lib/types/components/types/genericType.d.ts +2 -0
  146. package/lib/types/components/types/mapType.d.ts +2 -0
  147. package/lib/types/components/types/primitiveType.d.ts +2 -0
  148. package/lib/types/components/types/setType.d.ts +2 -0
  149. package/lib/types/decorators/common/any.d.ts +1 -1
  150. package/lib/types/decorators/common/examples.d.ts +1 -1
  151. package/lib/types/decorators/common/format.d.ts +1 -1
  152. package/lib/types/decorators/common/ignore.d.ts +1 -1
  153. package/lib/types/decorators/common/jsonEntityFn.d.ts +1 -1
  154. package/lib/types/decorators/config/jsonEntityComponent.d.ts +2 -1
  155. package/lib/types/decorators/generics/genericOf.d.ts +1 -1
  156. package/lib/types/decorators/operations/header.d.ts +1 -1
  157. package/lib/types/decorators/operations/in.d.ts +1 -2
  158. package/lib/types/decorators/operations/location.d.ts +1 -1
  159. package/lib/types/decorators/operations/redirect.d.ts +1 -1
  160. package/lib/types/decorators/operations/returns.d.ts +3 -3
  161. package/lib/types/decorators/operations/status.d.ts +1 -1
  162. package/lib/types/domain/Generics.d.ts +6 -0
  163. package/lib/types/domain/JsonEntityStore.d.ts +8 -19
  164. package/lib/types/domain/JsonLazyRef.d.ts +1 -1
  165. package/lib/types/domain/JsonMap.d.ts +1 -1
  166. package/lib/types/domain/JsonMedia.d.ts +1 -1
  167. package/lib/types/domain/JsonOperation.d.ts +2 -2
  168. package/lib/types/domain/JsonOperationRoute.d.ts +3 -3
  169. package/lib/types/domain/JsonParameter.d.ts +3 -3
  170. package/lib/types/domain/JsonRequestBody.d.ts +1 -1
  171. package/lib/types/domain/JsonResponse.d.ts +1 -1
  172. package/lib/types/domain/JsonSchema.d.ts +28 -22
  173. package/lib/types/{interfaces → domain}/JsonSchemaOptions.d.ts +14 -6
  174. package/lib/types/domain/__fixtures__/inspectOperationsPaths.d.ts +1 -1
  175. package/lib/types/domain/index.d.ts +26 -0
  176. package/lib/types/domain/types.d.ts +1 -1
  177. package/lib/types/fn/any.d.ts +1 -1
  178. package/lib/types/fn/boolean.d.ts +1 -1
  179. package/lib/types/{utils → fn}/compile.d.ts +10 -3
  180. package/lib/types/fn/date.d.ts +3 -3
  181. package/lib/types/fn/email.d.ts +1 -1
  182. package/lib/types/fn/from.d.ts +31 -3
  183. package/lib/types/fn/generic.d.ts +10 -0
  184. package/lib/types/fn/index.d.ts +24 -3
  185. package/lib/types/fn/integer.d.ts +1 -1
  186. package/lib/types/fn/lazyRef.d.ts +1 -1
  187. package/lib/types/fn/number.d.ts +1 -1
  188. package/lib/types/fn/oas/compileSpec.d.ts +6 -0
  189. package/lib/types/{utils → fn/oas}/getSpec.d.ts +1 -1
  190. package/lib/types/{utils → fn/oas}/getSpecType.d.ts +1 -1
  191. package/lib/types/{utils → fn/oas}/transformToOS2.d.ts +1 -1
  192. package/lib/types/fn/object.d.ts +1 -1
  193. package/lib/types/fn/string.d.ts +1 -1
  194. package/lib/types/fn/uri.d.ts +1 -1
  195. package/lib/types/fn/url.d.ts +1 -1
  196. package/lib/types/hooks/alterOneOf.d.ts +1 -1
  197. package/lib/types/hooks/alterRequiredGroups.d.ts +1 -1
  198. package/lib/types/index.d.ts +59 -48
  199. package/lib/types/{utils/getJsonEntityStore.d.ts → registries/JsonEntitiesContainer.d.ts} +5 -10
  200. package/lib/types/registries/JsonSchemaMapperContainer.d.ts +7 -1
  201. package/lib/types/registries/JsonTypesContainer.d.ts +15 -0
  202. package/lib/types/registries/{enumRegistries.d.ts → enumRegistry.d.ts} +1 -1
  203. package/lib/types/utils/generics.d.ts +13 -5
  204. package/lib/types/utils/getInheritedStores.d.ts +1 -1
  205. package/lib/types/utils/getOperationsRoutes.d.ts +3 -3
  206. package/lib/types/utils/getOperationsStores.d.ts +1 -1
  207. package/lib/types/utils/getPropertiesStores.d.ts +1 -1
  208. package/lib/types/utils/mapHeaders.d.ts +1 -1
  209. package/lib/types/utils/operationIdFormatter.d.ts +1 -1
  210. package/lib/types/utils/ref.d.ts +1 -1
  211. package/lib/types/utils/removeHiddenOperation.d.ts +1 -1
  212. package/lib/types/utils/toJsonMapCollection.d.ts +1 -1
  213. package/package.json +18 -19
  214. package/lib/esm/components/default/ofMapper.js +0 -9
  215. package/lib/esm/components/open-spec/discriminatorMappingMapper.js +0 -6
  216. package/lib/esm/components/open-spec/enumsMapper.js +0 -14
  217. package/lib/esm/components/open-spec/operationInParametersMapper.js +0 -5
  218. package/lib/esm/utils/compile.js +0 -13
  219. package/lib/esm/utils/getJsonEntityStore.js +0 -13
  220. package/lib/types/components/default/classMapper.d.ts +0 -3
  221. package/lib/types/components/default/enumsMapper.d.ts +0 -3
  222. package/lib/types/components/default/lazyRefMapper.d.ts +0 -3
  223. package/lib/types/components/default/ofMapper.d.ts +0 -3
  224. package/lib/types/components/default/requiredMapper.d.ts +0 -3
  225. package/lib/types/components/default/schemaMapper.d.ts +0 -3
  226. package/lib/types/components/open-spec/enumsMapper.d.ts +0 -3
  227. package/lib/types/components/open-spec/nullableMapper.d.ts +0 -3
  228. package/lib/types/components/open-spec/operationInParametersMapper.d.ts +0 -3
  229. package/lib/types/components/open-spec/operationMapper.d.ts +0 -3
  230. package/lib/types/components/open-spec/operationMediaMapper.d.ts +0 -3
  231. package/lib/types/components/open-spec/operationRequestBodyMapper.d.ts +0 -3
  232. package/lib/types/components/open-spec/operationResponseMapper.d.ts +0 -3
  233. package/lib/types/utils/getJsonSchema.d.ts +0 -6
  234. package/lib/esm/{interfaces/IgnoreCallback.js → domain/Generics.js} +0 -0
  235. package/lib/esm/{interfaces/JsonHookContext.js → domain/IgnoreCallback.js} +0 -0
  236. package/lib/esm/{interfaces/JsonOpenSpec.js → domain/JsonHookContext.js} +0 -0
  237. package/lib/esm/{interfaces/JsonSchemaOptions.js → domain/JsonOpenSpec.js} +0 -0
  238. package/lib/{types/components/open-spec/discriminatorMappingMapper.d.ts → esm/domain/JsonSchemaOptions.js} +0 -0
  239. package/lib/esm/{utils → fn/oas}/mapOpenSpec2.js +0 -0
  240. package/lib/esm/{utils → fn/oas}/mapOpenSpec3.js +0 -0
  241. package/lib/esm/{utils → fn/oas}/mapOpenSpecInfo.js +0 -0
  242. package/lib/esm/{utils → fn/oas}/mergeSpec.js +0 -0
  243. package/lib/esm/{utils → fn/oas}/transformToOS2.js +0 -0
  244. package/lib/esm/registries/{enumRegistries.js → enumRegistry.js} +0 -0
  245. package/lib/types/components/{open-spec/generate.d.ts → mappers/open-spec/discriminatorMappingMapper.d.ts} +0 -0
  246. package/lib/types/components/{open-spec → mappers/open-spec}/operationInFilesMapper.d.ts +0 -0
  247. package/lib/types/components/{open-spec → mappers/open-spec}/operationInQueryMapper.d.ts +0 -0
  248. package/lib/types/{interfaces → domain}/IgnoreCallback.d.ts +0 -0
  249. package/lib/types/{interfaces → domain}/JsonHookContext.d.ts +0 -0
  250. package/lib/types/{interfaces → domain}/JsonOpenSpec.d.ts +0 -0
  251. package/lib/types/{utils → fn/oas}/generateSpec.d.ts +1 -1
  252. /package/lib/types/{utils → fn/oas}/mapOpenSpec.d.ts +0 -0
  253. /package/lib/types/{utils → fn/oas}/mapOpenSpec2.d.ts +0 -0
  254. /package/lib/types/{utils → fn/oas}/mapOpenSpec3.d.ts +0 -0
  255. /package/lib/types/{utils → fn/oas}/mapOpenSpecInfo.d.ts +0 -0
  256. /package/lib/types/{utils → fn/oas}/mergeSpec.d.ts +0 -0
@@ -1,4 +1,4 @@
1
- import { JsonEntityStore } from "./JsonEntityStore.js";
1
+ import { JsonEntityStore } from "../../domain/index.js";
2
2
  import type { JsonMethodStore } from "./JsonMethodStore.js";
3
3
  import type { JsonPropertyStore } from "./JsonPropertyStore.js";
4
4
  /**
@@ -21,10 +21,10 @@ import type { JsonPropertyStore } from "./JsonPropertyStore.js";
21
21
  *
22
22
  * ```typescript
23
23
  * // Get class store
24
- * const classStore = JsonEntityStore.from(MyClass);
24
+ * const classStore = s.store(MyClass);
25
25
  *
26
26
  * // Access class schema
27
- * const schema = classStore.schema;
27
+ * const schema = s.get(MyClass);
28
28
  *
29
29
  * // Get all properties
30
30
  * const properties = classStore.children;
@@ -83,5 +83,5 @@ export declare class JsonClassStore extends JsonEntityStore {
83
83
  readonly children: Map<string | number, JsonMethodStore | JsonPropertyStore>;
84
84
  get path(): string;
85
85
  set path(path: string);
86
- protected build(): void;
86
+ build(): void;
87
87
  }
@@ -1,9 +1,9 @@
1
1
  import { Type } from "@tsed/core";
2
- import { type JsonClassStore } from "./JsonClassStore.js";
3
- import { JsonEntityStore, JsonEntityStoreOptions } from "./JsonEntityStore.js";
4
- import { JsonOperation } from "./JsonOperation.js";
5
- import { type JsonParameterStore } from "./JsonParameterStore.js";
6
- import { JsonSchema } from "./JsonSchema.js";
2
+ import { JsonEntityStore, JsonEntityStoreOptions } from "../../domain/JsonEntityStore.js";
3
+ import type { JsonClassStore } from "./JsonClassStore.js";
4
+ import { JsonOperation } from "../../domain/JsonOperation.js";
5
+ import type { JsonParameterStore } from "./JsonParameterStore.js";
6
+ import { JsonSchema } from "../../domain/JsonSchema.js";
7
7
  /**
8
8
  * Configuration options for view rendering.
9
9
  *
@@ -41,7 +41,7 @@ export interface JsonRedirectOptions {
41
41
  *
42
42
  * ```typescript
43
43
  * // Get method store
44
- * const methodStore = JsonEntityStore.from(MyController, "myMethod");
44
+ * const methodStore = getJsonEntityStore(MyController, "myMethod");
45
45
  *
46
46
  * // Access operation for OpenAPI
47
47
  * const operation = methodStore.operation;
@@ -98,18 +98,11 @@ export declare class JsonMethodStore extends JsonEntityStore {
98
98
  get acceptMimes(): string[];
99
99
  set acceptMimes(mimes: string[]);
100
100
  get parameters(): JsonParameterStore[];
101
- get operationPaths(): Map<string, import("./JsonOperation.js").JsonMethodPath>;
101
+ get operationPaths(): Map<string, import("../../domain/JsonOperation.js").JsonMethodPath>;
102
102
  get collectionType(): Type<any>;
103
103
  set collectionType(type: Type<any>);
104
104
  get isCollection(): boolean;
105
105
  get schema(): JsonSchema;
106
- /**
107
- * Get an endpoint.
108
- * @param target
109
- * @param propertyKey
110
- * @param descriptor
111
- */
112
- static get(target: Type<any>, propertyKey: string | symbol, descriptor?: PropertyDescriptor): JsonMethodStore;
113
106
  /**
114
107
  * TODO must be located on JsonOperation level directly
115
108
  * @param status
@@ -123,13 +116,13 @@ export declare class JsonMethodStore extends JsonEntityStore {
123
116
  /**
124
117
  * Append middlewares to the beforeMiddlewares list.
125
118
  * @param args
126
- * @returns {EndpointMetadata}
119
+ * @returns {JsonMethodStore}
127
120
  */
128
121
  before(args: Function[]): this;
129
122
  /**
130
123
  * Append middlewares to the afterMiddlewares list.
131
124
  * @param args
132
- * @returns {EndpointMetadata}
125
+ * @returns {JsonMethodStore}
133
126
  */
134
127
  after(args: Function[]): this;
135
128
  /**
@@ -145,12 +138,12 @@ export declare class JsonMethodStore extends JsonEntityStore {
145
138
  */
146
139
  get<T = any>(key: any): T;
147
140
  getParamTypes(): Record<string, boolean>;
148
- protected build(): void;
141
+ build(): void;
149
142
  }
150
143
  /**
151
- * EndpointMetadata contains metadata about a controller and his method.
144
+ * JsonMethodStore contains metadata about a controller and his method.
152
145
  * Each annotation (@Get, @Body...) attached to a method are stored into endpoint.
153
- * EndpointMetadata converts this metadata to an array which contain arguments to call an Express method.
146
+ * JsonMethodStore converts this metadata to an array which contain arguments to call an Express method.
154
147
  *
155
148
  * Example :
156
149
  *
@@ -165,6 +158,27 @@ export declare class JsonMethodStore extends JsonEntityStore {
165
158
  *```
166
159
  *
167
160
  * @alias JsonMethodStore
161
+ * @deprecated use s.store.method() to retrieve endpoint metadata or JsonMethodStore instead
168
162
  */
169
163
  export type EndpointMetadata = JsonMethodStore;
164
+ /**
165
+ * JsonMethodStore contains metadata about a controller and his method.
166
+ * Each annotation (@Get, @Body...) attached to a method are stored into endpoint.
167
+ * JsonMethodStore converts this metadata to an array which contain arguments to call an Express method.
168
+ *
169
+ * Example :
170
+ *
171
+ *```ts
172
+ * @Controller("/my-path")
173
+ * provide MyClass {
174
+ *
175
+ * @Get("/")
176
+ * @Authenticated()
177
+ * public myMethod(){}
178
+ * }
179
+ *```
180
+ *
181
+ * @alias JsonMethodStore
182
+ * @deprecated use s.store.method() to retrieve endpoint metadata or JsonMethodStore instead
183
+ */
170
184
  export declare const EndpointMetadata: typeof JsonMethodStore;
@@ -1,7 +1,7 @@
1
1
  import { Type } from "@tsed/core";
2
- import { JsonEntityStore, JsonEntityStoreOptions } from "./JsonEntityStore.js";
2
+ import { JsonEntityStore, JsonEntityStoreOptions } from "../../domain/JsonEntityStore.js";
3
3
  import type { JsonMethodStore } from "./JsonMethodStore.js";
4
- import { JsonParameter } from "./JsonParameter.js";
4
+ import { JsonParameter } from "../../domain/JsonParameter.js";
5
5
  /**
6
6
  * Configuration options for creating a JsonParameterStore.
7
7
  *
@@ -128,19 +128,23 @@ export declare class JsonParameterStore extends JsonEntityStore {
128
128
  get required(): boolean;
129
129
  set required(value: boolean);
130
130
  get allowedRequiredValues(): any[];
131
- get schema(): import("./JsonSchema.js").JsonSchema<import("json-schema").JSONSchema7Type>;
131
+ get schema(): import("@tsed/schema").JsonSchema<import("json-schema").JSONSchema7Type>;
132
132
  static getParams<T extends JsonParameterStore = JsonParameterStore>(target: Type<any>, propertyKey: string | symbol): T[];
133
- static get(target: Type<any>, propertyKey: string | symbol, index: number): JsonParameterStore;
134
133
  /**
135
134
  * Check precondition between value, required and allowedRequiredValues to know if the entity is required.
136
135
  * @param value
137
136
  * @returns {boolean}
138
137
  */
139
138
  isRequired(value: any): boolean;
140
- protected build(): void;
139
+ build(): void;
141
140
  }
142
141
  /**
143
142
  * @alias JsonParameterStore
143
+ * @deprecated
144
144
  */
145
145
  export type ParamMetadata = JsonParameterStore;
146
+ /**
147
+ * @alias JsonParameterStore
148
+ * @deprecated
149
+ */
146
150
  export declare const ParamMetadata: typeof JsonParameterStore;
@@ -1,6 +1,5 @@
1
- import { Type } from "@tsed/core";
2
1
  import type { JsonClassStore } from "./JsonClassStore.js";
3
- import { JsonEntityStore } from "./JsonEntityStore.js";
2
+ import { JsonEntityStore } from "../../domain/JsonEntityStore.js";
4
3
  /**
5
4
  * Store for property metadata and schema information.
6
5
  *
@@ -47,11 +46,15 @@ import { JsonEntityStore } from "./JsonEntityStore.js";
47
46
  */
48
47
  export declare class JsonPropertyStore extends JsonEntityStore {
49
48
  readonly parent: JsonClassStore;
50
- static get(target: Type<any>, propertyKey: string | symbol): JsonPropertyStore;
51
- protected build(): void;
49
+ build(): void;
52
50
  }
53
51
  /**
54
52
  * @alias JsonPropertyStore
53
+ * @deprecated
55
54
  */
56
55
  export type PropertyMetadata = JsonPropertyStore;
56
+ /**
57
+ * @alias JsonPropertyStore
58
+ * @deprecated
59
+ */
57
60
  export declare const PropertyMetadata: typeof JsonPropertyStore;
@@ -0,0 +1,2 @@
1
+ declare const _default: import("../../registries/JsonTypesContainer.js").JsonTypesResolver;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: import("../../registries/JsonTypesContainer.js").JsonTypesResolver;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: import("../../registries/JsonTypesContainer.js").JsonTypesResolver;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: import("../../registries/JsonTypesContainer.js").JsonTypesResolver;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: import("../../registries/JsonTypesContainer.js").JsonTypesResolver;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: import("../../registries/JsonTypesContainer.js").JsonTypesResolver;
2
+ export default _default;
@@ -1,5 +1,5 @@
1
- import { Type } from "@tsed/core";
2
1
  import type { JSONSchema6TypeName } from "json-schema";
2
+ import { Type } from "@tsed/core";
3
3
  /**
4
4
  * Allows a property to accept any type or a union of specified types.
5
5
  *
@@ -1,4 +1,4 @@
1
- import { OpenSpecHash, OpenSpecRef, OS3Example } from "@tsed/openspec";
1
+ import { OS3Example, OpenSpecHash, OpenSpecRef } from "@tsed/openspec";
2
2
  /**
3
3
  * Adds named examples for parameters in OpenAPI 3.0 format.
4
4
  *
@@ -1,5 +1,5 @@
1
- import { ValueOf } from "@tsed/core";
2
1
  import { JsonFormatTypes } from "../../domain/JsonFormatTypes.js";
2
+ import { ValueOf } from "@tsed/core";
3
3
  /**
4
4
  * Applies a format validation to string properties using JSON Schema's `format` keyword.
5
5
  *
@@ -1,4 +1,4 @@
1
- import { IgnoreCallback } from "../../interfaces/IgnoreCallback.js";
1
+ import { IgnoreCallback } from "../../domain/IgnoreCallback.js";
2
2
  /**
3
3
  * Ignore the property when JsonMapper serialize the class to a Plain Object JavaScript.
4
4
  *
@@ -1,5 +1,5 @@
1
1
  import { DecoratorParameters } from "@tsed/core";
2
- import type { JsonEntityStore } from "../../domain/JsonEntityStore.js";
2
+ import type { JsonEntityStore } from "../../domain/index.js";
3
3
  /**
4
4
  * Decorator util to compose another decorator. See @@Description@@ decorator implementation for more details.
5
5
  *
@@ -1,10 +1,11 @@
1
1
  import { DecoratorTypes, Type } from "@tsed/core";
2
- import { JsonEntityStore } from "../../domain/JsonEntityStore.js";
2
+ import { JsonEntityStore } from "../../domain/index.js";
3
3
  /**
4
4
  * Declare a new JsonEntityStore class for a specific decorator type.
5
5
  *
6
6
  * @ignore
7
7
  * @param type
8
8
  * @decorator
9
+ * @deprecated
9
10
  */
10
11
  export declare function JsonEntityComponent(type: DecoratorTypes): (target: Type<JsonEntityStore>) => void;
@@ -1,4 +1,4 @@
1
- import { GenericValue } from "../../utils/generics.js";
1
+ import { GenericValue } from "../../domain/Generics.js";
2
2
  /**
3
3
  * @ignore
4
4
  */
@@ -1,4 +1,4 @@
1
- import { JsonHeader, JsonHeaders } from "../../interfaces/JsonOpenSpec.js";
1
+ import { JsonHeader, JsonHeaders } from "../../domain/JsonOpenSpec.js";
2
2
  /**
3
3
  * Sets the response’s HTTP header field to value. To set multiple fields at once, pass an object as the parameter.
4
4
  *
@@ -1,6 +1,5 @@
1
1
  import { Type } from "@tsed/core";
2
- import { JsonParameterTypes } from "../../domain/JsonParameterTypes.js";
3
- import { JsonSchema, JsonSchemaObject } from "../../domain/JsonSchema.js";
2
+ import { JsonParameterTypes, JsonSchema, JsonSchemaObject } from "../../domain/index.js";
4
3
  export interface InChainedDecorators {
5
4
  <T>(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<T>): TypedPropertyDescriptor<T> | void;
6
5
  (target: Object, propertyKey: string | symbol, parameterIndex: number): void;
@@ -1,4 +1,4 @@
1
- import { JsonHeader } from "../../interfaces/JsonOpenSpec.js";
1
+ import { JsonHeader } from "../../domain/JsonOpenSpec.js";
2
2
  /**
3
3
  * Sets the response Location HTTP header to the specified path parameter.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { JsonHeader } from "../../interfaces/JsonOpenSpec.js";
1
+ import { JsonHeader } from "../../domain/JsonOpenSpec.js";
2
2
  /**
3
3
  * Redirects to the URL derived from the specified path, with specified status, a positive integer that corresponds to an HTTP status code . If not specified, status defaults to “302 “Found”.
4
4
  *
@@ -1,8 +1,8 @@
1
+ import { JsonSchema, JsonSchemaObject } from "../../domain/index.js";
1
2
  import { Type } from "@tsed/core";
3
+ import { JsonHeader, JsonHeaders } from "../../domain/JsonOpenSpec.js";
4
+ import { GenericValue } from "../../domain/Generics.js";
2
5
  import { OS3Example } from "@tsed/openspec";
3
- import { JsonSchema, JsonSchemaObject } from "../../domain/JsonSchema.js";
4
- import { JsonHeader, JsonHeaders } from "../../interfaces/JsonOpenSpec.js";
5
- import { GenericValue } from "../../utils/generics.js";
6
6
  export interface ReturnsChainedDecorators {
7
7
  <T>(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<T>): TypedPropertyDescriptor<T> | void;
8
8
  (target: Function): void;
@@ -1,5 +1,5 @@
1
- import { Type } from "@tsed/core";
2
1
  import { ReturnsChainedDecorators } from "./returns.js";
2
+ import { Type } from "@tsed/core";
3
3
  /**
4
4
  * Add responses documentation for a specific status code.
5
5
  *
@@ -0,0 +1,6 @@
1
+ import type { JsonSchema } from "./JsonSchema.js";
2
+ import { Type } from "@tsed/core";
3
+ export type GenericValue = Type<any> | JsonSchema | String | Number | Boolean | Object | Date;
4
+ export type GenericsMap = Record<string, [GenericValue] | [GenericValue, GenericsMap]>;
5
+ export type GenericInputValue = GenericValue | [GenericValue, GenericInput];
6
+ export type GenericInput = Record<string, GenericInputValue>;
@@ -1,13 +1,9 @@
1
1
  import { DecoratorTypes, Store, Type } from "@tsed/core";
2
- import type { JsonClassStore } from "./JsonClassStore.js";
3
- import type { JsonMethodStore } from "./JsonMethodStore.js";
4
- import type { JsonParameterStore } from "./JsonParameterStore.js";
5
- import type { JsonPropertyStore } from "./JsonPropertyStore.js";
2
+ import type { JsonClassStore } from "../components/stores/JsonClassStore.js";
3
+ import type { JsonMethodStore } from "../components/stores/JsonMethodStore.js";
4
+ import type { JsonParameterStore } from "../components/stores/JsonParameterStore.js";
5
+ import type { JsonPropertyStore } from "../components/stores/JsonPropertyStore.js";
6
6
  import type { JsonSchema } from "./JsonSchema.js";
7
- /**
8
- * @ignore
9
- */
10
- export declare const JsonEntitiesContainer: Map<DecoratorTypes, Type<JsonEntityStore>>;
11
7
  /**
12
8
  * Configuration options for creating a JsonEntityStore.
13
9
  *
@@ -54,13 +50,13 @@ export interface JsonEntityStoreOptions {
54
50
  *
55
51
  * ```typescript
56
52
  * // Get store for a class
57
- * const classStore = JsonEntityStore.from(MyClass);
53
+ * const classStore = getJsonEntityStore(MyClass);
58
54
  *
59
55
  * // Get store for a property
60
- * const propStore = JsonEntityStore.from(MyClass, "propertyName");
56
+ * const propStore = getJsonEntityStore(MyClass, "propertyName");
61
57
  *
62
58
  * // Get store for a method parameter
63
- * const paramStore = JsonEntityStore.from(MyClass, "methodName", 0);
59
+ * const paramStore = getJsonEntityStore(MyClass, "methodName", 0);
64
60
  * ```
65
61
  *
66
62
  * ### Architecture
@@ -146,13 +142,6 @@ export declare abstract class JsonEntityStore implements JsonEntityStoreOptions
146
142
  get isDiscriminatorChild(): boolean;
147
143
  get path(): string;
148
144
  set path(path: string);
149
- static from<T extends JsonClassStore = JsonClassStore>(target: Type<any>): T;
150
- static from<T extends JsonPropertyStore = JsonPropertyStore>(target: Type<any> | any, propertyKey: string | symbol): T;
151
- static from<T extends JsonParameterStore = JsonParameterStore>(target: Type<any> | any, propertyKey: string | symbol, index: number): T;
152
- static from<T extends JsonMethodStore = JsonMethodStore>(target: Type<any> | any, propertyKey: string | symbol, descriptor: PropertyDescriptor): T;
153
- static from<T extends JsonEntityStore = JsonEntityStore>(...args: any[]): T;
154
- static fromMethod<T extends JsonMethodStore = JsonMethodStore>(target: any, propertyKey: string | symbol): T;
155
- static get(target: Type<any>, propertyKey: string | symbol, descriptor?: any): JsonEntityStore;
156
145
  isGetterOnly(): boolean | undefined;
157
146
  get<T = any>(key: string, defaultValue?: any): T;
158
147
  set(key: string, value?: any): Store;
@@ -162,6 +151,6 @@ export declare abstract class JsonEntityStore implements JsonEntityStoreOptions
162
151
  is(input: DecoratorTypes.PROP): this is JsonPropertyStore;
163
152
  is(input: DecoratorTypes.METHOD): this is JsonMethodStore;
164
153
  is(input: DecoratorTypes.PARAM): this is JsonParameterStore;
165
- protected abstract build(): void;
154
+ abstract build(): void;
166
155
  protected buildType(type: any): void;
167
156
  }
@@ -37,6 +37,6 @@ export declare class JsonLazyRef {
37
37
  readonly isLazyRef = true;
38
38
  constructor(getType: () => Type<any>);
39
39
  get target(): Type<any>;
40
- get schema(): import("./JsonSchema.js").JsonSchema<import("json-schema").JSONSchema7Type>;
40
+ get schema(): import("@tsed/schema").JsonSchema<import("json-schema").JSONSchema7Type>;
41
41
  get name(): string;
42
42
  }
@@ -1,4 +1,4 @@
1
- import { JsonSchemaOptions } from "../interfaces/JsonSchemaOptions.js";
1
+ import { JsonSchemaOptions } from "./JsonSchemaOptions.js";
2
2
  /**
3
3
  * Base class for JSON document representations using a Map structure.
4
4
  *
@@ -1,6 +1,6 @@
1
- import { OS3MediaType } from "@tsed/openspec";
2
1
  import { JsonMap } from "./JsonMap.js";
3
2
  import { JsonSchema } from "./JsonSchema.js";
3
+ import { OS3MediaType } from "@tsed/openspec";
4
4
  /**
5
5
  * Represents a media type definition for HTTP request or response bodies.
6
6
  *
@@ -1,5 +1,5 @@
1
- import { OpenSpecSecurity, OpenSpecTag, OS3Operation } from "@tsed/openspec";
2
- import { JsonHeader } from "../interfaces/JsonOpenSpec.js";
1
+ import { OS3Operation, OpenSpecSecurity, OpenSpecTag } from "@tsed/openspec";
2
+ import { JsonHeader } from "./JsonOpenSpec.js";
3
3
  import { JsonMap } from "./JsonMap.js";
4
4
  import { JsonParameter } from "./JsonParameter.js";
5
5
  import { JsonResponse } from "./JsonResponse.js";
@@ -1,6 +1,6 @@
1
- import { Type } from "@tsed/core";
2
- import { JsonMethodStore } from "./JsonMethodStore.js";
3
1
  import { JsonMethodPath, JsonOperation } from "./JsonOperation.js";
2
+ import type { JsonMethodStore } from "../components/stores/JsonMethodStore.js";
3
+ import { Type } from "@tsed/core";
4
4
  /**
5
5
  * Represents a fully resolved HTTP route combining controller and method metadata.
6
6
  *
@@ -69,7 +69,7 @@ export declare class JsonOperationRoute<Entity extends JsonMethodStore = JsonMet
69
69
  get name(): string;
70
70
  get className(): string;
71
71
  get methodClassName(): string;
72
- get parameters(): import("./JsonParameterStore.js").JsonParameterStore[];
72
+ get parameters(): import("@tsed/schema").JsonParameterStore[];
73
73
  get propertyKey(): string;
74
74
  get propertyName(): string;
75
75
  get store(): import("@tsed/core").Store;
@@ -1,7 +1,7 @@
1
- import { OpenSpecHash, OpenSpecRef, OS3Example, OS3Parameter } from "@tsed/openspec";
2
- import { JsonSchemaOptions } from "../interfaces/JsonSchemaOptions.js";
1
+ import { OS3Example, OS3Parameter, OpenSpecHash, OpenSpecRef } from "@tsed/openspec";
3
2
  import { JsonMap } from "./JsonMap.js";
4
3
  import { JsonSchema } from "./JsonSchema.js";
4
+ import { JsonSchemaOptions } from "./JsonSchemaOptions.js";
5
5
  /**
6
6
  * Represents an HTTP operation parameter for OpenAPI specifications.
7
7
  *
@@ -25,7 +25,7 @@ import { JsonSchema } from "./JsonSchema.js";
25
25
  * .in("path")
26
26
  * .required(true)
27
27
  * .description("The user identifier")
28
- * .schema(JsonSchema.from(String));
28
+ * .schema(s.string());
29
29
  * ```
30
30
  *
31
31
  * ### Key Features
@@ -1,4 +1,4 @@
1
- import { OpenSpecHash, OS3MediaType, OS3RequestBody } from "@tsed/openspec";
1
+ import { OS3MediaType, OS3RequestBody, OpenSpecHash } from "@tsed/openspec";
2
2
  import { JsonMap } from "./JsonMap.js";
3
3
  import { JsonSchema } from "./JsonSchema.js";
4
4
  /**
@@ -1,5 +1,5 @@
1
1
  import { OS3MediaType, OS3Response } from "@tsed/openspec";
2
- import { JsonHeader } from "../interfaces/JsonOpenSpec.js";
2
+ import { JsonHeader } from "./JsonOpenSpec.js";
3
3
  import { JsonMap } from "./JsonMap.js";
4
4
  import { JsonMedia } from "./JsonMedia.js";
5
5
  import { JsonSchema } from "./JsonSchema.js";
@@ -1,15 +1,15 @@
1
- import { Type, ValueOf } from "@tsed/core";
2
- import { Hooks } from "@tsed/hooks";
3
- import type { JSONSchema7, JSONSchema7Definition, JSONSchema7Type, JSONSchema7TypeName, JSONSchema7Version } from "json-schema";
4
- import { VendorKeys } from "../constants/VendorKeys.js";
5
- import { IgnoreCallback } from "../interfaces/IgnoreCallback.js";
6
- import { JsonSchemaOptions } from "../interfaces/JsonSchemaOptions.js";
7
- import { type GenericsMap, GenericValue } from "../utils/generics.js";
8
1
  import { AliasMap, AliasType } from "./JsonAliasMap.js";
2
+ import type { GenericValue, GenericsMap } from "./Generics.js";
3
+ import type { Infer, PropsToShape, SchemaKey, SchemaMerge, SchemaOmit, SchemaPartial, SchemaPick, UnionToIntersection } from "./types.js";
4
+ import type { JSONSchema7, JSONSchema7Definition, JSONSchema7Type, JSONSchema7TypeName, JSONSchema7Version } from "json-schema";
5
+ import { Type, ValueOf } from "@tsed/core";
9
6
  import { Discriminator } from "./JsonDiscriminator.js";
7
+ import { Hooks } from "@tsed/hooks";
8
+ import { IgnoreCallback } from "./IgnoreCallback.js";
10
9
  import { JsonFormatTypes } from "./JsonFormatTypes.js";
11
10
  import { JsonLazyRef } from "./JsonLazyRef.js";
12
- import type { Infer, PropsToShape, SchemaKey, SchemaMerge, SchemaOmit, SchemaPartial, SchemaPick, UnionToIntersection } from "./types.js";
11
+ import { JsonSchemaOptions } from "./JsonSchemaOptions.js";
12
+ import { VendorKeys } from "../constants/VendorKeys.js";
13
13
  /**
14
14
  * Extended JSON Schema object supporting TypeScript types and Ts.ED enhancements.
15
15
  *
@@ -72,7 +72,7 @@ export type AnyJsonSchema<T = any> = JsonSchemaObject | JSONSchema7 | JsonSchema
72
72
  * email: string;
73
73
  * }
74
74
  *
75
- * const userSchema = JsonSchema.from(User);
75
+ * const userSchema = s.from(User);
76
76
  *
77
77
  * // Generate JSON Schema output
78
78
  * const jsonSchema = userSchema.toJSON();
@@ -223,22 +223,22 @@ export declare class JsonSchema<T = JSONSchema7Type> extends Map<string, any> {
223
223
  *
224
224
  * ```typescript
225
225
  * // From a class
226
- * const schema1 = JsonSchema.from(User);
226
+ * const schema1 = s.from(User);
227
227
  *
228
228
  * // From a primitive
229
- * const schema2 = JsonSchema.from(String);
229
+ * const schema2 = s.from(String);
230
230
  *
231
231
  * // From a schema object
232
- * const schema3 = JsonSchema.from({type: "string", minLength: 1});
232
+ * const schema3 = s.string().minLength(1);
233
233
  *
234
234
  * // From existing schema (no-op)
235
- * const schema4 = JsonSchema.from(schema1);
235
+ * const schema4 = s.from(schema1);
236
236
  * ```
237
237
  *
238
238
  * @param item - The input to convert to a JsonSchema
239
239
  * @returns A JsonSchema instance representing the input
240
+ * @deprecated
240
241
  */
241
- static from(item: Partial<JsonSchemaObject> | Type<any> | JsonSchema | undefined): JsonSchema<JSONSchema7Type>;
242
242
  static add<Keys extends keyof JsonSchema>(property: Keys, method: JsonSchema[Keys]): typeof JsonSchema;
243
243
  /**
244
244
  * Check if the schema has a property.
@@ -354,12 +354,16 @@ export declare class JsonSchema<T = JSONSchema7Type> extends Map<string, any> {
354
354
  * ```typescript
355
355
  * // For Paginated<User>
356
356
  * schema.genericOf([User]);
357
+ * schema.genericOf(User);
358
+ * schema.genericOf({T: [User]});
357
359
  * ```
358
360
  *
359
- * @param generics - Arrays of generic type values to apply
361
+ * @param generics - Generic bindings to apply
360
362
  * @returns This schema instance for method chaining
361
363
  */
362
- genericOf(...generics: GenericValue[][]): this;
364
+ genericOf(generics: GenericsMap): this;
365
+ genericOf(generic: GenericValue): this;
366
+ genericOf(...generics: Array<GenericValue[] | GenericValue>): this;
363
367
  /**
364
368
  * Mark this schema as nullable or non-nullable.
365
369
  *
@@ -565,7 +569,7 @@ export declare class JsonSchema<T = JSONSchema7Type> extends Map<string, any> {
565
569
  * Set the items' schema for array/set collections
566
570
  * @param items The schema for array/set items
567
571
  */
568
- items<I = JSONSchema7Type>(items: JsonSchema<I> | AnyJsonSchema | AnyJsonSchema[]): JsonSchema<T extends Array<any> ? I[] : T extends Set<any> ? Set<I> : I>;
572
+ items<I = JSONSchema7Type>(items: JsonSchema<I> | AnyJsonSchema | AnyJsonSchema[], init?: boolean): JsonSchema<T extends Array<any> ? I[] : T extends Set<any> ? Set<I> : I>;
569
573
  $comment(comment: string): this;
570
574
  /**
571
575
  * Must be a non-negative integer.
@@ -646,7 +650,7 @@ export declare class JsonSchema<T = JSONSchema7Type> extends Map<string, any> {
646
650
  * The default value is an empty schema that allows any value for additional properties.
647
651
  * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.20
648
652
  */
649
- additionalProperties<V>(additionalProperties: boolean | AnyJsonSchema | JsonSchema<V>): JsonSchema<Map<string, V>>;
653
+ additionalProperties<V>(additionalProperties: boolean | AnyJsonSchema | JsonSchema<V>, init?: boolean): JsonSchema<Map<string, V>>;
650
654
  /**
651
655
  * This attribute defines a schema for all properties that are not explicitly defined in an object type definition.
652
656
  * If specified, the value MUST be a schema or a boolean.
@@ -787,7 +791,7 @@ export declare class JsonSchema<T = JSONSchema7Type> extends Map<string, any> {
787
791
  toObject(options?: JsonSchemaOptions): any;
788
792
  toJSON(options?: JsonSchemaOptions): any;
789
793
  assign(obj: Partial<JSONSchema7> | JsonSchema | Record<string, unknown>): this;
790
- set(key: string, value: any): this;
794
+ set(key: string, value: any, force?: boolean): this;
791
795
  /**
792
796
  * Return the JSON type as string
793
797
  */
@@ -812,11 +816,13 @@ export declare class JsonSchema<T = JSONSchema7Type> extends Map<string, any> {
812
816
  getRefSchema(): JsonSchema<JSONSchema7Type> | undefined;
813
817
  propertyKey(s: string): this;
814
818
  getPropertyKey(): string | symbol | undefined;
815
- target(target: any): void;
819
+ target(target: any): this;
816
820
  isRequiredValue(property: string, value: any): boolean;
821
+ toCollection(): this;
822
+ unsetType(): this;
817
823
  protected setManyOf(keyword: "oneOf" | "anyOf" | "allOf", value: (AnyJsonSchema | null)[]): this | undefined;
818
- protected mapToJsonSchema(item: any[]): JsonSchema[];
819
- protected mapToJsonSchema(item: any): JsonSchema;
824
+ protected toSchema(item: any[]): JsonSchema[];
825
+ protected toSchema(item: any): JsonSchema;
820
826
  protected mapGenerics(jsonSchema: unknown, generics: GenericValue[][]): GenericsMap;
821
827
  protected mapProperties(properties: Record<string, any>): any;
822
828
  }