tsondb 0.5.18 → 0.6.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 (222) hide show
  1. package/dist/src/bin/tsondb.js +1 -1
  2. package/dist/src/index.d.ts +1 -1
  3. package/dist/src/node/config.d.ts +20 -0
  4. package/dist/src/node/config.js +5 -0
  5. package/dist/src/node/index.d.ts +3 -2
  6. package/dist/src/node/index.js +13 -8
  7. package/dist/src/node/renderers/jsonschema/render.d.ts +1 -1
  8. package/dist/src/node/renderers/jsonschema/render.js +12 -7
  9. package/dist/src/node/renderers/ts/render.d.ts +1 -1
  10. package/dist/src/node/renderers/ts/render.js +12 -6
  11. package/dist/src/node/schema/Node.d.ts +100 -29
  12. package/dist/src/node/schema/Node.js +268 -61
  13. package/dist/src/node/schema/Schema.js +96 -1
  14. package/dist/src/node/schema/TypeParameter.d.ts +7 -9
  15. package/dist/src/node/schema/TypeParameter.js +7 -5
  16. package/dist/src/node/schema/declarations/Declaration.d.ts +10 -28
  17. package/dist/src/node/schema/declarations/Declaration.js +8 -110
  18. package/dist/src/node/schema/declarations/EntityDecl.d.ts +48 -48
  19. package/dist/src/node/schema/declarations/EntityDecl.js +15 -12
  20. package/dist/src/node/schema/declarations/EnumDecl.d.ts +14 -17
  21. package/dist/src/node/schema/declarations/EnumDecl.js +12 -12
  22. package/dist/src/node/schema/declarations/TypeAliasDecl.d.ts +8 -14
  23. package/dist/src/node/schema/declarations/TypeAliasDecl.js +10 -11
  24. package/dist/src/node/schema/index.d.ts +0 -2
  25. package/dist/src/node/schema/index.js +0 -1
  26. package/dist/src/node/schema/types/Type.d.ts +19 -42
  27. package/dist/src/node/schema/types/Type.js +29 -167
  28. package/dist/src/node/schema/types/generic/ArrayType.d.ts +5 -14
  29. package/dist/src/node/schema/types/generic/ArrayType.js +15 -20
  30. package/dist/src/node/schema/types/generic/EnumType.d.ts +5 -17
  31. package/dist/src/node/schema/types/generic/EnumType.js +12 -20
  32. package/dist/src/node/schema/types/generic/ObjectType.d.ts +5 -19
  33. package/dist/src/node/schema/types/generic/ObjectType.js +11 -15
  34. package/dist/src/node/schema/types/primitives/BooleanType.d.ts +7 -8
  35. package/dist/src/node/schema/types/primitives/BooleanType.js +5 -4
  36. package/dist/src/node/schema/types/primitives/DateType.d.ts +6 -8
  37. package/dist/src/node/schema/types/primitives/DateType.js +5 -4
  38. package/dist/src/node/schema/types/primitives/FloatType.d.ts +9 -21
  39. package/dist/src/node/schema/types/primitives/FloatType.js +5 -4
  40. package/dist/src/node/schema/types/primitives/IntegerType.d.ts +9 -21
  41. package/dist/src/node/schema/types/primitives/IntegerType.js +5 -4
  42. package/dist/src/node/schema/types/primitives/StringType.d.ts +6 -10
  43. package/dist/src/node/schema/types/primitives/StringType.js +5 -4
  44. package/dist/src/node/schema/types/references/ChildEntitiesType.d.ts +18 -0
  45. package/dist/src/node/schema/types/references/ChildEntitiesType.js +18 -0
  46. package/dist/src/node/schema/types/references/IncludeIdentifierType.d.ts +7 -13
  47. package/dist/src/node/schema/types/references/IncludeIdentifierType.js +12 -12
  48. package/dist/src/node/schema/types/references/NestedEntityMapType.d.ts +7 -17
  49. package/dist/src/node/schema/types/references/NestedEntityMapType.js +11 -13
  50. package/dist/src/node/schema/types/references/ReferenceIdentifierType.d.ts +4 -10
  51. package/dist/src/node/schema/types/references/ReferenceIdentifierType.js +3 -5
  52. package/dist/src/node/schema/types/references/TypeArgumentType.d.ts +5 -10
  53. package/dist/src/node/schema/types/references/TypeArgumentType.js +10 -5
  54. package/dist/src/node/server/api/declarations.js +24 -6
  55. package/dist/src/node/server/api/index.js +11 -0
  56. package/dist/src/node/server/api/instances.js +9 -6
  57. package/dist/src/node/server/index.d.ts +6 -1
  58. package/dist/src/node/server/index.js +7 -3
  59. package/dist/src/node/server/init.d.ts +2 -1
  60. package/dist/src/node/server/init.js +11 -11
  61. package/dist/src/node/server/utils/childInstances.d.ts +4 -0
  62. package/dist/src/node/server/utils/childInstances.js +41 -0
  63. package/dist/src/node/server/utils/instanceOperations.d.ts +8 -0
  64. package/dist/src/node/server/utils/instanceOperations.js +107 -0
  65. package/dist/src/node/server/utils/locales.d.ts +2 -0
  66. package/dist/src/node/server/utils/locales.js +8 -0
  67. package/dist/src/node/utils/childInstances.d.ts +32 -0
  68. package/dist/src/node/utils/childInstances.js +164 -0
  69. package/dist/src/node/utils/displayName.d.ts +2 -1
  70. package/dist/src/node/utils/displayName.js +5 -4
  71. package/dist/src/node/utils/files.d.ts +5 -0
  72. package/dist/src/node/utils/files.js +9 -0
  73. package/dist/src/node/utils/instanceOperations.d.ts +14 -0
  74. package/dist/src/node/utils/instanceOperations.js +88 -0
  75. package/dist/src/node/utils/instances.d.ts +1 -1
  76. package/dist/src/node/utils/instances.js +12 -6
  77. package/dist/src/node/utils/references.d.ts +3 -1
  78. package/dist/src/node/utils/references.js +43 -18
  79. package/dist/src/node/utils/referencesWorker.d.ts +5 -0
  80. package/dist/src/node/utils/referencesWorker.js +22 -0
  81. package/dist/src/node/utils/workers.d.ts +15 -0
  82. package/dist/src/node/utils/workers.js +90 -0
  83. package/dist/src/shared/api.d.ts +14 -1
  84. package/dist/src/shared/schema/Node.d.ts +63 -0
  85. package/dist/src/shared/schema/Node.js +128 -0
  86. package/dist/src/shared/schema/TypeParameter.d.ts +9 -0
  87. package/dist/src/shared/schema/TypeParameter.js +2 -0
  88. package/dist/src/shared/schema/declarations/Declaration.d.ts +21 -0
  89. package/dist/src/shared/schema/declarations/Declaration.js +4 -0
  90. package/dist/src/shared/schema/declarations/EntityDecl.d.ts +32 -0
  91. package/dist/src/shared/schema/declarations/EntityDecl.js +8 -0
  92. package/dist/src/shared/schema/declarations/EnumDecl.d.ts +11 -0
  93. package/dist/src/shared/schema/declarations/EnumDecl.js +9 -0
  94. package/dist/src/shared/schema/declarations/TypeAliasDecl.d.ts +11 -0
  95. package/dist/src/shared/schema/declarations/TypeAliasDecl.js +7 -0
  96. package/dist/src/shared/schema/types/ArrayType.d.ts +11 -0
  97. package/dist/src/shared/schema/types/ArrayType.js +8 -0
  98. package/dist/src/shared/schema/types/BooleanType.d.ts +7 -0
  99. package/dist/src/shared/schema/types/BooleanType.js +2 -0
  100. package/dist/src/shared/schema/types/ChildEntitiesType.d.ts +8 -0
  101. package/dist/src/shared/schema/types/ChildEntitiesType.js +2 -0
  102. package/dist/src/shared/schema/types/DateType.d.ts +8 -0
  103. package/dist/src/shared/schema/types/DateType.js +2 -0
  104. package/dist/src/shared/schema/types/EnumType.d.ts +14 -0
  105. package/dist/src/shared/schema/types/EnumType.js +28 -0
  106. package/dist/src/shared/schema/types/FloatType.d.ts +11 -0
  107. package/dist/src/shared/schema/types/FloatType.js +2 -0
  108. package/dist/src/shared/schema/types/IncludeIdentifierType.d.ts +11 -0
  109. package/dist/src/shared/schema/types/IncludeIdentifierType.js +13 -0
  110. package/dist/src/shared/schema/types/IntegerType.d.ts +11 -0
  111. package/dist/src/shared/schema/types/IntegerType.js +2 -0
  112. package/dist/src/shared/schema/types/NestedEntityMapType.d.ts +17 -0
  113. package/dist/src/shared/schema/types/NestedEntityMapType.js +14 -0
  114. package/dist/src/shared/schema/types/ObjectType.d.ts +19 -0
  115. package/dist/src/shared/schema/types/ObjectType.js +14 -0
  116. package/dist/src/shared/schema/types/ReferenceIdentifierType.d.ts +8 -0
  117. package/dist/src/shared/schema/types/ReferenceIdentifierType.js +2 -0
  118. package/dist/src/shared/schema/types/StringType.d.ts +10 -0
  119. package/dist/src/shared/schema/types/StringType.js +2 -0
  120. package/dist/src/shared/schema/types/Type.d.ts +20 -0
  121. package/dist/src/shared/schema/types/TypeArgumentType.d.ts +12 -0
  122. package/dist/src/shared/schema/types/TypeArgumentType.js +7 -0
  123. package/dist/src/shared/utils/array.d.ts +4 -0
  124. package/dist/src/shared/utils/array.js +30 -0
  125. package/dist/src/shared/utils/async.d.ts +8 -0
  126. package/dist/src/shared/utils/async.js +35 -0
  127. package/dist/src/shared/utils/compare.js +3 -3
  128. package/dist/src/shared/utils/displayName.d.ts +6 -2
  129. package/dist/src/shared/utils/displayName.js +21 -8
  130. package/dist/src/shared/utils/instances.d.ts +2 -3
  131. package/dist/src/shared/utils/instances.js +3 -1
  132. package/dist/src/shared/utils/markdown.d.ts +4 -0
  133. package/dist/src/shared/utils/markdown.js +173 -110
  134. package/dist/src/shared/utils/object.d.ts +2 -0
  135. package/dist/src/shared/utils/object.js +2 -0
  136. package/dist/src/shared/utils/result.d.ts +8 -2
  137. package/dist/src/shared/utils/result.js +1 -1
  138. package/dist/src/web/api/declarations.d.ts +26 -0
  139. package/dist/src/web/api/declarations.js +51 -0
  140. package/dist/src/web/api/git.d.ts +14 -0
  141. package/dist/src/web/api/git.js +20 -0
  142. package/dist/src/web/api/index.d.ts +1 -0
  143. package/dist/src/web/api/index.js +2 -0
  144. package/dist/src/web/api/instances.d.ts +2 -0
  145. package/dist/src/web/api/instances.js +2 -0
  146. package/dist/src/web/components/Git.js +19 -16
  147. package/dist/src/web/components/InstanceRouteSkeleton.d.ts +42 -0
  148. package/dist/src/web/components/InstanceRouteSkeleton.js +114 -0
  149. package/dist/src/web/components/Layout.js +3 -2
  150. package/dist/src/web/components/ModalDialog.d.ts +3 -0
  151. package/dist/src/web/components/ModalDialog.js +16 -0
  152. package/dist/src/web/components/Settings.d.ts +2 -0
  153. package/dist/src/web/components/Settings.js +47 -0
  154. package/dist/src/web/components/typeInputs/ArrayTypeInput.d.ts +3 -11
  155. package/dist/src/web/components/typeInputs/ArrayTypeInput.js +5 -4
  156. package/dist/src/web/components/typeInputs/BooleanTypeInput.d.ts +3 -6
  157. package/dist/src/web/components/typeInputs/BooleanTypeInput.js +2 -2
  158. package/dist/src/web/components/typeInputs/ChildEntitiesTypeInput.d.ts +6 -0
  159. package/dist/src/web/components/typeInputs/ChildEntitiesTypeInput.js +27 -0
  160. package/dist/src/web/components/typeInputs/DateTypeInput.d.ts +3 -6
  161. package/dist/src/web/components/typeInputs/DateTypeInput.js +2 -2
  162. package/dist/src/web/components/typeInputs/EnumTypeInput.d.ts +3 -11
  163. package/dist/src/web/components/typeInputs/EnumTypeInput.js +55 -22
  164. package/dist/src/web/components/typeInputs/FloatTypeInput.d.ts +3 -6
  165. package/dist/src/web/components/typeInputs/FloatTypeInput.js +2 -2
  166. package/dist/src/web/components/typeInputs/GenericTypeArgumentIdentifierTypeInput.d.ts +3 -4
  167. package/dist/src/web/components/typeInputs/IncludeIdentifierTypeInput.d.ts +3 -11
  168. package/dist/src/web/components/typeInputs/IncludeIdentifierTypeInput.js +3 -2
  169. package/dist/src/web/components/typeInputs/IntegerTypeInput.d.ts +3 -6
  170. package/dist/src/web/components/typeInputs/IntegerTypeInput.js +2 -2
  171. package/dist/src/web/components/typeInputs/NestedEntityMapTypeInput.d.ts +3 -11
  172. package/dist/src/web/components/typeInputs/NestedEntityMapTypeInput.js +5 -4
  173. package/dist/src/web/components/typeInputs/ObjectTypeInput.d.ts +3 -11
  174. package/dist/src/web/components/typeInputs/ObjectTypeInput.js +8 -5
  175. package/dist/src/web/components/typeInputs/ReferenceIdentifierTypeInput.d.ts +3 -8
  176. package/dist/src/web/components/typeInputs/ReferenceIdentifierTypeInput.js +2 -2
  177. package/dist/src/web/components/typeInputs/StringTypeInput.d.ts +3 -6
  178. package/dist/src/web/components/typeInputs/StringTypeInput.js +3 -3
  179. package/dist/src/web/components/typeInputs/TypeInput.d.ts +12 -4
  180. package/dist/src/web/components/typeInputs/TypeInput.js +22 -17
  181. package/dist/src/web/components/typeInputs/utils/ValidationErrors.d.ts +1 -0
  182. package/dist/src/web/components/typeInputs/utils/ValidationErrors.js +1 -3
  183. package/dist/src/web/context/config.d.ts +11 -0
  184. package/dist/src/web/context/config.js +6 -0
  185. package/dist/src/web/context/entities.d.ts +8 -5
  186. package/dist/src/web/context/entities.js +1 -1
  187. package/dist/src/web/context/settings.d.ts +8 -0
  188. package/dist/src/web/context/settings.js +10 -0
  189. package/dist/src/web/hooks/useEntityFromRoute.d.ts +1 -1
  190. package/dist/src/web/hooks/useEntityFromRoute.js +2 -2
  191. package/dist/src/web/hooks/useInstanceNamesByEntity.d.ts +1 -1
  192. package/dist/src/web/hooks/useInstanceNamesByEntity.js +4 -2
  193. package/dist/src/web/hooks/useMappedAPIResource.js +2 -4
  194. package/dist/src/web/hooks/useSecondaryDeclarations.d.ts +1 -1
  195. package/dist/src/web/hooks/useSecondaryDeclarations.js +8 -4
  196. package/dist/src/web/hooks/useSettings.d.ts +10 -0
  197. package/dist/src/web/hooks/useSettings.js +51 -0
  198. package/dist/src/web/index.js +11 -5
  199. package/dist/src/web/routes/CreateInstance.js +40 -79
  200. package/dist/src/web/routes/Entity.js +42 -19
  201. package/dist/src/web/routes/Home.js +24 -5
  202. package/dist/src/web/routes/Instance.js +34 -85
  203. package/dist/src/web/utils/InlineMarkdown.d.ts +1 -1
  204. package/dist/src/web/utils/InlineMarkdown.js +13 -1
  205. package/dist/src/web/utils/api.d.ts +25 -0
  206. package/dist/src/web/utils/api.js +34 -0
  207. package/dist/src/web/utils/typeSkeleton.d.ts +1 -1
  208. package/dist/src/web/utils/typeSkeleton.js +2 -0
  209. package/package.json +2 -1
  210. package/public/css/styles.css +171 -12
  211. package/dist/src/node/schema/types/primitives/NumericType.d.ts +0 -6
  212. package/dist/src/node/schema/types/primitives/NumericType.js +0 -2
  213. package/dist/src/node/schema/types/primitives/PrimitiveType.d.ts +0 -6
  214. package/dist/src/node/schema/validation/type.d.ts +0 -4
  215. package/dist/src/node/schema/validation/type.js +0 -1
  216. package/dist/src/node/server/api/instanceOperations.d.ts +0 -6
  217. package/dist/src/node/server/api/instanceOperations.js +0 -93
  218. package/dist/src/shared/config.d.ts +0 -11
  219. package/dist/src/shared/config.js +0 -1
  220. package/dist/src/web/api.d.ts +0 -24
  221. package/dist/src/web/api.js +0 -201
  222. /package/dist/src/{node/schema/types/primitives/PrimitiveType.js → shared/schema/types/Type.js} +0 -0
@@ -84,7 +84,7 @@ switch (passedArguments.command.name) {
84
84
  break;
85
85
  case "serve":
86
86
  debug(`running command: serve`);
87
- await serve(config.schema, config.dataRootPath, config.serverOptions);
87
+ await serve(config.schema, config.dataRootPath, config.defaultLocales, config.homeLayoutSections, config.serverOptions);
88
88
  break;
89
89
  case "validate":
90
90
  debug(`running command: validate`);
@@ -1,2 +1,2 @@
1
+ export type { Config } from "./node/config.ts";
1
2
  export * from "./node/index.ts";
2
- export type { Config } from "./shared/config.ts";
@@ -0,0 +1,20 @@
1
+ import type { Output } from "../shared/output.ts";
2
+ import type { EntityDecl } from "./schema/index.ts";
3
+ import type { Schema } from "./schema/Schema.ts";
4
+ export type Config = {
5
+ serverOptions?: ServerOptions;
6
+ schema: Schema;
7
+ outputs: Output[];
8
+ defaultLocales: string[];
9
+ dataRootPath: string;
10
+ homeLayoutSections?: HomeLayoutSection[];
11
+ };
12
+ export type ServerOptions = {
13
+ port: number;
14
+ };
15
+ export type HomeLayoutSection = {
16
+ title: string;
17
+ comment?: string;
18
+ entities: EntityDecl[];
19
+ };
20
+ export declare const validateConfig: (config: Config) => void;
@@ -0,0 +1,5 @@
1
+ export const validateConfig = (config) => {
2
+ if (config.defaultLocales.length === 0) {
3
+ throw new Error("At least one default locale must be specified in the config.");
4
+ }
5
+ };
@@ -1,4 +1,5 @@
1
1
  import type { Output } from "../shared/output.ts";
2
+ import type { HomeLayoutSection } from "./config.ts";
2
3
  import { type Schema } from "./schema/Schema.ts";
3
4
  import type { ServerOptions } from "./server/index.ts";
4
5
  export declare const generateOutputs: (schema: Schema, outputs: Output[]) => Promise<void>;
@@ -8,7 +9,7 @@ type ValidationOptions = {
8
9
  };
9
10
  export declare const validate: (schema: Schema, dataRootPath: string, options?: Partial<ValidationOptions>) => Promise<void>;
10
11
  export declare const generateAndValidate: (schema: Schema, outputs: Output[], dataRootPath: string, validationOptions?: Partial<ValidationOptions>) => Promise<void>;
11
- export declare const serve: (schema: Schema, dataRootPath: string, serverOptions?: Partial<ServerOptions>) => Promise<void>;
12
- export declare const generateValidateAndServe: (schema: Schema, outputs: Output[], dataRootPath: string, serverOptions?: Partial<ServerOptions>, validationOptions?: Partial<ValidationOptions>) => Promise<void>;
12
+ export declare const serve: (schema: Schema, dataRootPath: string, defaultLocales: string[], homeLayoutSections?: HomeLayoutSection[], serverOptions?: Partial<ServerOptions>) => Promise<void>;
13
+ export declare const generateValidateAndServe: (schema: Schema, outputs: Output[], dataRootPath: string, defaultLocales: string[], homeLayoutSections?: HomeLayoutSection[], serverOptions?: Partial<ServerOptions>, validationOptions?: Partial<ValidationOptions>) => Promise<void>;
13
14
  export declare const format: (schema: Schema, dataRootPath: string) => Promise<void>;
14
15
  export {};
@@ -1,5 +1,5 @@
1
1
  import Debug from "debug";
2
- import { mkdir, writeFile } from "fs/promises";
2
+ import { mkdir } from "fs/promises";
3
3
  import { join, sep } from "path";
4
4
  import { styleText } from "util";
5
5
  import { parallelizeErrors } from "../shared/utils/validation.js";
@@ -8,7 +8,8 @@ import { createValidators } from "./schema/Node.js";
8
8
  import { getEntities } from "./schema/Schema.js";
9
9
  import { createServer } from "./server/index.js";
10
10
  import { countErrors, getErrorMessageForDisplay, wrapErrorsIfAny } from "./utils/error.js";
11
- import { formatInstance, getInstancesByEntityName } from "./utils/instances.js";
11
+ import { getFileNameForId, writeInstance } from "./utils/files.js";
12
+ import { getInstancesByEntityName } from "./utils/instances.js";
12
13
  const debug = Debug("tsondb:jsapi");
13
14
  const prepareFolders = async (dataRootPath, entities) => {
14
15
  await mkdir(dataRootPath, { recursive: true });
@@ -29,10 +30,11 @@ const _validate = (dataRootPath, entities, instancesByEntityName, options = {})
29
30
  throw new Error(`Entity "${onlyEntity}" not found in schema`);
30
31
  }
31
32
  }
33
+ const validationHelpers = createValidators(instancesByEntityName, true, checkReferentialIntegrity);
32
34
  const errors = (checkOnlyEntities.length > 0
33
35
  ? entities.filter(entity => checkOnlyEntities.includes(entity.name))
34
36
  : entities)
35
- .flatMap(entity => parallelizeErrors(instancesByEntityName[entity.name]?.map(instance => wrapErrorsIfAny(`in file ${styleText("white", `"${dataRootPath}${sep}${styleText("bold", join(entity.name, instance.fileName))}"`)}`, validateEntityDecl(createValidators(instancesByEntityName, true, checkReferentialIntegrity), entity, instance.content))) ?? []))
37
+ .flatMap(entity => parallelizeErrors(instancesByEntityName[entity.name]?.map(instance => wrapErrorsIfAny(`in file ${styleText("white", `"${dataRootPath}${sep}${styleText("bold", join(entity.name, getFileNameForId(instance.id)))}"`)}`, validateEntityDecl(validationHelpers, entity, instance.content))) ?? []))
36
38
  .toSorted((a, b) => a.message.localeCompare(b.message));
37
39
  if (errors.length === 0) {
38
40
  debug("All entities are valid");
@@ -55,21 +57,24 @@ export const generateAndValidate = async (schema, outputs, dataRootPath, validat
55
57
  const instancesByEntityName = await getInstancesByEntityName(dataRootPath, entities);
56
58
  _validate(dataRootPath, entities, instancesByEntityName, validationOptions);
57
59
  };
58
- export const serve = async (schema, dataRootPath, serverOptions) => {
60
+ export const serve = async (schema, dataRootPath, defaultLocales, homeLayoutSections, serverOptions) => {
61
+ if (defaultLocales.length === 0) {
62
+ throw new Error("At least one default locale must be specified to start the server.");
63
+ }
59
64
  const entities = getEntities(schema);
60
65
  await prepareFolders(dataRootPath, entities);
61
66
  debug("prepared folders");
62
67
  const instancesByEntityName = await getInstancesByEntityName(dataRootPath, entities);
63
68
  debug("loaded instances");
64
- await createServer(schema, dataRootPath, instancesByEntityName, serverOptions);
69
+ await createServer(schema, dataRootPath, instancesByEntityName, defaultLocales, homeLayoutSections, serverOptions);
65
70
  };
66
- export const generateValidateAndServe = async (schema, outputs, dataRootPath, serverOptions, validationOptions) => {
71
+ export const generateValidateAndServe = async (schema, outputs, dataRootPath, defaultLocales, homeLayoutSections, serverOptions, validationOptions) => {
67
72
  await generateOutputs(schema, outputs);
68
73
  const entities = getEntities(schema);
69
74
  await prepareFolders(dataRootPath, entities);
70
75
  const instancesByEntityName = await getInstancesByEntityName(dataRootPath, entities);
71
76
  _validate(dataRootPath, entities, instancesByEntityName, validationOptions);
72
- await createServer(schema, dataRootPath, instancesByEntityName, serverOptions);
77
+ await createServer(schema, dataRootPath, instancesByEntityName, defaultLocales, homeLayoutSections, serverOptions);
73
78
  };
74
79
  export const format = async (schema, dataRootPath) => {
75
80
  const entities = getEntities(schema);
@@ -80,7 +85,7 @@ export const format = async (schema, dataRootPath) => {
80
85
  const entity = entities.find(entity => entity.name === entityName);
81
86
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
82
87
  for (const instance of instancesByEntityName[entityName]) {
83
- await writeFile(join(dataRootPath, entityName, instance.fileName), formatInstance(entity, instance.content), { encoding: "utf-8" });
88
+ await writeInstance(dataRootPath, entity, instance.id, instance.content);
84
89
  }
85
90
  }
86
91
  };
@@ -1,4 +1,4 @@
1
- import type { Decl } from "../../schema/declarations/Declaration.ts";
1
+ import { type Decl } from "../../schema/declarations/Declaration.ts";
2
2
  export type JsonSchemaRendererOptions = {
3
3
  format: "minified" | "tabs" | {
4
4
  kind: "spaces";
@@ -1,11 +1,13 @@
1
1
  import { dirname, relative } from "node:path";
2
2
  import { discriminatorKey } from "../../../shared/enum.js";
3
3
  import { assertExhaustive } from "../../../shared/utils/typeSafety.js";
4
+ import { asDecl } from "../../schema/declarations/Declaration.js";
4
5
  import { addEphemeralUUIDToType, createEntityIdentifierTypeAsDecl, isEntityDecl, } from "../../schema/declarations/EntityDecl.js";
5
6
  import { TypeAliasDecl } from "../../schema/declarations/TypeAliasDecl.js";
6
7
  import { flatMapAuxiliaryDecls, NodeKind } from "../../schema/Node.js";
8
+ import { ArrayType } from "../../schema/types/generic/ArrayType.js";
7
9
  import { isNestedEntityMapType } from "../../schema/types/references/NestedEntityMapType.js";
8
- import { getParentDecl } from "../../schema/types/Type.js";
10
+ import { ReferenceIdentifierType } from "../../schema/types/references/ReferenceIdentifierType.js";
9
11
  import { ensureSpecialDirStart } from "../../utils/path.js";
10
12
  const defaultIndentation = 2;
11
13
  const defaultOptions = {
@@ -74,7 +76,7 @@ const renderReferenceIdentifierType = (_options, type) => ({
74
76
  $ref: `#/$defs/${type.entity.name}_ID`,
75
77
  });
76
78
  const renderIncludeIdentifierType = (options, type) => {
77
- const sourceUrl = getParentDecl(type)?.sourceUrl ?? "";
79
+ const sourceUrl = options.parentDecl?.sourceUrl ?? "";
78
80
  const filePath = options.preserveFiles && sourceUrl !== type.reference.sourceUrl
79
81
  ? ensureSpecialDirStart(relative(dirname(sourceUrl), type.reference.sourceUrl))
80
82
  : "";
@@ -101,6 +103,7 @@ const renderEnumType = (options, type) => ({
101
103
  required: [discriminatorKey, ...(caseDef.type === null ? [] : [caseName])],
102
104
  })),
103
105
  });
106
+ const renderChildEntitiesType = (options, type) => renderType(options, ArrayType(ReferenceIdentifierType(type.entity), { uniqueItems: true }));
104
107
  const renderType = (options, type) => {
105
108
  switch (type.kind) {
106
109
  case NodeKind.ArrayType:
@@ -127,6 +130,8 @@ const renderType = (options, type) => {
127
130
  return renderNestedEntityMapType(options, type);
128
131
  case NodeKind.EnumType:
129
132
  return renderEnumType(options, type);
133
+ case NodeKind.ChildEntitiesType:
134
+ return renderChildEntitiesType(options, type);
130
135
  default:
131
136
  return assertExhaustive(type, "Unknown type");
132
137
  }
@@ -149,11 +154,11 @@ const renderTypeAliasDecl = (options, decl) => ({
149
154
  const renderDecl = (options, decl) => {
150
155
  switch (decl.kind) {
151
156
  case NodeKind.EntityDecl:
152
- return renderEntityDecl(options, decl);
157
+ return renderEntityDecl({ ...options, parentDecl: decl }, decl);
153
158
  case NodeKind.EnumDecl:
154
- return renderEnumDecl(options, decl);
159
+ return renderEnumDecl({ ...options, parentDecl: decl }, decl);
155
160
  case NodeKind.TypeAliasDecl:
156
- return renderTypeAliasDecl(options, decl);
161
+ return renderTypeAliasDecl({ ...options, parentDecl: decl }, decl);
157
162
  default:
158
163
  return assertExhaustive(decl, "Unknown declaration");
159
164
  }
@@ -162,14 +167,14 @@ const renderDeclarations = (options, declarations) => Object.fromEntries(declara
162
167
  export const render = (options = defaultOptions, declarations) => {
163
168
  const finalOptions = { ...defaultOptions, ...options };
164
169
  return JSON.stringify({
165
- $defs: renderDeclarations(finalOptions, flatMapAuxiliaryDecls((node, existingDecls) => {
170
+ $defs: renderDeclarations(finalOptions, flatMapAuxiliaryDecls((parentNodes, node, existingDecls) => {
166
171
  if (isNestedEntityMapType(node)) {
167
172
  if (existingDecls.some(decl => decl.name === node.name)) {
168
173
  // this may happen when a nested entity map is defined in a generic declaration and the generic declaration is used multiple times
169
174
  // TODO: circumvent by defining the nested entity declaration outside the generic declaration
170
175
  return undefined;
171
176
  }
172
- return TypeAliasDecl(getParentDecl(node)?.sourceUrl ?? "", {
177
+ return TypeAliasDecl(asDecl(parentNodes[0])?.sourceUrl ?? "", {
173
178
  name: node.name,
174
179
  comment: node.comment,
175
180
  type: () => node.type.value,
@@ -1,4 +1,4 @@
1
- import type { Decl } from "../../schema/declarations/Declaration.ts";
1
+ import { type Decl } from "../../schema/declarations/Declaration.ts";
2
2
  export type TypeScriptRendererOptions = {
3
3
  indentation: number;
4
4
  objectTypeKeyword: "interface" | "type";
@@ -4,12 +4,14 @@ import { discriminatorKey } from "../../../shared/enum.js";
4
4
  import { unique } from "../../../shared/utils/array.js";
5
5
  import { toCamelCase } from "../../../shared/utils/string.js";
6
6
  import { assertExhaustive } from "../../../shared/utils/typeSafety.js";
7
+ import { asDecl } from "../../schema/declarations/Declaration.js";
7
8
  import { addEphemeralUUIDToType, createEntityIdentifierTypeAsDecl, isEntityDecl, } from "../../schema/declarations/EntityDecl.js";
8
9
  import { TypeAliasDecl } from "../../schema/declarations/TypeAliasDecl.js";
9
10
  import { flatMapAuxiliaryDecls, NodeKind } from "../../schema/Node.js";
11
+ import { ArrayType } from "../../schema/types/generic/ArrayType.js";
10
12
  import { isObjectType } from "../../schema/types/generic/ObjectType.js";
11
13
  import { isNestedEntityMapType } from "../../schema/types/references/NestedEntityMapType.js";
12
- import { getParentDecl } from "../../schema/types/Type.js";
14
+ import { ReferenceIdentifierType } from "../../schema/types/references/ReferenceIdentifierType.js";
13
15
  import { ensureSpecialDirStart } from "../../utils/path.js";
14
16
  import { combineSyntaxes, indent, prefixLines, syntax } from "../../utils/render.js";
15
17
  const defaultOptions = {
@@ -38,7 +40,8 @@ const renderObjectType = (options, type) => {
38
40
  };
39
41
  const renderBooleanType = (_options, _type) => syntax `boolean`;
40
42
  const renderDateType = (_options, _type) => syntax `Date`;
41
- const renderNumericType = (_options, _type) => syntax `number`;
43
+ const renderFloatType = (_options, _type) => syntax `number`;
44
+ const renderIntegerType = (_options, _type) => syntax `number`;
42
45
  const renderStringType = (_options, _type) => syntax `string`;
43
46
  const renderTypeArgumentType = (_options, type) => syntax `${type.argument.name}`;
44
47
  const renderReferenceIdentifierType = (_options, type) => [
@@ -55,6 +58,7 @@ const renderNestedEntityMapType = (options, type) => wrapAsObject(options, synta
55
58
  const renderEnumType = (options, type) => combineSyntaxes(Object.entries(type.values).map(([caseName, caseDef]) => indent(options.indentation, 1, syntax `${EOL}| {${EOL}${indent(options.indentation, 1, syntax `${discriminatorKey}: "${caseName}"${caseDef.type === null
56
59
  ? ""
57
60
  : syntax `${EOL}${caseName}: ${renderType(options, caseDef.type)}`}`)}${EOL}}`)));
61
+ const renderChildEntitiesType = (options, type) => renderType(options, ArrayType(ReferenceIdentifierType(type.entity), { uniqueItems: true }));
58
62
  const renderType = (options, type) => {
59
63
  switch (type.kind) {
60
64
  case NodeKind.ArrayType:
@@ -66,9 +70,9 @@ const renderType = (options, type) => {
66
70
  case NodeKind.DateType:
67
71
  return renderDateType(options, type);
68
72
  case NodeKind.FloatType:
69
- return renderNumericType(options, type);
73
+ return renderFloatType(options, type);
70
74
  case NodeKind.IntegerType:
71
- return renderNumericType(options, type);
75
+ return renderIntegerType(options, type);
72
76
  case NodeKind.StringType:
73
77
  return renderStringType(options, type);
74
78
  case NodeKind.TypeArgumentType:
@@ -81,6 +85,8 @@ const renderType = (options, type) => {
81
85
  return renderNestedEntityMapType(options, type);
82
86
  case NodeKind.EnumType:
83
87
  return renderEnumType(options, type);
88
+ case NodeKind.ChildEntitiesType:
89
+ return renderChildEntitiesType(options, type);
84
90
  default:
85
91
  return assertExhaustive(type, "Unknown type");
86
92
  }
@@ -119,9 +125,9 @@ const renderImports = (currentUrl, imports) => {
119
125
  };
120
126
  export const render = (options = defaultOptions, declarations) => {
121
127
  const finalOptions = { ...defaultOptions, ...options };
122
- const [imports, content] = renderDeclarations(finalOptions, flatMapAuxiliaryDecls(node => {
128
+ const [imports, content] = renderDeclarations(finalOptions, flatMapAuxiliaryDecls((parentNodes, node) => {
123
129
  if (isNestedEntityMapType(node)) {
124
- return TypeAliasDecl(getParentDecl(node)?.sourceUrl ?? "", {
130
+ return TypeAliasDecl(asDecl(parentNodes[0])?.sourceUrl ?? "", {
125
131
  name: node.name,
126
132
  comment: node.comment,
127
133
  type: () => node.type.value,
@@ -1,32 +1,50 @@
1
+ import type { SerializedEntityDecl } from "../../shared/schema/declarations/EntityDecl.ts";
2
+ import type { SerializedEnumDecl } from "../../shared/schema/declarations/EnumDecl.ts";
3
+ import type { SerializedTypeAliasDecl } from "../../shared/schema/declarations/TypeAliasDecl.ts";
4
+ import { NodeKind } from "../../shared/schema/Node.ts";
5
+ import type { SerializedTypeParameter } from "../../shared/schema/TypeParameter.ts";
6
+ import type { SerializedArrayType } from "../../shared/schema/types/ArrayType.ts";
7
+ import type { SerializedBooleanType } from "../../shared/schema/types/BooleanType.ts";
8
+ import type { SerializedChildEntitiesType } from "../../shared/schema/types/ChildEntitiesType.ts";
9
+ import type { SerializedDateType } from "../../shared/schema/types/DateType.ts";
10
+ import type { SerializedEnumCaseDecl, SerializedEnumType } from "../../shared/schema/types/EnumType.ts";
11
+ import type { SerializedFloatType } from "../../shared/schema/types/FloatType.ts";
12
+ import type { SerializedIncludeIdentifierType } from "../../shared/schema/types/IncludeIdentifierType.ts";
13
+ import type { SerializedIntegerType } from "../../shared/schema/types/IntegerType.ts";
14
+ import type { SerializedNestedEntityMapType } from "../../shared/schema/types/NestedEntityMapType.ts";
15
+ import type { SerializedMemberDecl, SerializedObjectType } from "../../shared/schema/types/ObjectType.ts";
16
+ import type { SerializedReferenceIdentifierType } from "../../shared/schema/types/ReferenceIdentifierType.ts";
17
+ import type { SerializedStringType } from "../../shared/schema/types/StringType.ts";
18
+ import type { SerializedTypeArgumentType } from "../../shared/schema/types/TypeArgumentType.ts";
1
19
  import type { InstancesByEntityName } from "../../shared/utils/instances.ts";
2
- import type { Decl } from "./declarations/Declaration.ts";
20
+ import { type Decl, type IncludableDeclP } from "./declarations/Declaration.ts";
21
+ import { type EntityDecl } from "./declarations/EntityDecl.ts";
22
+ import { type EnumDecl } from "./declarations/EnumDecl.ts";
23
+ import { type TypeAliasDecl } from "./declarations/TypeAliasDecl.ts";
24
+ import { type TypeParameter } from "./TypeParameter.ts";
25
+ import { type ArrayType } from "./types/generic/ArrayType.ts";
26
+ import { type EnumCaseDecl, type EnumType } from "./types/generic/EnumType.ts";
27
+ import { type MemberDecl, type ObjectType } from "./types/generic/ObjectType.ts";
28
+ import { type BooleanType } from "./types/primitives/BooleanType.ts";
29
+ import { type DateType } from "./types/primitives/DateType.ts";
30
+ import { type FloatType } from "./types/primitives/FloatType.ts";
31
+ import { type IntegerType } from "./types/primitives/IntegerType.ts";
32
+ import { type StringType } from "./types/primitives/StringType.ts";
33
+ import { type ChildEntitiesType } from "./types/references/ChildEntitiesType.ts";
34
+ import { type IncludeIdentifierType } from "./types/references/IncludeIdentifierType.ts";
35
+ import { type NestedEntityMapType } from "./types/references/NestedEntityMapType.ts";
36
+ import { type ReferenceIdentifierType } from "./types/references/ReferenceIdentifierType.ts";
37
+ import { type TypeArgumentType } from "./types/references/TypeArgumentType.ts";
3
38
  import type { Type } from "./types/Type.ts";
4
- export interface NodeKind {
5
- EntityDecl: "EntityDecl";
6
- EnumDecl: "EnumDecl";
7
- EnumCaseDecl: "EnumCaseDecl";
8
- TypeAliasDecl: "TypeAliasDecl";
9
- MemberDecl: "MemberDecl";
10
- ArrayType: "ArrayType";
11
- ObjectType: "ObjectType";
12
- BooleanType: "BooleanType";
13
- FloatType: "FloatType";
14
- IntegerType: "IntegerType";
15
- StringType: "StringType";
16
- DateType: "DateType";
17
- TypeArgumentType: "TypeArgumentType";
18
- GenericParameter: "GenericParameter";
19
- ReferenceIdentifierType: "ReferenceIdentifierType";
20
- IncludeIdentifierType: "IncludeIdentifierType";
21
- NestedEntityMapType: "NestedEntityMapType";
22
- EnumType: "EnumType";
23
- }
24
- export declare const NodeKind: NodeKind;
25
- export interface BaseNode {
26
- kind: (typeof NodeKind)[keyof typeof NodeKind];
27
- }
28
- export type Node = Decl | Type;
29
- export declare const flatMapAuxiliaryDecls: (callbackFn: (node: Node, existingDecls: Decl[]) => (Decl | undefined)[] | Decl | undefined, declarations: readonly Decl[]) => Decl[];
39
+ export type { BaseNode } from "../../shared/schema/Node.ts";
40
+ export { NodeKind };
41
+ export type Node = Decl | Type | TypeParameter;
42
+ export declare const reduceNodes: <R>(reducer: (parentNodes: Node[], node: Node, collectedResults: R[]) => R[], nodes: readonly Node[], options?: {
43
+ initialResults?: R[];
44
+ followIncludes?: boolean;
45
+ followChildEntities?: boolean;
46
+ }) => R[];
47
+ export declare const flatMapAuxiliaryDecls: (callbackFn: (parentNodes: Node[], node: Node, existingDecls: Decl[]) => (Decl | undefined)[] | Decl | undefined, declarations: readonly Decl[]) => Decl[];
30
48
  export type IdentifierToCheck = {
31
49
  name: string;
32
50
  value: unknown;
@@ -36,5 +54,58 @@ export interface Validators {
36
54
  checkReferentialIntegrity: (identifier: IdentifierToCheck) => Error[];
37
55
  }
38
56
  export declare const createValidators: (instancesByEntityName: InstancesByEntityName, useStyling: boolean, checkReferentialIntegrity?: boolean) => Validators;
39
- export type Serializer<T, U> = (node: T) => U;
40
- export type GetReferences<T extends Node> = (node: T, value: unknown) => string[];
57
+ export type Predicate<T extends Node> = (node: Node) => node is T;
58
+ export type GetNestedDeclarations<T extends Node = Node> = (addedDecls: Decl[], node: T) => Decl[];
59
+ export declare const getNestedDeclarations: GetNestedDeclarations;
60
+ export type Validator<T extends Node = Node> = (helpers: Validators, node: T, value: unknown) => Error[];
61
+ export type ValidatorOfParamDecl<T extends Node = Node> = (helpers: Validators, node: T, typeArgs: Type[], value: unknown) => Error[];
62
+ export declare const validateDecl: ValidatorOfParamDecl<Decl>;
63
+ export declare const validateType: Validator<Type>;
64
+ export type NodeWithResolvedTypeArguments<T extends Node | null> = T extends BooleanType | DateType | FloatType | IntegerType | StringType | ReferenceIdentifierType ? T : T extends EntityDecl<infer N, infer P, infer FK> ? EntityDecl<N, {
65
+ [K in keyof P]: P[K] extends MemberDecl<infer PT, infer R> ? MemberDecl<NodeWithResolvedTypeArguments<PT>, R> : never;
66
+ }, FK> : T extends EnumDecl<infer N, infer V, TypeParameter[]> ? EnumDecl<N, {
67
+ [K in keyof V]: V[K] extends EnumCaseDecl<infer CT> ? EnumCaseDecl<NodeWithResolvedTypeArguments<CT>> : never;
68
+ }, [
69
+ ]> : T extends TypeAliasDecl<infer N, infer U, TypeParameter[]> ? TypeAliasDecl<N, NodeWithResolvedTypeArguments<U>, []> : T extends ArrayType<infer I> ? ArrayType<NodeWithResolvedTypeArguments<I>> : T extends EnumType<infer V> ? EnumType<{
70
+ [K in keyof V]: V[K] extends EnumCaseDecl<infer CT> ? EnumCaseDecl<NodeWithResolvedTypeArguments<CT>> : never;
71
+ }> : T extends ObjectType<infer P> ? ObjectType<{
72
+ [K in keyof P]: P[K] extends MemberDecl<infer PT, infer R> ? MemberDecl<NodeWithResolvedTypeArguments<PT>, R> : never;
73
+ }> : T extends TypeArgumentType ? Type : T extends IncludeIdentifierType<[], IncludableDeclP<[]>> ? T : T extends IncludeIdentifierType ? Type : T extends NestedEntityMapType<infer N, infer P> ? NestedEntityMapType<N, {
74
+ [K in keyof P]: P[K] extends MemberDecl<infer PT, infer R> ? MemberDecl<NodeWithResolvedTypeArguments<PT>, R> : never;
75
+ }> : T extends TypeParameter<infer N, infer C> ? TypeParameter<N, NodeWithResolvedTypeArguments<C>> : T extends ChildEntitiesType<infer E> ? ChildEntitiesType<E> : T extends null ? null : never;
76
+ export type TypeArgumentsResolver<T extends Node = Node> = (args: Record<string, Type>, node: T) => NodeWithResolvedTypeArguments<T>;
77
+ export declare const resolveTypeArguments: <T extends Node = Node>(args: Record<string, Type>, node: T) => NodeWithResolvedTypeArguments<T>;
78
+ export type SerializedNodeMap = {
79
+ [NodeKind.EntityDecl]: [EntityDecl, SerializedEntityDecl];
80
+ [NodeKind.EnumDecl]: [EnumDecl, SerializedEnumDecl];
81
+ [NodeKind.TypeAliasDecl]: [TypeAliasDecl, SerializedTypeAliasDecl];
82
+ [NodeKind.ArrayType]: [ArrayType, SerializedArrayType];
83
+ [NodeKind.ObjectType]: [ObjectType, SerializedObjectType];
84
+ [NodeKind.BooleanType]: [BooleanType, SerializedBooleanType];
85
+ [NodeKind.DateType]: [DateType, SerializedDateType];
86
+ [NodeKind.FloatType]: [FloatType, SerializedFloatType];
87
+ [NodeKind.IntegerType]: [IntegerType, SerializedIntegerType];
88
+ [NodeKind.StringType]: [StringType, SerializedStringType];
89
+ [NodeKind.TypeArgumentType]: [TypeArgumentType, SerializedTypeArgumentType];
90
+ [NodeKind.ReferenceIdentifierType]: [ReferenceIdentifierType, SerializedReferenceIdentifierType];
91
+ [NodeKind.IncludeIdentifierType]: [IncludeIdentifierType, SerializedIncludeIdentifierType];
92
+ [NodeKind.NestedEntityMapType]: [NestedEntityMapType, SerializedNestedEntityMapType];
93
+ [NodeKind.EnumType]: [EnumType, SerializedEnumType];
94
+ [NodeKind.TypeParameter]: [TypeParameter, SerializedTypeParameter];
95
+ [NodeKind.ChildEntitiesType]: [ChildEntitiesType, SerializedChildEntitiesType];
96
+ };
97
+ export type SerializedTypeParameters<T extends TypeParameter[]> = {
98
+ [K in keyof T]: T[K] extends TypeParameter<infer N, infer C> ? SerializedTypeParameter<N, C extends Type ? Serialized<C> : undefined> : never;
99
+ };
100
+ export type SerializedMemberDeclObject<T extends Record<string, MemberDecl>> = {
101
+ [K in keyof T]: T[K] extends MemberDecl<infer CT, infer R> ? SerializedMemberDecl<Serialized<CT>, R> : never;
102
+ };
103
+ export type SerializedEnumCaseDeclObject<T extends Record<string, EnumCaseDecl>> = {
104
+ [K in keyof T]: T[K] extends EnumCaseDecl<infer CT> ? SerializedEnumCaseDecl<CT extends Type ? Serialized<CT> : null> : never;
105
+ };
106
+ export type Serialized<T extends Node> = T extends EntityDecl<infer Name, infer T, infer FK> ? SerializedEntityDecl<Name, SerializedMemberDeclObject<T>, FK> : T extends EnumDecl<infer Name, infer T, infer Params> ? SerializedEnumDecl<Name, SerializedEnumCaseDeclObject<T>, SerializedTypeParameters<Params>> : T extends TypeAliasDecl<infer Name, infer T, infer Params> ? SerializedTypeAliasDecl<Name, Serialized<T>, SerializedTypeParameters<Params>> : T extends ArrayType<infer T> ? SerializedArrayType<Serialized<T>> : T extends ObjectType<infer T> ? SerializedObjectType<SerializedMemberDeclObject<T>> : T extends BooleanType ? SerializedBooleanType : T extends DateType ? SerializedDateType : T extends FloatType ? SerializedFloatType : T extends IntegerType ? SerializedIntegerType : T extends StringType ? SerializedStringType : T extends TypeArgumentType<infer T> ? SerializedTypeArgumentType<Serialized<T>> : T extends ReferenceIdentifierType ? SerializedReferenceIdentifierType : T extends IncludeIdentifierType<infer Params> ? SerializedIncludeIdentifierType<SerializedTypeParameters<Params>> : T extends NestedEntityMapType<infer Name, infer T> ? SerializedNestedEntityMapType<Name, SerializedMemberDeclObject<T>> : T extends EnumType<infer T> ? SerializedEnumType<SerializedEnumCaseDeclObject<T>> : T extends TypeParameter<infer N, infer C> ? SerializedTypeParameter<N, C extends Type ? Serialized<C> : undefined> : T extends ChildEntitiesType ? SerializedChildEntitiesType : never;
107
+ export type SerializedOf<T extends Node> = SerializedNodeMap[T["kind"]][1];
108
+ export type Serializer<T extends Node = Node> = (node: T) => Serialized<T>;
109
+ export declare const serializeNode: <T extends Node>(node: T) => Serialized<T>;
110
+ export type GetReferences<T extends Node = Node> = (node: T, value: unknown) => string[];
111
+ export declare const getReferences: GetReferences;