48 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
		
		
			
		
	
	
			48 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
|   | import { Singleton } from "../Common/Singleton"; | ||
|  | import { IDirectoryProps } from "../UI/Components/SourceManage/CommonPanel"; | ||
|  | export interface IFileInfo { | ||
|  |     file_id?: string; | ||
|  |     dir_id?: string; | ||
|  |     name?: string; | ||
|  |     logo?: string; | ||
|  |     file?: string; | ||
|  |     props?: string; | ||
|  |     zip_type?: "gzip"; | ||
|  |     update_date?: string; | ||
|  |     code?: string; | ||
|  |     path?: string; | ||
|  |     pathNum?: number[]; | ||
|  | } | ||
|  | /** | ||
|  |  * File server | ||
|  |  * 保存CAD的文件服务,统一由这里经过文件的CRUD操作 | ||
|  |  */ | ||
|  | export declare class FileServer extends Singleton { | ||
|  |     currentFileInfo: { | ||
|  |         name: string; | ||
|  |         dir: IDirectoryProps; | ||
|  |     }; | ||
|  |     m_CurFileId: string; | ||
|  |     CurrentFileMd5: string; | ||
|  |     _CurrentFilePath: string; | ||
|  |     constructor(); | ||
|  |     AddNewFile(): Promise<boolean>; | ||
|  |     GetFileMD5(fid: string): Promise<string | undefined>; | ||
|  |     OpenFile(fid: string, file?: string): Promise<boolean>; | ||
|  |     ReadFileList(): Promise<IFileInfo[]>; | ||
|  |     /** | ||
|  |      * 读取文件信息,如果md5等于缓存,则直接打开,否则请求服务器并缓存文件信息 | ||
|  |      * @param fid 文件id | ||
|  |      * @param [code] md5值 | ||
|  |      * @returns | ||
|  |      */ | ||
|  |     GetFileInfo(fid: string, code?: string): Promise<IFileInfo>; | ||
|  |     CacheFileInfo(fid: string, info: IFileInfo): Promise<void>; | ||
|  |     UploadFile(fileInfo: IFileInfo, rawFile?: string): Promise<import("../Common/Request").IResponseData>; | ||
|  |     UpdateFile(fileInfo: IFileInfo, rawFile?: string): Promise<import("../Common/Request").IResponseData>; | ||
|  |     Download(fid: string): Promise<void>; | ||
|  |     DownloadTemplate(fid: string): Promise<void>; | ||
|  |     private SaveCurrentFileInfo; | ||
|  |     Clear(): void; | ||
|  | } | ||
|  | //# sourceMappingURL=FileServer.d.ts.map
 |