import EventEmitter from "@wxwzl/eventemitter"; export interface Options { /** * Defines the max size of file that can be selected.uint:MB */ maxSize?: number; /** * Defines the text which can be show when the selected file's size is oversize. */ overSizeErrorText?: string; /** * Defines the text which can be show when the selected file's type is wrong. */ fileTypeErrorText?: string; /** * Defines accepted file types. It's a comma-separated list of file * extensions, mime-types or unique file type specifiers. * * https://developer.mozilla.org/docs/Web/HTML/Element/input/file#Unique_file_type_specifiers * * @example ```js * "image/*,video/*,.pdf,.doc,.docx,.xls" * ``` */ accept?: string; /** * Defines accepted file extensions. It's a comma-separated list of * file extensions (each starts with a dot). Used when the browser or * system cannot identify the file's MIME type and leaves `File.type` * empty. * * @example ```js * ".pdf,.doc,.docx" * ``` */ acceptedFileExtensions?: string; /** * Defines the text which can be show when the selected file's * extension is not in the accepted list. */ fileExtensionErrorText?: string; /** * Allow multiple files selection. */ multiple?: boolean; /** * Combined with `accept` property it specifies which camera to use for * capture of image or video. It was previously a Boolean value. */ capture?: string | boolean; } export default class WebFileSelector extends EventEmitter { inputNode: HTMLInputElement & { capture?: boolean | string; }; option: Options; private files; private acceptTypes; private acceptedFileExtensions; private overSizeErrorText; private fileTypeErrorText; private fileExtensionErrorText; constructor(option?: Options); private createInputElement; private onChange; walkFiles(callBack: (file: File) => boolean | void, context?: any): void; checkFile(file: File): boolean; emitError(eventName: string, errMsg?: string, ...rest: Array): this; selectFile(): this; setAccept(accept: string | undefined): this; private isAcceptTypeMatch; private getFileExtension; setAcceptedFileExtensions(extensions: string | undefined): this; setMultiple(multiple: boolean): this; setMaxSize(maxSize: number): this; setCapture(capture: string | boolean): this; destroy(): void; getFileInBlob(): Promise>; getFileInDataUrl(files?: Array): Promise>; getFileInBinaryString(files?: Array): Promise>; getFileInArrayBuffer(files?: Array): Promise>; getFileInText(files?: Array): Promise>; transformFiles(files: Array, type: string): Promise; } //# sourceMappingURL=index.d.ts.map