@satisfactory-dev/docs.json.ts 0.6.1

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 (152) hide show
  1. package/LICENSE.md +190 -0
  2. package/README.md +81 -0
  3. package/assert/CustomAssert.d.ts +2 -0
  4. package/assert/CustomAssert.js +5 -0
  5. package/lib/AjvUtilities.d.ts +7 -0
  6. package/lib/AjvUtilities.js +59 -0
  7. package/lib/ArrayUtilities.d.ts +24 -0
  8. package/lib/ArrayUtilities.js +21 -0
  9. package/lib/CustomParsingTypes/CustomPairingTypes.d.ts +37 -0
  10. package/lib/CustomParsingTypes/CustomPairingTypes.js +42 -0
  11. package/lib/CustomParsingTypes/TypedString.d.ts +411 -0
  12. package/lib/CustomParsingTypes/TypedString.js +204 -0
  13. package/lib/CustomParsingTypes/TypedStringConst.d.ts +28 -0
  14. package/lib/CustomParsingTypes/TypedStringConst.js +35 -0
  15. package/lib/CustomParsingTypes/TypedStringEnum.d.ts +30 -0
  16. package/lib/CustomParsingTypes/TypedStringEnum.js +36 -0
  17. package/lib/CustomParsingTypes/TypedStringPattern.d.ts +64 -0
  18. package/lib/CustomParsingTypes/TypedStringPattern.js +82 -0
  19. package/lib/CustomParsingTypes/UnrealEngineString.d.ts +215 -0
  20. package/lib/CustomParsingTypes/UnrealEngineString.js +308 -0
  21. package/lib/CustomParsingTypes/ValueToRegexFormatter.d.ts +29 -0
  22. package/lib/CustomParsingTypes/ValueToRegexFormatter.js +205 -0
  23. package/lib/DataDiscovery/CustomTypes/BooleanOrBooleanExtended.d.ts +12 -0
  24. package/lib/DataDiscovery/CustomTypes/BooleanOrBooleanExtended.js +32 -0
  25. package/lib/DataDiscovery/CustomTypes/StringStartsWith.d.ts +9 -0
  26. package/lib/DataDiscovery/CustomTypes/StringStartsWith.js +19 -0
  27. package/lib/DataDiscovery/CustomTypes/TypedString.d.ts +23 -0
  28. package/lib/DataDiscovery/CustomTypes/TypedString.js +251 -0
  29. package/lib/DataDiscovery/CustomTypes/UnrealEngineString.d.ts +9 -0
  30. package/lib/DataDiscovery/CustomTypes/UnrealEngineString.js +45 -0
  31. package/lib/DataDiscovery/Generator.d.ts +19 -0
  32. package/lib/DataDiscovery/Generator.js +41 -0
  33. package/lib/DataDiscovery/JsonSchema/Array.d.ts +17 -0
  34. package/lib/DataDiscovery/JsonSchema/Array.js +41 -0
  35. package/lib/DataDiscovery/JsonSchema/Object.d.ts +61 -0
  36. package/lib/DataDiscovery/JsonSchema/Object.js +184 -0
  37. package/lib/DataDiscovery/JsonSchema/OneOf.d.ts +13 -0
  38. package/lib/DataDiscovery/JsonSchema/OneOf.js +47 -0
  39. package/lib/DataDiscovery/JsonSchema/Ref.d.ts +17 -0
  40. package/lib/DataDiscovery/JsonSchema/Ref.js +66 -0
  41. package/lib/DataDiscovery/JsonSchema/StringType.d.ts +39 -0
  42. package/lib/DataDiscovery/JsonSchema/StringType.js +121 -0
  43. package/lib/DataDiscovery/Literal.d.ts +8 -0
  44. package/lib/DataDiscovery/Literal.js +69 -0
  45. package/lib/DataDiscovery.d.ts +28 -0
  46. package/lib/DataDiscovery.js +116 -0
  47. package/lib/DocsToAutoImport/ArrayTypeNodes.d.ts +5 -0
  48. package/lib/DocsToAutoImport/ArrayTypeNodes.js +7 -0
  49. package/lib/DocsToAutoImport/ClassDeclarations.d.ts +5 -0
  50. package/lib/DocsToAutoImport/ClassDeclarations.js +14 -0
  51. package/lib/DocsToAutoImport/FunctionDeclaration.d.ts +5 -0
  52. package/lib/DocsToAutoImport/FunctionDeclaration.js +16 -0
  53. package/lib/DocsToAutoImport/LiteralTypeNodes.d.ts +5 -0
  54. package/lib/DocsToAutoImport/LiteralTypeNodes.js +23 -0
  55. package/lib/DocsToAutoImport/MethodDeclarations.d.ts +5 -0
  56. package/lib/DocsToAutoImport/MethodDeclarations.js +15 -0
  57. package/lib/DocsToAutoImport/NodeExtraction.d.ts +6 -0
  58. package/lib/DocsToAutoImport/NodeExtraction.js +21 -0
  59. package/lib/DocsToAutoImport/PropertyDeclarations.d.ts +5 -0
  60. package/lib/DocsToAutoImport/PropertyDeclarations.js +10 -0
  61. package/lib/DocsToAutoImport/TupleTypeNodes.d.ts +5 -0
  62. package/lib/DocsToAutoImport/TupleTypeNodes.js +7 -0
  63. package/lib/DocsToAutoImport/TypeLiteralNodes.d.ts +5 -0
  64. package/lib/DocsToAutoImport/TypeLiteralNodes.js +33 -0
  65. package/lib/DocsToAutoImport/TypeReferenceNodes.d.ts +5 -0
  66. package/lib/DocsToAutoImport/TypeReferenceNodes.js +7 -0
  67. package/lib/DocsToAutoImport/from_Node_array.d.ts +3 -0
  68. package/lib/DocsToAutoImport/from_Node_array.js +245 -0
  69. package/lib/DocsTsAutoImports.d.ts +21 -0
  70. package/lib/DocsTsAutoImports.js +110 -0
  71. package/lib/DocsTsGenerator/FilesGenerator.d.ts +25 -0
  72. package/lib/DocsTsGenerator/FilesGenerator.js +52 -0
  73. package/lib/DocsTsGenerator.d.ts +47 -0
  74. package/lib/DocsTsGenerator.js +188 -0
  75. package/lib/DocsValidation.d.ts +7 -0
  76. package/lib/DocsValidation.js +179 -0
  77. package/lib/Exceptions.d.ts +7 -0
  78. package/lib/Exceptions.js +13 -0
  79. package/lib/FilesGenerator.d.ts +19 -0
  80. package/lib/FilesGenerator.js +38 -0
  81. package/lib/MarkdownUtilities.d.ts +16 -0
  82. package/lib/MarkdownUtilities.js +68 -0
  83. package/lib/StringStartsWith.d.ts +10 -0
  84. package/lib/StringStartsWith.js +20 -0
  85. package/lib/TsFactoryWrapper.d.ts +80 -0
  86. package/lib/TsFactoryWrapper.js +236 -0
  87. package/lib/TypeDefinitionDiscovery/CustomParsingTypes/UnrealEngineString.d.ts +13 -0
  88. package/lib/TypeDefinitionDiscovery/CustomParsingTypes/UnrealEngineString.js +26 -0
  89. package/lib/TypeDefinitionDiscovery/CustomParsingTypes/string_starts_with.d.ts +25 -0
  90. package/lib/TypeDefinitionDiscovery/CustomParsingTypes/string_starts_with.js +20 -0
  91. package/lib/TypeDefinitionDiscovery/CustomParsingTypes/typed_string.d.ts +14 -0
  92. package/lib/TypeDefinitionDiscovery/CustomParsingTypes/typed_string.js +96 -0
  93. package/lib/TypeDefinitionDiscovery/Generator.d.ts +8 -0
  94. package/lib/TypeDefinitionDiscovery/Generator.js +8 -0
  95. package/lib/TypeDefinitionDiscovery/GeneratorDoesDiscovery.d.ts +8 -0
  96. package/lib/TypeDefinitionDiscovery/GeneratorDoesDiscovery.js +9 -0
  97. package/lib/TypeDefinitionDiscovery/JsonSchema/ArrayType.d.ts +19 -0
  98. package/lib/TypeDefinitionDiscovery/JsonSchema/ArrayType.js +61 -0
  99. package/lib/TypeDefinitionDiscovery/JsonSchema/Object/ExtendsObject.d.ts +23 -0
  100. package/lib/TypeDefinitionDiscovery/JsonSchema/Object/ExtendsObject.js +40 -0
  101. package/lib/TypeDefinitionDiscovery/JsonSchema/ObjectType.d.ts +91 -0
  102. package/lib/TypeDefinitionDiscovery/JsonSchema/ObjectType.js +76 -0
  103. package/lib/TypeDefinitionDiscovery/JsonSchema/String/Const.d.ts +29 -0
  104. package/lib/TypeDefinitionDiscovery/JsonSchema/String/Const.js +20 -0
  105. package/lib/TypeDefinitionDiscovery/JsonSchema/String/Enum/BooleanEnum.d.ts +16 -0
  106. package/lib/TypeDefinitionDiscovery/JsonSchema/String/Enum/BooleanEnum.js +47 -0
  107. package/lib/TypeDefinitionDiscovery/JsonSchema/String/Enum.d.ts +40 -0
  108. package/lib/TypeDefinitionDiscovery/JsonSchema/String/Enum.js +22 -0
  109. package/lib/TypeDefinitionDiscovery/JsonSchema/String/Pattern.d.ts +13 -0
  110. package/lib/TypeDefinitionDiscovery/JsonSchema/String/Pattern.js +21 -0
  111. package/lib/TypeDefinitionDiscovery/JsonSchema/String.d.ts +52 -0
  112. package/lib/TypeDefinitionDiscovery/JsonSchema/String.js +72 -0
  113. package/lib/TypeDefinitionDiscovery/JsonSchema/oneOf_or_anyOf.d.ts +63 -0
  114. package/lib/TypeDefinitionDiscovery/JsonSchema/oneOf_or_anyOf.js +47 -0
  115. package/lib/TypeDefinitionDiscovery.d.ts +49 -0
  116. package/lib/TypeDefinitionDiscovery.js +376 -0
  117. package/lib/TypeDefinitionWriter.d.ts +22 -0
  118. package/lib/TypeDefinitionWriter.js +233 -0
  119. package/lib/TypesDiscovery/CandidatesDiscovery.d.ts +10 -0
  120. package/lib/TypesDiscovery/CandidatesDiscovery.js +14 -0
  121. package/lib/TypesDiscovery/CustomParsingTypes/UnrealEngineString.d.ts +5 -0
  122. package/lib/TypesDiscovery/CustomParsingTypes/UnrealEngineString.js +18 -0
  123. package/lib/TypesDiscovery/CustomParsingTypes/typed_string.d.ts +6 -0
  124. package/lib/TypesDiscovery/CustomParsingTypes/typed_string.js +34 -0
  125. package/lib/TypesDiscovery/JsonSchema/$ref.d.ts +7 -0
  126. package/lib/TypesDiscovery/JsonSchema/$ref.js +33 -0
  127. package/lib/TypesDiscovery/JsonSchema/const.d.ts +6 -0
  128. package/lib/TypesDiscovery/JsonSchema/const.js +22 -0
  129. package/lib/TypesDiscovery/JsonSchema/enum.d.ts +6 -0
  130. package/lib/TypesDiscovery/JsonSchema/enum.js +22 -0
  131. package/lib/TypesDiscovery/JsonSchema/properties.d.ts +4 -0
  132. package/lib/TypesDiscovery/JsonSchema/properties.js +14 -0
  133. package/lib/TypesDiscovery/non_array_object_property.d.ts +4 -0
  134. package/lib/TypesDiscovery/non_array_object_property.js +11 -0
  135. package/lib/TypesDiscovery/non_empty_array_property.d.ts +4 -0
  136. package/lib/TypesDiscovery/non_empty_array_property.js +11 -0
  137. package/lib/TypesDiscovery.d.ts +24 -0
  138. package/lib/TypesDiscovery.js +77 -0
  139. package/lib/TypesGeneration/validators.d.ts +9 -0
  140. package/lib/TypesGeneration/validators.js +26 -0
  141. package/lib/TypesGeneration.d.ts +17 -0
  142. package/lib/TypesGeneration.js +53 -0
  143. package/lib/__dirname.d.ts +1 -0
  144. package/lib/__dirname.js +6 -0
  145. package/lib/helpers.d.ts +5 -0
  146. package/lib/helpers.js +29 -0
  147. package/lib/index.d.ts +8 -0
  148. package/lib/index.js +9 -0
  149. package/package.json +39 -0
  150. package/schema/update8.schema.json +8848 -0
  151. package/setup_PerformanceObserver.d.ts +3 -0
  152. package/setup_PerformanceObserver.js +55 -0
@@ -0,0 +1,411 @@
1
+ import Ajv, { SchemaObject } from 'ajv/dist/2020';
2
+ import { local_ref } from '../StringStartsWith';
3
+ import { UnrealEngineString_parent_type } from './UnrealEngineString';
4
+ import { const_schema_type } from './TypedStringConst';
5
+ import { enum_schema_type } from './TypedStringEnum';
6
+ type typed_string_sub_types = {
7
+ $ref: local_ref<string>;
8
+ } | const_schema_type | enum_schema_type | UnrealEngineString_parent_type;
9
+ type typed_string_object_type = typed_string_sub_types | typed_string_parent_type;
10
+ export type typed_string_inner_object_type = {
11
+ required: [string, ...string[]];
12
+ properties: {
13
+ [key: string]: (typed_string_object_type);
14
+ };
15
+ };
16
+ export type typed_string_inner_object_pattern_type = {
17
+ minProperties: number;
18
+ patternProperties: {
19
+ [key: string]: (typed_string_object_type);
20
+ };
21
+ };
22
+ type typed_string_inner_array_items_type = typed_string_sub_types | typed_string_parent_type;
23
+ export type typed_string_inner_array_type = {
24
+ minItems: number;
25
+ maxItems?: number;
26
+ items: typed_string_inner_array_items_type | {
27
+ oneOf: [
28
+ typed_string_inner_array_items_type,
29
+ ...typed_string_inner_array_items_type[]
30
+ ];
31
+ } | typed_string_inner_array_prefixItems_type;
32
+ };
33
+ export type typed_string_inner_array_prefixItems_type = {
34
+ items: false;
35
+ minItems: number;
36
+ maxItems?: number;
37
+ prefixItems: [typed_string_sub_types, ...typed_string_sub_types[]];
38
+ };
39
+ type typed_string_inner_type = typed_string_inner_object_type | typed_string_inner_object_pattern_type | typed_string_inner_array_type | typed_string_inner_array_prefixItems_type;
40
+ export type typed_string_parent_type = {
41
+ type: 'string';
42
+ minLength: 1;
43
+ typed_string: typed_string_inner_type;
44
+ };
45
+ export declare const pattern_properties_regex = "^\\^\\([A-za-z]+(\\|[A-za-z]+)*\\)\\$$";
46
+ export declare const pattern_properties_schema: {
47
+ type: string;
48
+ required: string[];
49
+ additionalProperties: boolean;
50
+ properties: {
51
+ minProperties: {
52
+ type: string;
53
+ minimum: number;
54
+ };
55
+ patternProperties: {
56
+ type: string;
57
+ additionalProperties: boolean;
58
+ minProperties: number;
59
+ maxProperties: number;
60
+ patternProperties: {
61
+ "^\\^\\([A-za-z]+(\\|[A-za-z]+)*\\)\\$$": {
62
+ $ref: string;
63
+ };
64
+ };
65
+ };
66
+ };
67
+ };
68
+ export declare function generate_object_parent_schema(): {
69
+ $ref: string;
70
+ };
71
+ export declare function generate_typed_string_$defs($defs: local_ref<string>[]): {
72
+ typed_string_subtypes: {
73
+ oneOf: ({
74
+ type: string;
75
+ required: string[];
76
+ additionalProperties: boolean;
77
+ properties: {
78
+ type: {
79
+ type: string;
80
+ const: string;
81
+ };
82
+ minLength: {
83
+ type: string;
84
+ const: number;
85
+ };
86
+ UnrealEngineString: {
87
+ oneOf: ({
88
+ type: string;
89
+ required: string[];
90
+ additionalProperties: boolean;
91
+ properties: {
92
+ left: {
93
+ $ref: "#/$defs/UnrealEngineString_left";
94
+ };
95
+ right: {
96
+ $ref: "#/$defs/UnrealEngineString_right";
97
+ };
98
+ };
99
+ const?: undefined;
100
+ } | {
101
+ type: string;
102
+ required: string[];
103
+ additionalProperties: boolean;
104
+ properties: {
105
+ left: {
106
+ $ref: "#/$defs/UnrealEngineString_left";
107
+ };
108
+ right?: undefined;
109
+ };
110
+ const?: undefined;
111
+ } | {
112
+ type: string;
113
+ required: string[];
114
+ additionalProperties: boolean;
115
+ properties: {
116
+ right: {
117
+ $ref: "#/$defs/UnrealEngineString_right";
118
+ };
119
+ left?: undefined;
120
+ };
121
+ const?: undefined;
122
+ } | {
123
+ type: string;
124
+ const: boolean;
125
+ required?: undefined;
126
+ additionalProperties?: undefined;
127
+ properties?: undefined;
128
+ })[];
129
+ };
130
+ };
131
+ } | {
132
+ type: string;
133
+ required: string[];
134
+ additionalProperties: boolean;
135
+ properties: {
136
+ type: {
137
+ type: string;
138
+ const: string;
139
+ };
140
+ const: {
141
+ type: string;
142
+ pattern: string;
143
+ };
144
+ };
145
+ } | {
146
+ type: string;
147
+ required: string[];
148
+ additionalProperties: boolean;
149
+ properties: {
150
+ type: {
151
+ type: string;
152
+ const: string;
153
+ };
154
+ enum: {
155
+ type: string;
156
+ minItems: number;
157
+ items: {
158
+ type: string;
159
+ pattern: string;
160
+ };
161
+ };
162
+ };
163
+ } | {
164
+ type: string;
165
+ required: string[];
166
+ additionalProperties: boolean;
167
+ properties: {
168
+ type: {
169
+ type: string;
170
+ const: string;
171
+ };
172
+ pattern: {
173
+ oneOf: {
174
+ type: string;
175
+ pattern: string;
176
+ }[];
177
+ };
178
+ };
179
+ } | {
180
+ type: string;
181
+ required: string[];
182
+ additionalProperties: boolean;
183
+ properties: {
184
+ $ref: {
185
+ type: string;
186
+ enum: `#/$defs/${string}`[];
187
+ };
188
+ };
189
+ $ref?: undefined;
190
+ } | {
191
+ $ref: string;
192
+ type?: undefined;
193
+ required?: undefined;
194
+ additionalProperties?: undefined;
195
+ properties?: undefined;
196
+ })[];
197
+ };
198
+ typed_string_parent_type: {
199
+ type: string;
200
+ required: string[];
201
+ additionalProperties: boolean;
202
+ properties: {
203
+ type: {
204
+ type: string;
205
+ const: string;
206
+ };
207
+ minLength: {
208
+ type: string;
209
+ const: number;
210
+ };
211
+ typed_string: {
212
+ oneOf: {
213
+ $ref: string;
214
+ }[];
215
+ };
216
+ };
217
+ };
218
+ typed_string_object_type: {
219
+ type: string;
220
+ required: string[];
221
+ additionalProperties: boolean;
222
+ properties: {
223
+ required: {
224
+ type: string;
225
+ minItems: number;
226
+ items: {
227
+ type: string;
228
+ minLength: number;
229
+ };
230
+ };
231
+ properties: {
232
+ type: string;
233
+ additionalProperties: boolean;
234
+ patternProperties: {
235
+ "^[A-Za-z][A-Za-z0-9_\\[\\]]*$": {
236
+ $ref: string;
237
+ };
238
+ };
239
+ };
240
+ };
241
+ };
242
+ typed_string_object_pattern_type: {
243
+ type: string;
244
+ required: string[];
245
+ additionalProperties: boolean;
246
+ properties: {
247
+ minProperties: {
248
+ type: string;
249
+ minimum: number;
250
+ };
251
+ patternProperties: {
252
+ type: string;
253
+ additionalProperties: boolean;
254
+ minProperties: number;
255
+ maxProperties: number;
256
+ patternProperties: {
257
+ "^\\^\\([A-za-z]+(\\|[A-za-z]+)*\\)\\$$": {
258
+ $ref: string;
259
+ };
260
+ };
261
+ };
262
+ };
263
+ };
264
+ typed_string_array_type: {
265
+ type: string;
266
+ required: string[];
267
+ additionalProperties: boolean;
268
+ properties: {
269
+ minItems: {
270
+ type: string;
271
+ minimum: number;
272
+ };
273
+ maxItems: {
274
+ type: string;
275
+ minimum: number;
276
+ };
277
+ items: {
278
+ oneOf: ({
279
+ $ref: string;
280
+ type?: undefined;
281
+ required?: undefined;
282
+ additionalProperties?: undefined;
283
+ properties?: undefined;
284
+ } | {
285
+ type: string;
286
+ required: string[];
287
+ additionalProperties: boolean;
288
+ properties: {
289
+ oneOf: {
290
+ type: string;
291
+ minItems: number;
292
+ uniqueItems: boolean;
293
+ items: {
294
+ $ref: string;
295
+ };
296
+ };
297
+ };
298
+ $ref?: undefined;
299
+ })[];
300
+ };
301
+ };
302
+ };
303
+ typed_string_prefixItems_type: {
304
+ type: string;
305
+ required: string[];
306
+ additionalProperties: boolean;
307
+ properties: {
308
+ items: {
309
+ type: string;
310
+ const: boolean;
311
+ };
312
+ minItems: {
313
+ type: string;
314
+ minimum: number;
315
+ };
316
+ maxItems: {
317
+ type: string;
318
+ minimum: number;
319
+ };
320
+ prefixItems: {
321
+ type: string;
322
+ minItems: number;
323
+ items: {
324
+ $ref: string;
325
+ };
326
+ };
327
+ };
328
+ };
329
+ UnrealEngineString_left_string: {
330
+ type: string;
331
+ pattern: string;
332
+ };
333
+ UnrealEngineString_right_string: {
334
+ type: string;
335
+ pattern: string;
336
+ };
337
+ UnrealEngineString_left: {
338
+ oneOf: ({
339
+ $ref: "#/$defs/UnrealEngineString_left_string";
340
+ type?: undefined;
341
+ minItems?: undefined;
342
+ items?: undefined;
343
+ } | {
344
+ type: string;
345
+ minItems: number;
346
+ items: {
347
+ $ref: "#/$defs/UnrealEngineString_left_string";
348
+ };
349
+ $ref?: undefined;
350
+ })[];
351
+ };
352
+ UnrealEngineString_right_starts_with: {
353
+ type: string;
354
+ pattern: string;
355
+ };
356
+ UnrealEngineString_right: {
357
+ oneOf: ({
358
+ $ref: "#/$defs/UnrealEngineString_right_string";
359
+ type?: undefined;
360
+ minItems?: undefined;
361
+ items?: undefined;
362
+ required?: undefined;
363
+ additionalProperties?: undefined;
364
+ properties?: undefined;
365
+ } | {
366
+ type: string;
367
+ minItems: number;
368
+ items: {
369
+ $ref: "#/$defs/UnrealEngineString_right_string";
370
+ };
371
+ $ref?: undefined;
372
+ required?: undefined;
373
+ additionalProperties?: undefined;
374
+ properties?: undefined;
375
+ } | {
376
+ type: string;
377
+ required: string[];
378
+ additionalProperties: boolean;
379
+ properties: {
380
+ starts_with: {
381
+ oneOf: ({
382
+ $ref: "#/$defs/UnrealEngineString_right_starts_with";
383
+ type?: undefined;
384
+ minItems?: undefined;
385
+ items?: undefined;
386
+ } | {
387
+ type: string;
388
+ minItems: number;
389
+ items: {
390
+ $ref: "#/$defs/UnrealEngineString_right_starts_with";
391
+ };
392
+ $ref?: undefined;
393
+ })[];
394
+ };
395
+ };
396
+ $ref?: undefined;
397
+ minItems?: undefined;
398
+ items?: undefined;
399
+ })[];
400
+ };
401
+ };
402
+ export declare class TypedString {
403
+ private already_configured;
404
+ private static _instance?;
405
+ protected constructor();
406
+ configure_ajv($defs: {
407
+ [key: string]: SchemaObject;
408
+ }, ajv: Ajv): void;
409
+ static instance(): TypedString;
410
+ }
411
+ export {};
@@ -0,0 +1,204 @@
1
+ import { local_ref, } from '../StringStartsWith';
2
+ import { UnrealEngineString_parent_schema, UnrealEngineString_schema_definitions, } from './UnrealEngineString';
3
+ import { typed_string_const_schema, } from './TypedStringConst';
4
+ import { ValueToRegexFormatter, } from './ValueToRegexFormatter';
5
+ import { typed_string_enum_schema, } from './TypedStringEnum';
6
+ import { typed_string_pattern_general_schema_self_testing, } from './TypedStringPattern';
7
+ const property_regex = '^[A-Za-z][A-Za-z0-9_\\[\\]]*$';
8
+ export const pattern_properties_regex = '^\\^\\([A-za-z]+(\\|[A-za-z]+)*\\)\\$$';
9
+ export const pattern_properties_schema = {
10
+ type: 'object',
11
+ required: [
12
+ 'minProperties',
13
+ 'patternProperties',
14
+ ],
15
+ additionalProperties: false,
16
+ properties: {
17
+ minProperties: { type: 'number', minimum: 1 },
18
+ patternProperties: {
19
+ type: 'object',
20
+ additionalProperties: false,
21
+ minProperties: 1,
22
+ maxProperties: 1,
23
+ patternProperties: {
24
+ [pattern_properties_regex]: {
25
+ $ref: '#/$defs/typed_string_subtypes',
26
+ },
27
+ },
28
+ },
29
+ },
30
+ };
31
+ export function generate_object_parent_schema() {
32
+ return { $ref: '#/$defs/typed_string_parent_type' };
33
+ }
34
+ export function generate_typed_string_$defs($defs) {
35
+ return {
36
+ ...UnrealEngineString_schema_definitions,
37
+ typed_string_subtypes: {
38
+ oneOf: [
39
+ {
40
+ type: 'object',
41
+ required: ['$ref'],
42
+ additionalProperties: false,
43
+ properties: {
44
+ $ref: {
45
+ type: 'string',
46
+ enum: $defs,
47
+ },
48
+ },
49
+ },
50
+ UnrealEngineString_parent_schema,
51
+ typed_string_const_schema,
52
+ typed_string_enum_schema,
53
+ typed_string_pattern_general_schema_self_testing,
54
+ { $ref: '#/$defs/typed_string_parent_type' },
55
+ ],
56
+ },
57
+ typed_string_parent_type: {
58
+ type: 'object',
59
+ required: ['type', 'minLength', 'typed_string'],
60
+ additionalProperties: false,
61
+ properties: {
62
+ type: { type: 'string', const: 'string' },
63
+ minLength: { type: 'number', const: 1 },
64
+ typed_string: {
65
+ oneOf: [
66
+ { $ref: '#/$defs/typed_string_object_type' },
67
+ { $ref: `#/$defs/typed_string_object_pattern_type` },
68
+ { $ref: '#/$defs/typed_string_array_type' },
69
+ { $ref: '#/$defs/typed_string_prefixItems_type' },
70
+ ],
71
+ },
72
+ },
73
+ },
74
+ typed_string_object_type: {
75
+ type: 'object',
76
+ required: [
77
+ 'properties',
78
+ ],
79
+ additionalProperties: false,
80
+ properties: {
81
+ required: {
82
+ type: 'array',
83
+ minItems: 1,
84
+ items: {
85
+ type: 'string',
86
+ minLength: 1,
87
+ },
88
+ },
89
+ properties: {
90
+ type: 'object',
91
+ additionalProperties: false,
92
+ patternProperties: {
93
+ [property_regex]: {
94
+ $ref: '#/$defs/typed_string_subtypes',
95
+ },
96
+ },
97
+ },
98
+ },
99
+ },
100
+ typed_string_object_pattern_type: pattern_properties_schema,
101
+ typed_string_array_type: {
102
+ type: 'object',
103
+ required: [
104
+ 'minItems',
105
+ 'items',
106
+ ],
107
+ additionalProperties: false,
108
+ properties: {
109
+ minItems: {
110
+ type: 'number',
111
+ 'minimum': 0,
112
+ },
113
+ maxItems: {
114
+ type: 'number',
115
+ 'minimum': 1,
116
+ },
117
+ items: {
118
+ oneOf: [
119
+ { $ref: '#/$defs/typed_string_subtypes' },
120
+ {
121
+ type: 'object',
122
+ required: ['oneOf'],
123
+ additionalProperties: false,
124
+ properties: {
125
+ oneOf: {
126
+ type: 'array',
127
+ minItems: 1,
128
+ uniqueItems: true,
129
+ items: {
130
+ $ref: `#/$defs/typed_string_subtypes`,
131
+ },
132
+ },
133
+ },
134
+ },
135
+ { $ref: '#/$defs/typed_string_prefixItems_type' },
136
+ ],
137
+ },
138
+ },
139
+ },
140
+ typed_string_prefixItems_type: {
141
+ type: 'object',
142
+ required: [
143
+ 'minItems',
144
+ 'items',
145
+ 'prefixItems',
146
+ ],
147
+ additionalProperties: false,
148
+ properties: {
149
+ items: { type: 'boolean', const: false },
150
+ minItems: {
151
+ type: 'number',
152
+ 'minimum': 0,
153
+ },
154
+ maxItems: {
155
+ type: 'number',
156
+ 'minimum': 1,
157
+ },
158
+ prefixItems: {
159
+ type: 'array',
160
+ minItems: 1,
161
+ items: { $ref: '#/$defs/typed_string_subtypes' },
162
+ },
163
+ },
164
+ },
165
+ };
166
+ }
167
+ export class TypedString {
168
+ already_configured = new WeakSet();
169
+ static _instance;
170
+ constructor() {
171
+ }
172
+ configure_ajv($defs, ajv) {
173
+ if (this.already_configured.has(ajv)) {
174
+ return;
175
+ }
176
+ const local_refs = Object.keys($defs).map(local_ref);
177
+ this.already_configured.add(ajv);
178
+ const meta_schema = {
179
+ $defs: generate_typed_string_$defs(local_refs),
180
+ oneOf: [
181
+ { $ref: '#/$defs/typed_string_object_type' },
182
+ { $ref: '#/$defs/typed_string_object_pattern_type' },
183
+ { $ref: '#/$defs/typed_string_array_type' },
184
+ { $ref: '#/$defs/typed_string_prefixItems_type' },
185
+ ],
186
+ };
187
+ const formatter = new ValueToRegexFormatter($defs);
188
+ ajv.addKeyword({
189
+ keyword: 'typed_string',
190
+ type: 'string',
191
+ metaSchema: meta_schema,
192
+ macro: (schema) => {
193
+ return formatter.pattern_from_value(schema);
194
+ },
195
+ });
196
+ }
197
+ static instance() {
198
+ if (!this._instance) {
199
+ this._instance = new this();
200
+ }
201
+ return this._instance;
202
+ }
203
+ }
204
+ //# sourceMappingURL=TypedString.js.map
@@ -0,0 +1,28 @@
1
+ import { SupportedSubSchemaType } from './CustomPairingTypes';
2
+ export declare const typed_string_const_value_regex = "^(?:[A-Za-z0-9][A-Za-z0-9_ -]*|/(?:[A-Z-][A-Za-z0-9_-]+/)+(?:[A-Z][A-Za-z_0-9-]+\\.[A-Z][A-Za-z_0-9-]+(?:_C)?(?::[A-Z][A-Za-z0-9_]+)?|[A-Z][A-Za-z_]+\\.[A-Z][A-Za-z_]+)|\\(\\))$";
3
+ export declare const typed_string_const_value_regex__native: RegExp;
4
+ export declare const typed_string_const_schema: {
5
+ type: string;
6
+ required: string[];
7
+ additionalProperties: boolean;
8
+ properties: {
9
+ type: {
10
+ type: string;
11
+ const: string;
12
+ };
13
+ const: {
14
+ type: string;
15
+ pattern: string;
16
+ };
17
+ };
18
+ };
19
+ export type const_schema_type = {
20
+ type: 'string';
21
+ const: string;
22
+ };
23
+ declare class TypedStringConst extends SupportedSubSchemaType<const_schema_type> {
24
+ is_supported_schema(maybe: unknown): maybe is const_schema_type;
25
+ value_regex(value: const_schema_type): string;
26
+ }
27
+ export declare const typed_string_const: TypedStringConst;
28
+ export {};
@@ -0,0 +1,35 @@
1
+ import { UnrealEngineString_general_regex, } from './UnrealEngineString';
2
+ import { object_has_property, SupportedSubSchemaType, value_is_non_array_object, } from './CustomPairingTypes';
3
+ import { is_string, } from '../StringStartsWith';
4
+ export const typed_string_const_value_regex = `^(?:[A-Za-z0-9][A-Za-z0-9_ -]*|${UnrealEngineString_general_regex}|\\(\\))$`;
5
+ export const typed_string_const_value_regex__native = new RegExp(typed_string_const_value_regex);
6
+ export const typed_string_const_schema = {
7
+ type: 'object',
8
+ required: ['type', 'const'],
9
+ additionalProperties: false,
10
+ properties: {
11
+ type: { type: 'string', const: 'string' },
12
+ const: {
13
+ type: 'string',
14
+ pattern: typed_string_const_value_regex,
15
+ },
16
+ },
17
+ };
18
+ class TypedStringConst extends SupportedSubSchemaType {
19
+ is_supported_schema(maybe) {
20
+ return (value_is_non_array_object(maybe)
21
+ && 2 === Object.keys(maybe).length
22
+ && object_has_property(maybe, 'type')
23
+ && 'string' === maybe.type
24
+ && object_has_property(maybe, 'const', is_string)
25
+ && typed_string_const_value_regex__native.test(maybe.const));
26
+ }
27
+ value_regex(value) {
28
+ const lazy_escape = value.const
29
+ .replace(/\(/g, '\\(')
30
+ .replace(/\)/g, '\\)');
31
+ return `(?:(${lazy_escape}|"${lazy_escape}"))`;
32
+ }
33
+ }
34
+ export const typed_string_const = new TypedStringConst();
35
+ //# sourceMappingURL=TypedStringConst.js.map
@@ -0,0 +1,30 @@
1
+ import { SupportedSubSchemaType } from './CustomPairingTypes';
2
+ export type enum_schema_type = {
3
+ type: 'string';
4
+ enum: [string, ...string[]];
5
+ };
6
+ export declare const typed_string_enum_schema: {
7
+ type: string;
8
+ required: string[];
9
+ additionalProperties: boolean;
10
+ properties: {
11
+ type: {
12
+ type: string;
13
+ const: string;
14
+ };
15
+ enum: {
16
+ type: string;
17
+ minItems: number;
18
+ items: {
19
+ type: string;
20
+ pattern: string;
21
+ };
22
+ };
23
+ };
24
+ };
25
+ declare class TypedStringEnum extends SupportedSubSchemaType<enum_schema_type> {
26
+ is_supported_schema(maybe: unknown): maybe is enum_schema_type;
27
+ value_regex(value: enum_schema_type): string;
28
+ }
29
+ export declare const typed_string_enum: TypedStringEnum;
30
+ export {};