import { ValueOrFunction } from '@moxb/util'; import type { FileUpload } from './FileUpload'; import { Label } from '../label/Label'; import { Action } from '../action/Action'; interface FileUploadOptions { /** * All controls must have an ID. */ id: string; /** * Label to display (in a form) */ label?: ValueOrFunction; /** * Help message to display (in a form) */ help?: ValueOrFunction; /** * What prompt should we show to the user? */ prompt?: ValueOrFunction; /** * What prompt title should we show to the user? */ promptTitle?: ValueOrFunction; /** * Is multiple file upload allowed? */ readonly multiple?: ValueOrFunction; /** * Should this control be hidden? */ invisible?: ValueOrFunction; /** * Should we call a function upon successful upload? */ onUpload?: (fileName: string, data: ArrayBuffer) => void; /** * File extensions to allow, if not set everything is allowed * Example: ['.mp3', '.png'] */ allowedFileExtensions?: ValueOrFunction; /** * File types to allow, if not set everything is allowed */ allowedFileTypes?: ValueOrFunction; } export declare class FileUploadImpl implements FileUpload { private readonly _options; private readonly _reader; _progress: number; get progress(): number; private _setProgress; constructor(_options: FileUploadOptions); get prompt(): string; get promptTitle(): string; get label(): string | undefined; get help(): string | undefined; get invisible(): boolean; get visible(): boolean; get allowedFileExtensions(): string[] | undefined; get allowedFileTypes(): string[] | undefined; get multiple(): boolean; private _pending; get pending(): boolean; private _fileList; private _fileListLength; private _currentFileIndex; private _file?; _done: boolean; _data?: ArrayBuffer; _failed: boolean; _errorMessage?: string; readonly errorLabel: Label; readonly successLabel: Label; readonly progressLabel: Label; get succeeded(): boolean; get failed(): boolean; get fileName(): string | undefined; get dataAsBinary(): ArrayBuffer | undefined; get dataAsString(): string | undefined; get errorMessage(): string | undefined; reset(): void; readonly resetAction: Action; protected _fail(errorMessage: string): void; protected _finish(data: ArrayBuffer): void; upload(file: File | File[]): void; protected uploadNextFile(): void; setErrorCheckMessage(error: string): void; } export {};