@aidc-toolkit/app-extension 1.0.49-beta → 1.0.50-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.
- package/dist/app-extension-options.d.ts +52 -0
- package/dist/app-extension-options.d.ts.map +1 -0
- package/dist/app-extension-options.js +2 -0
- package/dist/app-extension-options.js.map +1 -0
- package/dist/app-extension.d.ts +15 -31
- package/dist/app-extension.d.ts.map +1 -1
- package/dist/app-extension.js +0 -15
- package/dist/app-extension.js.map +1 -1
- package/dist/app-helper-proxy.d.ts +9 -23
- package/dist/app-helper-proxy.d.ts.map +1 -1
- package/dist/app-helper-proxy.js +27 -26
- package/dist/app-helper-proxy.js.map +1 -1
- package/dist/generator/functions-generator.d.ts +1 -17
- package/dist/generator/functions-generator.d.ts.map +1 -1
- package/dist/generator/functions-generator.js +13 -40
- package/dist/generator/functions-generator.js.map +1 -1
- package/dist/generator/generator.d.ts.map +1 -1
- package/dist/generator/generator.js +17 -14
- package/dist/generator/generator.js.map +1 -1
- package/dist/generator/locale-resources-generator.js +64 -44
- package/dist/generator/locale-resources-generator.js.map +1 -1
- package/dist/gs1/character-set-proxy.d.ts +6 -7
- package/dist/gs1/character-set-proxy.d.ts.map +1 -1
- package/dist/gs1/character-set-proxy.js.map +1 -1
- package/dist/gs1/check-proxy.d.ts +8 -8
- package/dist/gs1/check-proxy.d.ts.map +1 -1
- package/dist/gs1/check-proxy.js.map +1 -1
- package/dist/gs1/gcp-length-proxy.d.ts +6 -6
- package/dist/gs1/gcp-length-proxy.d.ts.map +1 -1
- package/dist/gs1/gcp-length-proxy.js.map +1 -1
- package/dist/gs1/gtin-creator-proxy.d.ts +4 -4
- package/dist/gs1/gtin-creator-proxy.d.ts.map +1 -1
- package/dist/gs1/gtin-creator-proxy.js.map +1 -1
- package/dist/gs1/gtin-validator-proxy.d.ts +12 -12
- package/dist/gs1/gtin-validator-proxy.d.ts.map +1 -1
- package/dist/gs1/gtin-validator-proxy.js.map +1 -1
- package/dist/gs1/identifier-creator-proxy.d.ts +14 -14
- package/dist/gs1/identifier-creator-proxy.d.ts.map +1 -1
- package/dist/gs1/identifier-creator-proxy.js.map +1 -1
- package/dist/gs1/identifier-validator-proxy.d.ts +10 -10
- package/dist/gs1/identifier-validator-proxy.d.ts.map +1 -1
- package/dist/gs1/identifier-validator-proxy.js.map +1 -1
- package/dist/gs1/non-gtin-creator-proxy.d.ts +22 -23
- package/dist/gs1/non-gtin-creator-proxy.d.ts.map +1 -1
- package/dist/gs1/non-gtin-creator-proxy.js.map +1 -1
- package/dist/gs1/non-gtin-validator-proxy.d.ts +22 -23
- package/dist/gs1/non-gtin-validator-proxy.d.ts.map +1 -1
- package/dist/gs1/non-gtin-validator-proxy.js.map +1 -1
- package/dist/gs1/prefix-manager-proxy.d.ts +2 -2
- package/dist/gs1/prefix-manager-proxy.d.ts.map +1 -1
- package/dist/gs1/prefix-manager-proxy.js.map +1 -1
- package/dist/gs1/variable-measure-proxy.d.ts +4 -4
- package/dist/gs1/variable-measure-proxy.d.ts.map +1 -1
- package/dist/gs1/variable-measure-proxy.js.map +1 -1
- package/dist/gs1/verified-by-gs1-proxy.d.ts +4 -4
- package/dist/gs1/verified-by-gs1-proxy.d.ts.map +1 -1
- package/dist/gs1/verified-by-gs1-proxy.js +2 -8
- package/dist/gs1/verified-by-gs1-proxy.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lib-proxy.d.ts +12 -26
- package/dist/lib-proxy.d.ts.map +1 -1
- package/dist/lib-proxy.js +1 -18
- package/dist/lib-proxy.js.map +1 -1
- package/dist/locale/en/locale-resources.js +1 -1
- package/dist/locale/en/locale-resources.js.map +1 -1
- package/dist/proxy.d.ts +3 -4
- package/dist/proxy.d.ts.map +1 -1
- package/dist/proxy.js.map +1 -1
- package/dist/streaming.d.ts +2 -2
- package/dist/streaming.d.ts.map +1 -1
- package/dist/type.d.ts +3 -22
- package/dist/type.d.ts.map +1 -1
- package/dist/utility/character-set-proxy.d.ts +17 -16
- package/dist/utility/character-set-proxy.d.ts.map +1 -1
- package/dist/utility/character-set-proxy.js.map +1 -1
- package/dist/utility/reg-exp-proxy.d.ts +2 -2
- package/dist/utility/reg-exp-proxy.d.ts.map +1 -1
- package/dist/utility/reg-exp-proxy.js.map +1 -1
- package/dist/utility/string-proxy.d.ts +2 -2
- package/dist/utility/string-proxy.d.ts.map +1 -1
- package/dist/utility/string-proxy.js.map +1 -1
- package/dist/utility/transformer-proxy.d.ts +6 -5
- package/dist/utility/transformer-proxy.d.ts.map +1 -1
- package/dist/utility/transformer-proxy.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +5 -5
- package/src/app-extension-options.ts +61 -0
- package/src/app-extension.ts +22 -32
- package/src/app-helper-proxy.ts +21 -33
- package/src/generator/functions-generator.ts +14 -45
- package/src/generator/generator.ts +28 -18
- package/src/generator/locale-resources-generator.ts +79 -52
- package/src/gs1/character-set-proxy.ts +6 -7
- package/src/gs1/check-proxy.ts +8 -8
- package/src/gs1/gcp-length-proxy.ts +8 -8
- package/src/gs1/gtin-creator-proxy.ts +4 -4
- package/src/gs1/gtin-validator-proxy.ts +12 -12
- package/src/gs1/identifier-creator-proxy.ts +14 -14
- package/src/gs1/identifier-validator-proxy.ts +10 -10
- package/src/gs1/non-gtin-creator-proxy.ts +22 -23
- package/src/gs1/non-gtin-validator-proxy.ts +22 -23
- package/src/gs1/prefix-manager-proxy.ts +2 -2
- package/src/gs1/variable-measure-proxy.ts +4 -4
- package/src/gs1/verified-by-gs1-proxy.ts +5 -11
- package/src/index.ts +1 -0
- package/src/lib-proxy.ts +27 -43
- package/src/locale/en/locale-resources.ts +1 -1
- package/src/proxy.ts +12 -15
- package/src/streaming.ts +3 -3
- package/src/type.ts +3 -22
- package/src/utility/character-set-proxy.ts +17 -16
- package/src/utility/reg-exp-proxy.ts +2 -2
- package/src/utility/string-proxy.ts +2 -2
- package/src/utility/transformer-proxy.ts +6 -5
- package/src/version.ts +1 -1
- package/tsconfig-src.tsbuildinfo +1 -1
package/src/proxy.ts
CHANGED
|
@@ -16,7 +16,6 @@ import {
|
|
|
16
16
|
type ReplacementParameterDescriptor
|
|
17
17
|
} from "./descriptor.js";
|
|
18
18
|
import { LibProxy } from "./lib-proxy.js";
|
|
19
|
-
import type { ErrorExtends } from "./type.js";
|
|
20
19
|
|
|
21
20
|
/**
|
|
22
21
|
* Remaining parameters past first parameter in constructor.
|
|
@@ -38,13 +37,12 @@ type RemainingConstructorParameters<TConstructor extends TypedAbstractConstructo
|
|
|
38
37
|
* Proxy class constructor type.
|
|
39
38
|
*/
|
|
40
39
|
type ProxyClassConstructor<
|
|
41
|
-
|
|
42
|
-
T extends LibProxy<ThrowError, TError, TInvocationContext, TStreamingInvocationContext, TBigInt>,
|
|
40
|
+
T extends LibProxy,
|
|
43
41
|
IsAbstract extends boolean,
|
|
44
42
|
TConstructor extends TypedAbstractConstructor<TConstructor>
|
|
45
43
|
> = IsAbstract extends true ?
|
|
46
|
-
AbstractConstructor<[appExtension: AppExtension
|
|
47
|
-
Constructor<[appExtension: AppExtension
|
|
44
|
+
AbstractConstructor<[appExtension: AppExtension, ...args: RemainingConstructorParameters<TConstructor>], T> :
|
|
45
|
+
Constructor<[appExtension: AppExtension], T>;
|
|
48
46
|
|
|
49
47
|
/**
|
|
50
48
|
* Class decorator type. Defines the parameters passed to a class decorator function and the return type as identical to
|
|
@@ -63,11 +61,10 @@ type ProxyClassConstructor<
|
|
|
63
61
|
* Narrowed proxy class constructor type.
|
|
64
62
|
*/
|
|
65
63
|
type ClassDecorator<
|
|
66
|
-
|
|
67
|
-
T extends LibProxy<ThrowError, TError, TInvocationContext, TStreamingInvocationContext, TBigInt>,
|
|
64
|
+
T extends LibProxy,
|
|
68
65
|
IsAbstract extends boolean,
|
|
69
66
|
TConstructor extends TypedAbstractConstructor<TConstructor>,
|
|
70
|
-
TProxyClassConstructor extends ProxyClassConstructor<
|
|
67
|
+
TProxyClassConstructor extends ProxyClassConstructor<T, IsAbstract, TConstructor>
|
|
71
68
|
> = (Target: TProxyClassConstructor, context: ClassDecoratorContext<TProxyClassConstructor>) => TProxyClassConstructor;
|
|
72
69
|
|
|
73
70
|
/**
|
|
@@ -210,12 +207,11 @@ export class Proxy {
|
|
|
210
207
|
* Function with which to decorate the class.
|
|
211
208
|
*/
|
|
212
209
|
describeClass<
|
|
213
|
-
|
|
214
|
-
T extends LibProxy<ThrowError, TError, TInvocationContext, TStreamingInvocationContext, TBigInt>,
|
|
210
|
+
T extends LibProxy,
|
|
215
211
|
IsAbstract extends boolean,
|
|
216
212
|
TConstructor extends TypedAbstractConstructor<TConstructor>,
|
|
217
|
-
TProxyClassConstructor extends ProxyClassConstructor<
|
|
218
|
-
>(isAbstract: IsAbstract, decoratorClassDescriptor: DecoratorClassDescriptor = {}): ClassDecorator<
|
|
213
|
+
TProxyClassConstructor extends ProxyClassConstructor<T, IsAbstract, TConstructor>
|
|
214
|
+
>(isAbstract: IsAbstract, decoratorClassDescriptor: DecoratorClassDescriptor = {}): ClassDecorator<T, IsAbstract, TConstructor, TProxyClassConstructor> {
|
|
219
215
|
const interimClassDescriptor: InterimClassDescriptor = decoratorClassDescriptor.replacementParameterDescriptors === undefined ?
|
|
220
216
|
omit(decoratorClassDescriptor, "replacementParameterDescriptors") :
|
|
221
217
|
{
|
|
@@ -246,8 +242,9 @@ export class Proxy {
|
|
|
246
242
|
|
|
247
243
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- Target is known to be of type LibProxy.
|
|
248
244
|
const targetClassType = Target as unknown as typeof LibProxy;
|
|
245
|
+
|
|
249
246
|
let baseClassType = targetClassType;
|
|
250
|
-
let baseClassDescriptor
|
|
247
|
+
let baseClassDescriptor;
|
|
251
248
|
|
|
252
249
|
do {
|
|
253
250
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- Class hierarchy is known to stop at LibProxy.
|
|
@@ -311,7 +308,7 @@ export class Proxy {
|
|
|
311
308
|
const methodName = interimMethodDescriptor.name;
|
|
312
309
|
const infixBefore = interimMethodDescriptor.infixBefore;
|
|
313
310
|
|
|
314
|
-
let functionName
|
|
311
|
+
let functionName;
|
|
315
312
|
|
|
316
313
|
if (methodInfix === undefined || interimMethodDescriptor.ignoreInfix === true) {
|
|
317
314
|
// No other classes in the hierarchy or no infix required.
|
|
@@ -444,7 +441,7 @@ export class Proxy {
|
|
|
444
441
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- Class has been modified to add log method.
|
|
445
442
|
const targetLogger = this as TargetLogger;
|
|
446
443
|
|
|
447
|
-
let result
|
|
444
|
+
let result;
|
|
448
445
|
|
|
449
446
|
try {
|
|
450
447
|
result = target.call(this, ...args);
|
package/src/streaming.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { MatrixResult } from "./type.js";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Streaming consumer callback, returned by application extension implementation.
|
|
5
5
|
*/
|
|
6
|
-
export type StreamingConsumerCallback<TResult
|
|
7
|
-
(result: MatrixResult<TResult
|
|
6
|
+
export type StreamingConsumerCallback<TResult> =
|
|
7
|
+
(result: MatrixResult<TResult>) => void;
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Streaming cancelled callback, passed to application extension implementation.
|
package/src/type.ts
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
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 {@linkcode 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;
|
|
1
|
+
import type { ApplicationError, ThrowError } from "./app-extension-options.js";
|
|
9
2
|
|
|
10
3
|
/**
|
|
11
4
|
* Sheet.
|
|
@@ -74,14 +67,8 @@ export type Matrix<T> = T[][];
|
|
|
74
67
|
*
|
|
75
68
|
* @template TResult
|
|
76
69
|
* Result type.
|
|
77
|
-
*
|
|
78
|
-
* @template ThrowError
|
|
79
|
-
* If true, errors are reported through the throw/catch mechanism.
|
|
80
|
-
*
|
|
81
|
-
* @template TError
|
|
82
|
-
* Error type.
|
|
83
70
|
*/
|
|
84
|
-
export type SingletonResult<TResult
|
|
71
|
+
export type SingletonResult<TResult> = ThrowError extends true ? TResult : TResult | ApplicationError;
|
|
85
72
|
|
|
86
73
|
/**
|
|
87
74
|
* Function matrix return, possibly including an error return in each element. If the application extension reports
|
|
@@ -90,11 +77,5 @@ export type SingletonResult<TResult, ThrowError extends boolean, TError extends
|
|
|
90
77
|
*
|
|
91
78
|
* @template TResult
|
|
92
79
|
* Result type.
|
|
93
|
-
*
|
|
94
|
-
* @template ThrowError
|
|
95
|
-
* If true, errors are reported through the throw/catch mechanism.
|
|
96
|
-
*
|
|
97
|
-
* @template TError
|
|
98
|
-
* Error type.
|
|
99
80
|
*/
|
|
100
|
-
export type MatrixResult<TResult
|
|
81
|
+
export type MatrixResult<TResult> = Matrix<SingletonResult<TResult>>;
|
|
@@ -10,10 +10,11 @@ import {
|
|
|
10
10
|
NUMERIC_CREATOR,
|
|
11
11
|
Sequence
|
|
12
12
|
} from "@aidc-toolkit/utility";
|
|
13
|
+
import type { BigInteger } from "../app-extension-options.js";
|
|
13
14
|
import type { AppExtension } from "../app-extension.js";
|
|
14
15
|
import { type ExtendsParameterDescriptor, Multiplicities, type ParameterDescriptor, Types } from "../descriptor.js";
|
|
15
16
|
import { expandParameterDescriptor, proxy } from "../proxy.js";
|
|
16
|
-
import type {
|
|
17
|
+
import type { Matrix, MatrixResult } from "../type.js";
|
|
17
18
|
import {
|
|
18
19
|
exclusionAnyParameterDescriptor,
|
|
19
20
|
exclusionFirstZeroParameterDescriptor,
|
|
@@ -41,10 +42,10 @@ const valueForSParameterDescriptor: ExtendsParameterDescriptor = {
|
|
|
41
42
|
};
|
|
42
43
|
|
|
43
44
|
@proxy.describeClass(true)
|
|
44
|
-
export abstract class CharacterSetValidatorProxy
|
|
45
|
+
export abstract class CharacterSetValidatorProxy extends StringProxy {
|
|
45
46
|
readonly #characterSetValidator: CharacterSetValidator;
|
|
46
47
|
|
|
47
|
-
constructor(appExtension: AppExtension
|
|
48
|
+
constructor(appExtension: AppExtension, characterSetValidator: CharacterSetValidator) {
|
|
48
49
|
super(appExtension);
|
|
49
50
|
|
|
50
51
|
this.#characterSetValidator = characterSetValidator;
|
|
@@ -72,10 +73,10 @@ export abstract class CharacterSetValidatorProxy<ThrowError extends boolean, TEr
|
|
|
72
73
|
}
|
|
73
74
|
|
|
74
75
|
@proxy.describeClass(true)
|
|
75
|
-
export abstract class CharacterSetCreatorProxy
|
|
76
|
+
export abstract class CharacterSetCreatorProxy extends CharacterSetValidatorProxy {
|
|
76
77
|
readonly #characterSetCreator: CharacterSetCreator;
|
|
77
78
|
|
|
78
|
-
constructor(appExtension: AppExtension
|
|
79
|
+
constructor(appExtension: AppExtension, characterSetCreator: CharacterSetCreator) {
|
|
79
80
|
super(appExtension, characterSetCreator);
|
|
80
81
|
|
|
81
82
|
this.#characterSetCreator = characterSetCreator;
|
|
@@ -86,7 +87,7 @@ export abstract class CharacterSetCreatorProxy<ThrowError extends boolean, TErro
|
|
|
86
87
|
multiplicity: Multiplicities.Matrix,
|
|
87
88
|
parameterDescriptors: [lengthParameterDescriptor, valueParameterDescriptor, exclusionNoneParameterDescriptor, tweakParameterDescriptor]
|
|
88
89
|
})
|
|
89
|
-
create(length: number, matrixValues: Matrix<number | bigint>, exclusion: Nullishable<Exclusion>, tweak: Nullishable<number | bigint>): MatrixResult<string
|
|
90
|
+
create(length: number, matrixValues: Matrix<number | bigint>, exclusion: Nullishable<Exclusion>, tweak: Nullishable<number | bigint>): MatrixResult<string> {
|
|
90
91
|
const exclusionOrUndefined = exclusion ?? undefined;
|
|
91
92
|
const tweakOrUndefined = tweak ?? undefined;
|
|
92
93
|
|
|
@@ -101,7 +102,7 @@ export abstract class CharacterSetCreatorProxy<ThrowError extends boolean, TErro
|
|
|
101
102
|
multiplicity: Multiplicities.Array,
|
|
102
103
|
parameterDescriptors: [lengthParameterDescriptor, startValueParameterDescriptor, countParameterDescriptor, exclusionNoneParameterDescriptor, tweakParameterDescriptor]
|
|
103
104
|
})
|
|
104
|
-
createSequence(length: number, startValue: number, count: number, exclusion: Nullishable<Exclusion>, tweak: Nullishable<number | bigint>): MatrixResult<string
|
|
105
|
+
createSequence(length: number, startValue: number, count: number, exclusion: Nullishable<Exclusion>, tweak: Nullishable<number | bigint>): MatrixResult<string> {
|
|
105
106
|
const exclusionOrUndefined = exclusion ?? undefined;
|
|
106
107
|
const tweakOrUndefined = tweak ?? undefined;
|
|
107
108
|
|
|
@@ -117,7 +118,7 @@ export abstract class CharacterSetCreatorProxy<ThrowError extends boolean, TErro
|
|
|
117
118
|
multiplicity: Multiplicities.Matrix,
|
|
118
119
|
parameterDescriptors: [valueForSParameterDescriptor, exclusionNoneParameterDescriptor, tweakParameterDescriptor]
|
|
119
120
|
})
|
|
120
|
-
valueFor(matrixSs: Matrix<string>, exclusion: Nullishable<Exclusion>, tweak: Nullishable<number | bigint>): MatrixResult<
|
|
121
|
+
valueFor(matrixSs: Matrix<string>, exclusion: Nullishable<Exclusion>, tweak: Nullishable<number | bigint>): MatrixResult<BigInteger> {
|
|
121
122
|
const exclusionOrUndefined = exclusion ?? undefined;
|
|
122
123
|
const tweakOrUndefined = tweak ?? undefined;
|
|
123
124
|
|
|
@@ -136,8 +137,8 @@ export abstract class CharacterSetCreatorProxy<ThrowError extends boolean, TErro
|
|
|
136
137
|
}
|
|
137
138
|
]
|
|
138
139
|
})
|
|
139
|
-
export class NumericProxy
|
|
140
|
-
constructor(appExtension: AppExtension
|
|
140
|
+
export class NumericProxy extends CharacterSetCreatorProxy {
|
|
141
|
+
constructor(appExtension: AppExtension) {
|
|
141
142
|
super(appExtension, NUMERIC_CREATOR);
|
|
142
143
|
}
|
|
143
144
|
}
|
|
@@ -151,8 +152,8 @@ export class NumericProxy<ThrowError extends boolean, TError extends ErrorExtend
|
|
|
151
152
|
}
|
|
152
153
|
]
|
|
153
154
|
})
|
|
154
|
-
export class HexadecimalProxy
|
|
155
|
-
constructor(appExtension: AppExtension
|
|
155
|
+
export class HexadecimalProxy extends CharacterSetCreatorProxy {
|
|
156
|
+
constructor(appExtension: AppExtension) {
|
|
156
157
|
super(appExtension, HEXADECIMAL_CREATOR);
|
|
157
158
|
}
|
|
158
159
|
}
|
|
@@ -160,8 +161,8 @@ export class HexadecimalProxy<ThrowError extends boolean, TError extends ErrorEx
|
|
|
160
161
|
@proxy.describeClass(false, {
|
|
161
162
|
methodInfix: "Alphabetic"
|
|
162
163
|
})
|
|
163
|
-
export class AlphabeticProxy
|
|
164
|
-
constructor(appExtension: AppExtension
|
|
164
|
+
export class AlphabeticProxy extends CharacterSetCreatorProxy {
|
|
165
|
+
constructor(appExtension: AppExtension) {
|
|
165
166
|
super(appExtension, ALPHABETIC_CREATOR);
|
|
166
167
|
}
|
|
167
168
|
}
|
|
@@ -175,8 +176,8 @@ export class AlphabeticProxy<ThrowError extends boolean, TError extends ErrorExt
|
|
|
175
176
|
}
|
|
176
177
|
]
|
|
177
178
|
})
|
|
178
|
-
export class AlphanumericProxy
|
|
179
|
-
constructor(appExtension: AppExtension
|
|
179
|
+
export class AlphanumericProxy extends CharacterSetCreatorProxy {
|
|
180
|
+
constructor(appExtension: AppExtension) {
|
|
180
181
|
super(appExtension, ALPHANUMERIC_CREATOR);
|
|
181
182
|
}
|
|
182
183
|
}
|
|
@@ -2,7 +2,7 @@ import type { Nullishable } from "@aidc-toolkit/core";
|
|
|
2
2
|
import { RegExpValidator } from "@aidc-toolkit/utility";
|
|
3
3
|
import { Multiplicities, type ParameterDescriptor, Types } from "../descriptor.js";
|
|
4
4
|
import { proxy } from "../proxy.js";
|
|
5
|
-
import type {
|
|
5
|
+
import type { Matrix } from "../type.js";
|
|
6
6
|
import { validateSParameterDescriptor } from "./string-descriptor.js";
|
|
7
7
|
import { StringProxy } from "./string-proxy.js";
|
|
8
8
|
|
|
@@ -23,7 +23,7 @@ const errorMessageParameterDescriptor: ParameterDescriptor = {
|
|
|
23
23
|
@proxy.describeClass(false, {
|
|
24
24
|
methodInfix: "RegExp"
|
|
25
25
|
})
|
|
26
|
-
export class RegExpProxy
|
|
26
|
+
export class RegExpProxy extends StringProxy {
|
|
27
27
|
@proxy.describeMethod({
|
|
28
28
|
type: Types.String,
|
|
29
29
|
multiplicity: Multiplicities.Matrix,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { StringValidation, StringValidator } from "@aidc-toolkit/utility";
|
|
2
2
|
import { LibProxy } from "../lib-proxy.js";
|
|
3
3
|
import { proxy } from "../proxy.js";
|
|
4
|
-
import type {
|
|
4
|
+
import type { Matrix } from "../type.js";
|
|
5
5
|
|
|
6
6
|
@proxy.describeClass(true, {
|
|
7
7
|
category: "string"
|
|
8
8
|
})
|
|
9
|
-
export abstract class StringProxy
|
|
9
|
+
export abstract class StringProxy extends LibProxy {
|
|
10
10
|
protected validateString<TStringValidation extends StringValidation>(validator: StringValidator<TStringValidation>, matrixSs: Matrix<string>, validation?: TStringValidation): Matrix<string> {
|
|
11
11
|
return this.matrixErrorResult(matrixSs, (s) => {
|
|
12
12
|
validator.validate(s, validation);
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { Nullishable } from "@aidc-toolkit/core";
|
|
2
2
|
import { mapIterable, Sequence, Transformer } from "@aidc-toolkit/utility";
|
|
3
|
+
import type { BigInteger } from "../app-extension-options.js";
|
|
3
4
|
import { type ExtendsParameterDescriptor, Multiplicities, type ParameterDescriptor, Types } from "../descriptor.js";
|
|
4
5
|
import { LibProxy } from "../lib-proxy.js";
|
|
5
6
|
import { proxy } from "../proxy.js";
|
|
6
|
-
import type {
|
|
7
|
+
import type { Matrix, MatrixResult } from "../type.js";
|
|
7
8
|
import {
|
|
8
9
|
countParameterDescriptor,
|
|
9
10
|
startValueParameterDescriptor,
|
|
@@ -27,13 +28,13 @@ const transformedValueParameterDescriptor: ExtendsParameterDescriptor = {
|
|
|
27
28
|
category: "transformation",
|
|
28
29
|
methodInfix: "Transform"
|
|
29
30
|
})
|
|
30
|
-
export class TransformerProxy
|
|
31
|
+
export class TransformerProxy extends LibProxy {
|
|
31
32
|
@proxy.describeMethod({
|
|
32
33
|
type: Types.Number,
|
|
33
34
|
multiplicity: Multiplicities.Matrix,
|
|
34
35
|
parameterDescriptors: [domainParameterDescriptor, valueParameterDescriptor, tweakParameterDescriptor]
|
|
35
36
|
})
|
|
36
|
-
forward(domain: number | bigint, matrixValues: Matrix<number | bigint>, tweak: Nullishable<number | bigint>): MatrixResult<
|
|
37
|
+
forward(domain: number | bigint, matrixValues: Matrix<number | bigint>, tweak: Nullishable<number | bigint>): MatrixResult<BigInteger> {
|
|
37
38
|
return this.setUpMatrixResult(() =>
|
|
38
39
|
Transformer.get(domain, tweak ?? undefined),
|
|
39
40
|
matrixValues, (transformer, value) =>
|
|
@@ -47,7 +48,7 @@ export class TransformerProxy<ThrowError extends boolean, TError extends ErrorEx
|
|
|
47
48
|
multiplicity: Multiplicities.Array,
|
|
48
49
|
parameterDescriptors: [domainParameterDescriptor, startValueParameterDescriptor, countParameterDescriptor, tweakParameterDescriptor]
|
|
49
50
|
})
|
|
50
|
-
forwardSequence(domain: number | bigint, startValue: number, count: number, tweak: Nullishable<number | bigint>): MatrixResult<
|
|
51
|
+
forwardSequence(domain: number | bigint, startValue: number, count: number, tweak: Nullishable<number | bigint>): MatrixResult<BigInteger> {
|
|
51
52
|
return this.iterableResult(() => {
|
|
52
53
|
this.appExtension.validateSequenceCount(count);
|
|
53
54
|
|
|
@@ -60,7 +61,7 @@ export class TransformerProxy<ThrowError extends boolean, TError extends ErrorEx
|
|
|
60
61
|
multiplicity: Multiplicities.Matrix,
|
|
61
62
|
parameterDescriptors: [domainParameterDescriptor, transformedValueParameterDescriptor, tweakParameterDescriptor]
|
|
62
63
|
})
|
|
63
|
-
reverse(domain: number | bigint, matrixTransformedValues: Matrix<number | bigint>, tweak: Nullishable<number | bigint>): MatrixResult<
|
|
64
|
+
reverse(domain: number | bigint, matrixTransformedValues: Matrix<number | bigint>, tweak: Nullishable<number | bigint>): MatrixResult<BigInteger> {
|
|
64
65
|
return this.setUpMatrixResult(() =>
|
|
65
66
|
Transformer.get(domain, tweak ?? undefined),
|
|
66
67
|
matrixTransformedValues, (transformer, transformedValue) =>
|
package/src/version.ts
CHANGED