import { ChangeDetectorRef, DestroyRef, ElementRef, InjectionToken, InputSignal, Renderer2 } from '@angular/core'; import { FormGroupDirective, NgControl, NgForm } from '@angular/forms'; import { CanUpdateErrorState, ErrorStateMatcher, KbqBaseFileUploadLocaleConfig, KbqEnumValues, KbqMultipleFileUploadLocaleConfig } from '@koobiq/components/core'; import { BehaviorSubject, Subject } from 'rxjs'; import { KbqFullScreenDropzoneService } from './dropzone'; import { KbqFileList, KbqFileUploadContext } from './primitives'; export interface KbqFile extends File { fullPath: string; } export interface KbqFileItem { file: File; hasError?: boolean; loading?: BehaviorSubject; progress?: BehaviorSubject; } /** * @docs-private * @deprecated Will be removed in next major release */ export interface KbqInputFile { disabled: boolean; accept?: string[]; onFileSelectedViaClick(event: Event): void; onFileDropped(files: FileList | KbqFile[]): void; } /** * @docs-private * @deprecated Will be removed in next major release */ export interface KbqInputFileLabel { captionText: string; browseLink: string; title?: string | undefined; } /** Upload modes enum. */ export declare enum KbqFileUploadAllowedType { File = "file", Folder = "folder", Mixed = "mixed" } /** Allowed upload modes for the upload component. */ export type KbqFileUploadAllowedTypeValues = KbqEnumValues; /** @docs-private */ export type KbqFileUploadCaptionContext = { captionText: string; browseLink?: string; captionTextSeparator?: string; browseLinkFolder?: string; }; /** * @deprecated use FormControl for validation */ export type KbqFileValidatorFn = (file: File) => string | null; export declare const KBQ_FILE_UPLOAD_CONFIGURATION: InjectionToken; /** @deprecated use `FileValidators.isCorrectExtension` instead. Will be removed in next major release. */ export declare const isCorrectExtension: (file: File, accept?: string[]) => boolean; /** @docs-private */ export declare abstract class KbqFileUploadBase implements CanUpdateErrorState { protected abstract localeConfig: InputSignal | undefined>; /** Tracks whether the component is in an error state based on the control, parent form, * and `errorStateMatcher`, triggering visual updates and state changes if needed. */ errorState: boolean; /** An object used to control the error state of the component. */ abstract errorStateMatcher: ErrorStateMatcher; /** * Emits whenever the component state changes and should cause the parent * form-field to update. Implemented as part of `KbqFormFieldControl`. * @docs-private */ readonly stateChanges: Subject; /** @docs-private */ protected readonly fileUploadContext: KbqFileUploadContext; /** @docs-private */ protected readonly fileList: KbqFileList; /** @docs-private */ get disabled(): boolean; /** @docs-private */ protected readonly cdr: ChangeDetectorRef; /** @docs-private */ protected readonly renderer: Renderer2; /** @docs-private */ protected readonly destroyRef: DestroyRef; /** @docs-private */ protected readonly localeService: import("@koobiq/components/core").KbqLocaleService | null; /** @docs-private */ protected readonly ngControl: NgControl | null; /** @docs-private */ protected readonly parentForm: NgForm | null; /** @docs-private */ protected readonly parentFormGroup: FormGroupDirective | null; /** @docs-private */ protected readonly defaultErrorStateMatcher: ErrorStateMatcher; /** @docs-private */ protected readonly elementRef: ElementRef; /** @docs-private */ protected readonly dropzoneService: KbqFullScreenDropzoneService; /** implemented as part of base class. Decided not use mixinErrorState, not to overcomplicate * @docs-private */ updateErrorState(): void; /** Merges base configuration with locale-specific overrides. */ protected buildConfig(config: T): T; }