UNPKG

jamis

Version:

一种支持通过JSON配置方式生成页面的组件库

55 lines (54 loc) 2.9 kB
import React from 'react'; import type { ActionObject, ApiObject, ApiString, Payload } from 'jamis-core'; import type { FileRejection } from 'react-dropzone'; import type { InputFileProps, InputFileValue, InputFileX, SchemaApi } from '../types'; interface FileState { uploading: boolean; files: Array<InputFileX | InputFileValue>; error?: string | null; } export declare function getNameFromUrl(url: string): string; export default class FileControl extends React.Component<InputFileProps, FileState> { static defaultProps: Partial<InputFileProps>; state: FileState; current: InputFileValue | InputFileX | null; resolve?: (value?: any) => void; emitValue: any; fileUploadCancelExecutors: Array<{ file: any; executor: () => void; }>; initAutoFill: boolean; static valueToFile(value: string | InputFileValue, props: InputFileProps, files?: Array<InputFileX | InputFileValue>): InputFileValue | undefined; dropzone: React.RefObject<any>; constructor(props: InputFileProps); componentDidMount(): void; componentDidUpdate(prevProps: InputFileProps): void; handleDrop(files: Array<InputFileX>): void; handleDropRejected(rejectedFiles: FileRejection[], evt: React.DragEvent<any>): void; handleClickFile(file: InputFileX | InputFileValue, e: React.MouseEvent): void; downloadTpl(e: React.MouseEvent): void; handleApi(api: SchemaApi, payload?: object): void; handleSelect(): void; startUpload(retry?: boolean): void; toggleUpload(e: React.MouseEvent<HTMLButtonElement>): void; stopUpload(): void; retry(): void; tick(): void; sendFile: (file: InputFileX, cb: (error: null | string, file?: InputFileX, obj?: InputFileValue) => void, onProgress: (progress: number) => void) => void; removeFile: (file: InputFileX | InputFileValue, index: number) => Promise<void>; clearError: () => void; onChange(changeImmediately?: boolean): Promise<void>; syncAutoFill(): void; uploadFile: (file: InputFileX, receiver: string, params: object, config: Partial<InputFileProps> | undefined, onProgress: (progress: number) => void) => Promise<Payload>; uploadBigFile(file: InputFileX, receiver: string, params: object, config: Partial<InputFileProps> | undefined, onProgress: (progress: number) => void): Promise<Payload>; _send(file: InputFileX, api: ApiObject | ApiString, data?: any, options?: object, onProgress?: (progress: number) => void, maxRetryLimit?: number): Promise<Payload>; removeFileCanelExecutor(file: any, execute?: boolean): void; validate(): any; dispatchEvent(e: string, data?: Record<string, any>): Promise<void | import("jamis-core").RendererEvent<any, any>>; doAction(action: ActionObject, data: object, throwErrors: boolean): void; render(): JSX.Element; } export declare class FileControlRenderer extends FileControl { } export {};