@aidc-toolkit/app-extension 1.0.23-beta → 1.0.24-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/index.cjs +3414 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1747 -0
- package/dist/index.d.ts +1747 -26
- package/dist/index.js +3379 -9
- package/dist/index.js.map +1 -1
- package/package.json +7 -10
- package/src/app-extension.ts +3 -10
- package/src/app-utility-proxy.ts +5 -4
- package/src/descriptor.ts +12 -8
- package/src/generator/descriptor.ts +1 -1
- package/src/generator/generator.ts +4 -4
- package/src/generator/index.ts +2 -2
- package/src/generator/locale-resources-generator.ts +14 -10
- package/src/gs1/character-set-proxy.ts +5 -5
- package/src/gs1/check-proxy.ts +3 -3
- package/src/gs1/identifier-proxy.ts +9 -8
- package/src/gs1/index.ts +3 -3
- package/src/index.ts +9 -9
- package/src/lib-proxy.ts +3 -3
- package/src/locale/i18n.ts +3 -5
- package/src/locale/i18next.d.ts +1 -1
- package/{dist/types.d.ts → src/type.ts} +10 -38
- package/src/utility/character-set-descriptor.ts +1 -1
- package/src/utility/character-set-proxy.ts +9 -8
- package/src/utility/index.ts +3 -3
- package/src/utility/reg-exp-proxy.ts +5 -4
- package/src/utility/string-descriptor.ts +1 -1
- package/src/utility/string-proxy.ts +2 -2
- package/src/utility/transformer-descriptor.ts +1 -1
- package/src/utility/transformer-proxy.ts +5 -4
- package/tsup.config.ts +3 -0
- package/dist/app-extension.d.ts +0 -169
- package/dist/app-extension.d.ts.map +0 -1
- package/dist/app-extension.js +0 -148
- package/dist/app-extension.js.map +0 -1
- package/dist/app-utility-proxy.d.ts +0 -66
- package/dist/app-utility-proxy.d.ts.map +0 -1
- package/dist/app-utility-proxy.js +0 -233
- package/dist/app-utility-proxy.js.map +0 -1
- package/dist/descriptor.d.ts +0 -172
- package/dist/descriptor.d.ts.map +0 -1
- package/dist/descriptor.js +0 -174
- package/dist/descriptor.js.map +0 -1
- package/dist/generator/descriptor.d.ts +0 -107
- package/dist/generator/descriptor.d.ts.map +0 -1
- package/dist/generator/descriptor.js +0 -2
- package/dist/generator/descriptor.js.map +0 -1
- package/dist/generator/generator.d.ts +0 -120
- package/dist/generator/generator.d.ts.map +0 -1
- package/dist/generator/generator.js +0 -213
- package/dist/generator/generator.js.map +0 -1
- package/dist/generator/index.d.ts +0 -3
- package/dist/generator/index.d.ts.map +0 -1
- package/dist/generator/index.js +0 -2
- package/dist/generator/index.js.map +0 -1
- package/dist/gs1/character-set-proxy.d.ts +0 -10
- package/dist/gs1/character-set-proxy.d.ts.map +0 -1
- package/dist/gs1/character-set-proxy.js +0 -47
- 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 -120
- package/dist/gs1/check-proxy.js.map +0 -1
- package/dist/gs1/identifier-proxy.d.ts +0 -136
- package/dist/gs1/identifier-proxy.d.ts.map +0 -1
- package/dist/gs1/identifier-proxy.js +0 -782
- package/dist/gs1/identifier-proxy.js.map +0 -1
- package/dist/gs1/index.d.ts +0 -4
- package/dist/gs1/index.d.ts.map +0 -1
- package/dist/gs1/index.js +0 -4
- package/dist/gs1/index.js.map +0 -1
- package/dist/index.d.ts.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 -235
- package/dist/lib-proxy.js.map +0 -1
- package/dist/locale/en/locale-resources.d.ts +0 -617
- package/dist/locale/en/locale-resources.d.ts.map +0 -1
- package/dist/locale/en/locale-resources.js +0 -616
- package/dist/locale/en/locale-resources.js.map +0 -1
- package/dist/locale/fr/locale-resources.d.ts +0 -617
- package/dist/locale/fr/locale-resources.d.ts.map +0 -1
- package/dist/locale/fr/locale-resources.js +0 -616
- 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 -39
- package/dist/locale/i18n.js.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -13
- package/dist/types.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 -26
- package/dist/utility/character-set-proxy.d.ts.map +0 -1
- package/dist/utility/character-set-proxy.js +0 -167
- 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 -7
- package/dist/utility/reg-exp-proxy.d.ts.map +0 -1
- package/dist/utility/reg-exp-proxy.js +0 -61
- 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 -8
- package/dist/utility/string-proxy.d.ts.map +0 -1
- package/dist/utility/string-proxy.js +0 -12
- 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 -8
- package/dist/utility/transformer-proxy.d.ts.map +0 -1
- package/dist/utility/transformer-proxy.js +0 -74
- package/dist/utility/transformer-proxy.js.map +0 -1
- package/src/generator/logger.ts +0 -45
- package/src/types.ts +0 -144
package/src/descriptor.ts
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
1
|
+
import type { TypedFunction } from "@aidc-toolkit/core";
|
|
2
|
+
import type { AppExtension } from "./app-extension";
|
|
3
|
+
import { LibProxy } from "./lib-proxy";
|
|
4
|
+
import type { ErrorExtends } from "./type";
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Core descriptor.
|
|
7
8
|
*/
|
|
8
9
|
interface Descriptor {
|
|
10
|
+
/**
|
|
11
|
+
* Name.
|
|
12
|
+
*/
|
|
9
13
|
readonly name: string;
|
|
10
14
|
}
|
|
11
15
|
|
|
@@ -167,12 +171,12 @@ type ProxyClassType<ThrowError extends boolean, TError extends ErrorExtends<Thro
|
|
|
167
171
|
let pendingParameterDescriptors: ParameterDescriptor[] = [];
|
|
168
172
|
|
|
169
173
|
/**
|
|
170
|
-
* Class method descriptors, keyed on declaration class name and method name.
|
|
174
|
+
* Class method descriptors map, keyed on declaration class name and method name.
|
|
171
175
|
*/
|
|
172
176
|
const classMethodsDescriptorsMap = new Map<string, MethodDescriptor[]>();
|
|
173
177
|
|
|
174
178
|
/**
|
|
175
|
-
* Class descriptors, keyed on declaration class name.
|
|
179
|
+
* Class descriptors map, keyed on declaration class name.
|
|
176
180
|
*/
|
|
177
181
|
const classDescriptorsMap = new Map<string, ClassDescriptor>();
|
|
178
182
|
|
|
@@ -309,11 +313,11 @@ export function ProxyClass<ThrowError extends boolean, TError extends ErrorExten
|
|
|
309
313
|
}
|
|
310
314
|
|
|
311
315
|
/**
|
|
312
|
-
* Get class descriptors.
|
|
316
|
+
* Get class descriptors map.
|
|
313
317
|
*
|
|
314
318
|
* @returns
|
|
315
|
-
* Class descriptors.
|
|
319
|
+
* Class descriptors map.
|
|
316
320
|
*/
|
|
317
|
-
export function
|
|
321
|
+
export function getClassDescriptorsMap(): ReadonlyMap<string, ClassDescriptor> {
|
|
318
322
|
return classDescriptorsMap;
|
|
319
323
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { I18nEnvironments } from "@aidc-toolkit/core";
|
|
2
2
|
import type { ParseKeys } from "i18next";
|
|
3
|
-
import { expandParameterDescriptor,
|
|
4
|
-
import { appExtensionResources, i18nAppExtensionInit, i18nextAppExtension } from "../locale/i18n
|
|
3
|
+
import { expandParameterDescriptor, getClassDescriptorsMap } from "../descriptor";
|
|
4
|
+
import { appExtensionResources, i18nAppExtensionInit, i18nextAppExtension } from "../locale/i18n";
|
|
5
5
|
import type {
|
|
6
6
|
FunctionLocalization,
|
|
7
7
|
Localization,
|
|
8
8
|
ParameterLocalization,
|
|
9
9
|
ProxyFunctionDescriptor,
|
|
10
10
|
ProxyObjectDescriptor
|
|
11
|
-
} from "./descriptor
|
|
11
|
+
} from "./descriptor";
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Abstract generator.
|
|
@@ -187,7 +187,7 @@ export abstract class Generator {
|
|
|
187
187
|
this.initialize();
|
|
188
188
|
|
|
189
189
|
try {
|
|
190
|
-
for (const classDescriptor of
|
|
190
|
+
for (const classDescriptor of getClassDescriptorsMap().values()) {
|
|
191
191
|
const namespace = classDescriptor.namespace;
|
|
192
192
|
const namespacePrefix = namespace === undefined ? "" : `${namespace}.`;
|
|
193
193
|
const className = classDescriptor.name;
|
package/src/generator/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type * from "./descriptor
|
|
2
|
-
export * from "./generator
|
|
1
|
+
export type * from "./descriptor";
|
|
2
|
+
export * from "./generator";
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { getLogger, type LocaleResources } from "@aidc-toolkit/core";
|
|
2
2
|
import * as fs from "node:fs";
|
|
3
3
|
import * as path from "node:path";
|
|
4
|
-
import { expandParameterDescriptor, type ParameterDescriptor } from "../descriptor
|
|
5
|
-
import type { ProxyFunctionDescriptor } from "./descriptor
|
|
6
|
-
import { Generator } from "./generator
|
|
7
|
-
import { logger } from "./logger.js";
|
|
4
|
+
import { expandParameterDescriptor, type ParameterDescriptor } from "../descriptor";
|
|
5
|
+
import type { ProxyFunctionDescriptor } from "./descriptor";
|
|
6
|
+
import { Generator } from "./generator";
|
|
8
7
|
|
|
9
8
|
/**
|
|
10
9
|
* Parameters sequencer entry.
|
|
@@ -50,6 +49,11 @@ class LocaleResourcesGenerator extends Generator {
|
|
|
50
49
|
*/
|
|
51
50
|
private static readonly IMPORT_PATH = "../app-extension/src/locale";
|
|
52
51
|
|
|
52
|
+
/**
|
|
53
|
+
* Logger.
|
|
54
|
+
*/
|
|
55
|
+
private readonly _logger = getLogger();
|
|
56
|
+
|
|
53
57
|
/**
|
|
54
58
|
* Parameters sequencer.
|
|
55
59
|
*/
|
|
@@ -215,7 +219,7 @@ class LocaleResourcesGenerator extends Generator {
|
|
|
215
219
|
* @returns
|
|
216
220
|
* Merged locale resources.
|
|
217
221
|
*/
|
|
218
|
-
private
|
|
222
|
+
private merge(logChanges: boolean, parentKey: string, sourceLocaleResources: LocaleResources, destinationLocaleResources: LocaleResources, addMissing: boolean): LocaleResources {
|
|
219
223
|
// Some entries at the top are not part of the generator output.
|
|
220
224
|
const deleteMissing = parentKey.length !== 0;
|
|
221
225
|
|
|
@@ -227,7 +231,7 @@ class LocaleResourcesGenerator extends Generator {
|
|
|
227
231
|
if (!deleteMissing) {
|
|
228
232
|
newDestinationLocaleResources[key] = destinationValue;
|
|
229
233
|
} else if (logChanges) {
|
|
230
|
-
|
|
234
|
+
this._logger.info(`Deleting ${parentKey}${key}...`);
|
|
231
235
|
}
|
|
232
236
|
}
|
|
233
237
|
}
|
|
@@ -236,7 +240,7 @@ class LocaleResourcesGenerator extends Generator {
|
|
|
236
240
|
if (!(key in destinationLocaleResources)) {
|
|
237
241
|
if (addMissing) {
|
|
238
242
|
if (logChanges) {
|
|
239
|
-
|
|
243
|
+
this._logger.info(`Adding ${parentKey}${key}...`);
|
|
240
244
|
}
|
|
241
245
|
|
|
242
246
|
newDestinationLocaleResources[key] = sourceValue;
|
|
@@ -245,7 +249,7 @@ class LocaleResourcesGenerator extends Generator {
|
|
|
245
249
|
const destinationValue = destinationLocaleResources[key];
|
|
246
250
|
|
|
247
251
|
if (typeof sourceValue === "object" && typeof destinationValue === "object") {
|
|
248
|
-
newDestinationLocaleResources[key] =
|
|
252
|
+
newDestinationLocaleResources[key] = this.merge(logChanges, `${parentKey}${key}.`, sourceValue, destinationValue, addMissing);
|
|
249
253
|
} else if (typeof sourceValue === "string" && typeof destinationValue === "string") {
|
|
250
254
|
newDestinationLocaleResources[key] = destinationValue;
|
|
251
255
|
} else {
|
|
@@ -346,7 +350,7 @@ class LocaleResourcesGenerator extends Generator {
|
|
|
346
350
|
|
|
347
351
|
await import(LocaleResourcesSource).then((module) => {
|
|
348
352
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- Module format is known.
|
|
349
|
-
const LocaleResources =
|
|
353
|
+
const LocaleResources = this.merge(entry.name === "en", "", this._LocaleResources, (module as LocaleResourcesModule).LocaleResources, !entry.name.includes("-"));
|
|
350
354
|
|
|
351
355
|
fs.writeFileSync(LocaleResourcesSource, `${LocaleResourcesGenerator.buildOutput("export default", LocaleResources, 0)};\n`);
|
|
352
356
|
});
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { AI39_CREATOR, AI82_CREATOR } from "@aidc-toolkit/gs1";
|
|
2
|
-
import type { AppExtension } from "../app-extension
|
|
3
|
-
import { expandParameterDescriptor, ProxyClass } from "../descriptor
|
|
4
|
-
import type { ErrorExtends } from "../
|
|
2
|
+
import type { AppExtension } from "../app-extension";
|
|
3
|
+
import { expandParameterDescriptor, ProxyClass } from "../descriptor";
|
|
4
|
+
import type { ErrorExtends } from "../type";
|
|
5
5
|
import {
|
|
6
6
|
exclusionAllNumericParameterDescriptor,
|
|
7
7
|
exclusionNoneParameterDescriptor
|
|
8
|
-
} from "../utility/character-set-descriptor
|
|
9
|
-
import { CharacterSetProxy } from "../utility
|
|
8
|
+
} from "../utility/character-set-descriptor";
|
|
9
|
+
import { CharacterSetProxy } from "../utility";
|
|
10
10
|
|
|
11
11
|
@ProxyClass({
|
|
12
12
|
namespace: "GS1",
|
package/src/gs1/check-proxy.ts
CHANGED
|
@@ -6,9 +6,9 @@ import {
|
|
|
6
6
|
isValidPriceOrWeightCheckDigit,
|
|
7
7
|
priceOrWeightCheckDigit
|
|
8
8
|
} from "@aidc-toolkit/gs1";
|
|
9
|
-
import { type ParameterDescriptor, ProxyClass, ProxyMethod, ProxyParameter, Types } from "../descriptor
|
|
10
|
-
import { LibProxy } from "../lib-proxy
|
|
11
|
-
import type { ErrorExtends, Matrix, MatrixResultError, ResultError } from "../
|
|
9
|
+
import { type ParameterDescriptor, ProxyClass, ProxyMethod, ProxyParameter, Types } from "../descriptor";
|
|
10
|
+
import { LibProxy } from "../lib-proxy";
|
|
11
|
+
import type { ErrorExtends, Matrix, MatrixResultError, ResultError } from "../type";
|
|
12
12
|
|
|
13
13
|
const checkSParameterDescriptor: ParameterDescriptor = {
|
|
14
14
|
name: "checkS",
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isNullish, type Nullishable } from "@aidc-toolkit/core";
|
|
1
2
|
import {
|
|
2
3
|
CPID_VALIDATOR,
|
|
3
4
|
GCN_VALIDATOR,
|
|
@@ -34,7 +35,7 @@ import {
|
|
|
34
35
|
SSCC_VALIDATOR
|
|
35
36
|
} from "@aidc-toolkit/gs1";
|
|
36
37
|
import { Sequence } from "@aidc-toolkit/utility";
|
|
37
|
-
import type { AppExtension } from "../app-extension
|
|
38
|
+
import type { AppExtension } from "../app-extension";
|
|
38
39
|
import {
|
|
39
40
|
expandParameterDescriptor,
|
|
40
41
|
type ParameterDescriptor,
|
|
@@ -42,17 +43,17 @@ import {
|
|
|
42
43
|
ProxyMethod,
|
|
43
44
|
ProxyParameter,
|
|
44
45
|
Types
|
|
45
|
-
} from "../descriptor
|
|
46
|
-
import { LibProxy } from "../lib-proxy
|
|
47
|
-
import { i18nextAppExtension } from "../locale/i18n
|
|
48
|
-
import {
|
|
49
|
-
import { exclusionAllNumericParameterDescriptor } from "../utility/character-set-descriptor
|
|
50
|
-
import { StringProxy } from "../utility/string-proxy
|
|
46
|
+
} from "../descriptor";
|
|
47
|
+
import { LibProxy } from "../lib-proxy";
|
|
48
|
+
import { i18nextAppExtension } from "../locale/i18n";
|
|
49
|
+
import type { ErrorExtends, Matrix, MatrixResultError } from "../type";
|
|
50
|
+
import { exclusionAllNumericParameterDescriptor } from "../utility/character-set-descriptor";
|
|
51
|
+
import { StringProxy } from "../utility/string-proxy";
|
|
51
52
|
import {
|
|
52
53
|
countParameterDescriptor,
|
|
53
54
|
startValueParameterDescriptor,
|
|
54
55
|
valueParameterDescriptor
|
|
55
|
-
} from "../utility/transformer-descriptor
|
|
56
|
+
} from "../utility/transformer-descriptor";
|
|
56
57
|
|
|
57
58
|
const identifierParameterDescriptor: ParameterDescriptor = {
|
|
58
59
|
name: "identifier",
|
package/src/gs1/index.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from "./character-set-proxy
|
|
2
|
-
export * from "./check-proxy
|
|
3
|
-
export * from "./identifier-proxy
|
|
1
|
+
export * from "./character-set-proxy";
|
|
2
|
+
export * from "./check-proxy";
|
|
3
|
+
export * from "./identifier-proxy";
|
package/src/index.ts
CHANGED
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
export * from "./locale/i18n
|
|
18
|
-
export * from "./
|
|
19
|
-
export * from "./app-extension
|
|
20
|
-
export * from "./lib-proxy
|
|
21
|
-
export * from "./descriptor
|
|
22
|
-
export * from "./app-utility-proxy
|
|
23
|
-
export * from "./utility/index
|
|
24
|
-
export * as GS1 from "./gs1/index
|
|
25
|
-
export * from "./generator/index
|
|
17
|
+
export * from "./locale/i18n";
|
|
18
|
+
export type * from "./type";
|
|
19
|
+
export * from "./app-extension";
|
|
20
|
+
export * from "./lib-proxy";
|
|
21
|
+
export * from "./descriptor";
|
|
22
|
+
export * from "./app-utility-proxy";
|
|
23
|
+
export * from "./utility/index";
|
|
24
|
+
export * as GS1 from "./gs1/index";
|
|
25
|
+
export * from "./generator/index";
|
package/src/lib-proxy.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { mapIterable } from "@aidc-toolkit/utility";
|
|
2
|
-
import type { AppExtension } from "./app-extension
|
|
3
|
-
import { i18nextAppExtension } from "./locale/i18n
|
|
4
|
-
import type { ErrorExtends, Matrix, MatrixResultError, ResultError } from "./
|
|
2
|
+
import type { AppExtension } from "./app-extension";
|
|
3
|
+
import { i18nextAppExtension } from "./locale/i18n";
|
|
4
|
+
import type { ErrorExtends, Matrix, MatrixResultError, ResultError } from "./type";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Library proxy.
|
package/src/locale/i18n.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i18nCoreInit, type I18nEnvironment } from "@aidc-toolkit/core";
|
|
2
2
|
import { gs1Resources, i18nGS1Init } from "@aidc-toolkit/gs1";
|
|
3
3
|
import { i18nUtilityInit, utilityResources } from "@aidc-toolkit/utility";
|
|
4
4
|
import i18next, { type i18n, type Resource } from "i18next";
|
|
5
|
-
import enLocaleResources from "./en/locale-resources
|
|
6
|
-
import frLocaleResources from "./fr/locale-resources
|
|
5
|
+
import enLocaleResources from "./en/locale-resources";
|
|
6
|
+
import frLocaleResources from "./fr/locale-resources";
|
|
7
7
|
|
|
8
8
|
export const appExtensionNS = "aidct_app_extension";
|
|
9
9
|
|
|
@@ -12,8 +12,6 @@ export const appExtensionNS = "aidct_app_extension";
|
|
|
12
12
|
*/
|
|
13
13
|
export type AppExtensionLocaleResources = typeof enLocaleResources;
|
|
14
14
|
|
|
15
|
-
i18nAssertValidResources(enLocaleResources, "fr", frLocaleResources);
|
|
16
|
-
|
|
17
15
|
/**
|
|
18
16
|
* App extension resources.
|
|
19
17
|
*/
|
package/src/locale/i18next.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { GS1LocaleResources } from "@aidc-toolkit/gs1";
|
|
2
2
|
import type { UtilityLocaleResources } from "@aidc-toolkit/utility";
|
|
3
|
-
import type { AppExtensionLocaleResources } from "./i18n
|
|
3
|
+
import type { AppExtensionLocaleResources } from "./i18n";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Internationalization module.
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* If true, errors are reported through the throw/catch mechanism.
|
|
7
7
|
*/
|
|
8
8
|
export type ErrorExtends<ThrowError extends boolean> = ThrowError extends true ? Error : object;
|
|
9
|
+
|
|
9
10
|
/**
|
|
10
11
|
* Sheet.
|
|
11
12
|
*/
|
|
@@ -15,6 +16,7 @@ export interface Sheet {
|
|
|
15
16
|
*/
|
|
16
17
|
readonly name: string;
|
|
17
18
|
}
|
|
19
|
+
|
|
18
20
|
/**
|
|
19
21
|
* Single cell address.
|
|
20
22
|
*/
|
|
@@ -23,16 +25,19 @@ export interface Address {
|
|
|
23
25
|
* Zero-indexed row.
|
|
24
26
|
*/
|
|
25
27
|
readonly rowIndex: number;
|
|
28
|
+
|
|
26
29
|
/**
|
|
27
30
|
* Zero-indexed column.
|
|
28
31
|
*/
|
|
29
32
|
readonly columnIndex: number;
|
|
30
33
|
}
|
|
34
|
+
|
|
31
35
|
/**
|
|
32
36
|
* Sheet address.
|
|
33
37
|
*/
|
|
34
38
|
export interface SheetAddress extends Sheet, Address {
|
|
35
39
|
}
|
|
40
|
+
|
|
36
41
|
/**
|
|
37
42
|
* Range of cells.
|
|
38
43
|
*/
|
|
@@ -41,16 +46,19 @@ export interface Range {
|
|
|
41
46
|
* Start address, inclusive.
|
|
42
47
|
*/
|
|
43
48
|
readonly startAddress: Address;
|
|
49
|
+
|
|
44
50
|
/**
|
|
45
51
|
* End address, exclusive.
|
|
46
52
|
*/
|
|
47
53
|
readonly endAddress: Address;
|
|
48
54
|
}
|
|
55
|
+
|
|
49
56
|
/**
|
|
50
57
|
* Sheet range.
|
|
51
58
|
*/
|
|
52
59
|
export interface SheetRange extends Sheet, Range {
|
|
53
60
|
}
|
|
61
|
+
|
|
54
62
|
/**
|
|
55
63
|
* Matrix type; shorthand for defining a two-dimensional matrix (array of array) of a type.
|
|
56
64
|
*
|
|
@@ -58,6 +66,7 @@ export interface SheetRange extends Sheet, Range {
|
|
|
58
66
|
* Type.
|
|
59
67
|
*/
|
|
60
68
|
export type Matrix<T> = T[][];
|
|
69
|
+
|
|
61
70
|
/**
|
|
62
71
|
* Function result, possibly including an error result. If the application framework reports errors through the return
|
|
63
72
|
* value, the result is the union of the result type and the error type; otherwise, it's just the result type.
|
|
@@ -72,6 +81,7 @@ export type Matrix<T> = T[][];
|
|
|
72
81
|
* Error type.
|
|
73
82
|
*/
|
|
74
83
|
export type ResultError<TResult, ThrowError extends boolean, TError extends ErrorExtends<ThrowError>> = ThrowError extends false ? TResult | TError : TResult;
|
|
84
|
+
|
|
75
85
|
/**
|
|
76
86
|
* Function result as matrix, possibly including an error result in each element. If the application framework reports
|
|
77
87
|
* errors through the return value, the individual element result is the union of the result type and the error type;
|
|
@@ -87,41 +97,3 @@ export type ResultError<TResult, ThrowError extends boolean, TError extends Erro
|
|
|
87
97
|
* Error type.
|
|
88
98
|
*/
|
|
89
99
|
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
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Nullishable } from "@aidc-toolkit/core";
|
|
1
2
|
import {
|
|
2
3
|
ALPHABETIC_CREATOR,
|
|
3
4
|
ALPHANUMERIC_CREATOR,
|
|
@@ -8,7 +9,7 @@ import {
|
|
|
8
9
|
NUMERIC_CREATOR,
|
|
9
10
|
Sequence
|
|
10
11
|
} from "@aidc-toolkit/utility";
|
|
11
|
-
import type { AppExtension } from "../app-extension
|
|
12
|
+
import type { AppExtension } from "../app-extension";
|
|
12
13
|
import {
|
|
13
14
|
expandParameterDescriptor,
|
|
14
15
|
type ParameterDescriptor,
|
|
@@ -16,22 +17,22 @@ import {
|
|
|
16
17
|
ProxyMethod,
|
|
17
18
|
ProxyParameter,
|
|
18
19
|
Types
|
|
19
|
-
} from "../descriptor
|
|
20
|
-
import { LibProxy } from "../lib-proxy
|
|
21
|
-
import type { ErrorExtends, Matrix, MatrixResultError,
|
|
20
|
+
} from "../descriptor";
|
|
21
|
+
import { LibProxy } from "../lib-proxy";
|
|
22
|
+
import type { ErrorExtends, Matrix, MatrixResultError, ResultError } from "../type";
|
|
22
23
|
import {
|
|
23
24
|
exclusionAnyParameterDescriptor,
|
|
24
25
|
exclusionFirstZeroParameterDescriptor,
|
|
25
26
|
exclusionNoneParameterDescriptor
|
|
26
|
-
} from "./character-set-descriptor
|
|
27
|
-
import { sParameterDescriptor, validateSParameterDescriptor } from "./string-descriptor
|
|
28
|
-
import { StringProxy } from "./string-proxy
|
|
27
|
+
} from "./character-set-descriptor";
|
|
28
|
+
import { sParameterDescriptor, validateSParameterDescriptor } from "./string-descriptor";
|
|
29
|
+
import { StringProxy } from "./string-proxy";
|
|
29
30
|
import {
|
|
30
31
|
countParameterDescriptor,
|
|
31
32
|
startValueParameterDescriptor,
|
|
32
33
|
tweakParameterDescriptor,
|
|
33
34
|
valueParameterDescriptor
|
|
34
|
-
} from "./transformer-descriptor
|
|
35
|
+
} from "./transformer-descriptor";
|
|
35
36
|
|
|
36
37
|
const lengthParameterDescriptor: ParameterDescriptor = {
|
|
37
38
|
name: "length",
|
package/src/utility/index.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from "./transformer-proxy
|
|
2
|
-
export * from "./reg-exp-proxy
|
|
3
|
-
export * from "./character-set-proxy
|
|
1
|
+
export * from "./transformer-proxy";
|
|
2
|
+
export * from "./reg-exp-proxy";
|
|
3
|
+
export * from "./character-set-proxy";
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import type { Nullishable } from "@aidc-toolkit/core";
|
|
1
2
|
import { RegExpValidator } from "@aidc-toolkit/utility";
|
|
2
|
-
import { type ParameterDescriptor, ProxyClass, ProxyMethod, ProxyParameter, Types } from "../descriptor
|
|
3
|
-
import type { ErrorExtends, Matrix, MatrixResultError
|
|
4
|
-
import { validateSParameterDescriptor } from "./string-descriptor
|
|
5
|
-
import { StringProxy } from "./string-proxy
|
|
3
|
+
import { type ParameterDescriptor, ProxyClass, ProxyMethod, ProxyParameter, Types } from "../descriptor";
|
|
4
|
+
import type { ErrorExtends, Matrix, MatrixResultError } from "../type";
|
|
5
|
+
import { validateSParameterDescriptor } from "./string-descriptor";
|
|
6
|
+
import { StringProxy } from "./string-proxy";
|
|
6
7
|
|
|
7
8
|
const regExpParameterDescriptor: ParameterDescriptor = {
|
|
8
9
|
name: "regExp",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { StringValidation, StringValidator } from "@aidc-toolkit/utility";
|
|
2
|
-
import { LibProxy } from "../lib-proxy
|
|
3
|
-
import type { ErrorExtends, Matrix, MatrixResultError } from "../
|
|
2
|
+
import { LibProxy } from "../lib-proxy";
|
|
3
|
+
import type { ErrorExtends, Matrix, MatrixResultError } from "../type";
|
|
4
4
|
|
|
5
5
|
export abstract class StringProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends LibProxy<ThrowError, TError, TInvocationContext, TBigInt> {
|
|
6
6
|
protected validateString<TStringValidation extends StringValidation>(validator: StringValidator<TStringValidation>, matrixSs: Matrix<string>, validation?: TStringValidation): Matrix<string> {
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
import type { Nullishable } from "@aidc-toolkit/core";
|
|
1
2
|
import { mapIterable, Sequence, Transformer } from "@aidc-toolkit/utility";
|
|
2
|
-
import { type ParameterDescriptor, ProxyClass, ProxyMethod, ProxyParameter, Types } from "../descriptor
|
|
3
|
-
import { LibProxy } from "../lib-proxy
|
|
4
|
-
import type { ErrorExtends, Matrix, MatrixResultError,
|
|
3
|
+
import { type ParameterDescriptor, ProxyClass, ProxyMethod, ProxyParameter, Types } from "../descriptor";
|
|
4
|
+
import { LibProxy } from "../lib-proxy";
|
|
5
|
+
import type { ErrorExtends, Matrix, MatrixResultError, ResultError } from "../type";
|
|
5
6
|
import {
|
|
6
7
|
countParameterDescriptor,
|
|
7
8
|
startValueParameterDescriptor,
|
|
8
9
|
tweakParameterDescriptor,
|
|
9
10
|
valueParameterDescriptor
|
|
10
|
-
} from "./transformer-descriptor
|
|
11
|
+
} from "./transformer-descriptor";
|
|
11
12
|
|
|
12
13
|
const domainParameterDescriptor: ParameterDescriptor = {
|
|
13
14
|
name: "domain",
|
package/tsup.config.ts
ADDED