@aidc-toolkit/gs1 0.9.8-beta → 0.9.10-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/LICENSE +0 -27
- package/README.md +14 -0
- package/dist/index.cjs +31 -2203
- package/dist/index.d.cts +2 -503
- package/dist/index.d.ts +2 -503
- package/dist/index.js +18 -2200
- package/package.json +8 -9
- package/src/idkey.ts +4 -1
- package/src/index.ts +16 -0
- package/src/locale/i18n.ts +3 -2
- package/test/idkey.test.ts +12 -12
package/dist/index.d.ts
CHANGED
|
@@ -1,509 +1,8 @@
|
|
|
1
|
-
import { $NormalizeIntoArray, $Dictionary } from './typescript/helpers.js';
|
|
2
|
-
import { DefaultNamespace, FlatNamespace, InitOptions, Namespace, FormatFunction, Resource, TOptions, InterpolationOptions, ResourceLanguage, ResourceKey } from './typescript/options.js';
|
|
3
|
-
import { TFunction, KeyPrefix } from './typescript/t.js';
|
|
4
1
|
import { I18NEnvironment } from '@aidc-toolkit/core';
|
|
2
|
+
import { i18n } from 'i18next';
|
|
5
3
|
import { CharacterSetCreator, StringValidation, StringValidator, CharacterSetValidation, Exclusion, TransformerInput, TransformerOutput } from '@aidc-toolkit/utility';
|
|
6
4
|
import * as ts_mixer_dist_types_types_js from 'ts-mixer/dist/types/types.js';
|
|
7
5
|
|
|
8
|
-
// Internal Helpers
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
interface Interpolator {
|
|
12
|
-
init(options: InterpolationOptions, reset: boolean): undefined;
|
|
13
|
-
reset(): undefined;
|
|
14
|
-
resetRegExp(): undefined;
|
|
15
|
-
interpolate(str: string, data: object, lng: string, options: InterpolationOptions): string;
|
|
16
|
-
nest(str: string, fc: (...args: any[]) => any, options: InterpolationOptions): string;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
declare class ResourceStore {
|
|
20
|
-
constructor(data: Resource, options: InitOptions);
|
|
21
|
-
|
|
22
|
-
public data: Resource;
|
|
23
|
-
|
|
24
|
-
public options: InitOptions;
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Gets fired when resources got added or removed
|
|
28
|
-
*/
|
|
29
|
-
on(event: 'added' | 'removed', callback: (lng: string, ns: string) => void): void;
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Remove event listener
|
|
33
|
-
* removes all callback when callback not specified
|
|
34
|
-
*/
|
|
35
|
-
off(event: 'added' | 'removed', callback?: (lng: string, ns: string) => void): void;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
interface Formatter {
|
|
39
|
-
init(services: Services, i18nextOptions: InitOptions): void;
|
|
40
|
-
add(name: string, fc: (value: any, lng: string | undefined, options: any) => string): void;
|
|
41
|
-
addCached(
|
|
42
|
-
name: string,
|
|
43
|
-
fc: (lng: string | undefined, options: any) => (value: any) => string,
|
|
44
|
-
): void;
|
|
45
|
-
format: FormatFunction;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
interface Services {
|
|
49
|
-
backendConnector: any;
|
|
50
|
-
i18nFormat: any;
|
|
51
|
-
interpolator: Interpolator;
|
|
52
|
-
languageDetector: any;
|
|
53
|
-
languageUtils: any;
|
|
54
|
-
logger: any;
|
|
55
|
-
pluralResolver: any;
|
|
56
|
-
resourceStore: ResourceStore;
|
|
57
|
-
formatter?: Formatter;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
type ModuleType =
|
|
61
|
-
| 'backend'
|
|
62
|
-
| 'logger'
|
|
63
|
-
| 'languageDetector'
|
|
64
|
-
| 'postProcessor'
|
|
65
|
-
| 'i18nFormat'
|
|
66
|
-
| 'formatter'
|
|
67
|
-
| '3rdParty';
|
|
68
|
-
|
|
69
|
-
interface Module {
|
|
70
|
-
type: ModuleType;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
type CallbackError = Error | string | null | undefined;
|
|
74
|
-
type ReadCallback = (
|
|
75
|
-
err: CallbackError,
|
|
76
|
-
data: ResourceKey | boolean | null | undefined,
|
|
77
|
-
) => void;
|
|
78
|
-
type MultiReadCallback = (err: CallbackError, data: Resource | null | undefined) => void;
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Used to load data for i18next.
|
|
82
|
-
* Can be provided as a singleton or as a prototype constructor (preferred for supporting multiple instances of i18next).
|
|
83
|
-
* For singleton set property `type` to `'backend'` For a prototype constructor set static property.
|
|
84
|
-
*/
|
|
85
|
-
interface BackendModule<Options = object> extends Module {
|
|
86
|
-
type: 'backend';
|
|
87
|
-
init(services: Services, backendOptions: Options, i18nextOptions: InitOptions): void;
|
|
88
|
-
read(language: string, namespace: string, callback: ReadCallback): void;
|
|
89
|
-
/** Save the missing translation */
|
|
90
|
-
create?(
|
|
91
|
-
languages: readonly string[],
|
|
92
|
-
namespace: string,
|
|
93
|
-
key: string,
|
|
94
|
-
fallbackValue: string,
|
|
95
|
-
): void;
|
|
96
|
-
/** Load multiple languages and namespaces. For backends supporting multiple resources loading */
|
|
97
|
-
readMulti?(
|
|
98
|
-
languages: readonly string[],
|
|
99
|
-
namespaces: readonly string[],
|
|
100
|
-
callback: MultiReadCallback,
|
|
101
|
-
): void;
|
|
102
|
-
/** Store the translation. For backends acting as cache layer */
|
|
103
|
-
save?(language: string, namespace: string, data: ResourceLanguage): void;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* Used to detect language in user land.
|
|
108
|
-
* Can be provided as a singleton or as a prototype constructor (preferred for supporting multiple instances of i18next).
|
|
109
|
-
* For singleton set property `type` to `'languageDetector'` For a prototype constructor set static property.
|
|
110
|
-
*/
|
|
111
|
-
interface LanguageDetectorModule extends Module {
|
|
112
|
-
type: 'languageDetector';
|
|
113
|
-
init?(services: Services, detectorOptions: object, i18nextOptions: InitOptions): void;
|
|
114
|
-
/** Must return detected language */
|
|
115
|
-
detect(): string | readonly string[] | undefined;
|
|
116
|
-
cacheUserLanguage?(lng: string): void;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* Used to detect language in user land.
|
|
121
|
-
* Can be provided as a singleton or as a prototype constructor (preferred for supporting multiple instances of i18next).
|
|
122
|
-
* For singleton set property `type` to `'languageDetector'` For a prototype constructor set static property.
|
|
123
|
-
*/
|
|
124
|
-
interface LanguageDetectorAsyncModule extends Module {
|
|
125
|
-
type: 'languageDetector';
|
|
126
|
-
/** Set to true to enable async detection */
|
|
127
|
-
async: true;
|
|
128
|
-
init?(services: Services, detectorOptions: object, i18nextOptions: InitOptions): void;
|
|
129
|
-
/** Must call callback passing detected language or return a Promise */
|
|
130
|
-
detect(
|
|
131
|
-
callback: (lng: string | readonly string[] | undefined) => void | undefined,
|
|
132
|
-
): void | Promise<string | readonly string[] | undefined>;
|
|
133
|
-
cacheUserLanguage?(lng: string): void | Promise<void>;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* Override the built-in console logger.
|
|
138
|
-
* Do not need to be a prototype function.
|
|
139
|
-
*/
|
|
140
|
-
interface LoggerModule extends Module {
|
|
141
|
-
type: 'logger';
|
|
142
|
-
log(...args: any[]): void;
|
|
143
|
-
warn(...args: any[]): void;
|
|
144
|
-
error(...args: any[]): void;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
interface I18nFormatModule extends Module {
|
|
148
|
-
type: 'i18nFormat';
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
interface FormatterModule extends Module, Formatter {
|
|
152
|
-
type: 'formatter';
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
interface ThirdPartyModule extends Module {
|
|
156
|
-
type: '3rdParty';
|
|
157
|
-
init(i18next: i18n): void;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
interface Modules {
|
|
161
|
-
backend?: BackendModule;
|
|
162
|
-
logger?: LoggerModule;
|
|
163
|
-
languageDetector?: LanguageDetectorModule | LanguageDetectorAsyncModule;
|
|
164
|
-
i18nFormat?: I18nFormatModule;
|
|
165
|
-
formatter?: FormatterModule;
|
|
166
|
-
external: ThirdPartyModule[];
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
// helper to identify class https://stackoverflow.com/a/45983481/2363935
|
|
170
|
-
interface Newable<T> {
|
|
171
|
-
new (...args: any[]): T;
|
|
172
|
-
}
|
|
173
|
-
interface NewableModule<T extends Module> extends Newable<T> {
|
|
174
|
-
type: T['type'];
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
type Callback = (error: any, t: TFunction) => void;
|
|
178
|
-
|
|
179
|
-
/**
|
|
180
|
-
* Uses similar args as the t function and returns true if a key exists.
|
|
181
|
-
*/
|
|
182
|
-
interface ExistsFunction<
|
|
183
|
-
TKeys extends string = string,
|
|
184
|
-
TInterpolationMap extends object = $Dictionary,
|
|
185
|
-
> {
|
|
186
|
-
(key: TKeys | TKeys[], options?: TOptions<TInterpolationMap>): boolean;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
interface CloneOptions extends InitOptions {
|
|
190
|
-
/**
|
|
191
|
-
* Will create a new instance of the resource store and import the existing translation resources.
|
|
192
|
-
* This way it will not shared the resource store instance.
|
|
193
|
-
* @default false
|
|
194
|
-
*/
|
|
195
|
-
forkResourceStore?: boolean;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
interface CustomInstanceExtensions {}
|
|
199
|
-
|
|
200
|
-
// Used just here to exclude `DefaultNamespace` which can be both string or array from `FlatNamespace`
|
|
201
|
-
// in TFunction declaration below.
|
|
202
|
-
// Due to this only very special usage I'm not moving this inside helpers.
|
|
203
|
-
type InferArrayValuesElseReturnType<T> = T extends (infer A)[] ? A : T;
|
|
204
|
-
|
|
205
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
206
|
-
interface i18n extends CustomInstanceExtensions {
|
|
207
|
-
// Expose parameterized t in the i18next interface hierarchy
|
|
208
|
-
t: TFunction<
|
|
209
|
-
[
|
|
210
|
-
...$NormalizeIntoArray<DefaultNamespace>,
|
|
211
|
-
...Exclude<FlatNamespace, InferArrayValuesElseReturnType<DefaultNamespace>>[],
|
|
212
|
-
]
|
|
213
|
-
>;
|
|
214
|
-
|
|
215
|
-
/**
|
|
216
|
-
* The default of the i18next module is an i18next instance ready to be initialized by calling init.
|
|
217
|
-
* You can create additional instances using the createInstance function.
|
|
218
|
-
*
|
|
219
|
-
* @param options - Initial options.
|
|
220
|
-
* @param callback - will be called after all translations were loaded or with an error when failed (in case of using a backend).
|
|
221
|
-
*/
|
|
222
|
-
init(callback?: Callback): Promise<TFunction>;
|
|
223
|
-
init<T>(options: InitOptions<T>, callback?: Callback): Promise<TFunction>;
|
|
224
|
-
|
|
225
|
-
loadResources(callback?: (err: any) => void): void;
|
|
226
|
-
|
|
227
|
-
/**
|
|
228
|
-
* The use function is there to load additional plugins to i18next.
|
|
229
|
-
* For available module see the plugins page and don't forget to read the documentation of the plugin.
|
|
230
|
-
*
|
|
231
|
-
* @param module Accepts a class or object
|
|
232
|
-
*/
|
|
233
|
-
use<T extends Module>(module: T | NewableModule<T> | Newable<T>): this;
|
|
234
|
-
|
|
235
|
-
/**
|
|
236
|
-
* List of modules used
|
|
237
|
-
*/
|
|
238
|
-
modules: Modules;
|
|
239
|
-
|
|
240
|
-
/**
|
|
241
|
-
* Internal container for all used plugins and implementation details like languageUtils, pluralResolvers, etc.
|
|
242
|
-
*/
|
|
243
|
-
services: Services;
|
|
244
|
-
|
|
245
|
-
/**
|
|
246
|
-
* Internal container for translation resources
|
|
247
|
-
*/
|
|
248
|
-
store: ResourceStore;
|
|
249
|
-
|
|
250
|
-
/**
|
|
251
|
-
* Uses similar args as the t function and returns true if a key exists.
|
|
252
|
-
*/
|
|
253
|
-
exists: ExistsFunction;
|
|
254
|
-
|
|
255
|
-
/**
|
|
256
|
-
* Returns a resource data by language.
|
|
257
|
-
*/
|
|
258
|
-
getDataByLanguage(lng: string): { [key: string]: { [key: string]: string } } | undefined;
|
|
259
|
-
|
|
260
|
-
/**
|
|
261
|
-
* Returns a t function that defaults to given language or namespace.
|
|
262
|
-
* Both params could be arrays of languages or namespaces and will be treated as fallbacks in that case.
|
|
263
|
-
* On the returned function you can like in the t function override the languages or namespaces by passing them in options or by prepending namespace.
|
|
264
|
-
*
|
|
265
|
-
* Accepts optional keyPrefix that will be automatically applied to returned t function.
|
|
266
|
-
*/
|
|
267
|
-
getFixedT<
|
|
268
|
-
Ns extends Namespace | null = DefaultNamespace,
|
|
269
|
-
TKPrefix extends KeyPrefix<ActualNs> = undefined,
|
|
270
|
-
ActualNs extends Namespace = Ns extends null ? DefaultNamespace : Ns,
|
|
271
|
-
>(
|
|
272
|
-
...args:
|
|
273
|
-
| [lng: string | readonly string[], ns?: Ns, keyPrefix?: TKPrefix]
|
|
274
|
-
| [lng: null, ns: Ns, keyPrefix?: TKPrefix]
|
|
275
|
-
): TFunction<ActualNs, TKPrefix>;
|
|
276
|
-
|
|
277
|
-
/**
|
|
278
|
-
* Changes the language. The callback will be called as soon translations were loaded or an error occurs while loading.
|
|
279
|
-
* HINT: For easy testing - setting lng to 'cimode' will set t function to always return the key.
|
|
280
|
-
*/
|
|
281
|
-
changeLanguage(lng?: string, callback?: Callback): Promise<TFunction>;
|
|
282
|
-
|
|
283
|
-
/**
|
|
284
|
-
* Is set to the current detected or set language.
|
|
285
|
-
* If you need the primary used language depending on your configuration (supportedLngs, load) you will prefer using i18next.languages[0].
|
|
286
|
-
*/
|
|
287
|
-
language: string;
|
|
288
|
-
|
|
289
|
-
/**
|
|
290
|
-
* Is set to an array of language-codes that will be used it order to lookup the translation value.
|
|
291
|
-
*/
|
|
292
|
-
languages: readonly string[];
|
|
293
|
-
|
|
294
|
-
/**
|
|
295
|
-
* Is set to the current resolved language.
|
|
296
|
-
* It can be used as primary used language, for example in a language switcher.
|
|
297
|
-
*/
|
|
298
|
-
resolvedLanguage?: string;
|
|
299
|
-
|
|
300
|
-
/**
|
|
301
|
-
* Checks if namespace has loaded yet.
|
|
302
|
-
* i.e. used by react-i18next
|
|
303
|
-
*/
|
|
304
|
-
hasLoadedNamespace(
|
|
305
|
-
ns: string | readonly string[],
|
|
306
|
-
options?: {
|
|
307
|
-
lng?: string | readonly string[];
|
|
308
|
-
fallbackLng?: InitOptions['fallbackLng'];
|
|
309
|
-
/**
|
|
310
|
-
* if `undefined` is returned default checks are performed.
|
|
311
|
-
*/
|
|
312
|
-
precheck?: (
|
|
313
|
-
i18n: i18n,
|
|
314
|
-
/**
|
|
315
|
-
* Check if the language namespace provided are not in loading status:
|
|
316
|
-
* returns `true` if load is completed successfully or with an error.
|
|
317
|
-
*/
|
|
318
|
-
loadNotPending: (
|
|
319
|
-
lng: string | readonly string[],
|
|
320
|
-
ns: string | readonly string[],
|
|
321
|
-
) => boolean,
|
|
322
|
-
) => boolean | undefined;
|
|
323
|
-
},
|
|
324
|
-
): boolean;
|
|
325
|
-
|
|
326
|
-
/**
|
|
327
|
-
* Loads additional namespaces not defined in init options.
|
|
328
|
-
*/
|
|
329
|
-
loadNamespaces(ns: string | readonly string[], callback?: Callback): Promise<void>;
|
|
330
|
-
|
|
331
|
-
/**
|
|
332
|
-
* Loads additional languages not defined in init options (preload).
|
|
333
|
-
*/
|
|
334
|
-
loadLanguages(lngs: string | readonly string[], callback?: Callback): Promise<void>;
|
|
335
|
-
|
|
336
|
-
/**
|
|
337
|
-
* Reloads resources on given state. Optionally you can pass an array of languages and namespaces as params if you don't want to reload all.
|
|
338
|
-
*/
|
|
339
|
-
reloadResources(
|
|
340
|
-
lngs?: string | readonly string[],
|
|
341
|
-
ns?: string | readonly string[],
|
|
342
|
-
callback?: () => void,
|
|
343
|
-
): Promise<void>;
|
|
344
|
-
reloadResources(lngs: null, ns: string | readonly string[], callback?: () => void): Promise<void>;
|
|
345
|
-
|
|
346
|
-
/**
|
|
347
|
-
* Changes the default namespace.
|
|
348
|
-
*/
|
|
349
|
-
setDefaultNamespace(ns: string | readonly string[]): void;
|
|
350
|
-
|
|
351
|
-
/**
|
|
352
|
-
* Returns rtl or ltr depending on languages read direction.
|
|
353
|
-
*/
|
|
354
|
-
dir(lng?: string): 'ltr' | 'rtl';
|
|
355
|
-
|
|
356
|
-
/**
|
|
357
|
-
* Exposes interpolation.format function added on init.
|
|
358
|
-
*/
|
|
359
|
-
format: FormatFunction;
|
|
360
|
-
|
|
361
|
-
/**
|
|
362
|
-
* Will return a new i18next instance.
|
|
363
|
-
* Please read the options page for details on configuration options.
|
|
364
|
-
* Providing a callback will automatically call init.
|
|
365
|
-
* The callback will be called after all translations were loaded or with an error when failed (in case of using a backend).
|
|
366
|
-
*/
|
|
367
|
-
createInstance(options?: InitOptions, callback?: Callback): i18n;
|
|
368
|
-
|
|
369
|
-
/**
|
|
370
|
-
* Creates a clone of the current instance. Shares store, plugins and initial configuration.
|
|
371
|
-
* Can be used to create an instance sharing storage but being independent on set language or namespaces.
|
|
372
|
-
*/
|
|
373
|
-
cloneInstance(options?: CloneOptions, callback?: Callback): i18n;
|
|
374
|
-
|
|
375
|
-
/**
|
|
376
|
-
* Gets fired after initialization.
|
|
377
|
-
*/
|
|
378
|
-
on(event: 'initialized', callback: (options: InitOptions) => void): void;
|
|
379
|
-
|
|
380
|
-
/**
|
|
381
|
-
* Gets fired on loaded resources.
|
|
382
|
-
*/
|
|
383
|
-
on(
|
|
384
|
-
event: 'loaded',
|
|
385
|
-
callback: (loaded: { [language: string]: { [namespace: string]: boolean } }) => void,
|
|
386
|
-
): void;
|
|
387
|
-
|
|
388
|
-
/**
|
|
389
|
-
* Gets fired if loading resources failed.
|
|
390
|
-
*/
|
|
391
|
-
on(event: 'failedLoading', callback: (lng: string, ns: string, msg: string) => void): void;
|
|
392
|
-
|
|
393
|
-
/**
|
|
394
|
-
* Gets fired on accessing a key not existing.
|
|
395
|
-
*/
|
|
396
|
-
on(
|
|
397
|
-
event: 'missingKey',
|
|
398
|
-
callback: (lngs: readonly string[], namespace: string, key: string, res: string) => void,
|
|
399
|
-
): void;
|
|
400
|
-
|
|
401
|
-
/**
|
|
402
|
-
* Gets fired when resources got added or removed.
|
|
403
|
-
*/
|
|
404
|
-
on(event: 'added' | 'removed', callback: (lng: string, ns: string) => void): void;
|
|
405
|
-
|
|
406
|
-
/**
|
|
407
|
-
* Gets fired when changeLanguage got called.
|
|
408
|
-
*/
|
|
409
|
-
on(event: 'languageChanged', callback: (lng: string) => void): void;
|
|
410
|
-
|
|
411
|
-
/**
|
|
412
|
-
* Event listener
|
|
413
|
-
*/
|
|
414
|
-
on(event: string, listener: (...args: any[]) => void): void;
|
|
415
|
-
|
|
416
|
-
/**
|
|
417
|
-
* Remove event listener
|
|
418
|
-
* removes all callback when callback not specified
|
|
419
|
-
*/
|
|
420
|
-
off(event: string, listener?: (...args: any[]) => void): void;
|
|
421
|
-
|
|
422
|
-
/**
|
|
423
|
-
* Gets one value by given key.
|
|
424
|
-
*/
|
|
425
|
-
getResource(
|
|
426
|
-
lng: string,
|
|
427
|
-
ns: string,
|
|
428
|
-
key: string,
|
|
429
|
-
options?: Pick<InitOptions, 'keySeparator' | 'ignoreJSONStructure'>,
|
|
430
|
-
): any;
|
|
431
|
-
|
|
432
|
-
/**
|
|
433
|
-
* Adds one key/value.
|
|
434
|
-
*/
|
|
435
|
-
addResource(
|
|
436
|
-
lng: string,
|
|
437
|
-
ns: string,
|
|
438
|
-
key: string,
|
|
439
|
-
value: string,
|
|
440
|
-
options?: { keySeparator?: string; silent?: boolean },
|
|
441
|
-
): i18n;
|
|
442
|
-
|
|
443
|
-
/**
|
|
444
|
-
* Adds multiple key/values.
|
|
445
|
-
*/
|
|
446
|
-
addResources(lng: string, ns: string, resources: any): i18n;
|
|
447
|
-
|
|
448
|
-
/**
|
|
449
|
-
* Adds a complete bundle.
|
|
450
|
-
* Setting deep param to true will extend existing translations in that file.
|
|
451
|
-
* Setting overwrite to true it will overwrite existing translations in that file.
|
|
452
|
-
*/
|
|
453
|
-
addResourceBundle(
|
|
454
|
-
lng: string,
|
|
455
|
-
ns: string,
|
|
456
|
-
resources: any,
|
|
457
|
-
deep?: boolean,
|
|
458
|
-
overwrite?: boolean,
|
|
459
|
-
): i18n;
|
|
460
|
-
|
|
461
|
-
/**
|
|
462
|
-
* Checks if a resource bundle exists.
|
|
463
|
-
*/
|
|
464
|
-
hasResourceBundle(lng: string, ns: string): boolean;
|
|
465
|
-
|
|
466
|
-
/**
|
|
467
|
-
* Returns a resource bundle.
|
|
468
|
-
*/
|
|
469
|
-
getResourceBundle(lng: string, ns: string): any;
|
|
470
|
-
|
|
471
|
-
/**
|
|
472
|
-
* Removes an existing bundle.
|
|
473
|
-
*/
|
|
474
|
-
removeResourceBundle(lng: string, ns: string): i18n;
|
|
475
|
-
|
|
476
|
-
/**
|
|
477
|
-
* Current options
|
|
478
|
-
*/
|
|
479
|
-
options: InitOptions;
|
|
480
|
-
|
|
481
|
-
/**
|
|
482
|
-
* Is initialized
|
|
483
|
-
*/
|
|
484
|
-
isInitialized: boolean;
|
|
485
|
-
|
|
486
|
-
/**
|
|
487
|
-
* Is initializing
|
|
488
|
-
*/
|
|
489
|
-
isInitializing: boolean;
|
|
490
|
-
|
|
491
|
-
/**
|
|
492
|
-
* Store was initialized
|
|
493
|
-
*/
|
|
494
|
-
initializedStoreOnce: boolean;
|
|
495
|
-
|
|
496
|
-
/**
|
|
497
|
-
* Language was initialized
|
|
498
|
-
*/
|
|
499
|
-
initializedLanguageOnce: boolean;
|
|
500
|
-
|
|
501
|
-
/**
|
|
502
|
-
* Emit event
|
|
503
|
-
*/
|
|
504
|
-
emit(eventName: string, ...args: any[]): void;
|
|
505
|
-
}
|
|
506
|
-
|
|
507
6
|
declare const localeStrings: {
|
|
508
7
|
readonly Check: {
|
|
509
8
|
readonly lengthOfStringForPriceOrWeightMustBeExactly: "Length {{length}} of string for price or weight sum must be exactly {{exactLength}}";
|
|
@@ -1401,7 +900,7 @@ interface NumericIdentificationKeyCreator extends NumericIdentificationKeyValida
|
|
|
1401
900
|
* Create all identification keys for the prefix from `0` to `capacity - 1`.
|
|
1402
901
|
*
|
|
1403
902
|
* The implementation creates the strings only as needed using an internal generator function. Although the result
|
|
1404
|
-
* is equivalent to calling `creator.create(new
|
|
903
|
+
* is equivalent to calling `creator.create(new Sequence(0, creator.capacity))`, this method is significantly
|
|
1405
904
|
* faster.
|
|
1406
905
|
*
|
|
1407
906
|
* @returns
|