@acorex/core 19.13.0-next.5 → 19.13.0-next.8
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/fesm2022/acorex-core-format.mjs +17 -16
- package/fesm2022/acorex-core-format.mjs.map +1 -1
- package/fesm2022/acorex-core-translation.mjs +236 -201
- package/fesm2022/acorex-core-translation.mjs.map +1 -1
- package/fesm2022/acorex-core-utils.mjs +140 -15
- package/fesm2022/acorex-core-utils.mjs.map +1 -1
- package/format/lib/format.service.d.ts +8 -7
- package/package.json +1 -1
- package/translation/index.d.ts +1 -1
- package/translation/lib/translation-loader.service.d.ts +20 -0
- package/translation/lib/translation.config.d.ts +19 -6
- package/translation/lib/translation.loader.d.ts +2 -2
- package/translation/lib/translation.parser.d.ts +7 -0
- package/translation/lib/translation.resolver.d.ts +9 -0
- package/translation/lib/translation.service.d.ts +13 -32
- package/translation/lib/translation.types.d.ts +8 -2
- package/translation/lib/translator.pipe.d.ts +0 -2
- package/utils/index.d.ts +6 -5
- package/utils/lib/execution.utils.d.ts +33 -0
- package/utils/lib/string.utils.d.ts +4 -0
- package/utils/lib/string-util.d.ts +0 -6
- /package/utils/lib/{color-util.d.ts → color.utils.d.ts} +0 -0
- /package/utils/lib/{drawing-util.d.ts → drawing.utils.d.ts} +0 -0
- /package/utils/lib/{html-util.d.ts → html-utils.d.ts} +0 -0
- /package/utils/lib/{auto-unsubscribe.d.ts → lifecycle-helpers.utils.d.ts} +0 -0
@@ -1,44 +1,25 @@
|
|
1
|
+
import { AXTranslateLang, AXTranslateOptions } from './translation.types';
|
1
2
|
import { Observable } from 'rxjs';
|
2
|
-
import { AXTranslateOptions } from './translation.types';
|
3
3
|
import * as i0 from "@angular/core";
|
4
4
|
export declare function translateSync(key: string, options?: AXTranslateOptions): string;
|
5
5
|
export declare class AXTranslationService {
|
6
|
-
private loader;
|
7
|
-
private config;
|
8
|
-
private eventService;
|
9
6
|
private localeService;
|
10
|
-
private
|
11
|
-
private
|
7
|
+
private config;
|
8
|
+
private loader;
|
9
|
+
private parser;
|
10
|
+
private resolver;
|
12
11
|
private activeLang;
|
13
|
-
langChanges$: Observable<string>;
|
14
|
-
private expressionCache;
|
15
|
-
getDefaultLang(): string;
|
16
|
-
getActiveLang(): string;
|
17
|
-
setActiveLang(lang: string): void;
|
18
|
-
/**
|
19
|
-
* @ignore
|
20
|
-
*/
|
12
|
+
readonly langChanges$: Observable<string>;
|
21
13
|
constructor();
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
* Set translation data into cache
|
26
|
-
*/
|
27
|
-
private setTranslationCache;
|
28
|
-
/**
|
29
|
-
* Get the translation from the cache or fallback to loading
|
30
|
-
*/
|
31
|
-
private getTranslationFromCache;
|
32
|
-
isLangAvailable(lang: string, scope?: string): boolean;
|
33
|
-
private translateKey;
|
34
|
-
private isExpression;
|
35
|
-
private decodeExpression;
|
36
|
-
private handleError;
|
37
|
-
private translateText;
|
14
|
+
setActiveLang(lang: AXTranslateLang): void;
|
15
|
+
getActiveLang(): AXTranslateLang;
|
16
|
+
getDefaultLang(): AXTranslateLang;
|
38
17
|
translate$(text: string, options?: AXTranslateOptions): Observable<string>;
|
39
18
|
translateAsync(text: string, options?: AXTranslateOptions): Promise<string>;
|
40
|
-
translateSync(text: string, options?: AXTranslateOptions
|
41
|
-
|
19
|
+
translateSync(text: string, options?: AXTranslateOptions & {
|
20
|
+
waitForLoad?: boolean;
|
21
|
+
timeoutMs?: number;
|
22
|
+
}): string;
|
42
23
|
static ɵfac: i0.ɵɵFactoryDeclaration<AXTranslationService, never>;
|
43
24
|
static ɵprov: i0.ɵɵInjectableDeclaration<AXTranslationService>;
|
44
25
|
}
|
@@ -1,10 +1,16 @@
|
|
1
|
-
export type AXTranslateParams<T = unknown> = Record<string, T>;
|
2
1
|
export type AXTranslateHashMap<T = unknown> = Record<string, T>;
|
3
|
-
export type AXTranslation = Record<string, string>;
|
4
2
|
export type AXTranslateLang = string;
|
5
3
|
export type AXTranslateScope = string;
|
4
|
+
export type AXTranslateParams<T = unknown> = Record<string, T>;
|
5
|
+
export type AXTranslation = Record<string, string>;
|
6
6
|
export interface AXTranslateOptions {
|
7
7
|
lang?: AXTranslateLang;
|
8
8
|
scope?: AXTranslateScope;
|
9
9
|
params?: AXTranslateParams;
|
10
10
|
}
|
11
|
+
export interface AXParsedToken {
|
12
|
+
key: string;
|
13
|
+
scope?: AXTranslateScope;
|
14
|
+
lang?: AXTranslateLang;
|
15
|
+
fullMatch: string;
|
16
|
+
}
|
@@ -1,11 +1,9 @@
|
|
1
1
|
import { PipeTransform } from '@angular/core';
|
2
2
|
import { Observable } from 'rxjs';
|
3
|
-
import { AXTranslationService } from './translation.service';
|
4
3
|
import { AXTranslateOptions } from './translation.types';
|
5
4
|
import * as i0 from "@angular/core";
|
6
5
|
export declare class AXTranslatorPipe implements PipeTransform {
|
7
6
|
private service;
|
8
|
-
constructor(service: AXTranslationService);
|
9
7
|
transform(key: string, options?: AXTranslateOptions): Observable<string>;
|
10
8
|
static ɵfac: i0.ɵɵFactoryDeclaration<AXTranslatorPipe, never>;
|
11
9
|
static ɵpipe: i0.ɵɵPipeDeclaration<AXTranslatorPipe, "translate", true>;
|
package/utils/index.d.ts
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
-
export * from './lib/
|
2
|
-
export * from './lib/color
|
3
|
-
export * from './lib/drawing
|
4
|
-
export * from './lib/html-
|
5
|
-
export * from './lib/string
|
1
|
+
export * from './lib/lifecycle-helpers.utils';
|
2
|
+
export * from './lib/color.utils';
|
3
|
+
export * from './lib/drawing.utils';
|
4
|
+
export * from './lib/html-utils';
|
5
|
+
export * from './lib/string.utils';
|
6
|
+
export * from './lib/execution.utils';
|
@@ -0,0 +1,33 @@
|
|
1
|
+
/**
|
2
|
+
* Blocks until a condition returns a value or the timeout is reached.
|
3
|
+
* Useful for simulating sync behavior with cached async results.
|
4
|
+
*/
|
5
|
+
export declare function waitFor<T>(peekFn: () => T | null | undefined, loadFn: () => void, timeoutMs?: number): T | null;
|
6
|
+
/**
|
7
|
+
* Delays for a specific amount of time.
|
8
|
+
*/
|
9
|
+
export declare function delay(ms: number): Promise<void>;
|
10
|
+
/**
|
11
|
+
* Retries an async function until it succeeds or a max attempt count is reached.
|
12
|
+
*/
|
13
|
+
export declare function retryUntil<T>(fn: () => Promise<T>, attempts?: number, delayMs?: number): Promise<T>;
|
14
|
+
/**
|
15
|
+
* Continuously polls a condition until it returns true or a timeout is reached.
|
16
|
+
*/
|
17
|
+
export declare function pollUntil(condition: () => boolean, intervalMs?: number, timeoutMs?: number): Promise<boolean>;
|
18
|
+
/**
|
19
|
+
* Throttles an async function to ensure only one instance runs at a time.
|
20
|
+
*/
|
21
|
+
export declare function throttleAsync<T extends (...args: any[]) => Promise<any>>(fn: T): T;
|
22
|
+
/**
|
23
|
+
* Polls a condition with cancel support via AbortSignal.
|
24
|
+
*/
|
25
|
+
export declare function pollUntilAbortable(condition: () => boolean, intervalMs?: number, timeoutMs?: number, signal?: AbortSignal): Promise<boolean>;
|
26
|
+
/**
|
27
|
+
* Debounces an async function to run only after no calls are made within the wait window.
|
28
|
+
*/
|
29
|
+
export declare function debounceAsync<T extends (...args: any[]) => Promise<any>>(fn: T, waitMs: number): T;
|
30
|
+
/**
|
31
|
+
* Runs a list of fallback functions until one resolves without throwing.
|
32
|
+
*/
|
33
|
+
export declare function fallbackChain<T>(tasks: Array<() => Promise<T>>): Promise<T>;
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|