mxcad 1.0.382 → 1.0.384

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
@@ -2,129 +2,6 @@
2
2
 
3
3
  import { AcquirePointOsnapMode, AcquirePointType, DetailedResult, DynamicInputType, McEdGetPointWorldDrawObject, MrxDbgUiPrBaseReturn, MrxDbgUiPrPoint, MxCursorType, MxDbEntity, MxDrawObject } from 'mxdraw';
4
4
 
5
- /**
6
- * 将数据进行 Base64 编码
7
- * @param str 目标数据
8
- * @return Base64 编码
9
- */
10
- export declare function b64Encode(str: string): string;
11
- /**
12
- * 将 Base64 编码的字符串解码为原始数据
13
- * @param str Base64 编码
14
- * @returns 原始数据
15
- */
16
- export declare function b64Decode(str: string): string;
17
- /**
18
- * 把字符串转成16进制格式编辑
19
- */
20
- export declare function crateHexString(str: string): string;
21
- export type FileTypes = {
22
- description?: string;
23
- accept: {
24
- [type: string]: string[];
25
- };
26
- }[];
27
- /**
28
- * 文件下载保存(另存为只支持 Chrome86 或 Edge 86 以及 Opera 72)兼容 iE10等较低版本的浏览器
29
- */
30
- export declare function saveAsFileDialog({ blob, filename, types }: {
31
- blob: Blob;
32
- filename?: string;
33
- types?: FileTypes;
34
- }): Promise<false | (FileSystemFileHandle & {
35
- createWritable: () => Promise<WritableStreamDefaultWriter<any>>;
36
- }) | undefined>;
37
- /**
38
- * 在浏览器中下载一个文件
39
- * @param blob Blob 对象,它包含了要下载的文件的数据
40
- * @param filename 将要保存的文件的文件名
41
- */
42
- export declare function downloadFile(blob: any, filename: string): void;
43
- /**
44
- * 从指定的 URL 下载文件到用户的计算机中
45
- * @param url 下载文件的 URL 地址
46
- * @param filename 将要保存的文件的文件名
47
- */
48
- export declare function downloadFileFromUrl(url: string, filename: string): void;
49
- /**
50
- * 从指定URL中获取文件json字符串
51
- * @param url 文件的 URL 地址
52
- * @returns json字符串
53
- */
54
- export declare const getJsonFromUrl: (url: string) => Promise<any>;
55
- /**
56
- * 从指定URL中获取文件
57
- * @param url 文件的 URL 地址
58
- * @returns 目标文件
59
- */
60
- export declare const getFileFromUrl: (url: string) => Promise<Response | undefined>;
61
- /** 接收输入的提示字符串
62
- * @param strId 字符串的ID 起一个符合定义的ID名称
63
- * @param str 提示字符串
64
- * */
65
- export declare function _ML_String(strId: string, str: string): string;
66
- /**
67
- * 检查一个数值是否接近于零的
68
- * @param val 数值
69
- * @returns 布尔值
70
- */
71
- export declare function IsZero(val: number): boolean;
72
- /**
73
- * 将内存中的数据发送到指定的 URL,以实现文件上传功能
74
- * @param memoryData 内存中数据的对象或者数据结构
75
- * @param url 数据将要发送到的目标 URL 地址
76
- * @param filename 上传的文件的文件名
77
- * @param retCall 回调函数
78
- * @param param 可选的额外参数,可以用来传递额外的数据或配置信息给上传函数
79
- */
80
- export declare function postMemoryFile(memoryData: any, url: string, filename: string, retCall: (code: number, message: string) => void, param?: any): void;
81
- /**
82
- * 从 IndexedDB(Indexed Database,索引数据库)中获取文件,并将其上传到指定的 URL
83
- * @param filekey 从 IndexedDB 中获取的文件的键(key)
84
- * @param url 数据将要发送到的目标 URL 地址,用于上传文件
85
- * @param retCall 回调函数
86
- * @param param 可选的额外参数,可以用来传递额外的数据或配置信息给上传函数
87
- */
88
- export declare function postEmscriptenIndexedDBFile(filekey: string, url: string, retCall: (code: number, message: string) => void, param?: any): void;
89
- export declare function createCursor(cursorSize?: number, targetFrameSize?: number, color?: string): any;
90
- export declare const MxTools: {
91
- b64Encode: typeof b64Encode;
92
- b64Decode: typeof b64Decode;
93
- saveAsFileDialog: typeof saveAsFileDialog;
94
- downloadFile: typeof downloadFile;
95
- downloadFileFromUrl: typeof downloadFileFromUrl;
96
- getJsonFromUrl: (url: string) => Promise<any>;
97
- getFileFromUrl: (url: string) => Promise<Response | undefined>;
98
- _ML_String: typeof _ML_String;
99
- IsZero: typeof IsZero;
100
- postEmscriptenIndexedDBFile: typeof postEmscriptenIndexedDBFile;
101
- postMemoryFile: typeof postMemoryFile;
102
- createCursor: typeof createCursor;
103
- };
104
- export declare class MxCanvas2Image {
105
- private $support;
106
- private downloadMime;
107
- private mydocument;
108
- constructor(in_document?: any);
109
- private scaleCanvas;
110
- private getDataURL;
111
- private saveFile;
112
- private genImage;
113
- private fixType;
114
- private encodeData;
115
- private getImageData;
116
- private makeURI;
117
- private genBitmapImage;
118
- /**
119
- * saveAsImage
120
- * @param canvasElement
121
- * @param {String} image type
122
- * @param {Number} [optional] png width
123
- * @param {Number} [optional] png height
124
- */
125
- saveAsImage(canvas: any, width: any, height: any, type: any): void;
126
- convertToImage(canvas: any, width: any, height: any, type: any): HTMLImageElement | undefined;
127
- }
128
5
  /**
129
6
  * 表示一个 Rx 对象的基类。
130
7
  */
@@ -271,6 +148,8 @@ export declare class McObjectId {
271
148
  * @param type 对象的类型。
272
149
  */
273
150
  constructor(id?: number, type?: McObjectIdType);
151
+ initFromCpp(id: number | string): void;
152
+ getValueFromCpp(): any;
274
153
  /**
275
154
  * id是否有效.
276
155
  * @returns 布尔值
@@ -2417,6 +2296,17 @@ export declare class MxCADResbuf extends McRxObject {
2417
2296
  val: McObjectId;
2418
2297
  ret: boolean;
2419
2298
  };
2299
+ /**
2300
+ * 获取 resbuf 数据项中的 ObjectId 值。
2301
+ * @param lItem 数据项索引。
2302
+ * @example
2303
+ * ```ts
2304
+ * ```
2305
+ */
2306
+ AtObjectIdValue(lItem: number): {
2307
+ val: number;
2308
+ ret: boolean;
2309
+ };
2420
2310
  /**
2421
2311
  * 获取 resbuf 数据项中的字符串。
2422
2312
  * @param lItem 数据项索引。
@@ -2517,7 +2407,7 @@ export declare class MxCADResbuf extends McRxObject {
2517
2407
  * filter.AddObjectId (objId);
2518
2408
  * ```
2519
2409
  */
2520
- AddObjectId(val: number, lDataType?: number): number;
2410
+ AddObjectId(val: number | BigInt, lDataType?: number): number;
2521
2411
  /**
2522
2412
  * 添加字符串到 resbuf 中。
2523
2413
  * @param str 字符串。
@@ -9651,8 +9541,8 @@ export declare class McDbLinetypeTableRecord extends McDbObject {
9651
9541
  * }
9652
9542
  * ```
9653
9543
  */
9654
- shapeStyleAt(index: number): number;
9655
- setShapeStyleAt(index: number, value: number): boolean;
9544
+ shapeStyleAt(index: number): McObjectId;
9545
+ setShapeStyleAt(index: number, id: McObjectId): boolean;
9656
9546
  /**
9657
9547
  * 获取或设置指定索引处的形状编号。
9658
9548
  * @param index 线型定义数组中索引。
@@ -13648,6 +13538,7 @@ export declare class McAppType {
13648
13538
  /** TrueType字体 */
13649
13539
  private trueFonts;
13650
13540
  private dMcGeBakTol;
13541
+ private iIsWasmx64;
13651
13542
  /**
13652
13543
  * 初始化 McAppType 对象。
13653
13544
  * @param imp 传入的 imp 对象。
@@ -13850,6 +13741,7 @@ export declare class McAppType {
13850
13741
  * ```
13851
13742
  */
13852
13743
  addNetworkLoadingFont(fontfiles: string | string[], fontFilesLoadOnInitialization?: string[], isAddTo?: boolean): void;
13744
+ isWasmx64(): boolean;
13853
13745
  /**
13854
13746
  * 全局参数的初始设置
13855
13747
  * @param ini 初始设置值
@@ -14160,6 +14052,13 @@ export declare class MxCppType {
14160
14052
  * ```
14161
14053
  */
14162
14054
  encodeToGb2312(str: string): string;
14055
+ /**
14056
+ * 得到cpp转过的id value
14057
+ * @example
14058
+ * ```ts
14059
+ * ```
14060
+ */
14061
+ getIdFromCpp(id: number | string): any;
14163
14062
  }
14164
14063
  /**
14165
14064
  * MxCADUI 模块提供插件程序使用的接口.
@@ -16380,7 +16279,7 @@ export declare let MxCpp: MxCppType;
16380
16279
  });
16381
16280
  * ```
16382
16281
  */
16383
- export declare function loadMxCADassembly(call?: (MxCpp: MxCppType) => void, locateFile?: (fileName: string, base?: string | URL) => string, wasmBinary?: ArrayBuffer, fontspath?: string, networkFonts?: string[], mxcad?: any): Promise<MxCppType>;
16282
+ export declare function loadMxCADassembly(call?: (MxCpp: MxCppType) => void, locateFile?: any, wasmBinary?: ArrayBuffer, fontspath?: string, networkFonts?: string[], mxcad?: any, wasmx64?: any): Promise<MxCppType>;
16384
16283
  /**
16385
16284
  * 检查浏览器类型和版本
16386
16285
  * @returns { object } ok 布尔值,表示浏览器是否符合要求 | error 如果浏览器不符合要求,则包含错误信息;否则为空字符串 | var 包含了浏览器信息的对象
@@ -16505,6 +16404,8 @@ export interface MxCadConfig {
16505
16404
  browse?: boolean | number;
16506
16405
  /**是否使用webgl1方式启动 */
16507
16406
  webgl1?: boolean;
16407
+ /**是否加载64位的wasm,默认加载32位 */
16408
+ wasmx64?: boolean;
16508
16409
  }
16509
16410
  /** 创建MxCad实例
16510
16411
  * @param config 参数配置
@@ -16566,6 +16467,131 @@ export declare function Mx_Erase(): Promise<void>;
16566
16467
  * 绘制矩形
16567
16468
  */
16568
16469
  export declare const drawRectang: () => Promise<void>;
16470
+ /**
16471
+ * 将数据进行 Base64 编码
16472
+ * @param str 目标数据
16473
+ * @return Base64 编码
16474
+ */
16475
+ export declare function b64Encode(str: string): string;
16476
+ /**
16477
+ * 将 Base64 编码的字符串解码为原始数据
16478
+ * @param str Base64 编码
16479
+ * @returns 原始数据
16480
+ */
16481
+ export declare function b64Decode(str: string): string;
16482
+ /**
16483
+ * 把字符串转成16进制格式编辑
16484
+ */
16485
+ export declare function crateHexString(str: string): string;
16486
+ export type FileTypes = {
16487
+ description?: string;
16488
+ accept: {
16489
+ [type: string]: string[];
16490
+ };
16491
+ }[];
16492
+ /**
16493
+ * 文件下载保存(另存为只支持 Chrome86 或 Edge 86 以及 Opera 72)兼容 iE10等较低版本的浏览器
16494
+ */
16495
+ export declare function saveAsFileDialog({ blob, filename, types }: {
16496
+ blob: Blob;
16497
+ filename?: string;
16498
+ types?: FileTypes;
16499
+ }): Promise<false | (FileSystemFileHandle & {
16500
+ createWritable: () => Promise<WritableStreamDefaultWriter<any>>;
16501
+ }) | undefined>;
16502
+ /**
16503
+ * 在浏览器中下载一个文件
16504
+ * @param blob Blob 对象,它包含了要下载的文件的数据
16505
+ * @param filename 将要保存的文件的文件名
16506
+ */
16507
+ export declare function downloadFile(blob: any, filename: string): void;
16508
+ /**
16509
+ * 从指定的 URL 下载文件到用户的计算机中
16510
+ * @param url 下载文件的 URL 地址
16511
+ * @param filename 将要保存的文件的文件名
16512
+ */
16513
+ export declare function downloadFileFromUrl(url: string, filename: string): void;
16514
+ /**
16515
+ * 从指定URL中获取文件json字符串
16516
+ * @param url 文件的 URL 地址
16517
+ * @returns json字符串
16518
+ */
16519
+ export declare const getJsonFromUrl: (url: string) => Promise<any>;
16520
+ /**
16521
+ * 从指定URL中获取文件
16522
+ * @param url 文件的 URL 地址
16523
+ * @returns 目标文件
16524
+ */
16525
+ export declare const getFileFromUrl: (url: string) => Promise<Response | undefined>;
16526
+ /** 接收输入的提示字符串
16527
+ * @param strId 字符串的ID 起一个符合定义的ID名称
16528
+ * @param str 提示字符串
16529
+ * */
16530
+ export declare function _ML_String(strId: string, str: string): string;
16531
+ /**
16532
+ * 检查一个数值是否接近于零的
16533
+ * @param val 数值
16534
+ * @returns 布尔值
16535
+ */
16536
+ export declare function IsZero(val: number): boolean;
16537
+ /**
16538
+ * 将内存中的数据发送到指定的 URL,以实现文件上传功能
16539
+ * @param memoryData 内存中数据的对象或者数据结构
16540
+ * @param url 数据将要发送到的目标 URL 地址
16541
+ * @param filename 上传的文件的文件名
16542
+ * @param retCall 回调函数
16543
+ * @param param 可选的额外参数,可以用来传递额外的数据或配置信息给上传函数
16544
+ */
16545
+ export declare function postMemoryFile(memoryData: any, url: string, filename: string, retCall: (code: number, message: string) => void, param?: any): void;
16546
+ /**
16547
+ * 从 IndexedDB(Indexed Database,索引数据库)中获取文件,并将其上传到指定的 URL
16548
+ * @param filekey 从 IndexedDB 中获取的文件的键(key)
16549
+ * @param url 数据将要发送到的目标 URL 地址,用于上传文件
16550
+ * @param retCall 回调函数
16551
+ * @param param 可选的额外参数,可以用来传递额外的数据或配置信息给上传函数
16552
+ */
16553
+ export declare function postEmscriptenIndexedDBFile(filekey: string, url: string, retCall: (code: number, message: string) => void, param?: any): void;
16554
+ export declare function createCursor(cursorSize?: number, targetFrameSize?: number, color?: string): any;
16555
+ export declare function createMdGeLongLongArrayFormAryId(aryId: McObjectId[]): any;
16556
+ export declare const MxTools: {
16557
+ b64Encode: typeof b64Encode;
16558
+ b64Decode: typeof b64Decode;
16559
+ saveAsFileDialog: typeof saveAsFileDialog;
16560
+ downloadFile: typeof downloadFile;
16561
+ downloadFileFromUrl: typeof downloadFileFromUrl;
16562
+ getJsonFromUrl: (url: string) => Promise<any>;
16563
+ getFileFromUrl: (url: string) => Promise<Response | undefined>;
16564
+ _ML_String: typeof _ML_String;
16565
+ IsZero: typeof IsZero;
16566
+ postEmscriptenIndexedDBFile: typeof postEmscriptenIndexedDBFile;
16567
+ postMemoryFile: typeof postMemoryFile;
16568
+ createCursor: typeof createCursor;
16569
+ createMdGeLongLongArrayFormAryId: typeof createMdGeLongLongArrayFormAryId;
16570
+ };
16571
+ export declare class MxCanvas2Image {
16572
+ private $support;
16573
+ private downloadMime;
16574
+ private mydocument;
16575
+ constructor(in_document?: any);
16576
+ private scaleCanvas;
16577
+ private getDataURL;
16578
+ private saveFile;
16579
+ private genImage;
16580
+ private fixType;
16581
+ private encodeData;
16582
+ private getImageData;
16583
+ private makeURI;
16584
+ private genBitmapImage;
16585
+ /**
16586
+ * saveAsImage
16587
+ * @param canvasElement
16588
+ * @param {String} image type
16589
+ * @param {Number} [optional] png width
16590
+ * @param {Number} [optional] png height
16591
+ */
16592
+ saveAsImage(canvas: any, width: any, height: any, type: any): void;
16593
+ convertToImage(canvas: any, width: any, height: any, type: any): HTMLImageElement | undefined;
16594
+ }
16569
16595
  export type Map = any;
16570
16596
  /**
16571
16597
  * cad地图对象