mxcad 1.0.33 → 1.0.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/mxcad.d.ts CHANGED
@@ -9,11 +9,24 @@ import { McGePoint3d } from 'mxdraw';
9
9
  export declare function fetchAndInstantiate(url: string, importObject: WebAssembly.Imports): Promise<WebAssembly.WebAssemblyInstantiatedSource>;
10
10
  export declare function b64Encode(str: string): string;
11
11
  export declare function b64Decode(str: string): string;
12
- export declare function setMcDbEntity(data: any): void;
12
+ export type FileTypes = {
13
+ description?: string;
14
+ accept: {
15
+ [type: string]: string[];
16
+ };
17
+ }[];
18
+ /** 文件下载保存(另存为只支持 Chrome86 或 Edge 86 以及 Opera 72)兼容 iE10等较低版本的浏览器 */
19
+ export declare function saveAsFileDialog({ blob, filename, types }: {
20
+ blob: Blob;
21
+ filename?: string;
22
+ types?: FileTypes;
23
+ }): Promise<void>;
24
+ export declare function downloadFile(blob: any, filename: string): void;
13
25
  export declare const MxTools: {
14
26
  b64Encode: typeof b64Encode;
15
27
  b64Decode: typeof b64Decode;
16
- setMcDbEntity: typeof setMcDbEntity;
28
+ saveAsFileDialog: typeof saveAsFileDialog;
29
+ downloadFile: typeof downloadFile;
17
30
  };
18
31
  /** 绘制文字 */
19
32
  export declare function drawText(): Promise<void>;
@@ -113,15 +126,16 @@ export declare class MdDbDatabase extends MdRxObject {
113
126
  }
114
127
  export declare class McObject {
115
128
  private imp;
129
+ static currentFileName: string;
116
130
  constructor(imp: any);
117
131
  getImp(): any;
118
132
  getMxCppImp(): any;
119
133
  updateDisplay(modelViewMatrix: number[], projectionMatrix: number[]): void;
120
134
  test(): void;
121
135
  openWebFile(sFileUrl: string): boolean;
136
+ getCurrentFileName(): string;
122
137
  saveFileToUrl(sSaveProgramUrl: string): boolean;
123
- private downloadFile;
124
- saveFile(pszFilePath: string, call?: (data: any) => void, isDownland?: boolean): boolean;
138
+ saveFile(pszFilePath?: string, call?: (data: any) => void, isDownland?: boolean, isShowSaveFileDialog?: boolean): boolean;
125
139
  GetDatabase(): MdDbDatabase;
126
140
  GetSysVarString(varName: string): string;
127
141
  SetSysVarString(varName: string, val: string): any;