/// import { ModelAttr } from '@m-fe/react-model-viewer/dist/types/types/ModelAttr'; import { RcFile, UploadFile } from 'antd/es/upload/interface'; import { AxiosResponse } from 'axios'; import { IdentifiedFile, RunOptions } from 'ufc-apis'; import * as S from 'ufc-schema'; import { AbcFileUploaderComp, IAbcFileUploaderProps, IAbcFileUploaderState } from '../AbcFileUploader'; /** 专用的拖拽式模型上传组件 */ export interface IDraggableModelUploaderProps extends IAbcFileUploaderProps { HOST?: string; fileStores: S.FileStore[]; externalAttrs: Record; runOptions?: RunOptions; withDragger?: boolean; withAdmeshResult?: boolean; withDirectory?: boolean; hiddenWebGLViewer?: boolean; disableLoadingInfo?: boolean; /** 文件大小限制 (byte) */ maxFileSize?: number; /** 开始上传一个文件 */ onStart?: (file?: IdentifiedFile) => void; /** 一个文件上传成功时 */ onUpload?: (file: IdentifiedFile) => void; /** 一个文件上传成功&解析完成时 */ finishedFiles?: S.D3ModelFile[]; onSuccess?: (fileId: S.Id, fileUrl?: string, modelFile?: S.D3ModelFile) => void; onAllUploadFinished?: (count: number) => void; /** * 上传失败的文件 */ onFailed?: (fileNames: string[]) => void; } export interface IDraggableModelUploaderState extends IAbcFileUploaderState { fileMap: Record; tip?: string; admeshProcess?: Partial; } /** Agent 上传组件 */ export declare class DraggableModelUploaderComp extends AbcFileUploaderComp { fileNames: string[]; uploadedFileNames: string[]; error: boolean; zippedModelMap: Record; unzippedModelSet: Set; modelAttrMap: Record; static defaultProps: Partial; state: IDraggableModelUploaderState; /** * 该文件是否已经上传 * @param model * @returns */ isUploadFinished: (fileName: string) => boolean; beforeUpload: (file: UploadFile, files: RcFile[]) => boolean; handleChange: (info: { file: UploadFile; }) => Promise; onUploadFinished: (resp: AxiosResponse, uploadFile: IdentifiedFile) => Promise; /** * 仅在压缩完毕,并且缩略图生成之后才进行上传操作 */ handleUpload: ({ action, data, file, headers, withCredentials, onError, onProgress, onSuccess, }: { action: string; data: any; file: IdentifiedFile; headers?: Record; withCredentials?: boolean; onError?: (...args: any[]) => void; onProgress?: (...args: any[]) => void; onSuccess?: (...args: any[]) => void; }) => { abort(): void; }; render(): JSX.Element; } export declare const DraggableModelUploader: typeof DraggableModelUploaderComp;