ngx-uploadx
Version:
Angular Resumable Upload Module
50 lines (49 loc) • 1.53 kB
TypeScript
import { InjectionToken } from '@angular/core';
import { Ajax } from './ajax';
import { AuthorizeRequest, UploaderOptions } from './interfaces';
import { Uploader } from './uploader';
/**
* Global Module Options
*/
export interface UploadxOptions extends UploaderOptions {
/**
* Provide a user-defined class to support another upload protocol or to extend an existing one.
* @defaultValue UploadX
*/
uploaderClass?: UploaderClass;
/**
* Set the maximum parallel uploads
* @defaultValue 2
*/
concurrency?: number;
/**
* Automatically start upload when files added
* @defaultValue true
*/
autoUpload?: boolean;
/**
* File types the user can pick from the file input
*/
allowedTypes?: string;
/**
* Add 'multiple' attribute
* @defaultValue true
*/
multiple?: boolean;
/**
* Retention time for incomplete uploads
* @defaultValue 24
*/
storeIncompleteHours?: number;
}
export interface UploadxFactoryOptions extends UploadxOptions {
endpoint: string;
autoUpload: boolean;
concurrency: number;
uploaderClass: UploaderClass;
authorize: AuthorizeRequest;
storeIncompleteHours: number;
}
export type UploaderClass = new (file: File, options: UploaderOptions, stateChange: (uploader: Uploader) => void, ajax: Ajax) => Uploader;
export declare const UPLOADX_FACTORY_OPTIONS: InjectionToken<UploadxFactoryOptions>;
export declare const UPLOADX_OPTIONS: InjectionToken<UploadxOptions>;