@akbarsafari00/bonyan-types 5.52.1-fa.4

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 (319) hide show
  1. package/LICENSE +37 -0
  2. package/README.md +9 -0
  3. package/dist/core/api.d.ts +3 -0
  4. package/dist/core/api.d.ts.map +1 -0
  5. package/dist/core/commands/index.d.ts +6 -0
  6. package/dist/core/commands/index.d.ts.map +1 -0
  7. package/dist/core/config/admin.d.ts +156 -0
  8. package/dist/core/config/admin.d.ts.map +1 -0
  9. package/dist/core/config/api.d.ts +38 -0
  10. package/dist/core/config/api.d.ts.map +1 -0
  11. package/dist/core/config/database.d.ts +78 -0
  12. package/dist/core/config/database.d.ts.map +1 -0
  13. package/dist/core/config/features.d.ts +14 -0
  14. package/dist/core/config/features.d.ts.map +1 -0
  15. package/dist/core/config/index.d.ts +11 -0
  16. package/dist/core/config/index.d.ts.map +1 -0
  17. package/dist/core/config/middlewares.d.ts +3 -0
  18. package/dist/core/config/middlewares.d.ts.map +1 -0
  19. package/dist/core/config/openapi.d.ts +35 -0
  20. package/dist/core/config/openapi.d.ts.map +1 -0
  21. package/dist/core/config/plugin.d.ts +8 -0
  22. package/dist/core/config/plugin.d.ts.map +1 -0
  23. package/dist/core/config/server.d.ts +102 -0
  24. package/dist/core/config/server.d.ts.map +1 -0
  25. package/dist/core/config/shared.d.ts +8 -0
  26. package/dist/core/config/shared.d.ts.map +1 -0
  27. package/dist/core/config/typescript.d.ts +10 -0
  28. package/dist/core/config/typescript.d.ts.map +1 -0
  29. package/dist/core/container.d.ts +5 -0
  30. package/dist/core/container.d.ts.map +1 -0
  31. package/dist/core/controller.d.ts +7 -0
  32. package/dist/core/controller.d.ts.map +1 -0
  33. package/dist/core/core-api/controller.d.ts +47 -0
  34. package/dist/core/core-api/controller.d.ts.map +1 -0
  35. package/dist/core/core-api/index.d.ts +4 -0
  36. package/dist/core/core-api/index.d.ts.map +1 -0
  37. package/dist/core/core-api/router.d.ts +64 -0
  38. package/dist/core/core-api/router.d.ts.map +1 -0
  39. package/dist/core/core-api/service.d.ts +69 -0
  40. package/dist/core/core-api/service.d.ts.map +1 -0
  41. package/dist/core/index.d.ts +15 -0
  42. package/dist/core/index.d.ts.map +1 -0
  43. package/dist/core/middleware.d.ts +15 -0
  44. package/dist/core/middleware.d.ts.map +1 -0
  45. package/dist/core/module.d.ts +26 -0
  46. package/dist/core/module.d.ts.map +1 -0
  47. package/dist/core/plugin.d.ts +6 -0
  48. package/dist/core/plugin.d.ts.map +1 -0
  49. package/dist/core/policy.d.ts +15 -0
  50. package/dist/core/policy.d.ts.map +1 -0
  51. package/dist/core/route.d.ts +54 -0
  52. package/dist/core/route.d.ts.map +1 -0
  53. package/dist/core/router.d.ts +15 -0
  54. package/dist/core/router.d.ts.map +1 -0
  55. package/dist/core/service.d.ts +4 -0
  56. package/dist/core/service.d.ts.map +1 -0
  57. package/dist/core/strapi.d.ts +162 -0
  58. package/dist/core/strapi.d.ts.map +1 -0
  59. package/dist/data/component.d.ts +21 -0
  60. package/dist/data/component.d.ts.map +1 -0
  61. package/dist/data/constants.d.ts +5 -0
  62. package/dist/data/constants.d.ts.map +1 -0
  63. package/dist/data/content-type.d.ts +26 -0
  64. package/dist/data/content-type.d.ts.map +1 -0
  65. package/dist/data/entity.d.ts +15 -0
  66. package/dist/data/entity.d.ts.map +1 -0
  67. package/dist/data/index.d.ts +5 -0
  68. package/dist/data/index.d.ts.map +1 -0
  69. package/dist/index.d.ts +20 -0
  70. package/dist/index.d.ts.map +1 -0
  71. package/dist/index.js +3 -0
  72. package/dist/index.js.map +1 -0
  73. package/dist/index.mjs +2 -0
  74. package/dist/index.mjs.map +1 -0
  75. package/dist/internal/index.d.ts +13 -0
  76. package/dist/internal/index.d.ts.map +1 -0
  77. package/dist/internal/namespace.d.ts +78 -0
  78. package/dist/internal/namespace.d.ts.map +1 -0
  79. package/dist/internal/registry.d.ts +8 -0
  80. package/dist/internal/registry.d.ts.map +1 -0
  81. package/dist/internal/uid.d.ts +116 -0
  82. package/dist/internal/uid.d.ts.map +1 -0
  83. package/dist/modules/ai.d.ts +34 -0
  84. package/dist/modules/ai.d.ts.map +1 -0
  85. package/dist/modules/audit-logs.d.ts +6 -0
  86. package/dist/modules/audit-logs.d.ts.map +1 -0
  87. package/dist/modules/auth.d.ts +25 -0
  88. package/dist/modules/auth.d.ts.map +1 -0
  89. package/dist/modules/content-api.d.ts +92 -0
  90. package/dist/modules/content-api.d.ts.map +1 -0
  91. package/dist/modules/core-store.d.ts +28 -0
  92. package/dist/modules/core-store.d.ts.map +1 -0
  93. package/dist/modules/cron.d.ts +27 -0
  94. package/dist/modules/cron.d.ts.map +1 -0
  95. package/dist/modules/custom-fields.d.ts +25 -0
  96. package/dist/modules/custom-fields.d.ts.map +1 -0
  97. package/dist/modules/documents/component-extension.d.ts +73 -0
  98. package/dist/modules/documents/component-extension.d.ts.map +1 -0
  99. package/dist/modules/documents/draft-and-publish.d.ts +12 -0
  100. package/dist/modules/documents/draft-and-publish.d.ts.map +1 -0
  101. package/dist/modules/documents/index.d.ts +27 -0
  102. package/dist/modules/documents/index.d.ts.map +1 -0
  103. package/dist/modules/documents/middleware.d.ts +14 -0
  104. package/dist/modules/documents/middleware.d.ts.map +1 -0
  105. package/dist/modules/documents/params/attributes/id.d.ts +4 -0
  106. package/dist/modules/documents/params/attributes/id.d.ts.map +1 -0
  107. package/dist/modules/documents/params/attributes/index.d.ts +79 -0
  108. package/dist/modules/documents/params/attributes/index.d.ts.map +1 -0
  109. package/dist/modules/documents/params/attributes/relations.d.ts +40 -0
  110. package/dist/modules/documents/params/attributes/relations.d.ts.map +1 -0
  111. package/dist/modules/documents/params/data.d.ts +67 -0
  112. package/dist/modules/documents/params/data.d.ts.map +1 -0
  113. package/dist/modules/documents/params/document-engine.d.ts +34 -0
  114. package/dist/modules/documents/params/document-engine.d.ts.map +1 -0
  115. package/dist/modules/documents/params/fields.d.ts +61 -0
  116. package/dist/modules/documents/params/fields.d.ts.map +1 -0
  117. package/dist/modules/documents/params/filters/index.d.ts +61 -0
  118. package/dist/modules/documents/params/filters/index.d.ts.map +1 -0
  119. package/dist/modules/documents/params/filters/operators.d.ts +9 -0
  120. package/dist/modules/documents/params/filters/operators.d.ts.map +1 -0
  121. package/dist/modules/documents/params/index.d.ts +162 -0
  122. package/dist/modules/documents/params/index.d.ts.map +1 -0
  123. package/dist/modules/documents/params/locale.d.ts +4 -0
  124. package/dist/modules/documents/params/locale.d.ts.map +1 -0
  125. package/dist/modules/documents/params/pagination.d.ts +11 -0
  126. package/dist/modules/documents/params/pagination.d.ts.map +1 -0
  127. package/dist/modules/documents/params/populate.d.ts +86 -0
  128. package/dist/modules/documents/params/populate.d.ts.map +1 -0
  129. package/dist/modules/documents/params/search.d.ts +2 -0
  130. package/dist/modules/documents/params/search.d.ts.map +1 -0
  131. package/dist/modules/documents/params/sort.d.ts +87 -0
  132. package/dist/modules/documents/params/sort.d.ts.map +1 -0
  133. package/dist/modules/documents/params/status.d.ts +12 -0
  134. package/dist/modules/documents/params/status.d.ts.map +1 -0
  135. package/dist/modules/documents/plugin.d.ts +11 -0
  136. package/dist/modules/documents/plugin.d.ts.map +1 -0
  137. package/dist/modules/documents/result/document-engine.d.ts +34 -0
  138. package/dist/modules/documents/result/document-engine.d.ts.map +1 -0
  139. package/dist/modules/documents/result/index.d.ts +93 -0
  140. package/dist/modules/documents/result/index.d.ts.map +1 -0
  141. package/dist/modules/documents/service-instance.d.ts +96 -0
  142. package/dist/modules/documents/service-instance.d.ts.map +1 -0
  143. package/dist/modules/entity-service/index.d.ts +87 -0
  144. package/dist/modules/entity-service/index.d.ts.map +1 -0
  145. package/dist/modules/entity-service/params/attributes/id.d.ts +3 -0
  146. package/dist/modules/entity-service/params/attributes/id.d.ts.map +1 -0
  147. package/dist/modules/entity-service/params/attributes/index.d.ts +71 -0
  148. package/dist/modules/entity-service/params/attributes/index.d.ts.map +1 -0
  149. package/dist/modules/entity-service/params/attributes/literals.d.ts +8 -0
  150. package/dist/modules/entity-service/params/attributes/literals.d.ts.map +1 -0
  151. package/dist/modules/entity-service/params/attributes/relation.d.ts +40 -0
  152. package/dist/modules/entity-service/params/attributes/relation.d.ts.map +1 -0
  153. package/dist/modules/entity-service/params/attributes/utils.d.ts +9 -0
  154. package/dist/modules/entity-service/params/attributes/utils.d.ts.map +1 -0
  155. package/dist/modules/entity-service/params/data.d.ts +52 -0
  156. package/dist/modules/entity-service/params/data.d.ts.map +1 -0
  157. package/dist/modules/entity-service/params/fields.d.ts +61 -0
  158. package/dist/modules/entity-service/params/fields.d.ts.map +1 -0
  159. package/dist/modules/entity-service/params/filters/index.d.ts +96 -0
  160. package/dist/modules/entity-service/params/filters/index.d.ts.map +1 -0
  161. package/dist/modules/entity-service/params/filters/operators.d.ts +9 -0
  162. package/dist/modules/entity-service/params/filters/operators.d.ts.map +1 -0
  163. package/dist/modules/entity-service/params/index.d.ts +123 -0
  164. package/dist/modules/entity-service/params/index.d.ts.map +1 -0
  165. package/dist/modules/entity-service/params/pagination.d.ts +10 -0
  166. package/dist/modules/entity-service/params/pagination.d.ts.map +1 -0
  167. package/dist/modules/entity-service/params/populate.d.ts +69 -0
  168. package/dist/modules/entity-service/params/populate.d.ts.map +1 -0
  169. package/dist/modules/entity-service/params/search.d.ts +2 -0
  170. package/dist/modules/entity-service/params/search.d.ts.map +1 -0
  171. package/dist/modules/entity-service/params/sort.d.ts +95 -0
  172. package/dist/modules/entity-service/params/sort.d.ts.map +1 -0
  173. package/dist/modules/entity-service/plugin.d.ts +11 -0
  174. package/dist/modules/entity-service/plugin.d.ts.map +1 -0
  175. package/dist/modules/entity-service/result.d.ts +78 -0
  176. package/dist/modules/entity-service/result.d.ts.map +1 -0
  177. package/dist/modules/entity-validator.d.ts +21 -0
  178. package/dist/modules/entity-validator.d.ts.map +1 -0
  179. package/dist/modules/event-hub.d.ts +16 -0
  180. package/dist/modules/event-hub.d.ts.map +1 -0
  181. package/dist/modules/features.d.ts +12 -0
  182. package/dist/modules/features.d.ts.map +1 -0
  183. package/dist/modules/fetch.d.ts +11 -0
  184. package/dist/modules/fetch.d.ts.map +1 -0
  185. package/dist/modules/index.d.ts +24 -0
  186. package/dist/modules/index.d.ts.map +1 -0
  187. package/dist/modules/mcp.d.ts +216 -0
  188. package/dist/modules/mcp.d.ts.map +1 -0
  189. package/dist/modules/metrics.d.ts +8 -0
  190. package/dist/modules/metrics.d.ts.map +1 -0
  191. package/dist/modules/permissions.d.ts +14 -0
  192. package/dist/modules/permissions.d.ts.map +1 -0
  193. package/dist/modules/request-context.d.ts +6 -0
  194. package/dist/modules/request-context.d.ts.map +1 -0
  195. package/dist/modules/sanitizers.d.ts +8 -0
  196. package/dist/modules/sanitizers.d.ts.map +1 -0
  197. package/dist/modules/server.d.ts +29 -0
  198. package/dist/modules/server.d.ts.map +1 -0
  199. package/dist/modules/session-manager.d.ts +70 -0
  200. package/dist/modules/session-manager.d.ts.map +1 -0
  201. package/dist/modules/validators.d.ts +8 -0
  202. package/dist/modules/validators.d.ts.map +1 -0
  203. package/dist/modules/webhook-runner.d.ts +19 -0
  204. package/dist/modules/webhook-runner.d.ts.map +1 -0
  205. package/dist/modules/webhook-store.d.ts +21 -0
  206. package/dist/modules/webhook-store.d.ts.map +1 -0
  207. package/dist/plugin/config/index.d.ts +3 -0
  208. package/dist/plugin/config/index.d.ts.map +1 -0
  209. package/dist/plugin/config/strapi-admin/index.d.ts +8 -0
  210. package/dist/plugin/config/strapi-admin/index.d.ts.map +1 -0
  211. package/dist/plugin/config/strapi-server/config.d.ts +8 -0
  212. package/dist/plugin/config/strapi-server/config.d.ts.map +1 -0
  213. package/dist/plugin/config/strapi-server/content-types.d.ts +11 -0
  214. package/dist/plugin/config/strapi-server/content-types.d.ts.map +1 -0
  215. package/dist/plugin/config/strapi-server/controllers.d.ts +8 -0
  216. package/dist/plugin/config/strapi-server/controllers.d.ts.map +1 -0
  217. package/dist/plugin/config/strapi-server/index.d.ts +21 -0
  218. package/dist/plugin/config/strapi-server/index.d.ts.map +1 -0
  219. package/dist/plugin/config/strapi-server/lifecycle.d.ts +8 -0
  220. package/dist/plugin/config/strapi-server/lifecycle.d.ts.map +1 -0
  221. package/dist/plugin/config/strapi-server/routes.d.ts +11 -0
  222. package/dist/plugin/config/strapi-server/routes.d.ts.map +1 -0
  223. package/dist/plugin/index.d.ts +40 -0
  224. package/dist/plugin/index.d.ts.map +1 -0
  225. package/dist/public/index.d.ts +6 -0
  226. package/dist/public/index.d.ts.map +1 -0
  227. package/dist/public/registries.d.ts +68 -0
  228. package/dist/public/registries.d.ts.map +1 -0
  229. package/dist/public/shared.d.ts +61 -0
  230. package/dist/public/shared.d.ts.map +1 -0
  231. package/dist/schema/attribute/base.d.ts +92 -0
  232. package/dist/schema/attribute/base.d.ts.map +1 -0
  233. package/dist/schema/attribute/common.d.ts +29 -0
  234. package/dist/schema/attribute/common.d.ts.map +1 -0
  235. package/dist/schema/attribute/constants.d.ts +12 -0
  236. package/dist/schema/attribute/constants.d.ts.map +1 -0
  237. package/dist/schema/attribute/definitions/biginteger.d.ts +19 -0
  238. package/dist/schema/attribute/definitions/biginteger.d.ts.map +1 -0
  239. package/dist/schema/attribute/definitions/blocks.d.ts +80 -0
  240. package/dist/schema/attribute/definitions/blocks.d.ts.map +1 -0
  241. package/dist/schema/attribute/definitions/boolean.d.ts +19 -0
  242. package/dist/schema/attribute/definitions/boolean.d.ts.map +1 -0
  243. package/dist/schema/attribute/definitions/component.d.ts +25 -0
  244. package/dist/schema/attribute/definitions/component.d.ts.map +1 -0
  245. package/dist/schema/attribute/definitions/date-time.d.ts +18 -0
  246. package/dist/schema/attribute/definitions/date-time.d.ts.map +1 -0
  247. package/dist/schema/attribute/definitions/date.d.ts +18 -0
  248. package/dist/schema/attribute/definitions/date.d.ts.map +1 -0
  249. package/dist/schema/attribute/definitions/decimal.d.ts +19 -0
  250. package/dist/schema/attribute/definitions/decimal.d.ts.map +1 -0
  251. package/dist/schema/attribute/definitions/dynamic-zone.d.ts +25 -0
  252. package/dist/schema/attribute/definitions/dynamic-zone.d.ts.map +1 -0
  253. package/dist/schema/attribute/definitions/email.d.ts +19 -0
  254. package/dist/schema/attribute/definitions/email.d.ts.map +1 -0
  255. package/dist/schema/attribute/definitions/enumeration.d.ts +22 -0
  256. package/dist/schema/attribute/definitions/enumeration.d.ts.map +1 -0
  257. package/dist/schema/attribute/definitions/float.d.ts +19 -0
  258. package/dist/schema/attribute/definitions/float.d.ts.map +1 -0
  259. package/dist/schema/attribute/definitions/index.d.ts +23 -0
  260. package/dist/schema/attribute/definitions/index.d.ts.map +1 -0
  261. package/dist/schema/attribute/definitions/integer.d.ts +19 -0
  262. package/dist/schema/attribute/definitions/integer.d.ts.map +1 -0
  263. package/dist/schema/attribute/definitions/json.d.ts +17 -0
  264. package/dist/schema/attribute/definitions/json.d.ts.map +1 -0
  265. package/dist/schema/attribute/definitions/media.d.ts +24 -0
  266. package/dist/schema/attribute/definitions/media.d.ts.map +1 -0
  267. package/dist/schema/attribute/definitions/password.d.ts +18 -0
  268. package/dist/schema/attribute/definitions/password.d.ts.map +1 -0
  269. package/dist/schema/attribute/definitions/relation.d.ts +167 -0
  270. package/dist/schema/attribute/definitions/relation.d.ts.map +1 -0
  271. package/dist/schema/attribute/definitions/richtext.d.ts +18 -0
  272. package/dist/schema/attribute/definitions/richtext.d.ts.map +1 -0
  273. package/dist/schema/attribute/definitions/string.d.ts +28 -0
  274. package/dist/schema/attribute/definitions/string.d.ts.map +1 -0
  275. package/dist/schema/attribute/definitions/text.d.ts +23 -0
  276. package/dist/schema/attribute/definitions/text.d.ts.map +1 -0
  277. package/dist/schema/attribute/definitions/time.d.ts +18 -0
  278. package/dist/schema/attribute/definitions/time.d.ts.map +1 -0
  279. package/dist/schema/attribute/definitions/timestamp.d.ts +18 -0
  280. package/dist/schema/attribute/definitions/timestamp.d.ts.map +1 -0
  281. package/dist/schema/attribute/definitions/uid.d.ts +31 -0
  282. package/dist/schema/attribute/definitions/uid.d.ts.map +1 -0
  283. package/dist/schema/attribute/index.d.ts +7 -0
  284. package/dist/schema/attribute/index.d.ts.map +1 -0
  285. package/dist/schema/attribute/options.d.ts +221 -0
  286. package/dist/schema/attribute/options.d.ts.map +1 -0
  287. package/dist/schema/attribute/utils.d.ts +101 -0
  288. package/dist/schema/attribute/utils.d.ts.map +1 -0
  289. package/dist/schema/index.d.ts +144 -0
  290. package/dist/schema/index.d.ts.map +1 -0
  291. package/dist/struct/index.d.ts +3 -0
  292. package/dist/struct/index.d.ts.map +1 -0
  293. package/dist/struct/schema-definition.d.ts +10 -0
  294. package/dist/struct/schema-definition.d.ts.map +1 -0
  295. package/dist/struct/schema.d.ts +286 -0
  296. package/dist/struct/schema.d.ts.map +1 -0
  297. package/dist/uid/index.d.ts +168 -0
  298. package/dist/uid/index.d.ts.map +1 -0
  299. package/dist/utils/array.d.ts +80 -0
  300. package/dist/utils/array.d.ts.map +1 -0
  301. package/dist/utils/constants.d.ts +67 -0
  302. package/dist/utils/constants.d.ts.map +1 -0
  303. package/dist/utils/expression.d.ts +490 -0
  304. package/dist/utils/expression.d.ts.map +1 -0
  305. package/dist/utils/function.d.ts +21 -0
  306. package/dist/utils/function.d.ts.map +1 -0
  307. package/dist/utils/guard.d.ts +90 -0
  308. package/dist/utils/guard.d.ts.map +1 -0
  309. package/dist/utils/index.d.ts +236 -0
  310. package/dist/utils/index.d.ts.map +1 -0
  311. package/dist/utils/json.d.ts +119 -0
  312. package/dist/utils/json.d.ts.map +1 -0
  313. package/dist/utils/object.d.ts +180 -0
  314. package/dist/utils/object.d.ts.map +1 -0
  315. package/dist/utils/string.d.ts +190 -0
  316. package/dist/utils/string.d.ts.map +1 -0
  317. package/dist/utils/tuple.d.ts +19 -0
  318. package/dist/utils/tuple.d.ts.map +1 -0
  319. package/package.json +68 -0
@@ -0,0 +1,286 @@
1
+ import type { Attribute } from '../schema';
2
+ import type * as UID from '../uid';
3
+ export type ContentTypeKind = 'collectionType' | 'singleType';
4
+ export type ModelType = 'contentType' | 'component';
5
+ export type Schema = CollectionTypeSchema | SingleTypeSchema | ComponentSchema;
6
+ /**
7
+ * A loaded instance of a Strapi Schema accessible to the server.
8
+ */
9
+ export interface BaseSchema {
10
+ /**
11
+ * The unique identifier of the Schema. This identifier is a combined type encompassing both ContentType and Component UID types.
12
+ *
13
+ * It is mainly used when dealing with either content types or components in a situation where the context is not specific.
14
+ */
15
+ uid: UID.Schema;
16
+ /**
17
+ * This is an identifier type that helps differentiate between a 'contentType' and 'component'.
18
+ * This distinction aids in communication where the ModelType needs to be specified explicitly.
19
+ */
20
+ modelType: ModelType;
21
+ /**
22
+ * Serves as the public name of the schema. Often utilized in referencing a specific schema (e.g. in the database).
23
+ */
24
+ modelName: string;
25
+ /**
26
+ * This global identifier acts as a unique reference to the schema across varying scopes and contexts.
27
+ */
28
+ globalId: string;
29
+ /**
30
+ * Contains options specific to plugins. It is an optional property and stores configurations that are read by the plugins associated with this Schema.
31
+ */
32
+ pluginOptions?: SchemaPluginOptions;
33
+ /**
34
+ * Encapsulates all core options related to Strapi features for a given Schema.
35
+ */
36
+ options?: SchemaOptions;
37
+ /**
38
+ * Optional property. Specifies the custom table name for the Schema if any.
39
+ */
40
+ collectionName?: string;
41
+ /**
42
+ * What plugin this schema belongs to if any
43
+ */
44
+ plugin?: string;
45
+ /**
46
+ * Contains information related to naming and display characteristics of the Schema.
47
+ */
48
+ info: SchemaInfo;
49
+ /**
50
+ * Houses a comprehensive collection of attributes for this Schema.
51
+ *
52
+ * Each attribute has a unique string key and corresponding value should be any Attribute type instance.
53
+ */
54
+ attributes: SchemaAttributes;
55
+ }
56
+ /**
57
+ * Metadata for an image uploaded through the admin upload provider (same shape as admin logos).
58
+ */
59
+ export interface PreviewImage {
60
+ url: string;
61
+ hash?: string;
62
+ provider?: string;
63
+ width?: number;
64
+ height?: number;
65
+ ext?: string;
66
+ size?: number;
67
+ name?: string;
68
+ }
69
+ /**
70
+ * Admin preview image reference: a git-portable static path/CDN URL, or an uploaded descriptor.
71
+ */
72
+ export type PreviewImageValue = string | PreviewImage;
73
+ /**
74
+ * Comprises naming and display parameters to customize a Schema's representation.
75
+ */
76
+ export interface SchemaInfo {
77
+ /**
78
+ * Sets the default nomenclature for the Admin Panel. Acts as the label while identifying
79
+ * the schema or interacting with it within the admin panel. For example, used as a label
80
+ * for fields, table columns, and menu items.
81
+ */
82
+ displayName: string;
83
+ /**
84
+ * Delineates the purpose of the model, clarifying its intended usage or its function. This
85
+ * property is optional and is primarily meant for further documentation to provide better
86
+ * context and understanding of the schema.
87
+ */
88
+ description?: string;
89
+ /**
90
+ * Specifies the visual identifier - an icon, for the schema inside the admin panel. It eases
91
+ * recognition and improves navigation. The value should be any valid @strapi/icon name. This
92
+ * property is optional, and if omitted, a default icon might be used by the interface.
93
+ */
94
+ icon?: string;
95
+ /**
96
+ * Optional preview image for admin UI surfaces (e.g. the dynamic zone component picker).
97
+ *
98
+ * - **String** — root-relative path or absolute CDN URL. Git-portable when the file is
99
+ * committed with the app (e.g. `/_component-screenshots/hero.png`) or hosted externally.
100
+ * - **`PreviewImage`** — descriptor from a CTB upload; bytes live on the upload provider
101
+ * (same metadata shape as admin logos). CTB upload UI is not implemented yet.
102
+ *
103
+ * When omitted, the picker falls back to the `icon`.
104
+ */
105
+ preview?: PreviewImageValue;
106
+ }
107
+ /**
108
+ * `SchemaAttributes` is a mapping of attribute keys to their corresponding values.
109
+ *
110
+ * These keys and values define the structure and characteristics of a Strapi schema.
111
+ */
112
+ export type SchemaAttributes = Record<string, Attribute.AnyAttribute>;
113
+ /**
114
+ * Contains various options employed during runtime to tweak certain aspects of Strapi features.
115
+ *
116
+ * Each property under this interface can enable, disable or modify a specific feature or functionality associated with a schema.
117
+ */
118
+ export interface SchemaOptions {
119
+ /**
120
+ * Toggles the review workflow feature on or off.
121
+ *
122
+ * A review workflow is a process that describes the stages a document must go through from creation to publication.
123
+ *
124
+ * @remark This option is Enterprise Edition Exclusive.
125
+ */
126
+ reviewWorkflows?: boolean;
127
+ /**
128
+ * Determines if creator fields can be populated.
129
+ *
130
+ * When enabled, this feature will allow populating data about the admin user who created a specific document entry.
131
+ */
132
+ populateCreatorFields?: boolean;
133
+ /**
134
+ * May be used for providing specific notes or annotations of the schema.
135
+ */
136
+ comment?: string;
137
+ /**
138
+ * Can be utilized for setting a particular version of schema related to the review-workflow feature.
139
+ *
140
+ * @deprecated As of v5, this is deprecated and will likely be removed soon.
141
+ */
142
+ version?: string;
143
+ /**
144
+ * Used to enable or disable the draft and publish feature.
145
+ * This would decide whether the changes made to a document are published immediately or saved as a draft for later.
146
+ */
147
+ draftAndPublish?: boolean;
148
+ }
149
+ /**
150
+ * Provides a flexible configuration method for Strapi plugins.
151
+ *
152
+ * In Strapi, plugins extend the core functionality and enhance features of the application. Each plugin may require
153
+ * prerequisite settings or configurations for successful functioning. `SchemaPluginOptions` facilitates this by storing these configurations
154
+ * as key-value pairs where the key corresponds to the name of the plugin, and the value defines the respective settings of that plugin.
155
+ *
156
+ * @remark The keys/values of configurations are not explicitly defined and are manually defined in each schema definition.
157
+ *
158
+ * @example
159
+ * Using `SchemaPluginOptions` in the schema definition:
160
+ *
161
+ * ```typescript
162
+ * import type { Struct } from '@strapi/types';
163
+ *
164
+ * const strapiPluginOptions: Struct.SchemaPluginOptions = {
165
+ * 'plugin-foo': {
166
+ * prop1: string;
167
+ * prop2: boolean;
168
+ * },
169
+ * 'plugin-bar': {
170
+ * prop1: string;
171
+ * prop2: boolean;
172
+ * },
173
+ * };
174
+ *
175
+ * const articleSchema: Struct.BaseSchema = {
176
+ * uid: 'article',
177
+ * modelType: 'contentType',
178
+ * modelName: 'Article',
179
+ * globalId: 'Article',
180
+ * pluginOptions: strapiPluginOptions,
181
+ * // Other schema properties...
182
+ * };
183
+ * ```
184
+ *
185
+ */
186
+ export interface SchemaPluginOptions {
187
+ [key: string]: unknown;
188
+ }
189
+ /**
190
+ * Serves as a layout for a content type.
191
+ *
192
+ * Inherits and enhances various properties from the `BaseSchema`, the `ContentTypeSchema` is a unique derivative of the base schema that distinguishes itself with additional properties.
193
+ */
194
+ export interface ContentTypeSchema extends BaseSchema {
195
+ /**
196
+ * Forces the `modelType` to be a `contentType`.
197
+ *
198
+ * @remark Helpful to distinguish a {@link ContentTypeSchema} from a {@link ComponentSchema}
199
+ */
200
+ modelType: 'contentType';
201
+ /**
202
+ * Unique identifier associated with the content type. It acts as a reference to work with data structures that are specifically identified by the content type's UID.
203
+ */
204
+ uid: UID.ContentType;
205
+ /**
206
+ * Classifies the content type as 'collection-type' or 'single-type'.
207
+ */
208
+ kind: ContentTypeKind;
209
+ /**
210
+ * Brings together attributes related to naming and display characteristics like singular name and plural name of the content type. These names are typically used in user interfaces where these entries are displayed.
211
+ */
212
+ info: ContentTypeSchemaInfo;
213
+ /**
214
+ * Optional attribute to indicate the indexes to be created on the database for this content type.
215
+ *
216
+ * @internal
217
+ */
218
+ indexes?: unknown[];
219
+ /**
220
+ * Optional attribute to indicate the foreignKeys to be created on the database for this content type.
221
+ *
222
+ * @internal
223
+ */
224
+ foreignKeys?: unknown[];
225
+ }
226
+ /**
227
+ * Contains naming properties specific to a specific content type.
228
+ */
229
+ export interface ContentTypeSchemaInfo extends SchemaInfo {
230
+ /**
231
+ * Indicates how a single instance of the content type should be labeled.
232
+ */
233
+ singularName: string;
234
+ /**
235
+ * Provides a human-friendly label for referring to multiple instances of the content type.
236
+ */
237
+ pluralName: string;
238
+ }
239
+ /**
240
+ * Schema that represents a collection of content types' entry in the system.
241
+ */
242
+ export interface CollectionTypeSchema extends ContentTypeSchema {
243
+ /**
244
+ * Explicitly sets the kind of content type schema to 'collectionType'.
245
+ *
246
+ * This signifies that the content type is organized in a collection, handling multiple entries.
247
+ */
248
+ kind: 'collectionType';
249
+ }
250
+ /**
251
+ * Schema that represents a single of content type's entry in the system.
252
+ */
253
+ export interface SingleTypeSchema extends ContentTypeSchema {
254
+ /**
255
+ * Explicitly sets the kind of content type schema to 'singleType'.
256
+ *
257
+ * This signifies that the content type has a single entry.
258
+ */
259
+ kind: 'singleType';
260
+ }
261
+ /**
262
+ * Serves as a layout for a component type.
263
+ *
264
+ * Inherits and enhances various properties from the `BaseSchema`, the `ComponentSchema` is a unique derivative of the base schema that distinguishes itself with additional properties.
265
+ */
266
+ export interface ComponentSchema extends BaseSchema {
267
+ /**
268
+ * Forces the `modelType` to be a `component`.
269
+ *
270
+ * @remark Helpful to distinguish a {@link ComponentSchema} from a {@link ContentTypeSchema}
271
+ */
272
+ modelType: 'component';
273
+ /**
274
+ * A unique identifier for the component.
275
+ *
276
+ * It uses `UID.Component` type which encapsulates unique identifiers for any component defined in the public component registry.
277
+ */
278
+ uid: UID.Component;
279
+ /**
280
+ * A classification field for the component.
281
+ *
282
+ * This string type field is utilized to categorize components into different categories based on their function or feature.
283
+ */
284
+ category: string;
285
+ }
286
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/struct/schema.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,168 @@
1
+ import type * as Internal from '../internal';
2
+ import type * as Struct from '../struct';
3
+ import type { Constants, Guard, Object, Extends, Or } from '../utils';
4
+ import type * as Public from '../public';
5
+ /**
6
+ * Combines ContentType and Component UID types in a single union type.
7
+ *
8
+ * `UID.Schema` provides the ability to deal with both content types and components through one streamlined type.
9
+ *
10
+ * It hinges on underlying schema registries, which aggregates and maps unique identifiers to their respective schemas.
11
+ *
12
+ * This type would typically be used where the context is not particular about dealing with content types or components exclusively but rather any kind of schema.
13
+ *
14
+ * @example
15
+ * Let's assume we need a function that processes schema irrespective of whether it's ContenType or Component.
16
+ *
17
+ * ```typescript
18
+ * import type { UID } from '@strapi/types';
19
+ *
20
+ * function processSchema(schemaID: UID.Schema) {
21
+ * // Implementation goes here...
22
+ * }
23
+ *
24
+ * // Now, calling processSchema() with uid of content type
25
+ * processSchema('api::foo.foo');
26
+ *
27
+ * // And calling processSchema() with uid of component
28
+ * processSchema('default.foo');
29
+ * ```
30
+ *
31
+ * @see {@link ContentType} Identifier for content types based on the public registry.
32
+ * @see {@link Component} Identifier for components based on the public registry.
33
+ */
34
+ export type Schema = ContentType | Component;
35
+ /**
36
+ * Unique identifiers for any content-type defined in the public content-type registry.
37
+ *
38
+ * Useful when it's required to work with data structures that can only be identified by the underlying content-type UID.
39
+ *
40
+ * When no content-types are declared in the registry, it uses the generic {@link Internal.UID.ContentType} instead.
41
+ *
42
+ * @example
43
+ * Here's an example of how to use the `UID.ContentType` type:
44
+ *
45
+ * ```typescript
46
+ * import type { UID } from '@strapi/types';
47
+ *
48
+ * // Assume we have a function that requires a ContentType UID
49
+ * function fetchSchema(uid: UID.ContentType) {
50
+ * // Implementation goes here...
51
+ * }
52
+ *
53
+ * // Now you can pass the unique identifier for a content type to fetch its schema
54
+ * fetchSchema('api::foo.foo');
55
+ * ```
56
+ * @see {@link Public.ContentTypeSchemas} Content-type public registry.
57
+ * @see {@link UID.ContentType} ContentType UID format definition.
58
+ */
59
+ export type ContentType = Internal.Registry.Keys<Public.ContentTypeSchemas, Internal.UID.ContentType>;
60
+ /**
61
+ * Unique identifiers for any component defined in the public component registry.
62
+ *
63
+ * Useful when it's required to work with data structures that can only be identified by the underlying component UID.
64
+ *
65
+ * When no component are declared in the registry, it uses the generic {@link Internal.UID.Component} instead.
66
+ *
67
+ * @example
68
+ * Here's an example of how to use the `UID.Component` type:
69
+ *
70
+ * ```typescript
71
+ * import type { UID } from '@strapi/types';
72
+ *
73
+ * // Assume we have a function that requires a Component UID
74
+ * function fetchSchema(uid: UID.Component) {
75
+ * // Implementation goes here...
76
+ * }
77
+ *
78
+ * // Now you can pass the unique identifier for a component to fetch its schema
79
+ * fetchSchema('default.foo');
80
+ * ```
81
+ * @see {@link Public.ComponentSchemas} Component public registry.
82
+ * @see {@link UID.Component} Component UID format definition.
83
+ */
84
+ export type Component = Internal.Registry.Keys<Public.ComponentSchemas, Internal.UID.Component>;
85
+ /**
86
+ * Obtains a union of every component's category from the public component registry.
87
+ *
88
+ * It utilizes [conditional types inference](https://www.typescriptlang.org/docs/handbook/2/conditional-types.html#inferring-within-conditional-types) to extract the category name from the components' UID.
89
+ *
90
+ * The component UID format is a string that follows a specific pattern defined by {@link Internal.UID.Component}.
91
+ * If a type extends `Internal.UID.Component`, it implies that it has a structure with `TCategory` string as the category name of the component.
92
+ *
93
+ * @see {@link Internal.UID.Component} for more details on how the component's unique identifier is structured.
94
+ */
95
+ export type ComponentCategory = Component extends Internal.UID.Component<infer TCategory> ? TCategory : never;
96
+ /**
97
+ * Collection-Type UID based on the public content-type registry
98
+ *
99
+ * If no collection type is found, it fallbacks to a generic content-type UID.
100
+ */
101
+ export type CollectionType = Guard.Never<Extract<Object.KeysBy<Public.ContentTypeSchemas, Struct.CollectionTypeSchema>, ContentType>, Internal.UID.ContentType>;
102
+ /**
103
+ * Single-Type UID based on the public content-type registry
104
+ *
105
+ * If no single type is found, it falls back to a generic content-type UID.
106
+ */
107
+ export type SingleType = Guard.Never<Extract<Object.KeysBy<Public.ContentTypeSchemas, Struct.SingleTypeSchema>, ContentType>, Internal.UID.ContentType>;
108
+ /**
109
+ * Service UID based on the public service registry
110
+ *
111
+ * @see {Public.Services}
112
+ */
113
+ export type Service = Internal.Registry.Keys<Public.Services, Internal.UID.Service>;
114
+ /**
115
+ * Controller UID based on the public service registry
116
+ *
117
+ * @see {Public.Controllers}
118
+ */
119
+ export type Controller = Internal.Registry.Keys<Public.Controllers, Internal.UID.Controller>;
120
+ /**
121
+ * Policy UID based on the public service registry
122
+ *
123
+ * @see {Public.Policies}
124
+ */
125
+ export type Policy = Internal.Registry.Keys<Public.Policies, Internal.UID.Policy>;
126
+ /**
127
+ * Middleware UID based on the public service registry
128
+ *
129
+ * @see {Public.Middlewares}
130
+ */
131
+ export type Middleware = Internal.Registry.Keys<Public.Middlewares, Internal.UID.Middleware>;
132
+ /**
133
+ * Verifies if a certain schema UIDs correspond to a collection type.
134
+ *
135
+ * Given a schema UID, it checks if it matches the {@link CollectionType} UID type. Since {@link CollectionType}
136
+ * can resolve to the more generic {@link ContentType} type, we also need to check that the associated
137
+ * schema extends the {@link Struct.CollectionTypeSchema} data structure.
138
+ *
139
+ * @template TSchemaUID - The UID of the schema
140
+ */
141
+ export type IsCollectionType<TSchemaUID extends Schema> = TSchemaUID extends CollectionType ? Extends<Public.ContentTypeSchemas[TSchemaUID], Struct.CollectionTypeSchema> : Constants.False;
142
+ /**
143
+ * Verifies if a certain schema UIDs correspond to a single type.
144
+ *
145
+ * Given a schema UID, it checks if it matches the {@link SingleType} UID type. Since {@link SingleType}
146
+ * can resolve to the more generic {@link ContentType} type, we also need to check that the associated
147
+ * schema extends the {@link Struct.CollectionTypeSchema} data structure.
148
+ *
149
+ * @template TSchemaUID - The UID of the schema
150
+ */
151
+ export type IsSingleType<TSchemaUID extends Schema> = TSchemaUID extends SingleType ? Extends<Public.ContentTypeSchemas[TSchemaUID], Struct.SingleTypeSchema> : Constants.False;
152
+ /**
153
+ * Verifies if a certain schema UIDs correspond to a component.
154
+ *
155
+ * Given a schema UID, it checks if it matches the {@link Component} UID type.
156
+ *
157
+ * @template TSchemaUID - The UID of the schema
158
+ */
159
+ export type IsComponent<TSchemaUID extends Schema> = TSchemaUID extends Component ? Extends<Public.ComponentSchemas[TSchemaUID], Struct.ComponentSchema> : Constants.False;
160
+ /**
161
+ * Verifies if a certain schema UIDs correspond to a content-type.
162
+ *
163
+ * Given a schema UID, it checks if it matches the {@link ContentType} UID type.
164
+ *
165
+ * @template TSchemaUID - The UID of the schema
166
+ */
167
+ export type IsContentType<TSchemaUID extends Schema> = TSchemaUID extends ContentType ? Or<IsCollectionType<TSchemaUID>, IsSingleType<TSchemaUID>> : Constants.False;
168
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/uid/index.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,80 @@
1
+ import type { Extends, Not } from '.';
2
+ /**
3
+ * The `Values` type extracts the type of the values stored in arrays or tuples.
4
+ *
5
+ * @returns A union of every value contained in the array/tuple
6
+ *
7
+ * @template TCollection - The array-like structure from which the values' type will be extracted.
8
+ *
9
+ * @example
10
+ * Let's suppose we have an array of numbers, and we would like to extract the type its values
11
+ *
12
+ * ```typescript
13
+ * type MyTuple = [1, 2, 3, 4];
14
+ *
15
+ * type TupleValues = Values<MyTuple>; // TupleValues: 1 | 2 | 3 | 4
16
+ * ```
17
+ *
18
+ * @example
19
+ * Now, let's suppose we have a regular TypeScript array, and we would like to extract its value
20
+ *
21
+ * ```typescript
22
+ * type MyArray = (string | number)[];
23
+ *
24
+ * type ArrayValues = Values<MyArray>; // ArrayValues: string | number
25
+ * ```
26
+ */
27
+ export type Values<TCollection extends Array<unknown>> = TCollection extends Array<infer TValues> ? TValues : never;
28
+ /**
29
+ * Checks if a given array ({@link TCollection}) is empty.
30
+ *
31
+ * @template TCollection - The array to be checked. It should extend 'Array<unknown>'.
32
+ *
33
+ * @example
34
+ * Validate an array that is empty:
35
+ * ```typescript
36
+ * type EmptyArray = [];
37
+ *
38
+ * type IsEmptyCheck = IsEmpty<EmptyArray>;
39
+ * // Result: Constants.True
40
+ * ```
41
+ *
42
+ * @example
43
+ * Validate an array that is not empty:
44
+ * ```typescript
45
+ * type NonEmptyArray = [1, 2, 3];
46
+ *
47
+ * type IsEmptyCheck = IsEmpty<NonEmptyArray>;
48
+ * // Result: Constants.False
49
+ * ```
50
+ */
51
+ export type IsEmpty<TCollection extends Array<unknown>> = Extends<TCollection['length'], 0>;
52
+ /**
53
+ * Checks if a given array ({@link TCollection}) is not empty.
54
+ *
55
+ * @template TCollection - The collection (array) that needs to be checked if it's not empty. It must extend 'Array<unknown>'.
56
+ *
57
+ * @see {@link Not}
58
+ * @see {@link IsEmpty}
59
+ *
60
+ * @example
61
+ * Checking non-empty array:
62
+ * ```typescript
63
+ * type NonEmptyArray = [1, 2, 3];
64
+ *
65
+ * // This type checks will result to True because
66
+ * // 'NonEmptyArray' is indeed not empty.
67
+ * type IsNotEmptyCheck = IsNotEmpty<NonEmptyArray>;
68
+ * ```
69
+ *
70
+ * @example
71
+ * Checking empty array:
72
+ * ```typescript
73
+ * type EmptyArray = [];
74
+ *
75
+ * // This type checks will result to False because 'EmptyArray' is empty.
76
+ * type IsNotEmptyCheck = IsNotEmpty<EmptyArray>;
77
+ * ```
78
+ */
79
+ export type IsNotEmpty<TCollection extends Array<unknown>> = Not<IsEmpty<TCollection>>;
80
+ //# sourceMappingURL=array.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../src/utils/array.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC;AAEtC;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,MAAM,MAAM,CAAC,WAAW,SAAS,KAAK,CAAC,OAAO,CAAC,IACnD,WAAW,SAAS,KAAK,CAAC,MAAM,OAAO,CAAC,GAAG,OAAO,GAAG,KAAK,CAAC;AAE7D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,MAAM,OAAO,CAAC,WAAW,SAAS,KAAK,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;AAE5F;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,MAAM,UAAU,CAAC,WAAW,SAAS,KAAK,CAAC,OAAO,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC"}
@@ -0,0 +1,67 @@
1
+ import type * as Internal from '../internal';
2
+ import type * as UID from '../uid';
3
+ import type { NotStrictEqual, Or } from '.';
4
+ export type True = true;
5
+ export type False = false;
6
+ export type BooleanValue = True | False;
7
+ /**
8
+ * Determine if there's been an extension or change in either Component Registry or Content-Type Registry.
9
+ *
10
+ * It applies the compound boolean OR operation on the results derived from {@link IsComponentRegistryExtended} and {@link IsContentTypeRegistryExtended}.
11
+ *
12
+ * If either or both results are true (indicating a change or extension in the corresponding registry), it returns {@link True}; otherwise, it returns {@link False}.
13
+ *
14
+ * @example
15
+ * ```typescript
16
+ * // A change or extension in both the Component Registry and the Content-Type Registry
17
+ * type Example1 = AreSchemaRegistriesExtended; // Result: Constants.True
18
+ *
19
+ * // A change or extension only in the Component Registry
20
+ * type Example2 = IsComponentRegistryExtended; // Result: Constants.True
21
+ *
22
+ * // A change or extension only in the Content-Type Registry
23
+ * type Example3 = IsContentTypeRegistryExtended; // Result: Constants.True
24
+
25
+ * // No change or extension in either registries
26
+ * type Example4 = AreSchemaRegistriesExtended; // Result: Constants.False
27
+ * ```
28
+ *
29
+ * @see IsComponentRegistryExtended
30
+ * @see IsContentTypeRegistryExtended
31
+ */
32
+ export type AreSchemaRegistriesExtended = Or<IsComponentRegistryExtended, IsContentTypeRegistryExtended>;
33
+ /**
34
+ * Evaluate if the internal UIDs ({@link Internal.UID.ContentType}) and public ones ({@link UID.ContentType}) are not identical.
35
+ *
36
+ * If these two types are not the same, it indicates an extension or change has occurred in the public Content-Type Registry.
37
+ *
38
+ * The type leverages {@link NotStrictEqual} to perform this comparison accurately. The result is a type-level
39
+ * boolean that denotes whether there is a deviation between the two Content-Type representations.
40
+ *
41
+ * @returns Either [Constants.True](@link Constants.True) if the Content-Type Registry has been extended, else [Constants.False](@link Constants.False).
42
+ *
43
+ * @remark
44
+ * This type is particularly useful when there is a need to verify whether there have been extensions or changes to the Content-Type Registry
45
+ * after initially creating it.
46
+ *
47
+ * It allows developers to perform this check at the type level and decide what type should be resolved depending on the context
48
+ */
49
+ export type IsContentTypeRegistryExtended = NotStrictEqual<Internal.UID.ContentType, UID.ContentType>;
50
+ /**
51
+ * Evaluate if the internal UIDs ({@link Internal.UID.Component}) and public ones ({@link UID.Component}) are not identical.
52
+ *
53
+ * If these two types are not the same, it indicates an extension or change has occurred in the public Component Registry.
54
+ *
55
+ * The type leverages {@link NotStrictEqual} to perform this comparison accurately. The result is a type-level
56
+ * boolean that denotes whether there is a deviation between the two Content-Type representations.
57
+ *
58
+ * @return - Either {@link True} if the Component Registry has been extended, else {@link False}.
59
+ *
60
+ * @remark
61
+ * This type is particularly useful when there is a need to verify whether there have been extensions or changes to the Component Registry
62
+ * after initially creating it.
63
+ *
64
+ * It allows developers to perform this check at the type level and decide what type should be resolved depending on the context
65
+ */
66
+ export type IsComponentRegistryExtended = NotStrictEqual<Internal.UID.Component, UID.Component>;
67
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/utils/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,QAAQ,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,KAAK,GAAG,MAAM,QAAQ,CAAC;AAEnC,OAAO,KAAK,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM,GAAG,CAAC;AAE5C,MAAM,MAAM,IAAI,GAAG,IAAI,CAAC;AAExB,MAAM,MAAM,KAAK,GAAG,KAAK,CAAC;AAE1B,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,KAAK,CAAC;AAExC;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,MAAM,2BAA2B,GAAG,EAAE,CAC1C,2BAA2B,EAC3B,6BAA6B,CAC9B,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,6BAA6B,GAAG,cAAc,CACxD,QAAQ,CAAC,GAAG,CAAC,WAAW,EACxB,GAAG,CAAC,WAAW,CAChB,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,2BAA2B,GAAG,cAAc,CAAC,QAAQ,CAAC,GAAG,CAAC,SAAS,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC"}