@acorex/core 21.0.2-next.24 → 21.0.2-next.25

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.
Files changed (62) hide show
  1. package/fesm2022/acorex-core-components.mjs +3 -3
  2. package/fesm2022/acorex-core-components.mjs.map +1 -1
  3. package/fesm2022/acorex-core-config.mjs +3 -3
  4. package/fesm2022/acorex-core-config.mjs.map +1 -1
  5. package/fesm2022/acorex-core-constants.mjs.map +1 -1
  6. package/fesm2022/acorex-core-date-time.mjs +25 -25
  7. package/fesm2022/acorex-core-date-time.mjs.map +1 -1
  8. package/fesm2022/acorex-core-events.mjs +3 -3
  9. package/fesm2022/acorex-core-events.mjs.map +1 -1
  10. package/fesm2022/acorex-core-file.mjs +92 -685
  11. package/fesm2022/acorex-core-file.mjs.map +1 -1
  12. package/fesm2022/acorex-core-format.mjs +19 -19
  13. package/fesm2022/acorex-core-format.mjs.map +1 -1
  14. package/fesm2022/acorex-core-full-screen.mjs +3 -3
  15. package/fesm2022/acorex-core-full-screen.mjs.map +1 -1
  16. package/fesm2022/acorex-core-icon.mjs +3 -3
  17. package/fesm2022/acorex-core-icon.mjs.map +1 -1
  18. package/fesm2022/acorex-core-image.mjs +3 -3
  19. package/fesm2022/acorex-core-image.mjs.map +1 -1
  20. package/fesm2022/acorex-core-locale.mjs +10 -10
  21. package/fesm2022/acorex-core-locale.mjs.map +1 -1
  22. package/fesm2022/acorex-core-memoize.mjs.map +1 -1
  23. package/fesm2022/acorex-core-network.mjs +3 -3
  24. package/fesm2022/acorex-core-network.mjs.map +1 -1
  25. package/fesm2022/acorex-core-pipes.mjs +3 -3
  26. package/fesm2022/acorex-core-pipes.mjs.map +1 -1
  27. package/fesm2022/acorex-core-platform.mjs +4 -4
  28. package/fesm2022/acorex-core-platform.mjs.map +1 -1
  29. package/fesm2022/acorex-core-storage.mjs +9 -9
  30. package/fesm2022/acorex-core-storage.mjs.map +1 -1
  31. package/fesm2022/acorex-core-translation.mjs +16 -16
  32. package/fesm2022/acorex-core-translation.mjs.map +1 -1
  33. package/fesm2022/acorex-core-utils.mjs +6 -4
  34. package/fesm2022/acorex-core-utils.mjs.map +1 -1
  35. package/fesm2022/acorex-core-validation.mjs +40 -40
  36. package/fesm2022/acorex-core-validation.mjs.map +1 -1
  37. package/fesm2022/acorex-core-z-index.mjs +3 -3
  38. package/fesm2022/acorex-core-z-index.mjs.map +1 -1
  39. package/fesm2022/acorex-core.mjs.map +1 -1
  40. package/package.json +23 -23
  41. package/types/acorex-core-file.d.ts +85 -0
  42. package/{format/index.d.ts → types/acorex-core-format.d.ts} +2 -2
  43. package/{utils/index.d.ts → types/acorex-core-utils.d.ts} +10 -2
  44. package/{validation/index.d.ts → types/acorex-core-validation.d.ts} +10 -10
  45. package/file/index.d.ts +0 -321
  46. /package/{components/index.d.ts → types/acorex-core-components.d.ts} +0 -0
  47. /package/{config/index.d.ts → types/acorex-core-config.d.ts} +0 -0
  48. /package/{constants/index.d.ts → types/acorex-core-constants.d.ts} +0 -0
  49. /package/{date-time/index.d.ts → types/acorex-core-date-time.d.ts} +0 -0
  50. /package/{events/index.d.ts → types/acorex-core-events.d.ts} +0 -0
  51. /package/{full-screen/index.d.ts → types/acorex-core-full-screen.d.ts} +0 -0
  52. /package/{icon/index.d.ts → types/acorex-core-icon.d.ts} +0 -0
  53. /package/{image/index.d.ts → types/acorex-core-image.d.ts} +0 -0
  54. /package/{locale/index.d.ts → types/acorex-core-locale.d.ts} +0 -0
  55. /package/{memoize/index.d.ts → types/acorex-core-memoize.d.ts} +0 -0
  56. /package/{network/index.d.ts → types/acorex-core-network.d.ts} +0 -0
  57. /package/{pipes/index.d.ts → types/acorex-core-pipes.d.ts} +0 -0
  58. /package/{platform/index.d.ts → types/acorex-core-platform.d.ts} +0 -0
  59. /package/{storage/index.d.ts → types/acorex-core-storage.d.ts} +0 -0
  60. /package/{translation/index.d.ts → types/acorex-core-translation.d.ts} +0 -0
  61. /package/{z-index/index.d.ts → types/acorex-core-z-index.d.ts} +0 -0
  62. /package/{index.d.ts → types/acorex-core.d.ts} +0 -0
@@ -83,6 +83,14 @@ declare function debounceAsync<T extends (...args: any[]) => Promise<any>>(fn: T
83
83
  */
84
84
  declare function fallbackChain<T>(tasks: Array<() => Promise<T>>): Promise<T>;
85
85
 
86
+ /** ACoreX layout size classes applied on a host or container. */
87
+ declare const AX_SIZE_CLASSES: readonly ["ax-xs", "ax-sm", "ax-md", "ax-lg", "ax-xl"];
88
+ type AXSizeClass = (typeof AX_SIZE_CLASSES)[number];
89
+ /** Resolved ACoreX size: the DOM node that carries the token and the token itself. */
90
+ interface AXClosestAxSizeMatch {
91
+ element: HTMLElement;
92
+ sizeClass: AXSizeClass;
93
+ }
86
94
  declare class AXHtmlUtil {
87
95
  static focusElement(element: HTMLElement): HTMLElement;
88
96
  static blurElement(element: HTMLElement): HTMLElement;
@@ -114,5 +122,5 @@ declare function getWordBoundsAtPosition(str: string, position: number): {
114
122
  end: number;
115
123
  };
116
124
 
117
- export { AXAutoUnsubscriber, AXColorUtil, AXDrawingUtil, AXHtmlUtil, AXUnsubscriber, debounceAsync, delay, fallbackChain, getWordBoundsAtPosition, pollUntil, pollUntilAbortable, retryUntil, throttleAsync, waitFor };
118
- export type { AXBoundingClientRect, AXColorFormat, AXColorMode, AXPoint };
125
+ export { AXAutoUnsubscriber, AXColorUtil, AXDrawingUtil, AXHtmlUtil, AXUnsubscriber, AX_SIZE_CLASSES, debounceAsync, delay, fallbackChain, getWordBoundsAtPosition, pollUntil, pollUntilAbortable, retryUntil, throttleAsync, waitFor };
126
+ export type { AXBoundingClientRect, AXClosestAxSizeMatch, AXColorFormat, AXColorMode, AXPoint, AXSizeClass };
@@ -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 "./index" {
37
+ declare module "./acorex-core-validation" {
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 "./index" {
52
+ declare module "./acorex-core-validation" {
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 "./index" {
67
+ declare module "./acorex-core-validation" {
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 "./index" {
84
+ declare module "./acorex-core-validation" {
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 "./index" {
99
+ declare module "./acorex-core-validation" {
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 "./index" {
114
+ declare module "./acorex-core-validation" {
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 "./index" {
131
+ declare module "./acorex-core-validation" {
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 "./index" {
147
+ declare module "./acorex-core-validation" {
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 "./index" {
163
+ declare module "./acorex-core-validation" {
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 "./index" {
179
+ declare module "./acorex-core-validation" {
180
180
  interface AXValidationRuleOptionsMap {
181
181
  lessThan: AXLessThanValidationRuleOptions;
182
182
  }
package/file/index.d.ts DELETED
@@ -1,321 +0,0 @@
1
- import * as i1 from '@acorex/core/format';
2
- import { AXFormatOptions, AXFormatter } from '@acorex/core/format';
3
- import * as i0 from '@angular/core';
4
- import { InjectionToken, Type, Provider, ModuleWithProviders } from '@angular/core';
5
- import * as i2 from '@acorex/core/validation';
6
- import { AXValidationRuleOptions, AXValidationRuleResult, AXValidationService, AXValidationRule } from '@acorex/core/validation';
7
-
8
- interface AXFileSizeFormatterOptions extends AXFormatOptions {
9
- format: string;
10
- }
11
- declare module '@acorex/core/format' {
12
- interface AXFormatOptionsMap {
13
- filesize: AXFileSizeFormatterOptions;
14
- }
15
- }
16
- declare class AXFileSizeFormatter implements AXFormatter {
17
- /**
18
- * Gets the name of the formatter.
19
- *
20
- * @returns string - The formatter name 'filesize'
21
- */
22
- get name(): string;
23
- /**
24
- * Formats a file size value to human-readable format.
25
- *
26
- * @param value - The file size in bytes
27
- * @returns string - The formatted file size string (e.g., '1.5 MB')
28
- */
29
- format(value: number): string;
30
- static ɵfac: i0.ɵɵFactoryDeclaration<AXFileSizeFormatter, never>;
31
- static ɵprov: i0.ɵɵInjectableDeclaration<AXFileSizeFormatter>;
32
- }
33
-
34
- /** Human-readable file size (binary units, e.g. `41.5 MB`). */
35
- declare function formatFileSizeBytes(bytes: number): string;
36
-
37
- /** Generic rule executed via {@link AXValidationService}. */
38
- interface AXFileValidationRule {
39
- rule: string;
40
- options?: AXValidationRuleOptions;
41
- }
42
- /**
43
- * Common file constraints shared by {@link AXFileType} and {@link AXFileTypeExtension}.
44
- * Extension `validations` are partial and override the parent type field-by-field.
45
- */
46
- interface AXFileValidations {
47
- mimeTypes?: string[];
48
- minSize?: number;
49
- maxSize?: number;
50
- rules?: AXFileValidationRule[];
51
- }
52
- /** Extension entry; `validations` override the parent {@link AXFileType.validations}. */
53
- interface AXFileTypeExtension {
54
- name: string;
55
- title?: string;
56
- icon?: string;
57
- validations?: Partial<AXFileValidations>;
58
- }
59
- /** Context passed to {@link AXFileType.utilities} handlers. */
60
- interface AXFileTypeUtilitiesContext {
61
- readAsDataUrl: (file: File | Blob) => Promise<string>;
62
- /** Angular `PLATFORM_ID` or similar for browser-only APIs. */
63
- platformId: object;
64
- }
65
- /**
66
- * Named utility handler. Each file type only registers the keys it supports
67
- * (e.g. image: `preview`; video: `preview`, `duration`).
68
- */
69
- type AXFileTypeUtility = (ctx: AXFileTypeUtilitiesContext, ...args: unknown[]) => Promise<unknown> | unknown;
70
- /**
71
- * Logical file category (image, video, …).
72
- *
73
- * - With type `validations` set: any file matching those rules is allowed; `extensions` only override when matched.
74
- * - With empty / omitted `validations` and `extensions` listed: only those extensions are allowed.
75
- */
76
- interface AXFileType {
77
- name: string;
78
- title?: string;
79
- icon?: string;
80
- validations?: AXFileValidations;
81
- extensions?: AXFileTypeExtension[];
82
- /** Named helpers; only define keys this type supports. */
83
- utilities?: Record<string, AXFileTypeUtility>;
84
- }
85
-
86
- /** Well-known utility keys (optional per {@link AXFileType}). */
87
- declare const AX_FILE_TYPE_UTILITY: {
88
- readonly preview: "preview";
89
- readonly duration: "duration";
90
- readonly formatSize: "formatSize";
91
- readonly formatDuration: "formatDuration";
92
- readonly createLocalPreviewUrl: "createLocalPreviewUrl";
93
- /** Resolves catalog name for mixed file-picker rows. */
94
- readonly pickerCatalog: "pickerCatalog";
95
- };
96
- type AXFileTypeUtilityName = (typeof AX_FILE_TYPE_UTILITY)[keyof typeof AX_FILE_TYPE_UTILITY];
97
- declare function createFileTypeUtilitiesContext(readAsDataUrl: (file: File | Blob) => Promise<string>, platformId: object): AXFileTypeUtilitiesContext;
98
- declare function hasFileTypeUtility(fileType: AXFileType | undefined, name: string): fileType is AXFileType & {
99
- utilities: Record<string, AXFileTypeUtility>;
100
- };
101
- declare function runFileTypeUtility<T>(fileType: AXFileType | undefined, name: string, ctx: AXFileTypeUtilitiesContext, ...args: unknown[]): Promise<T | undefined>;
102
- declare function runFileTypeUtilitySync<T>(fileType: AXFileType | undefined, name: string, ctx: AXFileTypeUtilitiesContext, ...args: unknown[]): T | undefined;
103
-
104
- /** Contributes {@link AXFileType} entries (multi provider). */
105
- declare abstract class AXFileTypeInfoProvider {
106
- abstract items(): Promise<AXFileType[]>;
107
- }
108
- declare const AX_FILE_TYPE_INFO_PROVIDER: InjectionToken<AXFileTypeInfoProvider[]>;
109
- declare function provideFileTypeInfoProvider(provider: Type<AXFileTypeInfoProvider>): Provider;
110
-
111
- declare class AXFileTypeRegistryService {
112
- private readonly validation;
113
- private readonly providers;
114
- private readonly registeredTypes;
115
- private cache;
116
- /** Registers or replaces catalog entries (e.g. from feature bootstrap). */
117
- registerTypes(types: AXFileType[]): void;
118
- invalidateCache(): void;
119
- private resolveTypes;
120
- getTypes(): Promise<AXFileType[]>;
121
- get(name: string): Promise<AXFileType | undefined>;
122
- accept(typeNames?: string | string[]): Promise<string>;
123
- matchType(file: File): Promise<AXFileType | undefined>;
124
- validate(file: File, typeName: string): Promise<AXValidationRuleResult[]>;
125
- validateAgainstTypes(file: File, typeNames: string | string[]): Promise<AXValidationRuleResult[]>;
126
- validateMany(files: File[], typeNames: string | string[]): Promise<{
127
- accepted: File[];
128
- rejected: {
129
- file: File;
130
- errors: AXValidationRuleResult[];
131
- }[];
132
- }>;
133
- private matchesMime;
134
- static ɵfac: i0.ɵɵFactoryDeclaration<AXFileTypeRegistryService, never>;
135
- static ɵprov: i0.ɵɵInjectableDeclaration<AXFileTypeRegistryService>;
136
- }
137
-
138
- /** Merges type-level validations with extension overrides (extension wins per field). */
139
- declare function mergeFileValidations(base: AXFileValidations, override?: Partial<AXFileValidations>): AXFileValidations;
140
- /** Resolved validations for a type + optional extension. */
141
- declare function resolveFileValidations(type: AXFileType, extension?: AXFileTypeExtension): AXFileValidations;
142
- /** True when no mime/size/rules are defined on the type. */
143
- declare function isEmptyFileValidations(validations?: AXFileValidations): boolean;
144
- /**
145
- * Extension-only mode: empty type `validations` and a non-empty `extensions` list.
146
- * Files must match a listed extension; rules come from that extension entry.
147
- */
148
- declare function isExtensionsOnlyType(type: AXFileType): boolean;
149
- /** File extension from name (lowercase, no dot). */
150
- declare function getFileExtension(fileName: string): string;
151
- /** Matching extension entry for a file within a type, if any. */
152
- declare function findFileTypeExtension(file: File, type: AXFileType): AXFileTypeExtension | undefined;
153
-
154
- /** Maps {@link AXFileValidations} to executable validation entries. */
155
- declare function fileValidationsToRules(validations: AXFileValidations): AXFileValidationRule[];
156
- /** Failed validation results; empty array means the file is valid. */
157
- declare function validateFileWithValidations(validation: AXValidationService, file: File, validations: AXFileValidations): Promise<AXValidationRuleResult[]>;
158
- /** Validates a file against a type; extension rules override when the file name matches. */
159
- declare function validateFileAgainstType(validation: AXValidationService, file: File, type: AXFileType, extension?: AXFileTypeExtension): Promise<AXValidationRuleResult[]>;
160
-
161
- declare const AX_AUDIO_FILE_TYPE: AXFileType;
162
- declare class AXAudioFileTypeProvider extends AXFileTypeInfoProvider {
163
- items(): Promise<AXFileType[]>;
164
- static ɵfac: i0.ɵɵFactoryDeclaration<AXAudioFileTypeProvider, never>;
165
- static ɵprov: i0.ɵɵInjectableDeclaration<AXAudioFileTypeProvider>;
166
- }
167
-
168
- /** Extension-only: no type `validations` — only listed extensions are allowed. */
169
- declare const AX_DOCUMENT_FILE_TYPE: AXFileType;
170
- declare class AXDocumentFileTypeProvider extends AXFileTypeInfoProvider {
171
- items(): Promise<AXFileType[]>;
172
- static ɵfac: i0.ɵɵFactoryDeclaration<AXDocumentFileTypeProvider, never>;
173
- static ɵprov: i0.ɵɵInjectableDeclaration<AXDocumentFileTypeProvider>;
174
- }
175
-
176
- declare const AX_FILE_FILE_TYPE: AXFileType;
177
- declare class AXFileFileTypeProvider extends AXFileTypeInfoProvider {
178
- items(): Promise<AXFileType[]>;
179
- static ɵfac: i0.ɵɵFactoryDeclaration<AXFileFileTypeProvider, never>;
180
- static ɵprov: i0.ɵɵInjectableDeclaration<AXFileFileTypeProvider>;
181
- }
182
-
183
- declare const AX_IMAGE_FILE_TYPE: AXFileType;
184
- declare class AXImageFileTypeProvider extends AXFileTypeInfoProvider {
185
- items(): Promise<AXFileType[]>;
186
- static ɵfac: i0.ɵɵFactoryDeclaration<AXImageFileTypeProvider, never>;
187
- static ɵprov: i0.ɵɵInjectableDeclaration<AXImageFileTypeProvider>;
188
- }
189
-
190
- declare const AX_VIDEO_FILE_TYPE: AXFileType;
191
- declare class AXVideoFileTypeProvider extends AXFileTypeInfoProvider {
192
- items(): Promise<AXFileType[]>;
193
- static ɵfac: i0.ɵɵFactoryDeclaration<AXVideoFileTypeProvider, never>;
194
- static ɵprov: i0.ɵɵInjectableDeclaration<AXVideoFileTypeProvider>;
195
- }
196
-
197
- /** Built-in file type provider classes (one logical type per provider). */
198
- declare const AX_BUILTIN_FILE_TYPE_PROVIDERS: readonly [typeof AXImageFileTypeProvider, typeof AXVideoFileTypeProvider, typeof AXAudioFileTypeProvider, typeof AXFileFileTypeProvider, typeof AXDocumentFileTypeProvider];
199
- /** Registers all built-in file type providers (image, video, audio, file, document). */
200
- declare function provideBuiltinFileTypeProviders(): Provider[];
201
- /** @deprecated Use {@link provideBuiltinFileTypeProviders}. */
202
- declare const provideDefaultFileTypeProviders: typeof provideBuiltinFileTypeProviders;
203
-
204
- interface AXFileMimeTypeValidationRuleOptions extends AXValidationRuleOptions {
205
- /** MIME patterns, e.g. `image/*`, `image/png`. */
206
- allowed: string[];
207
- }
208
- declare module '@acorex/core/validation' {
209
- interface AXValidationRuleOptionsMap {
210
- fileMimeType: AXFileMimeTypeValidationRuleOptions;
211
- }
212
- }
213
- declare class AXFileMimeTypeValidationRule implements AXValidationRule {
214
- get name(): string;
215
- validate(value: File | Blob, options: AXFileMimeTypeValidationRuleOptions): Promise<AXValidationRuleResult>;
216
- private matchesMime;
217
- static ɵfac: i0.ɵɵFactoryDeclaration<AXFileMimeTypeValidationRule, never>;
218
- static ɵprov: i0.ɵɵInjectableDeclaration<AXFileMimeTypeValidationRule>;
219
- }
220
-
221
- interface AXFileMinSizeValidationRuleOptions extends AXValidationRuleOptions {
222
- /** Minimum size in bytes. */
223
- minSize: number;
224
- }
225
- declare module '@acorex/core/validation' {
226
- interface AXValidationRuleOptionsMap {
227
- fileMinSize: AXFileMinSizeValidationRuleOptions;
228
- }
229
- }
230
- declare class AXFileMinSizeValidationRule implements AXValidationRule {
231
- get name(): string;
232
- validate(value: File | Blob, options: AXFileMinSizeValidationRuleOptions): Promise<AXValidationRuleResult>;
233
- static ɵfac: i0.ɵɵFactoryDeclaration<AXFileMinSizeValidationRule, never>;
234
- static ɵprov: i0.ɵɵInjectableDeclaration<AXFileMinSizeValidationRule>;
235
- }
236
-
237
- interface AXFileMaxSizeValidationRuleOptions extends AXValidationRuleOptions {
238
- /** Maximum size in bytes. */
239
- maxSize: number;
240
- }
241
- declare module '@acorex/core/validation' {
242
- interface AXValidationRuleOptionsMap {
243
- fileMaxSize: AXFileMaxSizeValidationRuleOptions;
244
- }
245
- }
246
- declare class AXFileMaxSizeValidationRule implements AXValidationRule {
247
- get name(): string;
248
- validate(value: File | Blob, options: AXFileMaxSizeValidationRuleOptions): Promise<AXValidationRuleResult>;
249
- static ɵfac: i0.ɵɵFactoryDeclaration<AXFileMaxSizeValidationRule, never>;
250
- static ɵprov: i0.ɵɵInjectableDeclaration<AXFileMaxSizeValidationRule>;
251
- }
252
-
253
- /** Validation rule classes to register with {@link AXValidationModule}. */
254
- declare const AX_FILE_VALIDATION_RULES: readonly [typeof AXFileMimeTypeValidationRule, typeof AXFileMinSizeValidationRule, typeof AXFileMaxSizeValidationRule];
255
- /** Registers file validation rules with {@link AXValidationRegistryService}. */
256
- declare function provideFileValidationRules(): Provider;
257
-
258
- /**
259
- * Registers validation rules and optional built-in file type providers.
260
- * {@link AXFileTypeRegistryService} and {@link AXFileService} are `providedIn: 'root'`.
261
- */
262
- declare function provideFileTypeSystem(): Provider[];
263
-
264
- interface AXFileModuleConfig {
265
- fileTypeProviders?: Provider[];
266
- includeDefaultFileTypes?: boolean;
267
- }
268
- declare class AXFileModule {
269
- static forRoot(config?: AXFileModuleConfig): ModuleWithProviders<AXFileModule>;
270
- static forChild(config?: AXFileModuleConfig): ModuleWithProviders<AXFileModule>;
271
- static ɵfac: i0.ɵɵFactoryDeclaration<AXFileModule, never>;
272
- static ɵmod: i0.ɵɵNgModuleDeclaration<AXFileModule, never, [typeof i1.AXFormatModule, typeof i2.AXValidationModule], never>;
273
- static ɵinj: i0.ɵɵInjectorDeclaration<AXFileModule>;
274
- }
275
-
276
- interface AXFileChooseOptions {
277
- /** Logical type name(s) from {@link AXFileTypeRegistryService}. When set, files are validated against the catalog. */
278
- fileType?: string | string[];
279
- accept?: string;
280
- multiple?: boolean;
281
- }
282
- declare class AXFileService {
283
- private readonly document;
284
- private readonly fileTypes;
285
- getFileTypes(): Promise<AXFileType[]>;
286
- getFileType(name: string): Promise<AXFileType | undefined>;
287
- getAcceptAttribute(fileType?: string | string[]): Promise<string>;
288
- matchFileType(file: File): Promise<AXFileType | undefined>;
289
- validate(file: File, fileType: string | string[]): Promise<AXValidationRuleResult[]>;
290
- validateMany(files: File[], fileType: string | string[]): Promise<{
291
- accepted: File[];
292
- rejected: {
293
- file: File;
294
- errors: AXValidationRuleResult[];
295
- }[];
296
- }>;
297
- /**
298
- * Opens a file selection dialog.
299
- * With `fileType`, returns files that pass catalog validation (`accept` defaults from the catalog).
300
- * Without `fileType`, returns all selected files (legacy `accept` / `multiple` only).
301
- */
302
- chooseValidated(options: AXFileChooseOptions): Promise<{
303
- accepted: File[];
304
- rejected: {
305
- file: File;
306
- errors: AXValidationRuleResult[];
307
- }[];
308
- }>;
309
- choose(options: AXFileChooseOptions): Promise<File[]>;
310
- blobToBase64(blob: Blob): Promise<string>;
311
- getSize(file: File | Blob | string): number | false;
312
- isBase64(base64: string): boolean;
313
- getBase64Size(base64: string): number;
314
- private resolveChooseOptions;
315
- private openFileDialog;
316
- static ɵfac: i0.ɵɵFactoryDeclaration<AXFileService, never>;
317
- static ɵprov: i0.ɵɵInjectableDeclaration<AXFileService>;
318
- }
319
-
320
- export { AXAudioFileTypeProvider, AXDocumentFileTypeProvider, AXFileFileTypeProvider, AXFileMaxSizeValidationRule, AXFileMimeTypeValidationRule, AXFileMinSizeValidationRule, AXFileModule, AXFileService, AXFileSizeFormatter, AXFileTypeInfoProvider, AXFileTypeRegistryService, AXImageFileTypeProvider, AXVideoFileTypeProvider, AX_AUDIO_FILE_TYPE, AX_BUILTIN_FILE_TYPE_PROVIDERS, AX_DOCUMENT_FILE_TYPE, AX_FILE_FILE_TYPE, AX_FILE_TYPE_INFO_PROVIDER, AX_FILE_TYPE_UTILITY, AX_FILE_VALIDATION_RULES, AX_IMAGE_FILE_TYPE, AX_VIDEO_FILE_TYPE, createFileTypeUtilitiesContext, fileValidationsToRules, findFileTypeExtension, formatFileSizeBytes, getFileExtension, hasFileTypeUtility, isEmptyFileValidations, isExtensionsOnlyType, mergeFileValidations, provideBuiltinFileTypeProviders, provideDefaultFileTypeProviders, provideFileTypeInfoProvider, provideFileTypeSystem, provideFileValidationRules, resolveFileValidations, runFileTypeUtility, runFileTypeUtilitySync, validateFileAgainstType, validateFileWithValidations };
321
- export type { AXFileChooseOptions, AXFileMaxSizeValidationRuleOptions, AXFileMimeTypeValidationRuleOptions, AXFileMinSizeValidationRuleOptions, AXFileModuleConfig, AXFileSizeFormatterOptions, AXFileType, AXFileTypeExtension, AXFileTypeUtilitiesContext, AXFileTypeUtility, AXFileTypeUtilityName, AXFileValidationRule, AXFileValidations };
File without changes