@acorex/core 21.0.0-next.6 → 21.0.0-next.61
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 +71 -0
- package/fesm2022/acorex-core-components.mjs +17 -3
- package/fesm2022/acorex-core-components.mjs.map +1 -1
- package/fesm2022/acorex-core-config.mjs +3 -3
- package/fesm2022/acorex-core-config.mjs.map +1 -1
- package/fesm2022/acorex-core-constants.mjs.map +1 -1
- package/fesm2022/acorex-core-date-time.mjs +89 -67
- package/fesm2022/acorex-core-date-time.mjs.map +1 -1
- package/fesm2022/acorex-core-events.mjs +3 -3
- package/fesm2022/acorex-core-events.mjs.map +1 -1
- package/fesm2022/acorex-core-file.mjs +53 -10
- package/fesm2022/acorex-core-file.mjs.map +1 -1
- package/fesm2022/acorex-core-format.mjs +82 -32
- package/fesm2022/acorex-core-format.mjs.map +1 -1
- package/fesm2022/acorex-core-icon.mjs +3 -3
- package/fesm2022/acorex-core-icon.mjs.map +1 -1
- package/fesm2022/acorex-core-image.mjs +11 -3
- package/fesm2022/acorex-core-image.mjs.map +1 -1
- package/fesm2022/acorex-core-locale.mjs +43 -10
- package/fesm2022/acorex-core-locale.mjs.map +1 -1
- package/fesm2022/acorex-core-memoize.mjs.map +1 -1
- package/fesm2022/acorex-core-network.mjs +3 -3
- package/fesm2022/acorex-core-network.mjs.map +1 -1
- package/fesm2022/acorex-core-pipes.mjs +9 -3
- package/fesm2022/acorex-core-pipes.mjs.map +1 -1
- package/fesm2022/acorex-core-platform.mjs +31 -10
- package/fesm2022/acorex-core-platform.mjs.map +1 -1
- package/fesm2022/acorex-core-storage.mjs +43 -12
- package/fesm2022/acorex-core-storage.mjs.map +1 -1
- package/fesm2022/acorex-core-translation.mjs +16 -16
- package/fesm2022/acorex-core-translation.mjs.map +1 -1
- package/fesm2022/acorex-core-utils.mjs +4 -4
- package/fesm2022/acorex-core-utils.mjs.map +1 -1
- package/fesm2022/acorex-core-validation.mjs +44 -40
- package/fesm2022/acorex-core-validation.mjs.map +1 -1
- package/fesm2022/acorex-core.mjs.map +1 -1
- package/file/index.d.ts +43 -0
- package/format/index.d.ts +56 -5
- package/image/index.d.ts +8 -0
- package/locale/index.d.ts +66 -0
- package/package.json +5 -5
- 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 +14 -10
package/format/index.d.ts
CHANGED
|
@@ -10,7 +10,16 @@ interface AXFormatOptionsMap {
|
|
|
10
10
|
|
|
11
11
|
declare abstract class AXFormatter {
|
|
12
12
|
abstract get name(): string;
|
|
13
|
+
/**
|
|
14
|
+
* Formats a value with optional options.
|
|
15
|
+
* @returns The formatted value.
|
|
16
|
+
*/
|
|
13
17
|
abstract format(value: unknown, options?: AXFormatOptions | string): string;
|
|
18
|
+
/**
|
|
19
|
+
* Optional update interval in milliseconds for formatters that need periodic updates.
|
|
20
|
+
* If specified, the format pipe will automatically refresh the formatted value at this interval.
|
|
21
|
+
*/
|
|
22
|
+
updateInterval?: number;
|
|
14
23
|
}
|
|
15
24
|
|
|
16
25
|
declare class AXFormatterDirective implements OnInit {
|
|
@@ -25,7 +34,16 @@ declare class AXFormatterDirective implements OnInit {
|
|
|
25
34
|
declare class AXFormatPipe implements PipeTransform {
|
|
26
35
|
private formatService;
|
|
27
36
|
private eventService;
|
|
37
|
+
private formatterRegistry;
|
|
28
38
|
private triggers;
|
|
39
|
+
/**
|
|
40
|
+
* Angular pipe for formatting values reactively. Re-evaluates when system events (such as language change) occur.
|
|
41
|
+
*
|
|
42
|
+
* @param value - The input value to format.
|
|
43
|
+
* @param name - The formatter name.
|
|
44
|
+
* @param options - Optional options specific to the formatter.
|
|
45
|
+
* @returns Observable<string> - Emits the formatted string and updates on system events.
|
|
46
|
+
*/
|
|
29
47
|
transform(value: unknown, name: string, options?: AXFormatOptions | string): Observable<string>;
|
|
30
48
|
static ɵfac: i0.ɵɵFactoryDeclaration<AXFormatPipe, never>;
|
|
31
49
|
static ɵpipe: i0.ɵɵPipeDeclaration<AXFormatPipe, "format", true>;
|
|
@@ -35,7 +53,19 @@ interface AXFormatModuleConfigs {
|
|
|
35
53
|
formatters: (new () => AXFormatter)[];
|
|
36
54
|
}
|
|
37
55
|
declare class AXFormatModule {
|
|
56
|
+
/**
|
|
57
|
+
* Configures the module for the root injector, optionally registering custom formatters.
|
|
58
|
+
*
|
|
59
|
+
* @param configs - Optional configuration containing custom formatter classes.
|
|
60
|
+
* @returns ModuleWithProviders<AXFormatModule>
|
|
61
|
+
*/
|
|
38
62
|
static forRoot(configs?: AXFormatModuleConfigs): ModuleWithProviders<AXFormatModule>;
|
|
63
|
+
/**
|
|
64
|
+
* Configures the module for a feature injector, optionally registering custom formatters.
|
|
65
|
+
*
|
|
66
|
+
* @param configs - Optional configuration containing custom formatter classes.
|
|
67
|
+
* @returns ModuleWithProviders<AXFormatModule>
|
|
68
|
+
*/
|
|
39
69
|
static forChild(configs?: AXFormatModuleConfigs): ModuleWithProviders<AXFormatModule>;
|
|
40
70
|
/**
|
|
41
71
|
* @ignore
|
|
@@ -52,9 +82,11 @@ declare class AXFormatterRegistryService {
|
|
|
52
82
|
register(...plugins: (new () => AXFormatter)[]): void;
|
|
53
83
|
get formatters(): AXFormatter[];
|
|
54
84
|
/**
|
|
55
|
-
* Resolves a formatter by its name.
|
|
56
|
-
*
|
|
57
|
-
* @
|
|
85
|
+
* Resolves a formatter instance by its name.
|
|
86
|
+
*
|
|
87
|
+
* @param name - The formatter name.
|
|
88
|
+
* @returns AXFormatter - The resolved formatter instance.
|
|
89
|
+
* @throws Error when no formatter with the given name exists.
|
|
58
90
|
*/
|
|
59
91
|
get(name: string): AXFormatter;
|
|
60
92
|
static ɵfac: i0.ɵɵFactoryDeclaration<AXFormatterRegistryService, never>;
|
|
@@ -64,8 +96,27 @@ declare class AXFormatService {
|
|
|
64
96
|
private pluginRegistry;
|
|
65
97
|
private renderSubject;
|
|
66
98
|
onRender: rxjs.Observable<void>;
|
|
99
|
+
/**
|
|
100
|
+
* Triggers a render event for listeners that care about formatting updates.
|
|
101
|
+
*
|
|
102
|
+
* @returns void - Emits on the onRender observable.
|
|
103
|
+
*/
|
|
67
104
|
render(): void;
|
|
105
|
+
/**
|
|
106
|
+
* Formats a value using the specified formatter name.
|
|
107
|
+
*
|
|
108
|
+
* @param value - The input value to format.
|
|
109
|
+
* @param formatter - The formatter name to use (e.g., 'number', 'string').
|
|
110
|
+
* @param options - Optional options specific to the formatter.
|
|
111
|
+
* @returns string - The formatted string.
|
|
112
|
+
*/
|
|
68
113
|
format(value: unknown, formatter: string, options?: any): string;
|
|
114
|
+
/**
|
|
115
|
+
* Starts a fluent formatting chain.
|
|
116
|
+
*
|
|
117
|
+
* @param value - The input value to format.
|
|
118
|
+
* @returns AXFormatFluent - A fluent API object for chaining.
|
|
119
|
+
*/
|
|
69
120
|
format(value: unknown): AXFormatFluent;
|
|
70
121
|
static ɵfac: i0.ɵɵFactoryDeclaration<AXFormatService, never>;
|
|
71
122
|
static ɵprov: i0.ɵɵInjectableDeclaration<AXFormatService>;
|
|
@@ -91,7 +142,7 @@ interface AXNumberFormatterOptions extends AXFormatOptions {
|
|
|
91
142
|
zeroPadLength?: number;
|
|
92
143
|
locale?: string;
|
|
93
144
|
}
|
|
94
|
-
declare module
|
|
145
|
+
declare module "./index" {
|
|
95
146
|
interface AXFormatOptionsMap {
|
|
96
147
|
number: AXNumberFormatterOptions;
|
|
97
148
|
}
|
|
@@ -108,7 +159,7 @@ declare class AXNumberFormatter implements AXFormatter {
|
|
|
108
159
|
interface AXStringFormatterOptions extends AXFormatOptions {
|
|
109
160
|
[key: string]: any;
|
|
110
161
|
}
|
|
111
|
-
declare module
|
|
162
|
+
declare module "./index" {
|
|
112
163
|
interface AXFormatOptionsMap {
|
|
113
164
|
string: AXStringFormatterOptions;
|
|
114
165
|
}
|
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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acorex/core",
|
|
3
|
-
"version": "21.0.0-next.
|
|
3
|
+
"version": "21.0.0-next.61",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": "^20.0.0",
|
|
6
6
|
"@angular/core": "^20.0.0",
|
|
@@ -88,13 +88,13 @@
|
|
|
88
88
|
"types": "./translation/index.d.ts",
|
|
89
89
|
"default": "./fesm2022/acorex-core-translation.mjs"
|
|
90
90
|
},
|
|
91
|
-
"./utils": {
|
|
92
|
-
"types": "./utils/index.d.ts",
|
|
93
|
-
"default": "./fesm2022/acorex-core-utils.mjs"
|
|
94
|
-
},
|
|
95
91
|
"./validation": {
|
|
96
92
|
"types": "./validation/index.d.ts",
|
|
97
93
|
"default": "./fesm2022/acorex-core-validation.mjs"
|
|
94
|
+
},
|
|
95
|
+
"./utils": {
|
|
96
|
+
"types": "./utils/index.d.ts",
|
|
97
|
+
"default": "./fesm2022/acorex-core-utils.mjs"
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
}
|
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
|
@@ -34,7 +34,7 @@ type AXCallbackValidation<T> = (value: T, options?: AXCallbackValidationRuleOpti
|
|
|
34
34
|
interface AXCallbackValidationRuleOptions<T> extends AXValidationRuleOptions {
|
|
35
35
|
validate: AXCallbackValidation<T>;
|
|
36
36
|
}
|
|
37
|
-
declare module
|
|
37
|
+
declare module "./index" {
|
|
38
38
|
interface AXValidationRuleOptionsMap {
|
|
39
39
|
callback: AXCallbackValidationRuleOptions<unknown>;
|
|
40
40
|
}
|
|
@@ -49,7 +49,7 @@ declare class AXCallbackValidationRule<T> implements AXValidationRule {
|
|
|
49
49
|
interface AXRegexValidationRuleOptions extends AXValidationRuleOptions {
|
|
50
50
|
pattern: string | RegExp;
|
|
51
51
|
}
|
|
52
|
-
declare module
|
|
52
|
+
declare module "./index" {
|
|
53
53
|
interface AXValidationRuleOptionsMap {
|
|
54
54
|
regex: AXRegexValidationRuleOptions;
|
|
55
55
|
}
|
|
@@ -64,7 +64,7 @@ declare class AXRegexValidationRule implements AXValidationRule {
|
|
|
64
64
|
|
|
65
65
|
interface AXRequiredValidationRuleOptions extends AXValidationRuleOptions {
|
|
66
66
|
}
|
|
67
|
-
declare module
|
|
67
|
+
declare module "./index" {
|
|
68
68
|
interface AXValidationRuleOptionsMap {
|
|
69
69
|
required: AXRequiredValidationRuleOptions;
|
|
70
70
|
}
|
|
@@ -81,7 +81,7 @@ interface AXLengthValidationRuleOptions extends AXValidationRuleOptions {
|
|
|
81
81
|
min: number;
|
|
82
82
|
max: number;
|
|
83
83
|
}
|
|
84
|
-
declare module
|
|
84
|
+
declare module "./index" {
|
|
85
85
|
interface AXValidationRuleOptionsMap {
|
|
86
86
|
length: AXLengthValidationRuleOptions;
|
|
87
87
|
}
|
|
@@ -96,7 +96,7 @@ declare class AXLengthValidationRule implements AXValidationRule {
|
|
|
96
96
|
interface AXMaxLengthValidationRuleOptions extends AXValidationRuleOptions {
|
|
97
97
|
value: number;
|
|
98
98
|
}
|
|
99
|
-
declare module
|
|
99
|
+
declare module "./index" {
|
|
100
100
|
interface AXValidationRuleOptionsMap {
|
|
101
101
|
maxLength: AXMaxLengthValidationRuleOptions;
|
|
102
102
|
}
|
|
@@ -111,7 +111,7 @@ declare class AXMaxLengthValidationRule implements AXValidationRule {
|
|
|
111
111
|
interface AXMinLengthValidationRuleOptions extends AXValidationRuleOptions {
|
|
112
112
|
value: number;
|
|
113
113
|
}
|
|
114
|
-
declare module
|
|
114
|
+
declare module "./index" {
|
|
115
115
|
interface AXValidationRuleOptionsMap {
|
|
116
116
|
minLength: AXMinLengthValidationRuleOptions;
|
|
117
117
|
}
|
|
@@ -128,7 +128,7 @@ interface AXBetweenValidationRuleOptions<T = number | Date> extends AXValidation
|
|
|
128
128
|
upperValue: T;
|
|
129
129
|
inclusive?: boolean;
|
|
130
130
|
}
|
|
131
|
-
declare module
|
|
131
|
+
declare module "./index" {
|
|
132
132
|
interface AXValidationRuleOptionsMap {
|
|
133
133
|
between: AXBetweenValidationRuleOptions;
|
|
134
134
|
}
|
|
@@ -144,7 +144,7 @@ interface AXEqualValidationRuleOptions extends AXValidationRuleOptions {
|
|
|
144
144
|
value: any;
|
|
145
145
|
not?: boolean;
|
|
146
146
|
}
|
|
147
|
-
declare module
|
|
147
|
+
declare module "./index" {
|
|
148
148
|
interface AXValidationRuleOptionsMap {
|
|
149
149
|
equal: AXEqualValidationRuleOptions;
|
|
150
150
|
}
|
|
@@ -160,7 +160,7 @@ interface AXGreaterThanValidationRuleOptions extends AXValidationRuleOptions {
|
|
|
160
160
|
value: number;
|
|
161
161
|
inclusive?: boolean;
|
|
162
162
|
}
|
|
163
|
-
declare module
|
|
163
|
+
declare module "./index" {
|
|
164
164
|
interface AXValidationRuleOptionsMap {
|
|
165
165
|
greaterThan: AXGreaterThanValidationRuleOptions;
|
|
166
166
|
}
|
|
@@ -176,7 +176,7 @@ interface AXLessThanValidationRuleOptions extends AXValidationRuleOptions {
|
|
|
176
176
|
value: number;
|
|
177
177
|
inclusive?: boolean;
|
|
178
178
|
}
|
|
179
|
-
declare module
|
|
179
|
+
declare module "./index" {
|
|
180
180
|
interface AXValidationRuleOptionsMap {
|
|
181
181
|
lessThan: AXLessThanValidationRuleOptions;
|
|
182
182
|
}
|
|
@@ -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>;
|