import { EventEmitter, OnChanges, SimpleChanges } from '@angular/core'; import { KInputControlValueAccessor } from 'kara-ui-alfa/components/form/base'; import { KFile, KUploadingFile } from './input-file'; import * as i0 from "@angular/core"; type KInputFile = File | any; interface PreventableEvent { defaultPrevented: boolean; preventDefault(): void; } export type MaxFilesErrorEvent = Readonly; export type MaxTotalSizeErrorEvent = Readonly; export declare class KInputFileComponent extends KInputControlValueAccessor implements OnChanges { /** Заголовок */ label?: string; /** Описание */ description?: string; /** * Допустимые форматы фалов через запятую(нативный input) * Пример: `.jpg, .jpeg, .png` * `image/*` * */ accept?: string; /** Максимальный размер файла в байтах * Пример: 1мб = 1 \* 1024 \* 1024 */ maxFileSize?: number; /** Максимальное количество файлов, если пусто то без ограничений */ readonly maxFiles: import("@angular/core").InputSignal; /** Суммарный максимальный размер файлов в байтах * Пример: 20мб = 20 \* 1024 \* 1024 */ readonly maxTotalFileSize: import("@angular/core").InputSignal; /** Отображение названия файла */ mapName: (file: KInputFile) => string; /** Отображение размера файла в байтах */ mapSizeInBytes: (file: KInputFile) => number | null; /** Если нужна логика по пред загрузке файла. * Пример: * ``` * uploadFile({ file, responseHandler }: KUploadingFile): void { * this.http * .post('https://api', file, { observe: 'events', reportProgress: true }) * .subscribe((response) => { * responseHandler(response); * }); * } * ``` */ uploadFile: EventEmitter; valueChange: EventEmitter; protected readonly maxFileError: import("@angular/core").OutputEmitterRef>; protected readonly maxTotalFileSizeError: import("@angular/core").OutputEmitterRef>; filesData: KFile[]; fileAlreadyExist: string[]; protected readonly showMaxFilesError: import("@angular/core").WritableSignal; protected readonly showMaxTotalFileSizeError: import("@angular/core").WritableSignal; protected readonly maxTotalFileSizeFormatted: import("@angular/core").Signal; readonly loadingFile: KFile; protected readonly language: import("@angular/core").Signal<{ loading: string; invalidFileSize: string; invalidFileFormat: string; errorFileLoading: string; repeatUploading: string; maxFileErrorTitle: string; maxFileErrorDescription: string; fileAlreadyLoaded: string; dragZoneLoadingOne: string; dragZoneExtraOne: string; dragZoneLoadingMany: string; dragZoneExtraMany: string; maxTotalFileSizeError: string; } | undefined>; protected readonly multiple: import("@angular/core").Signal; ngOnChanges(changes: SimpleChanges): void; onRemove(fileToRemove: KFile): void; onReload(file: KFile): void; processFiles(files: FileList | null): void; closeMaxTotalSizeErrorAlert(): void; closeMaxFilesErrorAlert(): void; closeFileAlreadyLoaded(): void; filesTrackBy(index: number, file: KFile): File | string | number; private initUploadingFile; private updateControlValue; private isFormatAcceptable; private responseHandler; private updateFile; writeValue(value: KInputFile[] | undefined): void; private defaultMapName; private defaultMapSize; private triggerMaxFilesError; private triggerMaxTotalFileSizeError; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } export {};