import { ModelType, WebGLViewer } from '@m-fe/react-model-viewer'; import * as React from 'react'; import { RouteComponentProps } from 'react-router'; import * as S from 'ufc-schema'; export interface D3ModelPreviewProps extends RouteComponentProps { fileId: S.Id; openOrderCode?: S.Id; modelFile?: S.D3ModelFile; fileStores?: S.FileStore[]; width?: number | string; height?: number | string; modelColor?: string; backgroundColor?: string; layoutType?: 'compact' | 'loose'; allowEditThumbnail?: boolean; onLoad?: () => void; onThumbnailChange?: (fileId: S.Id, fileUrl: string, modelFile: S.D3ModelFile) => void; } export interface D3ModelPreviewState { modelFile?: S.D3ModelFile; src?: string; compressType?: 'none' | 'zlib'; type?: ModelType; innerThumbnail: string; } /** * 专门用于各种 3D 模型展示的组件 * stl/obj 文件,则使用 WebGLViewer 进行展示 * stp/step 文件,则还是仅展示缩略图,或者展示转换后的 STL 文件 * */ export declare class D3ModelPreviewComp extends React.PureComponent { static displayName: string; static defaultProps: Partial; constructor(props: D3ModelPreviewProps); componentDidCatch(e: Error): void; /** 根据 ID 加载模型文件 */ loadModelFile(fileId: S.Id): Promise; /** 处理预览出错的情况 */ onPreviewError: () => Promise; componentDidMount(): Promise; /** 判断是否为 HTTP,提示点击 */ onSrcChange(): Promise; $ref: WebGLViewer; render(): JSX.Element; } export declare const D3ModelPreview: typeof D3ModelPreviewComp;