@acorex/core 20.2.26 → 20.2.28
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/components/index.d.ts +14 -0
- package/date-time/index.d.ts +70 -0
- package/fesm2022/acorex-core-components.mjs +14 -0
- package/fesm2022/acorex-core-components.mjs.map +1 -1
- package/fesm2022/acorex-core-date-time.mjs.map +1 -1
- package/fesm2022/acorex-core-file.mjs +43 -0
- package/fesm2022/acorex-core-file.mjs.map +1 -1
- package/fesm2022/acorex-core-format.mjs +37 -3
- package/fesm2022/acorex-core-format.mjs.map +1 -1
- package/fesm2022/acorex-core-image.mjs +8 -0
- package/fesm2022/acorex-core-image.mjs.map +1 -1
- package/fesm2022/acorex-core-locale.mjs +33 -0
- package/fesm2022/acorex-core-locale.mjs.map +1 -1
- package/fesm2022/acorex-core-pipes.mjs +6 -0
- package/fesm2022/acorex-core-pipes.mjs.map +1 -1
- package/fesm2022/acorex-core-platform.mjs +21 -0
- package/fesm2022/acorex-core-platform.mjs.map +1 -1
- package/fesm2022/acorex-core-storage.mjs +31 -0
- package/fesm2022/acorex-core-storage.mjs.map +1 -1
- package/fesm2022/acorex-core-validation.mjs +4 -0
- package/fesm2022/acorex-core-validation.mjs.map +1 -1
- package/file/index.d.ts +43 -0
- package/format/index.d.ts +48 -3
- package/image/index.d.ts +8 -0
- package/locale/index.d.ts +66 -0
- package/package.json +1 -1
- package/pipes/index.d.ts +6 -0
- package/platform/index.d.ts +21 -0
- package/storage/index.d.ts +31 -0
- package/validation/index.d.ts +4 -0
package/image/index.d.ts
CHANGED
|
@@ -3,6 +3,14 @@ import * as i0 from '@angular/core';
|
|
|
3
3
|
declare class AXImageService {
|
|
4
4
|
private document;
|
|
5
5
|
private platformID;
|
|
6
|
+
/**
|
|
7
|
+
* Resizes an image (File or HTMLImageElement) to fit within maxSize while preserving aspect ratio.
|
|
8
|
+
* @param options.maxSize Maximum width/height in pixels.
|
|
9
|
+
* @param options.source File or HTMLImageElement as source.
|
|
10
|
+
* @param options.type Output MIME type (default 'image/png').
|
|
11
|
+
* @param options.quality Output quality (0..1) for supported formats.
|
|
12
|
+
* @returns Promise<Blob> of the resized image.
|
|
13
|
+
*/
|
|
6
14
|
resize(options: {
|
|
7
15
|
maxSize: number;
|
|
8
16
|
source: HTMLImageElement | File;
|
package/locale/index.d.ts
CHANGED
|
@@ -15,12 +15,20 @@ declare module '@acorex/core/format' {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
interface AXLocaleProfile {
|
|
18
|
+
/**
|
|
19
|
+
* Returns the locale info.
|
|
20
|
+
* @returns The locale info.
|
|
21
|
+
*/
|
|
18
22
|
localeInfo: {
|
|
19
23
|
code: string;
|
|
20
24
|
language: string;
|
|
21
25
|
region: string;
|
|
22
26
|
timezone: string;
|
|
23
27
|
};
|
|
28
|
+
/**
|
|
29
|
+
* Returns the calendar.
|
|
30
|
+
* @returns The calendar.
|
|
31
|
+
*/
|
|
24
32
|
calendar: {
|
|
25
33
|
system: 'gregorian' | 'solar-hijri' | string;
|
|
26
34
|
week: {
|
|
@@ -31,6 +39,10 @@ interface AXLocaleProfile {
|
|
|
31
39
|
format24Hour: boolean;
|
|
32
40
|
};
|
|
33
41
|
};
|
|
42
|
+
/**
|
|
43
|
+
* Returns the formats.
|
|
44
|
+
* @returns The formats.
|
|
45
|
+
*/
|
|
34
46
|
formats: {
|
|
35
47
|
date: FormatPattern;
|
|
36
48
|
time: FormatPattern;
|
|
@@ -46,6 +58,10 @@ interface AXLocaleProfile {
|
|
|
46
58
|
postalCode: string;
|
|
47
59
|
};
|
|
48
60
|
};
|
|
61
|
+
/**
|
|
62
|
+
* Returns the units.
|
|
63
|
+
* @returns The units.
|
|
64
|
+
*/
|
|
49
65
|
units: {
|
|
50
66
|
temperature: 'celsius' | 'fahrenheit';
|
|
51
67
|
distance: 'kilometers' | 'miles';
|
|
@@ -55,6 +71,10 @@ interface AXLocaleProfile {
|
|
|
55
71
|
area: 'square-meters' | 'square-feet';
|
|
56
72
|
custom?: Record<string, string>;
|
|
57
73
|
};
|
|
74
|
+
/**
|
|
75
|
+
* Returns the i18n meta.
|
|
76
|
+
* @returns The i18n meta.
|
|
77
|
+
*/
|
|
58
78
|
i18nMeta: {
|
|
59
79
|
fallbackLocales?: string[];
|
|
60
80
|
supportedLanguages?: string[];
|
|
@@ -82,9 +102,31 @@ declare class AXLocaleProfileProviderService {
|
|
|
82
102
|
private resolvedCache;
|
|
83
103
|
private isInitialized;
|
|
84
104
|
private init;
|
|
105
|
+
/**
|
|
106
|
+
* Returns all available locale profiles by loading each registered provider.
|
|
107
|
+
*
|
|
108
|
+
* @returns Promise<AXLocaleProfile[]>
|
|
109
|
+
*/
|
|
85
110
|
getList(): Promise<AXLocaleProfile[]>;
|
|
111
|
+
/**
|
|
112
|
+
* Loads or returns from cache the locale profile associated with the given code.
|
|
113
|
+
*
|
|
114
|
+
* @param localeCode - The locale code to resolve.
|
|
115
|
+
* @returns Promise<AXLocaleProfile | undefined>
|
|
116
|
+
*/
|
|
86
117
|
getByLocale(localeCode: string): Promise<AXLocaleProfile | undefined>;
|
|
118
|
+
/**
|
|
119
|
+
* Clears caches and reloads all providers.
|
|
120
|
+
*
|
|
121
|
+
* @returns Promise<void>
|
|
122
|
+
*/
|
|
87
123
|
reload(): Promise<void>;
|
|
124
|
+
/**
|
|
125
|
+
* Indicates whether a loader has been registered for the given locale code.
|
|
126
|
+
*
|
|
127
|
+
* @param localeCode - The locale code to check.
|
|
128
|
+
* @returns boolean - True if a loader exists.
|
|
129
|
+
*/
|
|
88
130
|
has(localeCode: string): boolean;
|
|
89
131
|
static ɵfac: i0.ɵɵFactoryDeclaration<AXLocaleProfileProviderService, never>;
|
|
90
132
|
static ɵprov: i0.ɵɵInjectableDeclaration<AXLocaleProfileProviderService>;
|
|
@@ -108,13 +150,37 @@ declare class AXLocaleService {
|
|
|
108
150
|
activeProfile: i0.Signal<AXLocaleProfile>;
|
|
109
151
|
profileChanged$: rxjs.Observable<AXLocaleProfile>;
|
|
110
152
|
private originalProfile;
|
|
153
|
+
/**
|
|
154
|
+
* Loads and activates a locale profile by its code (e.g., 'en-US', 'fa-IR').
|
|
155
|
+
*
|
|
156
|
+
* @param localeCode - Locale identifier to load.
|
|
157
|
+
* @returns Promise<void> - Resolves when the profile is loaded and activated.
|
|
158
|
+
*/
|
|
111
159
|
setProfile(localeCode: string): Promise<void>;
|
|
112
160
|
/**
|
|
113
161
|
*
|
|
114
162
|
*/
|
|
115
163
|
constructor();
|
|
164
|
+
/**
|
|
165
|
+
* Applies overrides to the active profile using a deep-merge object.
|
|
166
|
+
*
|
|
167
|
+
* @param profile - Partial profile object whose properties override the active profile.
|
|
168
|
+
* @returns void
|
|
169
|
+
*/
|
|
116
170
|
apply(profile: Partial<AXLocaleProfile>): void;
|
|
171
|
+
/**
|
|
172
|
+
* Applies a single value override at the given path (dot notation).
|
|
173
|
+
*
|
|
174
|
+
* @param path - Dot-notated path (e.g., 'formats.date.short').
|
|
175
|
+
* @param value - The value to set at the path.
|
|
176
|
+
* @returns void
|
|
177
|
+
*/
|
|
117
178
|
apply(path: string, value: any): void;
|
|
179
|
+
/**
|
|
180
|
+
* Resets the active profile to its original loaded state (clears overrides).
|
|
181
|
+
*
|
|
182
|
+
* @returns void
|
|
183
|
+
*/
|
|
118
184
|
reset(): void;
|
|
119
185
|
static ɵfac: i0.ɵɵFactoryDeclaration<AXLocaleService, never>;
|
|
120
186
|
static ɵprov: i0.ɵɵInjectableDeclaration<AXLocaleService>;
|
package/package.json
CHANGED
package/pipes/index.d.ts
CHANGED
|
@@ -4,6 +4,12 @@ import { DomSanitizer, SafeHtml, SafeStyle, SafeScript, SafeUrl, SafeResourceUrl
|
|
|
4
4
|
|
|
5
5
|
declare class AXSafePipe implements PipeTransform {
|
|
6
6
|
protected sanitizer: DomSanitizer;
|
|
7
|
+
/**
|
|
8
|
+
* Marks values as safe for Angular binding via DomSanitizer.
|
|
9
|
+
* @param value The value to sanitize.
|
|
10
|
+
* @param type One of 'html' | 'style' | 'script' | 'url' | 'resourceUrl'.
|
|
11
|
+
* @throws Error when type is invalid.
|
|
12
|
+
*/
|
|
7
13
|
transform(value: any, type: string): SafeHtml | SafeStyle | SafeScript | SafeUrl | SafeResourceUrl;
|
|
8
14
|
static ɵfac: i0.ɵɵFactoryDeclaration<AXSafePipe, never>;
|
|
9
15
|
static ɵpipe: i0.ɵɵPipeDeclaration<AXSafePipe, "safe", true>;
|
package/platform/index.d.ts
CHANGED
|
@@ -59,12 +59,33 @@ declare class AXPlatform {
|
|
|
59
59
|
isRtl(): boolean;
|
|
60
60
|
isLandscape(): boolean;
|
|
61
61
|
isPortrate(): boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Checks whether the current environment matches the given platform/browser/technology/screen size keyword.
|
|
64
|
+
*
|
|
65
|
+
* @param name - One of AXPlatforms | AXBrowsers | AXTechnologies | AXScreenSizes.
|
|
66
|
+
*/
|
|
62
67
|
is(name: AXPlatforms | AXBrowsers | AXTechnologies | AXScreenSizes): boolean;
|
|
63
68
|
get screenSize(): AXScreenSizes;
|
|
69
|
+
/**
|
|
70
|
+
* Switches to light mode and persists it.
|
|
71
|
+
* @returns 'light'
|
|
72
|
+
*/
|
|
64
73
|
switchLightMode(): string;
|
|
74
|
+
/**
|
|
75
|
+
* Switches to dark mode and persists it.
|
|
76
|
+
* @returns 'dark'
|
|
77
|
+
*/
|
|
65
78
|
switchDarkMode(): string;
|
|
66
79
|
switchSystemMode(): void;
|
|
80
|
+
/**
|
|
81
|
+
* Reads persisted theme preference and applies it (returns the effective mode).
|
|
82
|
+
* @returns AXThemeMode
|
|
83
|
+
*/
|
|
67
84
|
autoDetectThemeMode(): "light" | "dark" | "system";
|
|
85
|
+
/**
|
|
86
|
+
* Sets theme mode explicitly and persists it.
|
|
87
|
+
* @param mode - Desired theme mode.
|
|
88
|
+
*/
|
|
68
89
|
setThemeMode(mode: AXThemeMode): void;
|
|
69
90
|
private setFullHeightRatio;
|
|
70
91
|
private autoSystemModeDetection;
|
package/storage/index.d.ts
CHANGED
|
@@ -122,11 +122,42 @@ declare class AXCookieStorageService {
|
|
|
122
122
|
declare const AX_LOCALSTORAGE_SECRET_KEY: InjectionToken<string>;
|
|
123
123
|
declare class AXLocalStorageService implements AXStorage {
|
|
124
124
|
private secret_key;
|
|
125
|
+
/**
|
|
126
|
+
* Reads a value from localStorage and parses JSON.
|
|
127
|
+
*
|
|
128
|
+
* @param key - Storage key
|
|
129
|
+
* @returns T | null
|
|
130
|
+
*/
|
|
125
131
|
get<T = unknown>(key: string): T;
|
|
132
|
+
/**
|
|
133
|
+
* Writes a JSON-serialized value to localStorage.
|
|
134
|
+
*
|
|
135
|
+
* @param key - Storage key
|
|
136
|
+
* @param value - Value to persist
|
|
137
|
+
*/
|
|
126
138
|
set<T = unknown>(key: string, value: T): void;
|
|
127
139
|
clear(): void;
|
|
140
|
+
/**
|
|
141
|
+
* Removes a single entry by key from localStorage.
|
|
142
|
+
*
|
|
143
|
+
* @param key - Storage key
|
|
144
|
+
*/
|
|
128
145
|
removeItem(key: string): void;
|
|
146
|
+
/**
|
|
147
|
+
* Encrypts the JSON-serialized value using AES and stores it.
|
|
148
|
+
* Requires providing AX_LOCALSTORAGE_SECRET_KEY.
|
|
149
|
+
*
|
|
150
|
+
* @param key - Storage key
|
|
151
|
+
* @param value - Value to encrypt and store
|
|
152
|
+
*/
|
|
129
153
|
setWithEncryption<T = unknown>(key: string, value: T): void;
|
|
154
|
+
/**
|
|
155
|
+
* Reads the encrypted value, decrypts it using AES and parses JSON.
|
|
156
|
+
* Requires providing AX_LOCALSTORAGE_SECRET_KEY.
|
|
157
|
+
*
|
|
158
|
+
* @param key - Storage key
|
|
159
|
+
* @returns T | null
|
|
160
|
+
*/
|
|
130
161
|
getWithEncription<T = unknown>(key: string): T;
|
|
131
162
|
static ɵfac: i0.ɵɵFactoryDeclaration<AXLocalStorageService, never>;
|
|
132
163
|
static ɵprov: i0.ɵɵInjectableDeclaration<AXLocalStorageService>;
|
package/validation/index.d.ts
CHANGED
|
@@ -230,6 +230,10 @@ declare class AXValidationRegistryService {
|
|
|
230
230
|
declare class AXValidationService {
|
|
231
231
|
private translationService;
|
|
232
232
|
private pluginRegistry;
|
|
233
|
+
/**
|
|
234
|
+
* Validates a value with optional options.
|
|
235
|
+
* @returns Promise<AXValidationRuleResult>
|
|
236
|
+
*/
|
|
233
237
|
validate(ruleName: string, value: unknown, options?: AXValidationRuleOptions): Promise<AXValidationRuleResult>;
|
|
234
238
|
ruleFor(value: unknown): AXValidationRuleChain;
|
|
235
239
|
static ɵfac: i0.ɵɵFactoryDeclaration<AXValidationService, never>;
|