@acorex/core 21.0.2-next.32 → 21.0.2-next.34

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 +667 -92
  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 +4 -4
  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 +11 -11
  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 +4 -4
  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 +5 -5
  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 +25 -24
  41. package/types/acorex-core-file.d.ts +313 -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 -85
  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
@@ -0,0 +1,313 @@
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
+ /** Structured copy payload from {@link AXFileType.copy}. */
38
+ interface AXFileCopyData {
39
+ /** Primary plain-text value for clipboard or previews. */
40
+ text: string;
41
+ /** Optional type-specific metadata for consumers (URLs, names, mime types, …). */
42
+ meta?: Record<string, unknown>;
43
+ }
44
+ /** Return value of {@link AXFileType.copy} — shorthand string or structured data. */
45
+ type AXFileCopyResult = string | AXFileCopyData | null | undefined;
46
+ /** Resolves clipboard/plain text from a copy result. */
47
+ declare function resolveFileCopyText(result: AXFileCopyResult): string | null;
48
+
49
+ /** Generic rule executed via {@link AXValidationService}. */
50
+ interface AXFileValidationRule {
51
+ rule: string;
52
+ options?: AXValidationRuleOptions;
53
+ }
54
+ /**
55
+ * Common file constraints shared by {@link AXFileType} and {@link AXFileTypeExtension}.
56
+ * Extension `validations` are partial and override the parent type field-by-field.
57
+ */
58
+ interface AXFileValidations {
59
+ mimeTypes?: string[];
60
+ minSize?: number;
61
+ maxSize?: number;
62
+ rules?: AXFileValidationRule[];
63
+ }
64
+ /** Extension entry; `validations` override the parent {@link AXFileType.validations}. */
65
+ interface AXFileTypeExtension {
66
+ name: string;
67
+ title?: string;
68
+ icon?: string;
69
+ validations?: Partial<AXFileValidations>;
70
+ }
71
+ /**
72
+ * Logical file category (image, video, …).
73
+ *
74
+ * - With type `validations` set: any file matching those rules is allowed; `extensions` only override when matched.
75
+ * - With empty / omitted `validations` and `extensions` listed: only those extensions are allowed.
76
+ */
77
+ interface AXFileType<T = Record<string, (ctx: {
78
+ readAsDataUrl: (file: File | Blob) => Promise<string>;
79
+ platformId: object;
80
+ }, ...args: unknown[]) => Promise<unknown> | unknown>> {
81
+ name: string;
82
+ title?: string;
83
+ icon?: string;
84
+ validations?: AXFileValidations;
85
+ extensions?: AXFileTypeExtension[];
86
+ /** Dynamic utility functions available for this file type. */
87
+ utilities?: T;
88
+ paste?: () => Promise<unknown>;
89
+ /**
90
+ * Produce copyable content from a payload (does not write to the clipboard).
91
+ * Returns a plain string or {@link AXFileCopyData} with `text` and optional `meta`.
92
+ */
93
+ copy?: (payload: unknown) => Promise<AXFileCopyResult> | AXFileCopyResult;
94
+ }
95
+
96
+ /** Contributes {@link AXFileType} entries (multi provider). */
97
+ declare abstract class AXFileTypeInfoProvider {
98
+ abstract items(): Promise<AXFileType[]>;
99
+ }
100
+ declare const AX_FILE_TYPE_INFO_PROVIDER: InjectionToken<AXFileTypeInfoProvider[]>;
101
+ declare function provideFileTypeInfoProvider(provider: Type<AXFileTypeInfoProvider>): Provider;
102
+
103
+ declare class AXFileTypeRegistryService {
104
+ private readonly validation;
105
+ private readonly providers;
106
+ private readonly registeredTypes;
107
+ private cache;
108
+ /** Registers or replaces catalog entries (e.g. from feature bootstrap). */
109
+ registerTypes(types: AXFileType[]): void;
110
+ invalidateCache(): void;
111
+ private resolveTypes;
112
+ getTypes(): Promise<AXFileType[]>;
113
+ get(name: string): Promise<AXFileType | undefined>;
114
+ accept(typeNames?: string | string[]): Promise<string>;
115
+ matchType(file: File): Promise<AXFileType | undefined>;
116
+ validate(file: File, typeName: string): Promise<AXValidationRuleResult[]>;
117
+ validateAgainstTypes(file: File, typeNames: string | string[]): Promise<AXValidationRuleResult[]>;
118
+ validateMany(files: File[], typeNames: string | string[]): Promise<{
119
+ accepted: File[];
120
+ rejected: {
121
+ file: File;
122
+ errors: AXValidationRuleResult[];
123
+ }[];
124
+ }>;
125
+ private matchesMime;
126
+ static ɵfac: i0.ɵɵFactoryDeclaration<AXFileTypeRegistryService, never>;
127
+ static ɵprov: i0.ɵɵInjectableDeclaration<AXFileTypeRegistryService>;
128
+ }
129
+
130
+ /** Merges type-level validations with extension overrides (extension wins per field). */
131
+ declare function mergeFileValidations(base: AXFileValidations, override?: Partial<AXFileValidations>): AXFileValidations;
132
+ /** Resolved validations for a type + optional extension. */
133
+ declare function resolveFileValidations(type: AXFileType, extension?: AXFileTypeExtension): AXFileValidations;
134
+ /** True when no mime/size/rules are defined on the type. */
135
+ declare function isEmptyFileValidations(validations?: AXFileValidations): boolean;
136
+ /**
137
+ * Extension-only mode: empty type `validations` and a non-empty `extensions` list.
138
+ * Files must match a listed extension; rules come from that extension entry.
139
+ */
140
+ declare function isExtensionsOnlyType(type: AXFileType): boolean;
141
+ /** File extension from name (lowercase, no dot). */
142
+ declare function getFileExtension(fileName: string): string;
143
+ /** Matching extension entry for a file within a type, if any. */
144
+ declare function findFileTypeExtension(file: File, type: AXFileType): AXFileTypeExtension | undefined;
145
+
146
+ /** Maps {@link AXFileValidations} to executable validation entries. */
147
+ declare function fileValidationsToRules(validations: AXFileValidations): AXFileValidationRule[];
148
+ /** Failed validation results; empty array means the file is valid. */
149
+ declare function validateFileWithValidations(validation: AXValidationService, file: File, validations: AXFileValidations): Promise<AXValidationRuleResult[]>;
150
+ /** Validates a file against a type; extension rules override when the file name matches. */
151
+ declare function validateFileAgainstType(validation: AXValidationService, file: File, type: AXFileType, extension?: AXFileTypeExtension): Promise<AXValidationRuleResult[]>;
152
+
153
+ declare const AX_AUDIO_FILE_TYPE: AXFileType;
154
+ declare class AXAudioFileTypeProvider extends AXFileTypeInfoProvider {
155
+ items(): Promise<AXFileType[]>;
156
+ static ɵfac: i0.ɵɵFactoryDeclaration<AXAudioFileTypeProvider, never>;
157
+ static ɵprov: i0.ɵɵInjectableDeclaration<AXAudioFileTypeProvider>;
158
+ }
159
+
160
+ /** Extension-only: no type `validations` — only listed extensions are allowed. */
161
+ declare const AX_DOCUMENT_FILE_TYPE: AXFileType;
162
+ declare class AXDocumentFileTypeProvider extends AXFileTypeInfoProvider {
163
+ items(): Promise<AXFileType[]>;
164
+ static ɵfac: i0.ɵɵFactoryDeclaration<AXDocumentFileTypeProvider, never>;
165
+ static ɵprov: i0.ɵɵInjectableDeclaration<AXDocumentFileTypeProvider>;
166
+ }
167
+
168
+ declare const AX_FILE_FILE_TYPE: AXFileType;
169
+ declare class AXFileFileTypeProvider extends AXFileTypeInfoProvider {
170
+ items(): Promise<AXFileType[]>;
171
+ static ɵfac: i0.ɵɵFactoryDeclaration<AXFileFileTypeProvider, never>;
172
+ static ɵprov: i0.ɵɵInjectableDeclaration<AXFileFileTypeProvider>;
173
+ }
174
+
175
+ declare const AX_IMAGE_FILE_TYPE: AXFileType;
176
+ declare class AXImageFileTypeProvider extends AXFileTypeInfoProvider {
177
+ items(): Promise<AXFileType[]>;
178
+ static ɵfac: i0.ɵɵFactoryDeclaration<AXImageFileTypeProvider, never>;
179
+ static ɵprov: i0.ɵɵInjectableDeclaration<AXImageFileTypeProvider>;
180
+ }
181
+
182
+ declare const AX_VIDEO_FILE_TYPE: AXFileType;
183
+ declare class AXVideoFileTypeProvider extends AXFileTypeInfoProvider {
184
+ items(): Promise<AXFileType[]>;
185
+ static ɵfac: i0.ɵɵFactoryDeclaration<AXVideoFileTypeProvider, never>;
186
+ static ɵprov: i0.ɵɵInjectableDeclaration<AXVideoFileTypeProvider>;
187
+ }
188
+
189
+ /** Built-in file type provider classes (one logical type per provider). */
190
+ declare const AX_BUILTIN_FILE_TYPE_PROVIDERS: readonly [typeof AXImageFileTypeProvider, typeof AXVideoFileTypeProvider, typeof AXAudioFileTypeProvider, typeof AXFileFileTypeProvider, typeof AXDocumentFileTypeProvider];
191
+ /** Registers all built-in file type providers (image, video, audio, file, document). */
192
+ declare function provideBuiltinFileTypeProviders(): Provider[];
193
+ /** @deprecated Use {@link provideBuiltinFileTypeProviders}. */
194
+ declare const provideDefaultFileTypeProviders: typeof provideBuiltinFileTypeProviders;
195
+
196
+ interface AXFileMimeTypeValidationRuleOptions extends AXValidationRuleOptions {
197
+ /** MIME patterns, e.g. `image/*`, `image/png`. */
198
+ allowed: string[];
199
+ }
200
+ declare module '@acorex/core/validation' {
201
+ interface AXValidationRuleOptionsMap {
202
+ fileMimeType: AXFileMimeTypeValidationRuleOptions;
203
+ }
204
+ }
205
+ declare class AXFileMimeTypeValidationRule implements AXValidationRule {
206
+ get name(): string;
207
+ validate(value: File | Blob, options: AXFileMimeTypeValidationRuleOptions): Promise<AXValidationRuleResult>;
208
+ private matchesMime;
209
+ static ɵfac: i0.ɵɵFactoryDeclaration<AXFileMimeTypeValidationRule, never>;
210
+ static ɵprov: i0.ɵɵInjectableDeclaration<AXFileMimeTypeValidationRule>;
211
+ }
212
+
213
+ interface AXFileMinSizeValidationRuleOptions extends AXValidationRuleOptions {
214
+ /** Minimum size in bytes. */
215
+ minSize: number;
216
+ }
217
+ declare module '@acorex/core/validation' {
218
+ interface AXValidationRuleOptionsMap {
219
+ fileMinSize: AXFileMinSizeValidationRuleOptions;
220
+ }
221
+ }
222
+ declare class AXFileMinSizeValidationRule implements AXValidationRule {
223
+ get name(): string;
224
+ validate(value: File | Blob, options: AXFileMinSizeValidationRuleOptions): Promise<AXValidationRuleResult>;
225
+ static ɵfac: i0.ɵɵFactoryDeclaration<AXFileMinSizeValidationRule, never>;
226
+ static ɵprov: i0.ɵɵInjectableDeclaration<AXFileMinSizeValidationRule>;
227
+ }
228
+
229
+ interface AXFileMaxSizeValidationRuleOptions extends AXValidationRuleOptions {
230
+ /** Maximum size in bytes. */
231
+ maxSize: number;
232
+ }
233
+ declare module '@acorex/core/validation' {
234
+ interface AXValidationRuleOptionsMap {
235
+ fileMaxSize: AXFileMaxSizeValidationRuleOptions;
236
+ }
237
+ }
238
+ declare class AXFileMaxSizeValidationRule implements AXValidationRule {
239
+ get name(): string;
240
+ validate(value: File | Blob, options: AXFileMaxSizeValidationRuleOptions): Promise<AXValidationRuleResult>;
241
+ static ɵfac: i0.ɵɵFactoryDeclaration<AXFileMaxSizeValidationRule, never>;
242
+ static ɵprov: i0.ɵɵInjectableDeclaration<AXFileMaxSizeValidationRule>;
243
+ }
244
+
245
+ /** Validation rule classes to register with {@link AXValidationModule}. */
246
+ declare const AX_FILE_VALIDATION_RULES: readonly [typeof AXFileMimeTypeValidationRule, typeof AXFileMinSizeValidationRule, typeof AXFileMaxSizeValidationRule];
247
+ /** Registers file validation rules with {@link AXValidationRegistryService}. */
248
+ declare function provideFileValidationRules(): Provider;
249
+
250
+ /**
251
+ * Registers validation rules and optional built-in file type providers.
252
+ * {@link AXFileTypeRegistryService} and {@link AXFileService} are `providedIn: 'root'`.
253
+ */
254
+ declare function provideFileTypeSystem(): Provider[];
255
+
256
+ interface AXFileModuleConfig {
257
+ fileTypeProviders?: Provider[];
258
+ includeDefaultFileTypes?: boolean;
259
+ }
260
+ declare class AXFileModule {
261
+ static forRoot(config?: AXFileModuleConfig): ModuleWithProviders<AXFileModule>;
262
+ static forChild(config?: AXFileModuleConfig): ModuleWithProviders<AXFileModule>;
263
+ static ɵfac: i0.ɵɵFactoryDeclaration<AXFileModule, never>;
264
+ static ɵmod: i0.ɵɵNgModuleDeclaration<AXFileModule, never, [typeof i1.AXFormatModule, typeof i2.AXValidationModule], never>;
265
+ static ɵinj: i0.ɵɵInjectorDeclaration<AXFileModule>;
266
+ }
267
+
268
+ interface AXFileChooseOptions {
269
+ /** Logical type name(s) from {@link AXFileTypeRegistryService}. When set, files are validated against the catalog. */
270
+ fileType?: string | string[];
271
+ accept?: string;
272
+ multiple?: boolean;
273
+ }
274
+ declare class AXFileService {
275
+ private readonly document;
276
+ private readonly fileTypes;
277
+ getFileTypes(): Promise<AXFileType[]>;
278
+ getFileType(name: string): Promise<AXFileType | undefined>;
279
+ getAcceptAttribute(fileType?: string | string[]): Promise<string>;
280
+ matchFileType(file: File): Promise<AXFileType | undefined>;
281
+ validate(file: File, fileType: string | string[]): Promise<AXValidationRuleResult[]>;
282
+ validateMany(files: File[], fileType: string | string[]): Promise<{
283
+ accepted: File[];
284
+ rejected: {
285
+ file: File;
286
+ errors: AXValidationRuleResult[];
287
+ }[];
288
+ }>;
289
+ /**
290
+ * Opens a file selection dialog.
291
+ * With `fileType`, returns files that pass catalog validation (`accept` defaults from the catalog).
292
+ * Without `fileType`, returns all selected files (legacy `accept` / `multiple` only).
293
+ */
294
+ chooseValidated(options: AXFileChooseOptions): Promise<{
295
+ accepted: File[];
296
+ rejected: {
297
+ file: File;
298
+ errors: AXValidationRuleResult[];
299
+ }[];
300
+ }>;
301
+ choose(options: AXFileChooseOptions): Promise<File[]>;
302
+ blobToBase64(blob: Blob): Promise<string>;
303
+ getSize(file: File | Blob | string): number | false;
304
+ isBase64(base64: string): boolean;
305
+ getBase64Size(base64: string): number;
306
+ private resolveChooseOptions;
307
+ private openFileDialog;
308
+ static ɵfac: i0.ɵɵFactoryDeclaration<AXFileService, never>;
309
+ static ɵprov: i0.ɵɵInjectableDeclaration<AXFileService>;
310
+ }
311
+
312
+ 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_VALIDATION_RULES, AX_IMAGE_FILE_TYPE, AX_VIDEO_FILE_TYPE, fileValidationsToRules, findFileTypeExtension, formatFileSizeBytes, getFileExtension, isEmptyFileValidations, isExtensionsOnlyType, mergeFileValidations, provideBuiltinFileTypeProviders, provideDefaultFileTypeProviders, provideFileTypeInfoProvider, provideFileTypeSystem, provideFileValidationRules, resolveFileCopyText, resolveFileValidations, validateFileAgainstType, validateFileWithValidations };
313
+ export type { AXFileChooseOptions, AXFileCopyData, AXFileCopyResult, AXFileMaxSizeValidationRuleOptions, AXFileMimeTypeValidationRuleOptions, AXFileMinSizeValidationRuleOptions, AXFileModuleConfig, AXFileSizeFormatterOptions, AXFileType, AXFileTypeExtension, AXFileValidationRule, AXFileValidations };
@@ -142,7 +142,7 @@ interface AXNumberFormatterOptions extends AXFormatOptions {
142
142
  zeroPadLength?: number;
143
143
  locale?: string;
144
144
  }
145
- declare module "./index" {
145
+ declare module "./acorex-core-format" {
146
146
  interface AXFormatOptionsMap {
147
147
  number: AXNumberFormatterOptions;
148
148
  }
@@ -159,7 +159,7 @@ declare class AXNumberFormatter implements AXFormatter {
159
159
  interface AXStringFormatterOptions extends AXFormatOptions {
160
160
  [key: string]: any;
161
161
  }
162
- declare module "./index" {
162
+ declare module "./acorex-core-format" {
163
163
  interface AXFormatOptionsMap {
164
164
  string: AXStringFormatterOptions;
165
165
  }
@@ -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,85 +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
-
5
- interface AXFileSizeFormatterOptions extends AXFormatOptions {
6
- format: string;
7
- }
8
- declare module '@acorex/core/format' {
9
- interface AXFormatOptionsMap {
10
- filesize: AXFileSizeFormatterOptions;
11
- }
12
- }
13
- declare class AXFileSizeFormatter implements AXFormatter {
14
- /**
15
- * Gets the name of the formatter.
16
- *
17
- * @returns string - The formatter name 'filesize'
18
- */
19
- get name(): string;
20
- /**
21
- * Formats a file size value to human-readable format.
22
- *
23
- * @param value - The file size in bytes
24
- * @returns string - The formatted file size string (e.g., '1.5 MB')
25
- */
26
- format(value: number): string;
27
- static ɵfac: i0.ɵɵFactoryDeclaration<AXFileSizeFormatter, never>;
28
- static ɵprov: i0.ɵɵInjectableDeclaration<AXFileSizeFormatter>;
29
- }
30
-
31
- declare class AXFileModule {
32
- static ɵfac: i0.ɵɵFactoryDeclaration<AXFileModule, never>;
33
- static ɵmod: i0.ɵɵNgModuleDeclaration<AXFileModule, never, [typeof i1.AXFormatModule], never>;
34
- static ɵinj: i0.ɵɵInjectorDeclaration<AXFileModule>;
35
- }
36
-
37
- declare class AXFileService {
38
- private document;
39
- private platformID;
40
- /**
41
- * Opens a file selection dialog and returns the selected files.
42
- *
43
- * @param options - Optional configuration for file selection
44
- * @param options.accept - File types to accept (e.g., 'image/*', '.pdf')
45
- * @param options.multiple - Whether to allow multiple file selection
46
- * @returns Promise<File[]> - Promise that resolves with the selected files
47
- */
48
- choose(options?: {
49
- accept?: string;
50
- multiple?: boolean;
51
- }): Promise<File[]>;
52
- /**
53
- * Gets the size of a file, blob, or base64 string.
54
- *
55
- * @param file - The file, blob, or base64 string to get size for
56
- * @returns number | false - The size in bytes or false if not a base64 string
57
- */
58
- blobToBase64: (blob: Blob) => Promise<string>;
59
- /**
60
- * Gets the size of a file, blob, or base64 string.
61
- *
62
- * @param file - The file, blob, or base64 string to get size for
63
- * @returns number | false - The size in bytes or false if not a base64 string
64
- */
65
- getSize(file: File | Blob | string): number | false;
66
- /**
67
- * Checks if a string is a valid base64 string.
68
- *
69
- * @param base64 - The string to check
70
- * @returns boolean - True if the string is a valid base64 string
71
- */
72
- isBase64(base64: string): boolean;
73
- /**
74
- * Gets the size of a base64 string in bytes.
75
- *
76
- * @param base64 - The base64 string to get size for
77
- * @returns number - The size in bytes
78
- */
79
- getBase64Size(base64: string): number;
80
- static ɵfac: i0.ɵɵFactoryDeclaration<AXFileService, never>;
81
- static ɵprov: i0.ɵɵInjectableDeclaration<AXFileService>;
82
- }
83
-
84
- export { AXFileModule, AXFileService, AXFileSizeFormatter };
85
- export type { AXFileSizeFormatterOptions };
File without changes