/********** Angular **********/ import { NgZone, OnInit } from "@angular/core"; import { ChunkSettings, FileInfo, FileRestrictions, RemoveEvent, SelectEvent, SuccessEvent, UploadComponent, UploadEvent } from "@progress/kendo-angular-upload"; /********** Component & Service **********/ import { InputFieldBase } from "../components/inputfieldbase.component"; import { ZComponentService } from "../services/zcomponent.service"; import { AlertService, AuthService, CompressImageService, SharePointService, ZComponent, ZCoreService } from "mmhglobal-zcore"; import * as i0 from "@angular/core"; /** * Kendo FileInfo + optional base64 payload (used by SelectFileOnly mode). * NOTE: Keeps runtime behavior the same; only improves type safety. */ declare type SelectedFileData = FileInfo & { /** * Base64 Data URL or ArrayBuffer from FileReader. * Present only when SelectFileOnly reads file content into memory. */ file?: string | ArrayBuffer | null; }; export declare class MyFileInfo implements FileInfo { name: string; uid?: string; /** * Server or application-defined UID used for remove/download operations. * (Set from API response fileUid when upload succeeds) */ myUid?: string; } export declare class ZuploadComponent extends InputFieldBase implements ZComponent, OnInit { readonly componentService: ZComponentService; private readonly authService; private readonly compressImage; private readonly zcoreService; private readonly ngZone; private readonly sharePointService; private readonly alertService; uploadComponent: UploadComponent; private readonly defaultUploadSaveUrl; private readonly defaultUploadRemoveUrl; uploadAttachmentUrl: string | null; uploadSaveUrl: string; uploadRemoveUrl: string; readonly downloadFileUrl = "/Attachment/downloadFile"; readonly getImageUrl = "/Attachment/getImage"; isAutoUpload: boolean; isMultiple: boolean; showFileList: boolean; imagePreviews: Array>; uid: string[]; fileList: SelectedFileData[]; restrictions: FileRestrictions; readonly chunkSettings: ChunkSettings; constructor(componentService: ZComponentService, authService: AuthService, compressImage: CompressImageService, zcoreService: ZCoreService, ngZone: NgZone, sharePointService: SharePointService, alertService: AlertService); /** * Angular lifecycle hook - initializes restrictions and upload behavior from field config. */ ngOnInit(): void; /** * Kendo Upload success callback for both upload and remove. * Keeps zModel in sync and emits ZComponent output events. */ onSuccess(e: SuccessEvent): void; /** * Normalize and enrich image compression config with byte-based thresholds. */ private compressionConfigHandler; /** * Convert string size values like "10KB", "2 MB", "1gb", "1024" into bytes. * If unit is omitted, bytes are assumed. * * @param sizeString Human readable size string. * @returns Size in bytes. Returns 0 if parsing fails. */ private convertSizeToByte; /** * Kendo Upload upload event: validates files, builds image previews, injects metadata and auth header. */ uploadEventHandler(e: UploadEvent): void; /** * Kendo Upload remove event: updates component memory, fires project event if defined, * otherwise attaches required payload and authorization headers. */ onRemove(e: RemoveEvent): void; /** * Kendo Upload change event handler. Emits project event if configured. */ onChange(files: FileInfo[]): void; /** * Validate a selected/uploaded file against configured restrictions (size + extension). * * @param file Kendo FileInfo * @returns true if file passes restrictions, otherwise false (and shows alert). */ private isValidUploadedFile; /** * Kendo Upload select event handler: * - Handles SharePoint endpoint switching * - Supports SelectFileOnly mode (read file content into memory and emit event) * - Supports image compression when AutoUpload is false */ selectEventHandler(e: SelectEvent): void; /** * Clears UI-selected files and syncs group state. * NOTE: Original behavior sets group value to fileList (not empty); preserved. */ clearFiles(): void; /** * Format bytes into human-readable string. * * @param bytes Raw byte size * @returns Formatted file size string (e.g. "12.5MB") */ private formatFileSize; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } export {};