@aidc-toolkit/app-extension 1.0.48-beta → 1.0.49
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/character-set-proxy-BOW94WCe.d.cts +473 -0
- package/dist/character-set-proxy-BOW94WCe.d.ts +473 -0
- package/dist/chunk-22IRLVWO.js +1 -0
- package/dist/chunk-MR63TJ3B.js +1 -0
- package/dist/chunk-TWX7TPRC.js +1 -0
- package/dist/{descriptor.d.ts → descriptor-D6tZH-vc.d.cts} +13 -13
- package/dist/descriptor-D6tZH-vc.d.ts +185 -0
- package/dist/generator/index.cjs +17 -0
- package/dist/generator/index.d.cts +240 -0
- package/dist/generator/index.d.ts +239 -17
- package/dist/generator/index.js +1 -2
- package/dist/gs1/index.cjs +1 -0
- package/dist/gs1/index.d.cts +185 -0
- package/dist/gs1/index.d.ts +185 -11
- package/dist/gs1/index.js +1 -11
- package/dist/index.cjs +17 -0
- package/dist/{locale/en/locale-resources.d.ts → index.d.cts} +113 -2
- package/dist/index.d.ts +862 -21
- package/dist/index.js +1 -7
- package/package.json +5 -5
- package/src/app-extension.ts +29 -0
- package/src/app-helper-proxy.ts +45 -7
- package/src/generator/functions-generator.ts +292 -0
- package/src/generator/generator.ts +9 -29
- package/src/generator/index.ts +1 -0
- package/src/generator/locale-resources-generator.ts +9 -7
- package/src/gs1/check-proxy.ts +3 -3
- package/src/gs1/gtin-validator-proxy.ts +2 -2
- package/src/gs1/identifier-validator-proxy.ts +2 -2
- package/src/locale/fr/locale-resources.ts +2 -2
- package/src/locale/i18n.ts +5 -5
- package/src/version.ts +4 -0
- package/tsconfig-src.tsbuildinfo +1 -1
- package/dist/app-extension.d.ts +0 -198
- package/dist/app-extension.d.ts.map +0 -1
- package/dist/app-extension.js +0 -133
- package/dist/app-extension.js.map +0 -1
- package/dist/app-helper-proxy.d.ts +0 -61
- package/dist/app-helper-proxy.d.ts.map +0 -1
- package/dist/app-helper-proxy.js +0 -333
- package/dist/app-helper-proxy.js.map +0 -1
- package/dist/descriptor.d.ts.map +0 -1
- package/dist/descriptor.js +0 -44
- package/dist/descriptor.js.map +0 -1
- package/dist/generator/generator.d.ts +0 -124
- package/dist/generator/generator.d.ts.map +0 -1
- package/dist/generator/generator.js +0 -198
- package/dist/generator/generator.js.map +0 -1
- package/dist/generator/index.d.ts.map +0 -1
- package/dist/generator/index.js.map +0 -1
- package/dist/generator/locale-resources-generator.d.ts +0 -2
- package/dist/generator/locale-resources-generator.d.ts.map +0 -1
- package/dist/generator/locale-resources-generator.js +0 -312
- package/dist/generator/locale-resources-generator.js.map +0 -1
- package/dist/gs1/character-set-proxy.d.ts +0 -13
- package/dist/gs1/character-set-proxy.d.ts.map +0 -1
- package/dist/gs1/character-set-proxy.js +0 -126
- package/dist/gs1/character-set-proxy.js.map +0 -1
- package/dist/gs1/check-proxy.d.ts +0 -11
- package/dist/gs1/check-proxy.d.ts.map +0 -1
- package/dist/gs1/check-proxy.js +0 -163
- package/dist/gs1/check-proxy.js.map +0 -1
- package/dist/gs1/gcp-length-proxy.d.ts +0 -11
- package/dist/gs1/gcp-length-proxy.d.ts.map +0 -1
- package/dist/gs1/gcp-length-proxy.js +0 -187
- package/dist/gs1/gcp-length-proxy.js.map +0 -1
- package/dist/gs1/gtin-creator-proxy.d.ts +0 -10
- package/dist/gs1/gtin-creator-proxy.d.ts.map +0 -1
- package/dist/gs1/gtin-creator-proxy.js +0 -85
- package/dist/gs1/gtin-creator-proxy.js.map +0 -1
- package/dist/gs1/gtin-descriptor.d.ts +0 -3
- package/dist/gs1/gtin-descriptor.d.ts.map +0 -1
- package/dist/gs1/gtin-descriptor.js +0 -8
- package/dist/gs1/gtin-descriptor.js.map +0 -1
- package/dist/gs1/gtin-validator-proxy.d.ts +0 -26
- package/dist/gs1/gtin-validator-proxy.d.ts.map +0 -1
- package/dist/gs1/gtin-validator-proxy.js +0 -256
- package/dist/gs1/gtin-validator-proxy.js.map +0 -1
- package/dist/gs1/identifier-creator-proxy.d.ts +0 -30
- package/dist/gs1/identifier-creator-proxy.d.ts.map +0 -1
- package/dist/gs1/identifier-creator-proxy.js +0 -318
- package/dist/gs1/identifier-creator-proxy.js.map +0 -1
- package/dist/gs1/identifier-descriptor.d.ts +0 -4
- package/dist/gs1/identifier-descriptor.d.ts.map +0 -1
- package/dist/gs1/identifier-descriptor.js +0 -14
- package/dist/gs1/identifier-descriptor.js.map +0 -1
- package/dist/gs1/identifier-type.d.ts +0 -22
- package/dist/gs1/identifier-type.d.ts.map +0 -1
- package/dist/gs1/identifier-type.js +0 -34
- package/dist/gs1/identifier-type.js.map +0 -1
- package/dist/gs1/identifier-validator-proxy.d.ts +0 -29
- package/dist/gs1/identifier-validator-proxy.d.ts.map +0 -1
- package/dist/gs1/identifier-validator-proxy.js +0 -212
- package/dist/gs1/identifier-validator-proxy.js.map +0 -1
- package/dist/gs1/index.d.ts.map +0 -1
- package/dist/gs1/index.js.map +0 -1
- package/dist/gs1/non-gtin-creator-proxy.d.ts +0 -38
- package/dist/gs1/non-gtin-creator-proxy.d.ts.map +0 -1
- package/dist/gs1/non-gtin-creator-proxy.js +0 -301
- package/dist/gs1/non-gtin-creator-proxy.js.map +0 -1
- package/dist/gs1/non-gtin-validator-proxy.d.ts +0 -37
- package/dist/gs1/non-gtin-validator-proxy.d.ts.map +0 -1
- package/dist/gs1/non-gtin-validator-proxy.js +0 -302
- package/dist/gs1/non-gtin-validator-proxy.js.map +0 -1
- package/dist/gs1/prefix-definition-descriptor.d.ts +0 -4
- package/dist/gs1/prefix-definition-descriptor.d.ts.map +0 -1
- package/dist/gs1/prefix-definition-descriptor.js +0 -16
- package/dist/gs1/prefix-definition-descriptor.js.map +0 -1
- package/dist/gs1/prefix-manager-proxy.d.ts +0 -8
- package/dist/gs1/prefix-manager-proxy.d.ts.map +0 -1
- package/dist/gs1/prefix-manager-proxy.js +0 -94
- package/dist/gs1/prefix-manager-proxy.js.map +0 -1
- package/dist/gs1/variable-measure-proxy.d.ts +0 -7
- package/dist/gs1/variable-measure-proxy.d.ts.map +0 -1
- package/dist/gs1/variable-measure-proxy.js +0 -114
- package/dist/gs1/variable-measure-proxy.js.map +0 -1
- package/dist/gs1/verified-by-gs1-proxy.d.ts +0 -7
- package/dist/gs1/verified-by-gs1-proxy.d.ts.map +0 -1
- package/dist/gs1/verified-by-gs1-proxy.js +0 -106
- package/dist/gs1/verified-by-gs1-proxy.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/lib-proxy.d.ts +0 -135
- package/dist/lib-proxy.d.ts.map +0 -1
- package/dist/lib-proxy.js +0 -276
- package/dist/lib-proxy.js.map +0 -1
- package/dist/locale/en/locale-resources.d.ts.map +0 -1
- package/dist/locale/en/locale-resources.js +0 -754
- package/dist/locale/en/locale-resources.js.map +0 -1
- package/dist/locale/fr/locale-resources.d.ts +0 -755
- package/dist/locale/fr/locale-resources.d.ts.map +0 -1
- package/dist/locale/fr/locale-resources.js +0 -754
- package/dist/locale/fr/locale-resources.js.map +0 -1
- package/dist/locale/i18n.d.ts +0 -27
- package/dist/locale/i18n.d.ts.map +0 -1
- package/dist/locale/i18n.js +0 -36
- package/dist/locale/i18n.js.map +0 -1
- package/dist/proxy.d.ts +0 -136
- package/dist/proxy.d.ts.map +0 -1
- package/dist/proxy.js +0 -291
- package/dist/proxy.js.map +0 -1
- package/dist/streaming.d.ts +0 -10
- package/dist/streaming.d.ts.map +0 -1
- package/dist/streaming.js +0 -2
- package/dist/streaming.js.map +0 -1
- package/dist/type.d.ts +0 -91
- package/dist/type.d.ts.map +0 -1
- package/dist/type.js +0 -2
- package/dist/type.js.map +0 -1
- package/dist/utility/character-set-descriptor.d.ts +0 -6
- package/dist/utility/character-set-descriptor.d.ts.map +0 -1
- package/dist/utility/character-set-descriptor.js +0 -28
- package/dist/utility/character-set-descriptor.js.map +0 -1
- package/dist/utility/character-set-proxy.d.ts +0 -31
- package/dist/utility/character-set-proxy.d.ts.map +0 -1
- package/dist/utility/character-set-proxy.js +0 -278
- package/dist/utility/character-set-proxy.js.map +0 -1
- package/dist/utility/index.d.ts +0 -4
- package/dist/utility/index.d.ts.map +0 -1
- package/dist/utility/index.js +0 -4
- package/dist/utility/index.js.map +0 -1
- package/dist/utility/reg-exp-proxy.d.ts +0 -8
- package/dist/utility/reg-exp-proxy.d.ts.map +0 -1
- package/dist/utility/reg-exp-proxy.js +0 -103
- package/dist/utility/reg-exp-proxy.js.map +0 -1
- package/dist/utility/string-descriptor.d.ts +0 -4
- package/dist/utility/string-descriptor.d.ts.map +0 -1
- package/dist/utility/string-descriptor.js +0 -12
- package/dist/utility/string-descriptor.js.map +0 -1
- package/dist/utility/string-proxy.d.ts +0 -7
- package/dist/utility/string-proxy.d.ts.map +0 -1
- package/dist/utility/string-proxy.js +0 -63
- package/dist/utility/string-proxy.js.map +0 -1
- package/dist/utility/transformer-descriptor.d.ts +0 -6
- package/dist/utility/transformer-descriptor.d.ts.map +0 -1
- package/dist/utility/transformer-descriptor.js +0 -24
- package/dist/utility/transformer-descriptor.js.map +0 -1
- package/dist/utility/transformer-proxy.d.ts +0 -9
- package/dist/utility/transformer-proxy.d.ts.map +0 -1
- package/dist/utility/transformer-proxy.js +0 -111
- package/dist/utility/transformer-proxy.js.map +0 -1
|
@@ -0,0 +1,473 @@
|
|
|
1
|
+
import { MemoryTransport, Promisable, AppDataStorage, HTTPFetch, Hyperlink, Nullishable } from '@aidc-toolkit/core';
|
|
2
|
+
import { StringValidation, StringValidator, CharacterSetValidator, Exclusion, CharacterSetCreator } from '@aidc-toolkit/utility';
|
|
3
|
+
import { Logger } from 'tslog';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Type that error type is expected to extend. If the application framework reports errors through the throw/catch
|
|
7
|
+
* mechanism, the error type is expected to extend {@linkcode Error}. Otherwise, it may extend any object type.
|
|
8
|
+
*
|
|
9
|
+
* @template ThrowError
|
|
10
|
+
* If true, errors are reported through the throw/catch mechanism.
|
|
11
|
+
*/
|
|
12
|
+
type ErrorExtends<ThrowError extends boolean> = ThrowError extends true ? Error : object;
|
|
13
|
+
/**
|
|
14
|
+
* Sheet.
|
|
15
|
+
*/
|
|
16
|
+
interface Sheet {
|
|
17
|
+
/**
|
|
18
|
+
* Sheet name.
|
|
19
|
+
*/
|
|
20
|
+
readonly name: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Single cell address.
|
|
24
|
+
*/
|
|
25
|
+
interface Address {
|
|
26
|
+
/**
|
|
27
|
+
* Zero-indexed row.
|
|
28
|
+
*/
|
|
29
|
+
readonly rowIndex: number;
|
|
30
|
+
/**
|
|
31
|
+
* Zero-indexed column.
|
|
32
|
+
*/
|
|
33
|
+
readonly columnIndex: number;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Sheet address.
|
|
37
|
+
*/
|
|
38
|
+
interface SheetAddress extends Sheet, Address {
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Range of cells.
|
|
42
|
+
*/
|
|
43
|
+
interface Range {
|
|
44
|
+
/**
|
|
45
|
+
* Start address, inclusive.
|
|
46
|
+
*/
|
|
47
|
+
readonly startAddress: Address;
|
|
48
|
+
/**
|
|
49
|
+
* End address, exclusive.
|
|
50
|
+
*/
|
|
51
|
+
readonly endAddress: Address;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Sheet range.
|
|
55
|
+
*/
|
|
56
|
+
interface SheetRange extends Sheet, Range {
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Matrix type; shorthand for defining a two-dimensional matrix (array of array) of a type.
|
|
60
|
+
*
|
|
61
|
+
* @template T
|
|
62
|
+
* Type.
|
|
63
|
+
*/
|
|
64
|
+
type Matrix<T> = T[][];
|
|
65
|
+
/**
|
|
66
|
+
* Function singleton return, possibly including an error return. If the application extension reports errors through
|
|
67
|
+
* the return value, the result is the union of the return type and the error type; otherwise, it's just the return
|
|
68
|
+
* type.
|
|
69
|
+
*
|
|
70
|
+
* @template TResult
|
|
71
|
+
* Result type.
|
|
72
|
+
*
|
|
73
|
+
* @template ThrowError
|
|
74
|
+
* If true, errors are reported through the throw/catch mechanism.
|
|
75
|
+
*
|
|
76
|
+
* @template TError
|
|
77
|
+
* Error type.
|
|
78
|
+
*/
|
|
79
|
+
type SingletonResult<TResult, ThrowError extends boolean, TError extends ErrorExtends<ThrowError>> = ThrowError extends false ? TResult | TError : TResult;
|
|
80
|
+
/**
|
|
81
|
+
* Function matrix return, possibly including an error return in each element. If the application extension reports
|
|
82
|
+
* errors through the return value, the individual element result is the union of the return type and the error type;
|
|
83
|
+
* otherwise, it's just the return type.
|
|
84
|
+
*
|
|
85
|
+
* @template TResult
|
|
86
|
+
* Result type.
|
|
87
|
+
*
|
|
88
|
+
* @template ThrowError
|
|
89
|
+
* If true, errors are reported through the throw/catch mechanism.
|
|
90
|
+
*
|
|
91
|
+
* @template TError
|
|
92
|
+
* Error type.
|
|
93
|
+
*/
|
|
94
|
+
type MatrixResult<TResult, ThrowError extends boolean, TError extends ErrorExtends<ThrowError>> = Matrix<SingletonResult<TResult, ThrowError, TError>>;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Streaming consumer callback, returned by application extension implementation.
|
|
98
|
+
*/
|
|
99
|
+
type StreamingConsumerCallback<TResult, ThrowError extends boolean, TError extends ErrorExtends<ThrowError>> = (result: MatrixResult<TResult, ThrowError, TError>) => void;
|
|
100
|
+
/**
|
|
101
|
+
* Streaming cancelled callback, passed to application extension implementation.
|
|
102
|
+
*/
|
|
103
|
+
type StreamingCancelledCallback = () => void;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Library proxy.
|
|
107
|
+
*
|
|
108
|
+
* @template ThrowError
|
|
109
|
+
* If true, errors are reported through the throw/catch mechanism.
|
|
110
|
+
*
|
|
111
|
+
* @template TError
|
|
112
|
+
* Error type.
|
|
113
|
+
*
|
|
114
|
+
* @template TInvocationContext
|
|
115
|
+
* Application-specific invocation context type.
|
|
116
|
+
*
|
|
117
|
+
* @template TStreamingInvocationContext
|
|
118
|
+
* Application-specific streaming invocation context type.
|
|
119
|
+
*
|
|
120
|
+
* @template TBigInt
|
|
121
|
+
* Type to which big integer is mapped.
|
|
122
|
+
*/
|
|
123
|
+
declare abstract class LibProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TStreamingInvocationContext, TBigInt> {
|
|
124
|
+
#private;
|
|
125
|
+
/**
|
|
126
|
+
* Constructor.
|
|
127
|
+
*
|
|
128
|
+
* @param appExtension
|
|
129
|
+
* Application extension.
|
|
130
|
+
*/
|
|
131
|
+
constructor(appExtension: AppExtension<ThrowError, TError, TInvocationContext, TStreamingInvocationContext, TBigInt>);
|
|
132
|
+
/**
|
|
133
|
+
* Get the application extension.
|
|
134
|
+
*/
|
|
135
|
+
get appExtension(): AppExtension<ThrowError, TError, TInvocationContext, TStreamingInvocationContext, TBigInt>;
|
|
136
|
+
/**
|
|
137
|
+
* Map big integer to another type if necessary.
|
|
138
|
+
*
|
|
139
|
+
* @param value
|
|
140
|
+
* Big integer value to map.
|
|
141
|
+
*
|
|
142
|
+
* @returns
|
|
143
|
+
* Mapped big integer value.
|
|
144
|
+
*/
|
|
145
|
+
mapBigInt(value: bigint): SingletonResult<TBigInt, ThrowError, TError>;
|
|
146
|
+
/**
|
|
147
|
+
* Call a singleton result function with error handling.
|
|
148
|
+
*
|
|
149
|
+
* @param callback
|
|
150
|
+
* Callback.
|
|
151
|
+
*
|
|
152
|
+
* @returns
|
|
153
|
+
* Callback return or error if errors are not thrown.
|
|
154
|
+
*/
|
|
155
|
+
singletonResult<TResult>(callback: () => SingletonResult<TResult, ThrowError, TError>): SingletonResult<TResult, ThrowError, TError>;
|
|
156
|
+
/**
|
|
157
|
+
* Call a matrix result function with error handling.
|
|
158
|
+
*
|
|
159
|
+
* @param matrixValues
|
|
160
|
+
* Matrix of values.
|
|
161
|
+
*
|
|
162
|
+
* @param valueCallback
|
|
163
|
+
* Callback to process value.
|
|
164
|
+
*
|
|
165
|
+
* @returns
|
|
166
|
+
* Matrix of callback results and errors if errors are not thrown.
|
|
167
|
+
*/
|
|
168
|
+
protected matrixResult<TValue, TResult>(matrixValues: Matrix<TValue>, valueCallback: (value: TValue) => SingletonResult<TResult, ThrowError, TError>): MatrixResult<TResult, ThrowError, TError>;
|
|
169
|
+
/**
|
|
170
|
+
* Map a matrix of validate string results to boolean. If the string is empty, the result is true, indicating that
|
|
171
|
+
* there is no error.
|
|
172
|
+
*
|
|
173
|
+
* @param matrixValidateResults
|
|
174
|
+
* Matrix of results from a call to a validate function.
|
|
175
|
+
*
|
|
176
|
+
* @returns
|
|
177
|
+
* Matrix of boolean values, true if corresponding string is empty.
|
|
178
|
+
*/
|
|
179
|
+
protected isValidString(matrixValidateResults: MatrixResult<string, ThrowError, TError>): Matrix<boolean>;
|
|
180
|
+
/**
|
|
181
|
+
* Set up a mapping and call a matrix result function with error handling.
|
|
182
|
+
*
|
|
183
|
+
* @param setUpCallback
|
|
184
|
+
* Callback to set up the mapping.
|
|
185
|
+
*
|
|
186
|
+
* @param matrixValues
|
|
187
|
+
* Matrix of values.
|
|
188
|
+
*
|
|
189
|
+
* @param valueCallback
|
|
190
|
+
* Callback to process value.
|
|
191
|
+
*
|
|
192
|
+
* @returns
|
|
193
|
+
* Matrix of callback results and errors if errors are not thrown.
|
|
194
|
+
*/
|
|
195
|
+
protected setUpMatrixResult<TSetup, TValue, TResult>(setUpCallback: () => TSetup, matrixValues: Matrix<TValue>, valueCallback: (setup: TSetup, value: TValue) => SingletonResult<TResult, ThrowError, TError>): MatrixResult<TResult, ThrowError, TError>;
|
|
196
|
+
/**
|
|
197
|
+
* Call an array result function with error handling and map to a matrix.
|
|
198
|
+
*
|
|
199
|
+
* @param matrixValues
|
|
200
|
+
* Matrix of values.
|
|
201
|
+
*
|
|
202
|
+
* @param callback
|
|
203
|
+
* Callback.
|
|
204
|
+
*
|
|
205
|
+
* @returns
|
|
206
|
+
* Matrix of callback results and errors if errors are not thrown.
|
|
207
|
+
*/
|
|
208
|
+
protected arrayResult<TValue, TResult>(matrixValues: Matrix<TValue>, callback: (value: TValue) => Array<SingletonResult<TResult, ThrowError, TError>>): MatrixResult<TResult, ThrowError, TError>;
|
|
209
|
+
/**
|
|
210
|
+
* Call a matrix result function with error handling and map a non-error result to an empty string and {@linkcode
|
|
211
|
+
* RangeError} to the string error message.
|
|
212
|
+
*
|
|
213
|
+
* @param matrixValues
|
|
214
|
+
* Matrix of values.
|
|
215
|
+
*
|
|
216
|
+
* @param callback
|
|
217
|
+
* Callback that either returns or throws an exception.
|
|
218
|
+
*
|
|
219
|
+
* @returns
|
|
220
|
+
* Matrix of strings.
|
|
221
|
+
*/
|
|
222
|
+
protected matrixErrorResult<TValue>(matrixValues: Matrix<TValue>, callback: (value: TValue) => void): Matrix<string>;
|
|
223
|
+
/**
|
|
224
|
+
* Call an iterable result function with error handling and map to a matrix. Although the natural approach would be
|
|
225
|
+
* to map to a single-element array containing an array of *N* results (i.e., [[r0, r1, r2, ..., r*N*]]), this is
|
|
226
|
+
* rendered visually as a single row. The more readable approach is as a single column, so the mapping is to an
|
|
227
|
+
* *N*-element array of single-element result arrays (i.e., [[r0], [r1], [r2], ..., [r*N*]]).
|
|
228
|
+
*
|
|
229
|
+
* @param iterableCallback
|
|
230
|
+
* Iterable callback.
|
|
231
|
+
*
|
|
232
|
+
* @returns
|
|
233
|
+
* Matrix of callback results.
|
|
234
|
+
*/
|
|
235
|
+
protected iterableResult<TResult>(iterableCallback: () => Iterable<SingletonResult<TResult, ThrowError, TError>>): MatrixResult<TResult, ThrowError, TError>;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Application extension.
|
|
240
|
+
*
|
|
241
|
+
* @template ThrowError
|
|
242
|
+
* If true, errors are reported through the throw/catch mechanism.
|
|
243
|
+
*
|
|
244
|
+
* @template TError
|
|
245
|
+
* Error type.
|
|
246
|
+
*
|
|
247
|
+
* @template TInvocationContext
|
|
248
|
+
* Application-specific invocation context type.
|
|
249
|
+
*
|
|
250
|
+
* @template TStreamingInvocationContext
|
|
251
|
+
* Application-specific streaming invocation context type.
|
|
252
|
+
*
|
|
253
|
+
* @template TBigInt
|
|
254
|
+
* Type to which big integer is mapped.
|
|
255
|
+
*/
|
|
256
|
+
declare abstract class AppExtension<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TStreamingInvocationContext, TBigInt> {
|
|
257
|
+
#private;
|
|
258
|
+
/**
|
|
259
|
+
* Application name.
|
|
260
|
+
*/
|
|
261
|
+
static readonly APPLICATION_NAME = "AIDCToolkit";
|
|
262
|
+
/**
|
|
263
|
+
* Version property name.
|
|
264
|
+
*/
|
|
265
|
+
static readonly VERSION_NAME: string;
|
|
266
|
+
/**
|
|
267
|
+
* Constructor.
|
|
268
|
+
*
|
|
269
|
+
* @param version
|
|
270
|
+
* Application version.
|
|
271
|
+
*
|
|
272
|
+
* @param maximumSequenceCount
|
|
273
|
+
* Maximum sequence count supported by application.
|
|
274
|
+
*
|
|
275
|
+
* @param throwError
|
|
276
|
+
* If true, errors are reported through the throw/catch mechanism.
|
|
277
|
+
*/
|
|
278
|
+
protected constructor(version: string, maximumSequenceCount: number, throwError: ThrowError);
|
|
279
|
+
/**
|
|
280
|
+
* Initialize the application extension.
|
|
281
|
+
*/
|
|
282
|
+
initialize(): Promise<void>;
|
|
283
|
+
/**
|
|
284
|
+
* Get the version.
|
|
285
|
+
*
|
|
286
|
+
* @returns
|
|
287
|
+
* Version.
|
|
288
|
+
*/
|
|
289
|
+
get version(): string;
|
|
290
|
+
/**
|
|
291
|
+
* Determine if errors are reported through the throw/catch mechanism.
|
|
292
|
+
*/
|
|
293
|
+
get throwError(): ThrowError;
|
|
294
|
+
/**
|
|
295
|
+
* Get the logger.
|
|
296
|
+
*/
|
|
297
|
+
get logger(): Logger<object>;
|
|
298
|
+
/**
|
|
299
|
+
* Get the logger memory transport.
|
|
300
|
+
*/
|
|
301
|
+
get memoryTransport(): MemoryTransport<object>;
|
|
302
|
+
/**
|
|
303
|
+
* Get the maximum width supported by the application.
|
|
304
|
+
*/
|
|
305
|
+
abstract get maximumWidth(): number;
|
|
306
|
+
/**
|
|
307
|
+
* Get the maximum height supported by the application.
|
|
308
|
+
*/
|
|
309
|
+
abstract get maximumHeight(): number;
|
|
310
|
+
/**
|
|
311
|
+
* Get a proxy instance. The use of a weak map ensures that proxies are loaded only as needed and may be garbage
|
|
312
|
+
* collected if required.
|
|
313
|
+
*
|
|
314
|
+
* @param ProxyConstructor
|
|
315
|
+
* Proxy constructor.
|
|
316
|
+
*
|
|
317
|
+
* @returns
|
|
318
|
+
* Proxy instance.
|
|
319
|
+
*/
|
|
320
|
+
getProxy<T extends LibProxy<ThrowError, TError, TInvocationContext, TStreamingInvocationContext, TBigInt>>(ProxyConstructor: new (appExtension: AppExtension<ThrowError, TError, TInvocationContext, TStreamingInvocationContext, TBigInt>) => T): T;
|
|
321
|
+
/**
|
|
322
|
+
* Get the sheet address from an invocation context.
|
|
323
|
+
*
|
|
324
|
+
* @param invocationContext
|
|
325
|
+
* Invocation context.
|
|
326
|
+
*
|
|
327
|
+
* @returns
|
|
328
|
+
* Sheet address.
|
|
329
|
+
*/
|
|
330
|
+
abstract getSheetAddress(invocationContext: TInvocationContext): Promisable<SheetAddress>;
|
|
331
|
+
/**
|
|
332
|
+
* Get a parameter range from an invocation context.
|
|
333
|
+
*
|
|
334
|
+
* @param invocationContext
|
|
335
|
+
* Invocation context.
|
|
336
|
+
*
|
|
337
|
+
* @param parameterNumber
|
|
338
|
+
* Parameter number.
|
|
339
|
+
*
|
|
340
|
+
* @returns
|
|
341
|
+
* Sheet range or null if parameter is not a range.
|
|
342
|
+
*/
|
|
343
|
+
abstract getParameterSheetRange(invocationContext: TInvocationContext, parameterNumber: number): Promisable<SheetRange | null>;
|
|
344
|
+
/**
|
|
345
|
+
* Set up streaming for a streaming function.
|
|
346
|
+
*
|
|
347
|
+
* @param streamingInvocationContext
|
|
348
|
+
* Streaming invocation context.
|
|
349
|
+
*
|
|
350
|
+
* @param streamingCancelledCallback
|
|
351
|
+
* Streaming cancelled callback, called when streaming is cancelled.
|
|
352
|
+
*
|
|
353
|
+
* @returns
|
|
354
|
+
* Streaming consumer callback, called when stream contents updated.
|
|
355
|
+
*/
|
|
356
|
+
abstract setUpStreaming<TResult>(streamingInvocationContext: TStreamingInvocationContext, streamingCancelledCallback: StreamingCancelledCallback): StreamingConsumerCallback<TResult, ThrowError, TError>;
|
|
357
|
+
/**
|
|
358
|
+
* Get a property stored within the active document.
|
|
359
|
+
*
|
|
360
|
+
* @param name
|
|
361
|
+
* Property name.
|
|
362
|
+
*
|
|
363
|
+
* @returns
|
|
364
|
+
* Property value or undefined if no value is stored under the given name.
|
|
365
|
+
*/
|
|
366
|
+
abstract getDocumentProperty(name: string): Promisable<string | undefined>;
|
|
367
|
+
/**
|
|
368
|
+
* Set a property to be stored within the active document.
|
|
369
|
+
*
|
|
370
|
+
* @param name
|
|
371
|
+
* Property name.
|
|
372
|
+
*
|
|
373
|
+
* @param value
|
|
374
|
+
* Property value.
|
|
375
|
+
*/
|
|
376
|
+
abstract setDocumentProperty(name: string, value: string): Promisable<void>;
|
|
377
|
+
/**
|
|
378
|
+
* Delete a property from the active document.
|
|
379
|
+
*
|
|
380
|
+
* @param name
|
|
381
|
+
* Property name.
|
|
382
|
+
*/
|
|
383
|
+
abstract deleteDocumentProperty(name: string): Promisable<void>;
|
|
384
|
+
/**
|
|
385
|
+
* Get application data storage for the current document.
|
|
386
|
+
*/
|
|
387
|
+
abstract get documentAppDataStorage(): AppDataStorage<boolean>;
|
|
388
|
+
/**
|
|
389
|
+
* Get application data storage shared across multiple documents.
|
|
390
|
+
*/
|
|
391
|
+
abstract get sharedAppDataStorage(): AppDataStorage<boolean>;
|
|
392
|
+
/**
|
|
393
|
+
* Get HTTP fetch function.
|
|
394
|
+
*/
|
|
395
|
+
abstract get httpFetch(): HTTPFetch;
|
|
396
|
+
/**
|
|
397
|
+
* Validate a sequence count against the maximum supported by application.
|
|
398
|
+
*
|
|
399
|
+
* @param sequenceCount
|
|
400
|
+
* Sequence count.
|
|
401
|
+
*/
|
|
402
|
+
validateSequenceCount(sequenceCount: number): void;
|
|
403
|
+
/**
|
|
404
|
+
* Map big integer to another type if necessary.
|
|
405
|
+
*
|
|
406
|
+
* @param value
|
|
407
|
+
* Big integer value to map.
|
|
408
|
+
*
|
|
409
|
+
* @returns
|
|
410
|
+
* Mapped big integer value.
|
|
411
|
+
*/
|
|
412
|
+
abstract mapBigInt(value: bigint): SingletonResult<TBigInt, ThrowError, TError>;
|
|
413
|
+
/**
|
|
414
|
+
* Map hyperlink results to a form suitable for the application.
|
|
415
|
+
*
|
|
416
|
+
* @param invocationContext
|
|
417
|
+
* Invocation context.
|
|
418
|
+
*
|
|
419
|
+
* @param matrixHyperlinkResults
|
|
420
|
+
* Matrix of hyperlink results from function call.
|
|
421
|
+
*
|
|
422
|
+
* @returns
|
|
423
|
+
* Matrix of results in a form suitable for the application.
|
|
424
|
+
*/
|
|
425
|
+
abstract mapHyperlinkResults(invocationContext: TInvocationContext, matrixHyperlinkResults: MatrixResult<Hyperlink, ThrowError, TError>): Promisable<MatrixResult<unknown, ThrowError, TError>>;
|
|
426
|
+
/**
|
|
427
|
+
* Map a range error (thrown by the library) to an application-specific error. If errors are reported through the
|
|
428
|
+
* throw/catch mechanism, the implementation may return the range error unmodified if that is supported.
|
|
429
|
+
*
|
|
430
|
+
* @param rangeError
|
|
431
|
+
*/
|
|
432
|
+
abstract mapRangeError(rangeError: RangeError): TError;
|
|
433
|
+
/**
|
|
434
|
+
* Handle an error with a message; called when an exception occurs outside the control of the AIDC Toolkit library.
|
|
435
|
+
* Implementation must not return, most likely by throwing the message wrapped in an error type.
|
|
436
|
+
*
|
|
437
|
+
* @param message
|
|
438
|
+
* Message to include in the error.
|
|
439
|
+
*/
|
|
440
|
+
abstract handleError(message: string): never;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
declare abstract class StringProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TStreamingInvocationContext, TBigInt> extends LibProxy<ThrowError, TError, TInvocationContext, TStreamingInvocationContext, TBigInt> {
|
|
444
|
+
protected validateString<TStringValidation extends StringValidation>(validator: StringValidator<TStringValidation>, matrixSs: Matrix<string>, validation?: TStringValidation): Matrix<string>;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
declare abstract class CharacterSetValidatorProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TStreamingInvocationContext, TBigInt> extends StringProxy<ThrowError, TError, TInvocationContext, TStreamingInvocationContext, TBigInt> {
|
|
448
|
+
#private;
|
|
449
|
+
constructor(appExtension: AppExtension<ThrowError, TError, TInvocationContext, TStreamingInvocationContext, TBigInt>, characterSetValidator: CharacterSetValidator);
|
|
450
|
+
validate(matrixSs: Matrix<string>, exclusion: Nullishable<Exclusion>): Matrix<string>;
|
|
451
|
+
isValid(matrixSs: Matrix<string>, exclusion: Nullishable<Exclusion>): Matrix<boolean>;
|
|
452
|
+
}
|
|
453
|
+
declare abstract class CharacterSetCreatorProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TStreamingInvocationContext, TBigInt> extends CharacterSetValidatorProxy<ThrowError, TError, TInvocationContext, TStreamingInvocationContext, TBigInt> {
|
|
454
|
+
#private;
|
|
455
|
+
constructor(appExtension: AppExtension<ThrowError, TError, TInvocationContext, TStreamingInvocationContext, TBigInt>, characterSetCreator: CharacterSetCreator);
|
|
456
|
+
create(length: number, matrixValues: Matrix<number | bigint>, exclusion: Nullishable<Exclusion>, tweak: Nullishable<number | bigint>): MatrixResult<string, ThrowError, TError>;
|
|
457
|
+
createSequence(length: number, startValue: number, count: number, exclusion: Nullishable<Exclusion>, tweak: Nullishable<number | bigint>): MatrixResult<string, ThrowError, TError>;
|
|
458
|
+
valueFor(matrixSs: Matrix<string>, exclusion: Nullishable<Exclusion>, tweak: Nullishable<number | bigint>): MatrixResult<TBigInt, ThrowError, TError>;
|
|
459
|
+
}
|
|
460
|
+
declare class NumericProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TStreamingInvocationContext, TBigInt> extends CharacterSetCreatorProxy<ThrowError, TError, TInvocationContext, TStreamingInvocationContext, TBigInt> {
|
|
461
|
+
constructor(appExtension: AppExtension<ThrowError, TError, TInvocationContext, TStreamingInvocationContext, TBigInt>);
|
|
462
|
+
}
|
|
463
|
+
declare class HexadecimalProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TStreamingInvocationContext, TBigInt> extends CharacterSetCreatorProxy<ThrowError, TError, TInvocationContext, TStreamingInvocationContext, TBigInt> {
|
|
464
|
+
constructor(appExtension: AppExtension<ThrowError, TError, TInvocationContext, TStreamingInvocationContext, TBigInt>);
|
|
465
|
+
}
|
|
466
|
+
declare class AlphabeticProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TStreamingInvocationContext, TBigInt> extends CharacterSetCreatorProxy<ThrowError, TError, TInvocationContext, TStreamingInvocationContext, TBigInt> {
|
|
467
|
+
constructor(appExtension: AppExtension<ThrowError, TError, TInvocationContext, TStreamingInvocationContext, TBigInt>);
|
|
468
|
+
}
|
|
469
|
+
declare class AlphanumericProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TStreamingInvocationContext, TBigInt> extends CharacterSetCreatorProxy<ThrowError, TError, TInvocationContext, TStreamingInvocationContext, TBigInt> {
|
|
470
|
+
constructor(appExtension: AppExtension<ThrowError, TError, TInvocationContext, TStreamingInvocationContext, TBigInt>);
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
export { type Address as A, CharacterSetValidatorProxy as C, type ErrorExtends as E, HexadecimalProxy as H, LibProxy as L, type Matrix as M, NumericProxy as N, type Range as R, StringProxy as S, type MatrixResult as a, type Sheet as b, type SheetAddress as c, type SheetRange as d, type SingletonResult as e, type StreamingConsumerCallback as f, type StreamingCancelledCallback as g, AppExtension as h, CharacterSetCreatorProxy as i, AlphabeticProxy as j, AlphanumericProxy as k };
|