@aidc-toolkit/app-extension 1.0.27-beta → 1.0.28-beta

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 (37) hide show
  1. package/dist/index.cjs +1102 -877
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.cts +79 -241
  4. package/dist/index.d.ts +79 -241
  5. package/dist/index.js +1100 -870
  6. package/dist/index.js.map +1 -1
  7. package/package.json +5 -5
  8. package/src/app-extension.ts +5 -5
  9. package/src/app-utility-proxy.ts +18 -24
  10. package/src/descriptor.ts +29 -259
  11. package/src/generator/generator.ts +86 -132
  12. package/src/generator/index.ts +0 -1
  13. package/src/generator/locale-resources-generator.ts +39 -14
  14. package/src/gs1/character-set-proxy.ts +5 -5
  15. package/src/gs1/check-proxy.ts +35 -42
  16. package/src/gs1/gtin-creator-proxy.ts +58 -0
  17. package/src/gs1/gtin-descriptor.ts +29 -0
  18. package/src/gs1/gtin-validator-proxy.ts +161 -0
  19. package/src/gs1/identifier-creator-proxy.ts +227 -0
  20. package/src/gs1/identifier-validator-proxy.ts +87 -0
  21. package/src/gs1/index.ts +5 -1
  22. package/src/gs1/non-gtin-creator-proxy.ts +119 -0
  23. package/src/gs1/non-gtin-validator-proxy.ts +119 -0
  24. package/src/gs1/prefix-definition-descriptor.ts +18 -0
  25. package/src/gs1/prefix-manager-proxy.ts +42 -0
  26. package/src/index.ts +1 -0
  27. package/src/lib-proxy.ts +1 -1
  28. package/src/proxy.ts +509 -0
  29. package/src/utility/character-set-descriptor.ts +5 -5
  30. package/src/utility/character-set-proxy.ts +31 -47
  31. package/src/utility/reg-exp-proxy.ts +11 -15
  32. package/src/utility/string-descriptor.ts +2 -2
  33. package/src/utility/transformer-descriptor.ts +3 -3
  34. package/src/utility/transformer-proxy.ts +16 -26
  35. package/tsconfig-src.json +1 -4
  36. package/src/generator/descriptor.ts +0 -125
  37. package/src/gs1/identifier-proxy.ts +0 -826
package/src/proxy.ts ADDED
@@ -0,0 +1,509 @@
1
+ import {
2
+ type AbstractConstructor,
3
+ type Constructor,
4
+ getLogger,
5
+ LogLevels,
6
+ omit,
7
+ type TypedAbstractConstructor
8
+ } from "@aidc-toolkit/core";
9
+ import type { Logger } from "tslog";
10
+ import type { AppExtension } from "./app-extension.js";
11
+ import type {
12
+ ClassDescriptor,
13
+ ExtendsParameterDescriptor,
14
+ MethodDescriptor,
15
+ ParameterDescriptor
16
+ } from "./descriptor.js";
17
+ import { LibProxy } from "./lib-proxy.js";
18
+ import type { ErrorExtends } from "./type.js";
19
+
20
+ /**
21
+ * Remaining parameters past first parameter in constructor.
22
+ */
23
+ type RemainingParameters<TConstructor extends TypedAbstractConstructor<TConstructor>> =
24
+ TConstructor extends abstract new (arg0: infer _P0, ...args: infer P) => InstanceType<TConstructor> ? P : never;
25
+
26
+ /**
27
+ * Proxy class constructor type with fixed constructor signature for concrete class and variable constructor for
28
+ * abstract class.
29
+ *
30
+ * @template T
31
+ * Proxy class type.
32
+ *
33
+ * @template IsAbstract
34
+ * True if the proxy class is abstract.
35
+ *
36
+ * @template TConstructor
37
+ * Proxy class constructor type.
38
+ */
39
+ type ProxyClassConstructor<
40
+ ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt,
41
+ T extends LibProxy<ThrowError, TError, TInvocationContext, TBigInt>,
42
+ IsAbstract extends boolean,
43
+ TConstructor extends TypedAbstractConstructor<TConstructor>
44
+ > = IsAbstract extends true ?
45
+ AbstractConstructor<[appExtension: AppExtension<ThrowError, TError, TInvocationContext, TBigInt>, ...args: RemainingParameters<TConstructor>], T> :
46
+ Constructor<[appExtension: AppExtension<ThrowError, TError, TInvocationContext, TBigInt>], T>;
47
+
48
+ /**
49
+ * Class decorator type. Defines the parameters passed to a class decorator function and the return type as identical to
50
+ * the constructor.
51
+ *
52
+ * @template T
53
+ * Proxy class type.
54
+ *
55
+ * @template IsAbstract
56
+ * True if the proxy class is abstract.
57
+ *
58
+ * @template TConstructor
59
+ * Proxy class constructor type.
60
+ *
61
+ * @template TProxyClassConstructor
62
+ * Narrowed proxy class constructor type.
63
+ */
64
+ type ClassDecorator<
65
+ ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt,
66
+ T extends LibProxy<ThrowError, TError, TInvocationContext, TBigInt>,
67
+ IsAbstract extends boolean,
68
+ TConstructor extends TypedAbstractConstructor<TConstructor>,
69
+ TProxyClassConstructor extends ProxyClassConstructor<ThrowError, TError, TInvocationContext, TBigInt, T, IsAbstract, TConstructor>
70
+ > = (Target: TProxyClassConstructor, context: ClassDecoratorContext<TProxyClassConstructor>) => TProxyClassConstructor;
71
+
72
+ /**
73
+ * Class method decorator type. Defines the parameters passed to a class method decorator function and the return type
74
+ * as identical to the method.
75
+ *
76
+ * @template TFunction
77
+ * Function type.
78
+ */
79
+ type ClassMethodDecorator<TThis, TArguments extends unknown[], TReturn> =
80
+ (target: (this: TThis, ...args: TArguments) => TReturn, context: ClassMethodDecoratorContext<TThis>) => (this: TThis, ...args: TArguments) => TReturn;
81
+
82
+ /**
83
+ * Subset of method descriptor used during decoration process.
84
+ */
85
+ type InterimMethodDescriptor = Omit<MethodDescriptor, "functionName" | "namespaceFunctionName">;
86
+
87
+ /**
88
+ * Subset of method descriptor used in call to decorator.
89
+ */
90
+ type DecoratorMethodDescriptor = Omit<InterimMethodDescriptor, "name" | "parameterDescriptors"> & {
91
+ parameterDescriptors: Array<ParameterDescriptor | ExtendsParameterDescriptor>;
92
+ };
93
+
94
+ /**
95
+ * Subset of class descriptor used during decoration process.
96
+ */
97
+ type InterimClassDescriptor =
98
+ Omit<ClassDescriptor, "name" | "namespaceClassName" | "objectName" | "methodDescriptors">;
99
+
100
+ /**
101
+ * Subset of class descriptor used in call to decorator.
102
+ */
103
+ interface DecoratorClassDescriptor extends Omit<InterimClassDescriptor, "replaceParameterDescriptors"> {
104
+ readonly replaceParameterDescriptors?: ReadonlyArray<Omit<Required<ClassDescriptor>["replaceParameterDescriptors"][number], "replacement"> & {
105
+ readonly replacement: ParameterDescriptor | ExtendsParameterDescriptor;
106
+ }>;
107
+ }
108
+
109
+ /**
110
+ * Expand a parameter descriptor to its full form with all required attributes.
111
+ *
112
+ * @param parameterDescriptor
113
+ * Parameter descriptor.
114
+ *
115
+ * @returns
116
+ * Parameter descriptor in its full form.
117
+ */
118
+ export function expandParameterDescriptor(parameterDescriptor: ParameterDescriptor | ExtendsParameterDescriptor): ParameterDescriptor {
119
+ return !("extendsDescriptor" in parameterDescriptor) ?
120
+ parameterDescriptor :
121
+ {
122
+ ...expandParameterDescriptor(parameterDescriptor.extendsDescriptor),
123
+ ...parameterDescriptor
124
+ };
125
+ }
126
+
127
+ /**
128
+ * Placeholder for interim descriptors.
129
+ */
130
+ interface Interim {
131
+ /**
132
+ * Interim class descriptor.
133
+ */
134
+ readonly classDescriptor: InterimClassDescriptor;
135
+
136
+ /**
137
+ * Interim method descriptors.
138
+ */
139
+ readonly methodDescriptors: InterimMethodDescriptor[];
140
+ }
141
+
142
+ /**
143
+ * Target logger interface to be implemented by returned decorator class.
144
+ */
145
+ interface TargetLogger {
146
+ /**
147
+ * Log a method call.
148
+ *
149
+ * @param methodName
150
+ * Method name.
151
+ *
152
+ * @param args
153
+ * Input arguments.
154
+ *
155
+ * @param result
156
+ * Output result.
157
+ */
158
+ log: (methodName: string, args: unknown[], result: unknown) => void;
159
+ }
160
+
161
+ /**
162
+ * Proxy class.
163
+ */
164
+ export class Proxy {
165
+ /**
166
+ * Logger.
167
+ */
168
+ readonly #logger: Logger<unknown> = getLogger(LogLevels.Info);
169
+
170
+ /**
171
+ * Abstract class descriptors map, keyed on declaration class name. Abstract classes are not used directly by target
172
+ * applications.
173
+ */
174
+ readonly #abstractClassDescriptorsMap = new Map<string, ClassDescriptor>();
175
+
176
+ /**
177
+ * Concrete class descriptors map, keyed on declaration class name.
178
+ */
179
+ readonly #concreteClassDescriptorsMap = new Map<string, ClassDescriptor>();
180
+
181
+ /**
182
+ * Interim object.
183
+ */
184
+ #interim: Interim | undefined = undefined;
185
+
186
+ /**
187
+ * Get the proper JSON representation of a value.
188
+ *
189
+ * @param value
190
+ * Value.
191
+ *
192
+ * @returns
193
+ * Replacement value.
194
+ */
195
+ static #jsonValue(value: unknown): unknown {
196
+ let replacementValue: unknown;
197
+
198
+ switch (typeof value) {
199
+ case "string":
200
+ case "number":
201
+ case "boolean":
202
+ case "undefined":
203
+ replacementValue = value;
204
+ break;
205
+
206
+ case "bigint":
207
+ // Big integers not supported in JSON.
208
+ replacementValue = value >= Number.MIN_SAFE_INTEGER && value <= Number.MAX_SAFE_INTEGER ? Number(value) : value.toString(10);
209
+ break;
210
+
211
+ case "object":
212
+ if (value === null) {
213
+ replacementValue = value;
214
+ } else if (Array.isArray(value)) {
215
+ replacementValue = value.map(entry => Proxy.#jsonValue(entry));
216
+ } else {
217
+ replacementValue = Object.fromEntries(Object.entries(value).map(([k, v]) => [k, Proxy.#jsonValue(v)]));
218
+ }
219
+ break;
220
+
221
+ case "symbol":
222
+ case "function":
223
+ throw new Error(`Unsupported ${typeof value} value type`);
224
+ }
225
+
226
+ return replacementValue;
227
+ }
228
+
229
+ /**
230
+ * Describe a proxy class.
231
+ *
232
+ * @template T
233
+ * Proxy class type.
234
+ *
235
+ * @template IsAbstract
236
+ * True if the proxy class is abstract.
237
+ *
238
+ * @template TConstructor
239
+ * Proxy class constructor type.
240
+ *
241
+ * @template TProxyClassConstructor
242
+ * Narrowed proxy class constructor type.
243
+ *
244
+ * @param isAbstract
245
+ * True if class is abstract.
246
+ *
247
+ * @param decoratorClassDescriptor
248
+ * Class descriptor.
249
+ *
250
+ * @returns
251
+ * Function with which to decorate the class.
252
+ */
253
+ describeClass<
254
+ ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt,
255
+ T extends LibProxy<ThrowError, TError, TInvocationContext, TBigInt>,
256
+ IsAbstract extends boolean,
257
+ TConstructor extends TypedAbstractConstructor<TConstructor>,
258
+ TProxyClassConstructor extends ProxyClassConstructor<ThrowError, TError, TInvocationContext, TBigInt, T, IsAbstract, TConstructor>
259
+ >(isAbstract: IsAbstract, decoratorClassDescriptor: DecoratorClassDescriptor = {}): ClassDecorator<ThrowError, TError, TInvocationContext, TBigInt, T, IsAbstract, TConstructor, TProxyClassConstructor> {
260
+ const interimClassDescriptor: InterimClassDescriptor = decoratorClassDescriptor.replaceParameterDescriptors === undefined ?
261
+ omit(decoratorClassDescriptor, "replaceParameterDescriptors") :
262
+ {
263
+ ...decoratorClassDescriptor,
264
+ replaceParameterDescriptors: decoratorClassDescriptor.replaceParameterDescriptors.map(replaceParameterDescriptor => ({
265
+ ...replaceParameterDescriptor,
266
+ replacement: expandParameterDescriptor(replaceParameterDescriptor.replacement)
267
+ }))
268
+ };
269
+
270
+ const interim: Interim = {
271
+ classDescriptor: interimClassDescriptor,
272
+ methodDescriptors: []
273
+ };
274
+
275
+ this.#interim = interim;
276
+
277
+ return (Target: TProxyClassConstructor, context: ClassDecoratorContext<TProxyClassConstructor>) => {
278
+ const name = context.name;
279
+
280
+ // Validate that class descriptor is applied within an appropriate class.
281
+ if (typeof name !== "string") {
282
+ throw new Error(`${String(name)} has an invalid name`);
283
+ }
284
+
285
+ const namespacePrefix = decoratorClassDescriptor.namespace === undefined ? "" : `${decoratorClassDescriptor.namespace}.`;
286
+ const namespaceClassName = `${namespacePrefix}${name}`;
287
+
288
+ const abstractClassDescriptorsMap = this.#abstractClassDescriptorsMap;
289
+ const concreteClassDescriptorsMap = this.#concreteClassDescriptorsMap;
290
+
291
+ if (abstractClassDescriptorsMap.has(namespaceClassName) || concreteClassDescriptorsMap.has(namespaceClassName)) {
292
+ throw new Error(`Duplicate class ${namespaceClassName}`);
293
+ }
294
+
295
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- Class hierarchy is known.
296
+ let baseClassType: typeof LibProxy = Target as unknown as typeof LibProxy;
297
+ let baseClassDescriptor: ClassDescriptor | undefined;
298
+
299
+ do {
300
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- Class hierarchy is known.
301
+ baseClassType = Object.getPrototypeOf(baseClassType) as typeof LibProxy;
302
+
303
+ const namespaceBaseClassName = `${namespacePrefix}${baseClassType.name}`;
304
+
305
+ // Look first within the namespace and then in no namespace, in both abstract class descriptors map and concrete class descriptors map.
306
+ baseClassDescriptor =
307
+ abstractClassDescriptorsMap.get(namespaceBaseClassName) ?? abstractClassDescriptorsMap.get(baseClassType.name) ??
308
+ concreteClassDescriptorsMap.get(namespaceBaseClassName) ?? concreteClassDescriptorsMap.get(baseClassType.name);
309
+ } while (baseClassType !== LibProxy && baseClassDescriptor === undefined);
310
+
311
+ let interimMethodDescriptors: InterimMethodDescriptor[];
312
+
313
+ if (baseClassDescriptor !== undefined) {
314
+ const baseClassMethodDescriptors = baseClassDescriptor.methodDescriptors;
315
+ const replaceParameterDescriptors = decoratorClassDescriptor.replaceParameterDescriptors;
316
+
317
+ if (replaceParameterDescriptors !== undefined) {
318
+ const replacementParameterDescriptorsMap = new Map(replaceParameterDescriptors.map(replaceParameterDescriptor => [replaceParameterDescriptor.name, expandParameterDescriptor(replaceParameterDescriptor.replacement)]));
319
+
320
+ // Interim method descriptors for class have to be built as copies due to possible mutation of parameter descriptors.
321
+ interimMethodDescriptors = baseClassMethodDescriptors.map(baseClassMethodDescriptor => ({
322
+ ...baseClassMethodDescriptor,
323
+ parameterDescriptors: baseClassMethodDescriptor.parameterDescriptors.map(parameterDescriptor => replacementParameterDescriptorsMap.get(parameterDescriptor.name) ?? parameterDescriptor)
324
+ }));
325
+ } else {
326
+ interimMethodDescriptors = baseClassMethodDescriptors.slice();
327
+ }
328
+ } else {
329
+ interimMethodDescriptors = [];
330
+ }
331
+
332
+ // Replace base class method descriptors with matching names or append new method descriptor.
333
+ for (const classInterimMethodDescriptor of interim.methodDescriptors) {
334
+ const existingIndex = interimMethodDescriptors.findIndex(interimMethodDescriptor => interimMethodDescriptor.name === classInterimMethodDescriptor.name);
335
+
336
+ if (existingIndex !== -1) {
337
+ interimMethodDescriptors[existingIndex] = classInterimMethodDescriptor;
338
+ } else {
339
+ interimMethodDescriptors.push(classInterimMethodDescriptor);
340
+ }
341
+ }
342
+
343
+ const methodDescriptors: MethodDescriptor[] = [];
344
+
345
+ const methodInfix = decoratorClassDescriptor.methodInfix;
346
+
347
+ for (const interimMethodDescriptor of interimMethodDescriptors) {
348
+ const methodName = interimMethodDescriptor.name;
349
+ const infixBefore = interimMethodDescriptor.infixBefore;
350
+
351
+ let functionName: string;
352
+
353
+ if (methodInfix === undefined || interimMethodDescriptor.ignoreInfix === true) {
354
+ // No other classes in the hierarchy or no infix required.
355
+ functionName = methodName;
356
+ } else if (infixBefore === undefined) {
357
+ // Other classes in the hierarchy and infix is postfix.
358
+ functionName = `${methodName}${methodInfix}`;
359
+ } else {
360
+ const insertIndex = methodName.indexOf(infixBefore);
361
+
362
+ if (insertIndex === -1) {
363
+ throw new Error(`Cannot find "${infixBefore}" in method ${methodName}`);
364
+ }
365
+
366
+ // Other classes in the hierarchy and infix is in the middle of the string.
367
+ functionName = `${methodName.substring(0, insertIndex)}${methodInfix}${methodName.substring(insertIndex)}`;
368
+ }
369
+
370
+ const namespaceFunctionName = `${namespacePrefix}${functionName}`;
371
+
372
+ const methodDescriptor = {
373
+ ...interimMethodDescriptor,
374
+ functionName,
375
+ namespaceFunctionName
376
+ };
377
+
378
+ methodDescriptors.push(methodDescriptor);
379
+ }
380
+
381
+ // First capture group is:
382
+ // - one or more uppercase letters followed by zero or more numbers; or
383
+ // - single uppercase letter followed by zero or more characters except uppercase letters or period.
384
+ //
385
+ // Second capture group is:
386
+ // - single uppercase letter followed by zero or more characters except period; or
387
+ // - zero characters (empty string).
388
+ //
389
+ // Third capture group, separated by optional period, is:
390
+ // - single uppercase letter followed by zero or more characters (remainder of string); or
391
+ // - zero characters (empty string).
392
+ const objectNameGroups = /^(?<namespaceFirstWord>[A-Z]+[0-9]*|[A-Z][^A-Z.]*)(?<namespaceRemaining>[A-Z][^.]*|)\.?(?<className>[A-Z].*|)$/.exec(namespaceClassName)?.groups;
393
+
394
+ if (objectNameGroups === undefined) {
395
+ throw new Error(`${namespaceClassName} is not a valid namespace-qualified class name`);
396
+ }
397
+
398
+ const classDescriptor: ClassDescriptor = {
399
+ name,
400
+ ...interimClassDescriptor,
401
+ namespaceClassName,
402
+ objectName: `${objectNameGroups["namespaceFirstWord"].toLowerCase()}${objectNameGroups["namespaceRemaining"]}${objectNameGroups["className"]}`,
403
+ methodDescriptors
404
+ };
405
+
406
+ (isAbstract ? abstractClassDescriptorsMap : concreteClassDescriptorsMap).set(namespaceClassName, classDescriptor);
407
+
408
+ const methodDescriptorsMap = new Map<string, MethodDescriptor>();
409
+
410
+ for (const methodDescriptor of methodDescriptors) {
411
+ methodDescriptorsMap.set(methodDescriptor.name, methodDescriptor);
412
+ }
413
+
414
+ this.#interim = undefined;
415
+
416
+ const logger = this.#logger;
417
+
418
+ return class extends Target implements TargetLogger {
419
+ /**
420
+ * @inheritDoc
421
+ */
422
+ log(methodName: string, args: unknown[], result: unknown): void {
423
+ // // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- Type hierarchy is known.
424
+ // const appExtension = (this as unknown as T).appExtension;
425
+
426
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- Method name is known to be valid at this point.
427
+ const methodDescriptor = methodDescriptorsMap.get(methodName)!;
428
+
429
+ logger.info(JSON.stringify({
430
+ namespace: decoratorClassDescriptor.namespace,
431
+ className: name,
432
+ methodName,
433
+ functionName: methodDescriptor.functionName,
434
+ parameters: methodDescriptor.parameterDescriptors.map((parameterDescriptor, index) => ({
435
+ name: parameterDescriptor.name,
436
+ value: args[index]
437
+ })),
438
+ result: Proxy.#jsonValue(result)
439
+ }, null, 2));
440
+ }
441
+ };
442
+ };
443
+ }
444
+
445
+ /**
446
+ * Describe a proxy method.
447
+ *
448
+ * @template TFunction
449
+ * Function type.
450
+ *
451
+ * @param decoratorMethodDescriptor
452
+ * Method descriptor.
453
+ *
454
+ * @returns
455
+ * Function with which to decorate the method.
456
+ */
457
+ describeMethod<TThis, TArguments extends unknown[], TReturn>(decoratorMethodDescriptor: DecoratorMethodDescriptor): ClassMethodDecorator<TThis, TArguments, TReturn> {
458
+ return (target: (this: TThis, ...args: TArguments) => TReturn, context: ClassMethodDecoratorContext<TThis>): (this: TThis, ...args: TArguments) => TReturn => {
459
+ const name = context.name;
460
+
461
+ // Validate that method descriptor is applied within an appropriate class and has a valid name.
462
+ if (this.#interim === undefined || typeof name !== "string" || context.static || context.private) {
463
+ throw new Error(`${String(name)} is not defined within a supported class, has an invalid name, is static, or is private`);
464
+ }
465
+
466
+ let anyOptional = false;
467
+
468
+ // Expand all parameter descriptors.
469
+ const parameterDescriptors = decoratorMethodDescriptor.parameterDescriptors.map((decoratorParameterDescriptor) => {
470
+ const parameterDescriptor = expandParameterDescriptor(decoratorParameterDescriptor);
471
+
472
+ if (!parameterDescriptor.isRequired) {
473
+ anyOptional = true;
474
+ } else if (anyOptional) {
475
+ throw new Error(`Parameter ${parameterDescriptor.name} descriptor of method ${name} is required but prior parameter descriptor is optional`);
476
+ }
477
+
478
+ return parameterDescriptor;
479
+ });
480
+
481
+ this.#interim.methodDescriptors.push({
482
+ name,
483
+ ...decoratorMethodDescriptor,
484
+ parameterDescriptors
485
+ });
486
+
487
+ return function methodProxy(this: TThis, ...args: TArguments): TReturn {
488
+ const result = target.call(this, ...args);
489
+
490
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- Class has been modified to add log method.
491
+ (this as TargetLogger).log(name, args, result);
492
+
493
+ return result;
494
+ };
495
+ };
496
+ }
497
+
498
+ /**
499
+ * Get the class descriptors map.
500
+ */
501
+ get classDescriptorsMap(): Map<string, ClassDescriptor> {
502
+ return this.#concreteClassDescriptorsMap;
503
+ }
504
+ }
505
+
506
+ /**
507
+ * Proxy object used by all proxy classes.
508
+ */
509
+ export const proxy = new Proxy();
@@ -1,4 +1,4 @@
1
- import { type ParameterDescriptor, Types } from "../descriptor.js";
1
+ import { type ExtendsParameterDescriptor, type ParameterDescriptor, Types } from "../descriptor.js";
2
2
 
3
3
  const exclusionParameterDescriptor: ParameterDescriptor = {
4
4
  name: "exclusion",
@@ -7,25 +7,25 @@ const exclusionParameterDescriptor: ParameterDescriptor = {
7
7
  isRequired: false
8
8
  };
9
9
 
10
- export const exclusionNoneParameterDescriptor: ParameterDescriptor = {
10
+ export const exclusionNoneParameterDescriptor: ExtendsParameterDescriptor = {
11
11
  extendsDescriptor: exclusionParameterDescriptor,
12
12
  sortOrder: 0,
13
13
  name: "exclusionNone"
14
14
  };
15
15
 
16
- export const exclusionFirstZeroParameterDescriptor: ParameterDescriptor = {
16
+ export const exclusionFirstZeroParameterDescriptor: ExtendsParameterDescriptor = {
17
17
  extendsDescriptor: exclusionParameterDescriptor,
18
18
  sortOrder: 1,
19
19
  name: "exclusionFirstZero"
20
20
  };
21
21
 
22
- export const exclusionAllNumericParameterDescriptor: ParameterDescriptor = {
22
+ export const exclusionAllNumericParameterDescriptor: ExtendsParameterDescriptor = {
23
23
  extendsDescriptor: exclusionParameterDescriptor,
24
24
  sortOrder: 2,
25
25
  name: "exclusionAllNumeric"
26
26
  };
27
27
 
28
- export const exclusionAnyParameterDescriptor: ParameterDescriptor = {
28
+ export const exclusionAnyParameterDescriptor: ExtendsParameterDescriptor = {
29
29
  extendsDescriptor: exclusionParameterDescriptor,
30
30
  sortOrder: 3,
31
31
  name: "exclusionAny"