ng-devui
Version:
DevUI components based on Angular
60 lines (59 loc) • 3 kB
TypeScript
import { ElementRef, EventEmitter, OnDestroy } from '@angular/core';
import { I18nInterface, I18nService } from 'ng-devui/i18n';
import { Message } from 'ng-devui/toast';
import { Observable, Subscription } from 'rxjs';
import { FileUploader } from './file-uploader.class';
import { IFileOptions, IUploadOptions } from './file-uploader.types';
import { SelectFiles } from './select-files.utils';
import { UploadComponent } from './upload.class';
import * as i0 from "@angular/core";
export declare class UploadDirective extends UploadComponent implements OnDestroy {
private selectFiles;
private i18n;
uploadOptions: IUploadOptions;
fileOptions: IFileOptions;
uploadedFiles: Array<Object>;
fileUploaders: Array<FileUploader>;
enableDrop: boolean;
dynamicUploadOptionsFn: (files: any, uploadOptions: any) => IUploadOptions;
beforeUpload: (file: any) => boolean | Promise<boolean> | Observable<boolean>;
fileOver: EventEmitter<boolean>;
fileDrop: EventEmitter<any>;
successEvent: EventEmitter<Array<{
file: File;
response: any;
}>>;
errorEvent: EventEmitter<{
file: File;
response: any;
}>;
alertMsgEvent: EventEmitter<Message[]>;
fileSelect: EventEmitter<File[]>;
errorMsg: any[];
protected element: ElementRef;
i18nText: I18nInterface['upload'];
i18nSubscription: Subscription;
private onChange;
private onTouched;
constructor(selectFiles: SelectFiles, i18n: I18nService, element: ElementRef);
writeValue(files: any): void;
registerOnChange(fn: any): void;
registerOnTouched(fn: any): void;
simulateSelectFiles(files: any): Promise<unknown>;
onClick(): void;
_dealFiles(observale: any): void;
checkSameName(): void;
checkValid(): void;
uploadFiles(): void;
onFileSelect(files: any): void;
onDrop(event: any): void;
onDragOver(event: any): void;
onDragLeave(event: any): any;
protected _getTransfer(event: any): any;
protected _preventAndStop(event: any): any;
protected _haveFiles(types: any): any;
canUpload(): Promise<boolean>;
ngOnDestroy(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<UploadDirective, never>;
static ɵdir: i0.ɵɵDirectiveDeclaration<UploadDirective, "[dUpload]", ["dUpload"], { "uploadOptions": { "alias": "uploadOptions"; "required": false; }; "fileOptions": { "alias": "fileOptions"; "required": false; }; "uploadedFiles": { "alias": "uploadedFiles"; "required": false; }; "fileUploaders": { "alias": "fileUploaders"; "required": false; }; "enableDrop": { "alias": "enableDrop"; "required": false; }; "dynamicUploadOptionsFn": { "alias": "dynamicUploadOptionsFn"; "required": false; }; "beforeUpload": { "alias": "beforeUpload"; "required": false; }; }, { "fileOver": "fileOver"; "fileDrop": "fileDrop"; "successEvent": "successEvent"; "errorEvent": "errorEvent"; "alertMsgEvent": "alertMsgEvent"; "fileSelect": "fileSelect"; }, never, never, false, never>;
}