@aidc-toolkit/app-extension 0.9.19-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 (112) hide show
  1. package/LICENSE +174 -0
  2. package/README.md +17 -0
  3. package/app-extension.iml +9 -0
  4. package/dist/app-extension.d.ts +169 -0
  5. package/dist/app-extension.d.ts.map +1 -0
  6. package/dist/app-extension.js +148 -0
  7. package/dist/app-extension.js.map +1 -0
  8. package/dist/app-utility-proxy.d.ts +66 -0
  9. package/dist/app-utility-proxy.d.ts.map +1 -0
  10. package/dist/app-utility-proxy.js +233 -0
  11. package/dist/app-utility-proxy.js.map +1 -0
  12. package/dist/descriptor.d.ts +168 -0
  13. package/dist/descriptor.d.ts.map +1 -0
  14. package/dist/descriptor.js +175 -0
  15. package/dist/descriptor.js.map +1 -0
  16. package/dist/gs1/character-set-proxy.d.ts +10 -0
  17. package/dist/gs1/character-set-proxy.d.ts.map +1 -0
  18. package/dist/gs1/character-set-proxy.js +47 -0
  19. package/dist/gs1/character-set-proxy.js.map +1 -0
  20. package/dist/gs1/check-proxy.d.ts +11 -0
  21. package/dist/gs1/check-proxy.d.ts.map +1 -0
  22. package/dist/gs1/check-proxy.js +120 -0
  23. package/dist/gs1/check-proxy.js.map +1 -0
  24. package/dist/gs1/idkey-proxy.d.ts +135 -0
  25. package/dist/gs1/idkey-proxy.d.ts.map +1 -0
  26. package/dist/gs1/idkey-proxy.js +779 -0
  27. package/dist/gs1/idkey-proxy.js.map +1 -0
  28. package/dist/gs1/index.d.ts +4 -0
  29. package/dist/gs1/index.d.ts.map +1 -0
  30. package/dist/gs1/index.js +4 -0
  31. package/dist/gs1/index.js.map +1 -0
  32. package/dist/index.d.ts +25 -0
  33. package/dist/index.d.ts.map +1 -0
  34. package/dist/index.js +25 -0
  35. package/dist/index.js.map +1 -0
  36. package/dist/lib-proxy.d.ts +135 -0
  37. package/dist/lib-proxy.d.ts.map +1 -0
  38. package/dist/lib-proxy.js +235 -0
  39. package/dist/lib-proxy.js.map +1 -0
  40. package/dist/locale/en/locale-strings.d.ts +616 -0
  41. package/dist/locale/en/locale-strings.d.ts.map +1 -0
  42. package/dist/locale/en/locale-strings.js +616 -0
  43. package/dist/locale/en/locale-strings.js.map +1 -0
  44. package/dist/locale/fr/locale-strings.d.ts +616 -0
  45. package/dist/locale/fr/locale-strings.d.ts.map +1 -0
  46. package/dist/locale/fr/locale-strings.js +616 -0
  47. package/dist/locale/fr/locale-strings.js.map +1 -0
  48. package/dist/locale/i18n.d.ts +27 -0
  49. package/dist/locale/i18n.d.ts.map +1 -0
  50. package/dist/locale/i18n.js +39 -0
  51. package/dist/locale/i18n.js.map +1 -0
  52. package/dist/types.d.ts +127 -0
  53. package/dist/types.d.ts.map +1 -0
  54. package/dist/types.js +13 -0
  55. package/dist/types.js.map +1 -0
  56. package/dist/utility/character-set-descriptor.d.ts +6 -0
  57. package/dist/utility/character-set-descriptor.d.ts.map +1 -0
  58. package/dist/utility/character-set-descriptor.js +28 -0
  59. package/dist/utility/character-set-descriptor.js.map +1 -0
  60. package/dist/utility/character-set-proxy.d.ts +26 -0
  61. package/dist/utility/character-set-proxy.d.ts.map +1 -0
  62. package/dist/utility/character-set-proxy.js +167 -0
  63. package/dist/utility/character-set-proxy.js.map +1 -0
  64. package/dist/utility/index.d.ts +4 -0
  65. package/dist/utility/index.d.ts.map +1 -0
  66. package/dist/utility/index.js +4 -0
  67. package/dist/utility/index.js.map +1 -0
  68. package/dist/utility/reg-exp-proxy.d.ts +7 -0
  69. package/dist/utility/reg-exp-proxy.d.ts.map +1 -0
  70. package/dist/utility/reg-exp-proxy.js +61 -0
  71. package/dist/utility/reg-exp-proxy.js.map +1 -0
  72. package/dist/utility/string-descriptor.d.ts +4 -0
  73. package/dist/utility/string-descriptor.d.ts.map +1 -0
  74. package/dist/utility/string-descriptor.js +12 -0
  75. package/dist/utility/string-descriptor.js.map +1 -0
  76. package/dist/utility/string-proxy.d.ts +8 -0
  77. package/dist/utility/string-proxy.d.ts.map +1 -0
  78. package/dist/utility/string-proxy.js +12 -0
  79. package/dist/utility/string-proxy.js.map +1 -0
  80. package/dist/utility/transformer-descriptor.d.ts +6 -0
  81. package/dist/utility/transformer-descriptor.d.ts.map +1 -0
  82. package/dist/utility/transformer-descriptor.js +24 -0
  83. package/dist/utility/transformer-descriptor.js.map +1 -0
  84. package/dist/utility/transformer-proxy.d.ts +8 -0
  85. package/dist/utility/transformer-proxy.d.ts.map +1 -0
  86. package/dist/utility/transformer-proxy.js +74 -0
  87. package/dist/utility/transformer-proxy.js.map +1 -0
  88. package/eslint.config.ts +21 -0
  89. package/package.json +37 -0
  90. package/src/app-extension.ts +244 -0
  91. package/src/app-utility-proxy.ts +266 -0
  92. package/src/descriptor.ts +314 -0
  93. package/src/gs1/character-set-proxy.ts +41 -0
  94. package/src/gs1/check-proxy.ts +122 -0
  95. package/src/gs1/idkey-proxy.ts +815 -0
  96. package/src/gs1/index.ts +3 -0
  97. package/src/index.ts +24 -0
  98. package/src/lib-proxy.ts +256 -0
  99. package/src/locale/en/locale-strings.ts +615 -0
  100. package/src/locale/fr/locale-strings.ts +615 -0
  101. package/src/locale/i18n.ts +48 -0
  102. package/src/locale/i18next.d.ts +20 -0
  103. package/src/types.ts +144 -0
  104. package/src/utility/character-set-descriptor.ts +32 -0
  105. package/src/utility/character-set-proxy.ts +185 -0
  106. package/src/utility/index.ts +3 -0
  107. package/src/utility/reg-exp-proxy.ts +51 -0
  108. package/src/utility/string-descriptor.ts +13 -0
  109. package/src/utility/string-proxy.ts +15 -0
  110. package/src/utility/transformer-descriptor.ts +27 -0
  111. package/src/utility/transformer-proxy.ts +72 -0
  112. package/tsconfig.json +6 -0
@@ -0,0 +1,39 @@
1
+ import { i18nAssertValidResources, i18nCoreInit } from "@aidc-toolkit/core";
2
+ import { gs1Resources, i18nGS1Init } from "@aidc-toolkit/gs1";
3
+ import { i18nUtilityInit, utilityResources } from "@aidc-toolkit/utility";
4
+ import i18next from "i18next";
5
+ import { localeStrings as enLocaleStrings } from "./en/locale-strings.js";
6
+ import { localeStrings as frLocaleStrings } from "./fr/locale-strings.js";
7
+ export const appExtensionNS = "aidct_app_extension";
8
+ i18nAssertValidResources(enLocaleStrings, "fr", frLocaleStrings);
9
+ /**
10
+ * App extension resources.
11
+ */
12
+ export const appExtensionResources = {
13
+ en: {
14
+ aidct_app_extension: enLocaleStrings
15
+ },
16
+ fr: {
17
+ aidct_app_extension: frLocaleStrings
18
+ }
19
+ };
20
+ // Explicit type is necessary to work around bug in type discovery with linked packages.
21
+ export const i18nextAppExtension = i18next.createInstance();
22
+ /**
23
+ * Initialize internationalization.
24
+ *
25
+ * @param environment
26
+ * Environment in which the application is running.
27
+ *
28
+ * @param debug
29
+ * Debug setting.
30
+ *
31
+ * @returns
32
+ * Void promise.
33
+ */
34
+ export async function i18nAppExtensionInit(environment, debug = false) {
35
+ await i18nUtilityInit(environment, debug);
36
+ await i18nGS1Init(environment, debug);
37
+ await i18nCoreInit(i18nextAppExtension, environment, debug, appExtensionNS, utilityResources, gs1Resources, appExtensionResources);
38
+ }
39
+ //# sourceMappingURL=i18n.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i18n.js","sourceRoot":"","sources":["../../src/locale/i18n.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,YAAY,EAAwB,MAAM,oBAAoB,CAAC;AAClG,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC1E,OAAO,OAAqC,MAAM,SAAS,CAAC;AAC5D,OAAO,EAAE,aAAa,IAAI,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,EAAE,aAAa,IAAI,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE1E,MAAM,CAAC,MAAM,cAAc,GAAG,qBAAqB,CAAC;AAOpD,wBAAwB,CAAC,eAAe,EAAE,IAAI,EAAE,eAAe,CAAC,CAAC;AAEjE;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAa;IAC3C,EAAE,EAAE;QACA,mBAAmB,EAAE,eAAe;KACvC;IACD,EAAE,EAAE;QACA,mBAAmB,EAAE,eAAe;KACvC;CACJ,CAAC;AAEF,wFAAwF;AACxF,MAAM,CAAC,MAAM,mBAAmB,GAAS,OAAO,CAAC,cAAc,EAAE,CAAC;AAElE;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,WAA4B,EAAE,KAAK,GAAG,KAAK;IAClF,MAAM,eAAe,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IAC1C,MAAM,WAAW,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IACtC,MAAM,YAAY,CAAC,mBAAmB,EAAE,WAAW,EAAE,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,YAAY,EAAE,qBAAqB,CAAC,CAAC;AACvI,CAAC"}
@@ -0,0 +1,127 @@
1
+ /**
2
+ * Type that error type is expected to extend. If the application framework reports errors through the throw/catch
3
+ * mechanism, the error type is expected to extend {@link Error}. Otherwise, it may extend any object type.
4
+ *
5
+ * @template ThrowError
6
+ * If true, errors are reported through the throw/catch mechanism.
7
+ */
8
+ export type ErrorExtends<ThrowError extends boolean> = ThrowError extends true ? Error : object;
9
+ /**
10
+ * Sheet.
11
+ */
12
+ export interface Sheet {
13
+ /**
14
+ * Sheet name.
15
+ */
16
+ readonly name: string;
17
+ }
18
+ /**
19
+ * Single cell address.
20
+ */
21
+ export interface Address {
22
+ /**
23
+ * Zero-indexed row.
24
+ */
25
+ readonly rowIndex: number;
26
+ /**
27
+ * Zero-indexed column.
28
+ */
29
+ readonly columnIndex: number;
30
+ }
31
+ /**
32
+ * Sheet address.
33
+ */
34
+ export interface SheetAddress extends Sheet, Address {
35
+ }
36
+ /**
37
+ * Range of cells.
38
+ */
39
+ export interface Range {
40
+ /**
41
+ * Start address, inclusive.
42
+ */
43
+ readonly startAddress: Address;
44
+ /**
45
+ * End address, exclusive.
46
+ */
47
+ readonly endAddress: Address;
48
+ }
49
+ /**
50
+ * Sheet range.
51
+ */
52
+ export interface SheetRange extends Sheet, Range {
53
+ }
54
+ /**
55
+ * Matrix type; shorthand for defining a two-dimensional matrix (array of array) of a type.
56
+ *
57
+ * @template T
58
+ * Type.
59
+ */
60
+ export type Matrix<T> = T[][];
61
+ /**
62
+ * Function result, possibly including an error result. If the application framework reports errors through the return
63
+ * value, the result is the union of the result type and the error type; otherwise, it's just the result type.
64
+ *
65
+ * @template TResult
66
+ * Result type.
67
+ *
68
+ * @template ThrowError
69
+ * If true, errors are reported through the throw/catch mechanism.
70
+ *
71
+ * @template TError
72
+ * Error type.
73
+ */
74
+ export type ResultError<TResult, ThrowError extends boolean, TError extends ErrorExtends<ThrowError>> = ThrowError extends false ? TResult | TError : TResult;
75
+ /**
76
+ * Function result as matrix, possibly including an error result in each element. If the application framework reports
77
+ * errors through the return value, the individual element result is the union of the result type and the error type;
78
+ * otherwise, it's just the result type.
79
+ *
80
+ * @template TResult
81
+ * Result type.
82
+ *
83
+ * @template ThrowError
84
+ * If true, errors are reported through the throw/catch mechanism.
85
+ *
86
+ * @template TError
87
+ * Error type.
88
+ */
89
+ export type MatrixResultError<TResult, ThrowError extends boolean, TError extends ErrorExtends<ThrowError>> = Matrix<ResultError<TResult, ThrowError, TError>>;
90
+ /**
91
+ * Typed function, applicable to any function, stricter than {@link Function}.
92
+ */
93
+ export type TypedFunction<TMethod extends (...args: Parameters<TMethod>) => ReturnType<TMethod>> = (...args: Parameters<TMethod>) => ReturnType<TMethod>;
94
+ /**
95
+ * Typed synchronous function, applicable to any function that doesn't return a Promise.
96
+ */
97
+ export type TypedSyncFunction<TMethod extends TypedFunction<TMethod>> = [ReturnType<TMethod>] extends [PromiseLike<unknown>] ? never : TypedFunction<TMethod>;
98
+ /**
99
+ * Determine the fundamental promised type. This is stricter than `Awaited\<Type\>` in that it requires a Promise.
100
+ */
101
+ type PromisedType<T> = [T] extends [PromiseLike<infer TPromised>] ? TPromised : never;
102
+ /**
103
+ * Typed asynchronous function, applicable to any function that returns a Promise.
104
+ */
105
+ export type TypedAsyncFunction<TMethod extends (...args: Parameters<TMethod>) => PromiseLike<PromisedType<ReturnType<TMethod>>>> = (...args: Parameters<TMethod>) => Promise<PromisedType<ReturnType<TMethod>>>;
106
+ /**
107
+ * Nullishable type. Application extension may pass `null` or `undefined` to missing parameters.
108
+ */
109
+ export type Nullishable<T> = T | null | undefined;
110
+ /**
111
+ * Non-nullishable type. If T is an object type, it is spread and attributes within it are made non-nullishable.
112
+ */
113
+ export type NonNullishable<T> = T extends object ? {
114
+ [P in keyof T]-?: NonNullishable<T[P]>;
115
+ } : NonNullable<T>;
116
+ /**
117
+ * Determine if argument is nullish. Application extension may pass `null` or `undefined` to missing parameters.
118
+ *
119
+ * @param argument
120
+ * Argument.
121
+ *
122
+ * @returns
123
+ * True if argument is undefined or null.
124
+ */
125
+ export declare function isNullish<T>(argument: T | null | undefined): argument is null | undefined;
126
+ export {};
127
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,CAAC,UAAU,SAAS,OAAO,IAAI,UAAU,SAAS,IAAI,GAAG,KAAK,GAAG,MAAM,CAAC;AAEhG;;GAEG;AACH,MAAM,WAAW,KAAK;IAClB;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,OAAO;IACpB;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAChC;AAED;;GAEG;AACH,MAAM,WAAW,YAAa,SAAQ,KAAK,EAAE,OAAO;C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,CAAC,MAAM,SAAS,CAAC,CAAC,GAAG,SAAS,GAAG,KAAK,CAAC;AAEtF;;GAEG;AACH,MAAM,MAAM,kBAAkB,CAAC,OAAO,SAAS,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,OAAO,CAAC,KAAK,WAAW,CAAC,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,OAAO,CAAC,KAAK,OAAO,CAAC,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAEhN;;GAEG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC;AAElD;;GAEG;AACH,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GAAG;KAC9C,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CACzC,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;AAEnB;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,GAAG,SAAS,GAAG,QAAQ,IAAI,IAAI,GAAG,SAAS,CAEzF"}
package/dist/types.js ADDED
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Determine if argument is nullish. Application extension may pass `null` or `undefined` to missing parameters.
3
+ *
4
+ * @param argument
5
+ * Argument.
6
+ *
7
+ * @returns
8
+ * True if argument is undefined or null.
9
+ */
10
+ export function isNullish(argument) {
11
+ return argument === null || argument === undefined;
12
+ }
13
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAoIA;;;;;;;;GAQG;AACH,MAAM,UAAU,SAAS,CAAI,QAA8B;IACvD,OAAO,QAAQ,KAAK,IAAI,IAAI,QAAQ,KAAK,SAAS,CAAC;AACvD,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { type ParameterDescriptor } from "../descriptor.js";
2
+ export declare const exclusionNoneParameterDescriptor: ParameterDescriptor;
3
+ export declare const exclusionFirstZeroParameterDescriptor: ParameterDescriptor;
4
+ export declare const exclusionAllNumericParameterDescriptor: ParameterDescriptor;
5
+ export declare const exclusionAnyParameterDescriptor: ParameterDescriptor;
6
+ //# sourceMappingURL=character-set-descriptor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"character-set-descriptor.d.ts","sourceRoot":"","sources":["../../src/utility/character-set-descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,mBAAmB,EAAQ,MAAM,kBAAkB,CAAC;AASlE,eAAO,MAAM,gCAAgC,EAAE,mBAI9C,CAAC;AAEF,eAAO,MAAM,qCAAqC,EAAE,mBAInD,CAAC;AAEF,eAAO,MAAM,sCAAsC,EAAE,mBAIpD,CAAC;AAEF,eAAO,MAAM,+BAA+B,EAAE,mBAI7C,CAAC"}
@@ -0,0 +1,28 @@
1
+ import { Type } from "../descriptor.js";
2
+ const exclusionParameterDescriptor = {
3
+ name: "exclusion",
4
+ type: Type.Number,
5
+ isMatrix: false,
6
+ isRequired: false
7
+ };
8
+ export const exclusionNoneParameterDescriptor = {
9
+ extendsDescriptor: exclusionParameterDescriptor,
10
+ sortOrder: 0,
11
+ name: "exclusionNone"
12
+ };
13
+ export const exclusionFirstZeroParameterDescriptor = {
14
+ extendsDescriptor: exclusionParameterDescriptor,
15
+ sortOrder: 1,
16
+ name: "exclusionFirstZero"
17
+ };
18
+ export const exclusionAllNumericParameterDescriptor = {
19
+ extendsDescriptor: exclusionParameterDescriptor,
20
+ sortOrder: 2,
21
+ name: "exclusionAllNumeric"
22
+ };
23
+ export const exclusionAnyParameterDescriptor = {
24
+ extendsDescriptor: exclusionParameterDescriptor,
25
+ sortOrder: 3,
26
+ name: "exclusionAny"
27
+ };
28
+ //# sourceMappingURL=character-set-descriptor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"character-set-descriptor.js","sourceRoot":"","sources":["../../src/utility/character-set-descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAElE,MAAM,4BAA4B,GAAwB;IACtD,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,IAAI,CAAC,MAAM;IACjB,QAAQ,EAAE,KAAK;IACf,UAAU,EAAE,KAAK;CACpB,CAAC;AAEF,MAAM,CAAC,MAAM,gCAAgC,GAAwB;IACjE,iBAAiB,EAAE,4BAA4B;IAC/C,SAAS,EAAE,CAAC;IACZ,IAAI,EAAE,eAAe;CACxB,CAAC;AAEF,MAAM,CAAC,MAAM,qCAAqC,GAAwB;IACtE,iBAAiB,EAAE,4BAA4B;IAC/C,SAAS,EAAE,CAAC;IACZ,IAAI,EAAE,oBAAoB;CAC7B,CAAC;AAEF,MAAM,CAAC,MAAM,sCAAsC,GAAwB;IACvE,iBAAiB,EAAE,4BAA4B;IAC/C,SAAS,EAAE,CAAC;IACZ,IAAI,EAAE,qBAAqB;CAC9B,CAAC;AAEF,MAAM,CAAC,MAAM,+BAA+B,GAAwB;IAChE,iBAAiB,EAAE,4BAA4B;IAC/C,SAAS,EAAE,CAAC;IACZ,IAAI,EAAE,cAAc;CACvB,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { type CharacterSetCreator, type Exclusion } from "@aidc-toolkit/utility";
2
+ import type { AppExtension } from "../app-extension.js";
3
+ import type { ErrorExtends, Matrix, MatrixResultError, Nullishable, ResultError } from "../types.js";
4
+ import { StringProxy } from "./string-proxy.js";
5
+ export declare abstract class CharacterSetProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends StringProxy<ThrowError, TError, TInvocationContext, TBigInt> {
6
+ private readonly _characterSetCreator;
7
+ protected constructor(appExtension: AppExtension<ThrowError, TError, TInvocationContext, TBigInt>, characterSetCreator: CharacterSetCreator);
8
+ validate(matrixSs: Matrix<string>, exclusion: Nullishable<Exclusion>): MatrixResultError<string, ThrowError, TError>;
9
+ isValid(matrixSs: Matrix<string>, exclusion: Nullishable<Exclusion>): MatrixResultError<boolean, ThrowError, TError>;
10
+ create(length: number, matrixValues: Matrix<number | bigint>, exclusion: Nullishable<Exclusion>, tweak: Nullishable<number | bigint>): MatrixResultError<string, ThrowError, TError>;
11
+ createSequence(length: number, startValue: number, count: number, exclusion: Nullishable<Exclusion>, tweak: Nullishable<number | bigint>): Matrix<string>;
12
+ valueFor(matrixSs: Matrix<string>, exclusion: Nullishable<Exclusion>, tweak: Nullishable<number | bigint>): MatrixResultError<ResultError<TBigInt, ThrowError, TError>, ThrowError, TError>;
13
+ }
14
+ export declare class NumericProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends CharacterSetProxy<ThrowError, TError, TInvocationContext, TBigInt> {
15
+ constructor(appExtension: AppExtension<ThrowError, TError, TInvocationContext, TBigInt>);
16
+ }
17
+ export declare class HexadecimalProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends CharacterSetProxy<ThrowError, TError, TInvocationContext, TBigInt> {
18
+ constructor(appExtension: AppExtension<ThrowError, TError, TInvocationContext, TBigInt>);
19
+ }
20
+ export declare class AlphabeticProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends CharacterSetProxy<ThrowError, TError, TInvocationContext, TBigInt> {
21
+ constructor(appExtension: AppExtension<ThrowError, TError, TInvocationContext, TBigInt>);
22
+ }
23
+ export declare class AlphanumericProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends CharacterSetProxy<ThrowError, TError, TInvocationContext, TBigInt> {
24
+ constructor(appExtension: AppExtension<ThrowError, TError, TInvocationContext, TBigInt>);
25
+ }
26
+ //# sourceMappingURL=character-set-proxy.d.ts.map
@@ -0,0 +1 @@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CAAC,UAAU,EAAE,MAAM,EAAE,kBAAkB,EAAE,OAAO,CAAC;gBACzL,YAAY,EAAE,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,kBAAkB,EAAE,OAAO,CAAC;CAG1F;AAED,qBASa,iBAAiB,CAAC,UAAU,SAAS,OAAO,EAAE,MAAM,SAAS,YAAY,CAAC,UAAU,CAAC,EAAE,kBAAkB,EAAE,OAAO,CAAE,SAAQ,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,kBAAkB,EAAE,OAAO,CAAC;gBAC3L,YAAY,EAAE,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,kBAAkB,EAAE,OAAO,CAAC;CAG1F"}
@@ -0,0 +1,167 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
8
+ return function (target, key) { decorator(target, key, paramIndex); }
9
+ };
10
+ import { ALPHABETIC_CREATOR, ALPHANUMERIC_CREATOR, HEXADECIMAL_CREATOR, NUMERIC_CREATOR, Sequence } from "@aidc-toolkit/utility";
11
+ import { expandParameterDescriptor, ProxyClass, ProxyMethod, ProxyParameter, Type } from "../descriptor.js";
12
+ import { LibProxy } from "../lib-proxy.js";
13
+ import { exclusionAnyParameterDescriptor, exclusionFirstZeroParameterDescriptor, exclusionNoneParameterDescriptor } from "./character-set-descriptor.js";
14
+ import { sParameterDescriptor, validateSParameterDescriptor } from "./string-descriptor.js";
15
+ import { StringProxy } from "./string-proxy.js";
16
+ import { countParameterDescriptor, startValueParameterDescriptor, tweakParameterDescriptor, valueParameterDescriptor } from "./transformer-descriptor.js";
17
+ const lengthParameterDescriptor = {
18
+ name: "length",
19
+ type: Type.Number,
20
+ isMatrix: false,
21
+ isRequired: true
22
+ };
23
+ const valueForSParameterDescriptor = {
24
+ extendsDescriptor: sParameterDescriptor,
25
+ name: "valueForS"
26
+ };
27
+ export class CharacterSetProxy extends StringProxy {
28
+ _characterSetCreator;
29
+ constructor(appExtension, characterSetCreator) {
30
+ super(appExtension);
31
+ this._characterSetCreator = characterSetCreator;
32
+ }
33
+ validate(matrixSs, exclusion) {
34
+ return this.validateString(this._characterSetCreator, matrixSs, {
35
+ exclusion: exclusion ?? undefined
36
+ });
37
+ }
38
+ isValid(matrixSs, exclusion) {
39
+ return this.isValidString(this.validate(matrixSs, exclusion));
40
+ }
41
+ create(length, matrixValues, exclusion, tweak) {
42
+ const exclusionOrUndefined = exclusion ?? undefined;
43
+ const tweakOrUndefined = tweak ?? undefined;
44
+ return this.mapMatrix(matrixValues, value => this._characterSetCreator.create(length, value, exclusionOrUndefined, tweakOrUndefined));
45
+ }
46
+ createSequence(length, startValue, count, exclusion, tweak) {
47
+ this.appExtension.validateSequenceCount(count);
48
+ const exclusionOrUndefined = exclusion ?? undefined;
49
+ const tweakOrUndefined = tweak ?? undefined;
50
+ return LibProxy.matrixResult(this._characterSetCreator.create(length, new Sequence(startValue, count), exclusionOrUndefined, tweakOrUndefined));
51
+ }
52
+ valueFor(matrixSs, exclusion, tweak) {
53
+ const exclusionOrUndefined = exclusion ?? undefined;
54
+ const tweakOrUndefined = tweak ?? undefined;
55
+ return this.mapMatrix(matrixSs, s => this.mapBigInt(this._characterSetCreator.valueFor(s, exclusionOrUndefined, tweakOrUndefined)));
56
+ }
57
+ }
58
+ __decorate([
59
+ ProxyMethod({
60
+ type: Type.String,
61
+ isMatrix: true
62
+ }),
63
+ __param(0, ProxyParameter(validateSParameterDescriptor)),
64
+ __param(1, ProxyParameter(exclusionNoneParameterDescriptor))
65
+ ], CharacterSetProxy.prototype, "validate", null);
66
+ __decorate([
67
+ ProxyMethod({
68
+ type: Type.Boolean,
69
+ isMatrix: true
70
+ }),
71
+ __param(0, ProxyParameter(validateSParameterDescriptor)),
72
+ __param(1, ProxyParameter(exclusionNoneParameterDescriptor))
73
+ ], CharacterSetProxy.prototype, "isValid", null);
74
+ __decorate([
75
+ ProxyMethod({
76
+ type: Type.String,
77
+ isMatrix: true
78
+ }),
79
+ __param(0, ProxyParameter(lengthParameterDescriptor)),
80
+ __param(1, ProxyParameter(valueParameterDescriptor)),
81
+ __param(2, ProxyParameter(exclusionNoneParameterDescriptor)),
82
+ __param(3, ProxyParameter(tweakParameterDescriptor))
83
+ ], CharacterSetProxy.prototype, "create", null);
84
+ __decorate([
85
+ ProxyMethod({
86
+ infixBefore: "Sequence",
87
+ type: Type.String,
88
+ isMatrix: true
89
+ }),
90
+ __param(0, ProxyParameter(lengthParameterDescriptor)),
91
+ __param(1, ProxyParameter(startValueParameterDescriptor)),
92
+ __param(2, ProxyParameter(countParameterDescriptor)),
93
+ __param(3, ProxyParameter(exclusionNoneParameterDescriptor)),
94
+ __param(4, ProxyParameter(tweakParameterDescriptor))
95
+ ], CharacterSetProxy.prototype, "createSequence", null);
96
+ __decorate([
97
+ ProxyMethod({
98
+ type: Type.Number,
99
+ isMatrix: true
100
+ }),
101
+ __param(0, ProxyParameter(valueForSParameterDescriptor)),
102
+ __param(1, ProxyParameter(exclusionNoneParameterDescriptor)),
103
+ __param(2, ProxyParameter(tweakParameterDescriptor))
104
+ ], CharacterSetProxy.prototype, "valueFor", null);
105
+ let NumericProxy = class NumericProxy extends CharacterSetProxy {
106
+ constructor(appExtension) {
107
+ super(appExtension, NUMERIC_CREATOR);
108
+ }
109
+ };
110
+ NumericProxy = __decorate([
111
+ ProxyClass({
112
+ methodInfix: "Numeric",
113
+ replaceParameterDescriptors: [
114
+ {
115
+ name: expandParameterDescriptor(exclusionNoneParameterDescriptor).name,
116
+ replacement: exclusionFirstZeroParameterDescriptor
117
+ }
118
+ ]
119
+ })
120
+ ], NumericProxy);
121
+ export { NumericProxy };
122
+ let HexadecimalProxy = class HexadecimalProxy extends CharacterSetProxy {
123
+ constructor(appExtension) {
124
+ super(appExtension, HEXADECIMAL_CREATOR);
125
+ }
126
+ };
127
+ HexadecimalProxy = __decorate([
128
+ ProxyClass({
129
+ methodInfix: "Hexadecimal",
130
+ replaceParameterDescriptors: [
131
+ {
132
+ name: expandParameterDescriptor(exclusionNoneParameterDescriptor).name,
133
+ replacement: exclusionAnyParameterDescriptor
134
+ }
135
+ ]
136
+ })
137
+ ], HexadecimalProxy);
138
+ export { HexadecimalProxy };
139
+ let AlphabeticProxy = class AlphabeticProxy extends CharacterSetProxy {
140
+ constructor(appExtension) {
141
+ super(appExtension, ALPHABETIC_CREATOR);
142
+ }
143
+ };
144
+ AlphabeticProxy = __decorate([
145
+ ProxyClass({
146
+ methodInfix: "Alphabetic"
147
+ })
148
+ ], AlphabeticProxy);
149
+ export { AlphabeticProxy };
150
+ let AlphanumericProxy = class AlphanumericProxy extends CharacterSetProxy {
151
+ constructor(appExtension) {
152
+ super(appExtension, ALPHANUMERIC_CREATOR);
153
+ }
154
+ };
155
+ AlphanumericProxy = __decorate([
156
+ ProxyClass({
157
+ methodInfix: "Alphanumeric",
158
+ replaceParameterDescriptors: [
159
+ {
160
+ name: expandParameterDescriptor(exclusionNoneParameterDescriptor).name,
161
+ replacement: exclusionAnyParameterDescriptor
162
+ }
163
+ ]
164
+ })
165
+ ], AlphanumericProxy);
166
+ export { AlphanumericProxy };
167
+ //# sourceMappingURL=character-set-proxy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"character-set-proxy.js","sourceRoot":"","sources":["../../src/utility/character-set-proxy.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EACH,kBAAkB,EAClB,oBAAoB,EAIpB,mBAAmB,EACnB,eAAe,EACf,QAAQ,EACX,MAAM,uBAAuB,CAAC;AAE/B,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/C;SACJ;KACJ,CAAC;GACW,iBAAiB,CAI7B"}
@@ -0,0 +1,4 @@
1
+ export * from "./transformer-proxy.js";
2
+ export * from "./reg-exp-proxy.js";
3
+ export * from "./character-set-proxy.js";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utility/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from "./transformer-proxy.js";
2
+ export * from "./reg-exp-proxy.js";
3
+ export * from "./character-set-proxy.js";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utility/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { ErrorExtends, Matrix, MatrixResultError, Nullishable } from "../types.js";
2
+ import { StringProxy } from "./string-proxy.js";
3
+ export declare class RegExpProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends StringProxy<ThrowError, TError, TInvocationContext, TBigInt> {
4
+ validate(regExp: string, matrixSs: Matrix<string>, errorMessage: Nullishable<string>): MatrixResultError<string, ThrowError, TError>;
5
+ isValid(regExp: string, matrixSs: Matrix<string>): MatrixResultError<boolean, ThrowError, TError>;
6
+ }
7
+ //# sourceMappingURL=reg-exp-proxy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reg-exp-proxy.d.ts","sourceRoot":"","sources":["../../src/utility/reg-exp-proxy.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAExF,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAgBhD,qBAGa,WAAW,CAAC,UAAU,SAAS,OAAO,EAAE,MAAM,SAAS,YAAY,CAAC,UAAU,CAAC,EAAE,kBAAkB,EAAE,OAAO,CAAE,SAAQ,WAAW,CAAC,UAAU,EAAE,MAAM,EAAE,kBAAkB,EAAE,OAAO,CAAC;IAK3L,QAAQ,CACuC,MAAM,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,EACrB,YAAY,EAAE,WAAW,CAAC,MAAM,CAAC,GACnF,iBAAiB,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC;IAYhD,OAAO,CACwC,MAAM,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,GACvE,iBAAiB,CAAC,OAAO,EAAE,UAAU,EAAE,MAAM,CAAC;CAGpD"}
@@ -0,0 +1,61 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
8
+ return function (target, key) { decorator(target, key, paramIndex); }
9
+ };
10
+ import { RegExpValidator } from "@aidc-toolkit/utility";
11
+ import { ProxyClass, ProxyMethod, ProxyParameter, Type } from "../descriptor.js";
12
+ import { validateSParameterDescriptor } from "./string-descriptor.js";
13
+ import { StringProxy } from "./string-proxy.js";
14
+ const regExpParameterDescriptor = {
15
+ name: "regExp",
16
+ type: Type.String,
17
+ isMatrix: false,
18
+ isRequired: true
19
+ };
20
+ const errorMessageParameterDescriptor = {
21
+ name: "errorMessage",
22
+ type: Type.String,
23
+ isMatrix: false,
24
+ isRequired: false
25
+ };
26
+ let RegExpProxy = class RegExpProxy extends StringProxy {
27
+ validate(regExp, matrixSs, errorMessage) {
28
+ return this.validateString(new class extends RegExpValidator {
29
+ createErrorMessage(s) {
30
+ return errorMessage ?? super.createErrorMessage(s);
31
+ }
32
+ }(new RegExp(regExp)), matrixSs);
33
+ }
34
+ isValid(regExp, matrixSs) {
35
+ return this.isValidString(this.validate(regExp, matrixSs, undefined));
36
+ }
37
+ };
38
+ __decorate([
39
+ ProxyMethod({
40
+ type: Type.String,
41
+ isMatrix: true
42
+ }),
43
+ __param(0, ProxyParameter(regExpParameterDescriptor)),
44
+ __param(1, ProxyParameter(validateSParameterDescriptor)),
45
+ __param(2, ProxyParameter(errorMessageParameterDescriptor))
46
+ ], RegExpProxy.prototype, "validate", null);
47
+ __decorate([
48
+ ProxyMethod({
49
+ type: Type.Boolean,
50
+ isMatrix: true
51
+ }),
52
+ __param(0, ProxyParameter(regExpParameterDescriptor)),
53
+ __param(1, ProxyParameter(validateSParameterDescriptor))
54
+ ], RegExpProxy.prototype, "isValid", null);
55
+ RegExpProxy = __decorate([
56
+ ProxyClass({
57
+ methodInfix: "RegExp"
58
+ })
59
+ ], RegExpProxy);
60
+ export { RegExpProxy };
61
+ //# sourceMappingURL=reg-exp-proxy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reg-exp-proxy.js","sourceRoot":"","sources":["../../src/utility/reg-exp-proxy.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAA4B,UAAU,EAAE,WAAW,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAE3G,OAAO,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,MAAM,yBAAyB,GA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;0CAGhD;AA1BQ,WAAW;IAHvB,UAAU,CAAC;QACR,WAAW,EAAE,QAAQ;KACxB,CAAC;GACW,WAAW,CA2BvB"}
@@ -0,0 +1,4 @@
1
+ import { type ParameterDescriptor } from "../descriptor.js";
2
+ export declare const sParameterDescriptor: ParameterDescriptor;
3
+ export declare const validateSParameterDescriptor: ParameterDescriptor;
4
+ //# sourceMappingURL=string-descriptor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"string-descriptor.d.ts","sourceRoot":"","sources":["../../src/utility/string-descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,mBAAmB,EAAQ,MAAM,kBAAkB,CAAC;AAElE,eAAO,MAAM,oBAAoB,EAAE,mBAKlC,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,mBAG1C,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { Type } from "../descriptor.js";
2
+ export const sParameterDescriptor = {
3
+ name: "s",
4
+ type: Type.String,
5
+ isMatrix: true,
6
+ isRequired: true
7
+ };
8
+ export const validateSParameterDescriptor = {
9
+ extendsDescriptor: sParameterDescriptor,
10
+ name: "validateS"
11
+ };
12
+ //# sourceMappingURL=string-descriptor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"string-descriptor.js","sourceRoot":"","sources":["../../src/utility/string-descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAElE,MAAM,CAAC,MAAM,oBAAoB,GAAwB;IACrD,IAAI,EAAE,GAAG;IACT,IAAI,EAAE,IAAI,CAAC,MAAM;IACjB,QAAQ,EAAE,IAAI;IACd,UAAU,EAAE,IAAI;CACnB,CAAC;AAEF,MAAM,CAAC,MAAM,4BAA4B,GAAwB;IAC7D,iBAAiB,EAAE,oBAAoB;IACvC,IAAI,EAAE,WAAW;CACpB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { StringValidation, StringValidator } from "@aidc-toolkit/utility";
2
+ import { LibProxy } from "../lib-proxy.js";
3
+ import type { ErrorExtends, Matrix, MatrixResultError } from "../types.js";
4
+ export declare abstract class StringProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends LibProxy<ThrowError, TError, TInvocationContext, TBigInt> {
5
+ protected validateString<TStringValidation extends StringValidation>(validator: StringValidator<TStringValidation>, matrixSs: Matrix<string>, validation?: TStringValidation): Matrix<string>;
6
+ protected isValidString(matrixValidateResults: MatrixResultError<string, ThrowError, TError>): MatrixResultError<boolean, ThrowError, TError>;
7
+ }
8
+ //# sourceMappingURL=string-proxy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"string-proxy.d.ts","sourceRoot":"","sources":["../../src/utility/string-proxy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAE3E,8BAAsB,WAAW,CAAC,UAAU,SAAS,OAAO,EAAE,MAAM,SAAS,YAAY,CAAC,UAAU,CAAC,EAAE,kBAAkB,EAAE,OAAO,CAAE,SAAQ,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,kBAAkB,EAAE,OAAO,CAAC;IACjM,SAAS,CAAC,cAAc,CAAC,iBAAiB,SAAS,gBAAgB,EAAE,SAAS,EAAE,eAAe,CAAC,iBAAiB,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,EAAE,iBAAiB,GAAG,MAAM,CAAC,MAAM,CAAC;IAM7L,SAAS,CAAC,aAAa,CAAC,qBAAqB,EAAE,iBAAiB,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,GAAG,iBAAiB,CAAC,OAAO,EAAE,UAAU,EAAE,MAAM,CAAC;CAGhJ"}
@@ -0,0 +1,12 @@
1
+ import { LibProxy } from "../lib-proxy.js";
2
+ export class StringProxy extends LibProxy {
3
+ validateString(validator, matrixSs, validation) {
4
+ return LibProxy.mapMatrixRangeError(matrixSs, (s) => {
5
+ validator.validate(s, validation);
6
+ });
7
+ }
8
+ isValidString(matrixValidateResults) {
9
+ return this.mapMatrix(matrixValidateResults, validateResult => validateResult === "");
10
+ }
11
+ }
12
+ //# sourceMappingURL=string-proxy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"string-proxy.js","sourceRoot":"","sources":["../../src/utility/string-proxy.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAG3C,MAAM,OAAgB,WAA8G,SAAQ,QAAyD;IACvL,cAAc,CAA6C,SAA6C,EAAE,QAAwB,EAAE,UAA8B;QACxK,OAAO,QAAQ,CAAC,mBAAmB,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE;YAChD,SAAS,CAAC,QAAQ,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;QACtC,CAAC,CAAC,CAAC;IACP,CAAC;IAES,aAAa,CAAC,qBAAoE;QACxF,OAAO,IAAI,CAAC,SAAS,CAAC,qBAAqB,EAAE,cAAc,CAAC,EAAE,CAAC,cAAc,KAAK,EAAE,CAAC,CAAC;IAC1F,CAAC;CACJ"}
@@ -0,0 +1,6 @@
1
+ import { type ParameterDescriptor } from "../descriptor.js";
2
+ export declare const valueParameterDescriptor: ParameterDescriptor;
3
+ export declare const startValueParameterDescriptor: ParameterDescriptor;
4
+ export declare const countParameterDescriptor: ParameterDescriptor;
5
+ export declare const tweakParameterDescriptor: ParameterDescriptor;
6
+ //# sourceMappingURL=transformer-descriptor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transformer-descriptor.d.ts","sourceRoot":"","sources":["../../src/utility/transformer-descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,mBAAmB,EAAQ,MAAM,kBAAkB,CAAC;AAElE,eAAO,MAAM,wBAAwB,EAAE,mBAKtC,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,mBAI3C,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,mBAItC,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,mBAKtC,CAAC"}