mxcad 1.0.92 → 1.0.94

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
@@ -1,6 +1,7 @@
1
1
  // Generated by dts-bundle-generator v6.13.0
2
2
 
3
3
  import { DetailedResult, DynamicInputType, McEdGetPointWorldDrawObject, MrxDbgUiPrBaseReturn, MxCursorType, MxDbEntity, MxDrawObject } from 'mxdraw';
4
+ import * as THREE from 'three';
4
5
 
5
6
  export declare function b64Encode(str: string): string;
6
7
  export declare function b64Decode(str: string): string;
@@ -689,7 +690,7 @@ export declare class MxCADUtilityClass {
689
690
  getCurrentSelect(filter?: MxCADResbuf | null): McObjectId[];
690
691
  userSelect(strPrompt?: string, filter?: MxCADResbuf | null): Promise<McObjectId[]>;
691
692
  private init;
692
- getCorner(strPrompt?: string, pt1?: McGePoint3d, detailedResult?: Function, drawSelectCroner?: boolean): Promise<{
693
+ getCorner(strPrompt?: string, pt1?: McGePoint3d, detailedResult?: Function, drawSelectCroner?: boolean, isDisableAllTrace?: boolean): Promise<{
693
694
  pt1: McGePoint3d;
694
695
  pt2: McGePoint3d;
695
696
  } | null>;
@@ -823,6 +824,15 @@ export declare class MxCADUiPrBase {
823
824
  * 是否禁用捕捉
824
825
  */
825
826
  isDisableOsnap(): boolean;
827
+ setDisableDynamicTrace(isDisable: boolean): void;
828
+ isDisableDynamicTrace(): boolean;
829
+ setDisablePolarAxisTrace(isDisable: boolean): void;
830
+ isDisablePolarAxisTrace(): boolean;
831
+ setDisableGridTrace(isDisable: boolean): void;
832
+ isDisableGridTrace(): boolean;
833
+ setDisableOrthoTrace(isDisable: boolean): void;
834
+ isDisableOrthoTrace(): boolean;
835
+ disableAllTrace(isDisable?: boolean): void;
826
836
  /**
827
837
  * 返回输入控制设置,UserInputControls
828
838
  */
@@ -1511,8 +1521,10 @@ export declare class McDbBlockReference extends McDbEntity {
1511
1521
  /**
1512
1522
  * 获取或设置该实体的缩放因子。
1513
1523
  */
1514
- get scaleFactors(): number;
1515
- set scaleFactors(val: number);
1524
+ get scaleFactors(): McGePoint3d;
1525
+ set scaleFactors(val: McGePoint3d);
1526
+ setScale(val: number): void;
1527
+ getScale(): number;
1516
1528
  /**
1517
1529
  * 获取或设置该实体的旋转角度。
1518
1530
  */
@@ -2360,6 +2372,14 @@ export declare class McObject {
2360
2372
  * @returns 是否成功打开文件
2361
2373
  */
2362
2374
  openWebFile(sFileUrl: string, retCall?: (iRet: number) => void, isWorkThread?: boolean, initialParameter?: object, fetchAttributes?: number): boolean;
2375
+ /**
2376
+ * 插件图块文件
2377
+ * @param sFileUrl 网络文件路径
2378
+ * @param sBlkName 插入的图块的块名
2379
+ * @param isWorkThread 是否使用工作线程打开文件,默认为 true
2380
+ * @param fetchAttributes 1:EMSCRIPTEN_FETCH_LOAD_TO_MEMORY,把图纸数据加载内存中,0:EMSCRIPTEN_FETCH_LOAD_TO_MEMORY | EMSCRIPTEN_FETCH_PERSIST_FILE | EMSCRIPTEN_FETCH_APPEND,把图纸数据加到IndexedDB。
2381
+ */
2382
+ InsertBlock(sFileUrl: string, sBlkName: string, isWorkThread?: boolean, fetchAttributes?: number): Promise<McObjectId>;
2363
2383
  /**
2364
2384
  * 获取当前文件名
2365
2385
  * @returns 当前文件名
@@ -2945,7 +2965,7 @@ export declare class MxCppType {
2945
2965
  }
2946
2966
  export declare let MxCpp: MxCppType;
2947
2967
  export declare function loadMxCADassembly(call?: (MxCpp: MxCppType) => void, locateFile?: (fileName: string, base?: string | URL) => string, wasmBinary?: ArrayBuffer, fontspath?: string, networkFonts?: string[]): Promise<MxCppType>;
2948
- /** MxCad配置 */
2968
+ /** createMxCad 的参数配置 */
2949
2969
  export interface MxCadConfig {
2950
2970
  /** 获取加载wasm相关文件(wasm/js/worker.js)路径位置
2951
2971
  * @param fileName wasm相关的文件名称
@@ -3002,8 +3022,131 @@ export interface MxCadConfig {
3002
3022
  /** 打开文件参数设置 */
3003
3023
  openParameter?: object;
3004
3024
  }
3005
- /** 创建MxCad实例 */
3025
+ /** 创建MxCad实例
3026
+ * @example
3027
+ * 通过创建实例实现图纸展示以下基于vite打包工具
3028
+ * ```ts
3029
+ * createMxCad({
3030
+ * canvas: "#myCanvas",
3031
+ * locateFile: (fileName)=> new URL(`/node_modules/mxcad/dist/wasm/2d/${fileName}`, import.meta.url).href,
3032
+ * fileUrl: new URL("../assets/test.mxweb", import.meta.url).href
3033
+ * })
3034
+ * ```
3035
+ */
3006
3036
  export declare const createMxCad: (config?: MxCadConfig) => Promise<McObject>;
3037
+ /** 排除接口包含某些类型的属性名称 */
3038
+ export type NonPropertyNames<T, P> = {
3039
+ [K in keyof T]: T[K] extends P ? never : K;
3040
+ }[keyof T];
3041
+ /** 排除接口包含某些类型的属性
3042
+ * @param T 需要排除类型的接口
3043
+ * @param P 需要排除类型接口属性的类型
3044
+ * @example
3045
+ * ```ts
3046
+ * interface MyInterface {
3047
+ * name: string;
3048
+ * age: number;
3049
+ * sayHello(): void;
3050
+ * walk(distance: number): void;
3051
+ * }
3052
+ * ExcludePropertiesContainingThisType<MyInterface, Function>
3053
+ * ```
3054
+ */
3055
+ export type ExcludePropertiesContainingThisType<T, P> = Pick<T, NonPropertyNames<T, P>>;
3056
+ /** 颜色方法类型 */
3057
+ export declare enum ColorMethod {
3058
+ /** 颜色随层 */
3059
+ kByLayer = 1,
3060
+ /** 颜色随块 */
3061
+ kByBlock = 2,
3062
+ /** 颜色值 */
3063
+ kByColor = 3,
3064
+ /** 颜色索引值 */
3065
+ kByACI = 4,
3066
+ kByPen = 5,
3067
+ kForeground = 6,
3068
+ kLayerOff = 7,
3069
+ kLayerFrozen = 8,
3070
+ kNone = 9
3071
+ }
3072
+ /** 颜色索引类型 */
3073
+ export declare enum ColorIndexType {
3074
+ /** 随块 */
3075
+ kByblock = 0,
3076
+ /** 红色 */
3077
+ kRed = 1,
3078
+ /** 黄色 */
3079
+ kYellow = 2,
3080
+ /** 绿色 */
3081
+ kGreen = 3,
3082
+ /** 青色 */
3083
+ KCyan = 4,
3084
+ /** 蓝色*/
3085
+ kBlue = 5,
3086
+ /** 洋红色*/
3087
+ kMagenta = 6,
3088
+ /** 白色(反色)*/
3089
+ kWhite = 7,
3090
+ /** 随层 */
3091
+ kBylayer = 256
3092
+ }
3093
+ export type ConstructorArguments<T> = T extends new (...args: infer U) => any ? U : never;
3094
+ export type McCmColorJSON = ExcludePropertiesContainingThisType<McCmColor, Function>;
3095
+ export type THREEColorArgs = [
3096
+ (string | number | THREE.Color)
3097
+ ] | ConstructorArguments<typeof THREE.Color> | [
3098
+ ];
3099
+ export type CreateColorArgs = THREEColorArgs | [
3100
+ (Partial<McCmColorJSON> | McCmColor)
3101
+ ];
3102
+ export declare const getColorUtils: (...ages: THREEColorArgs) => THREE.Color;
3103
+ export declare const createMcCmColor: (...ages: CreateColorArgs) => McCmColor;
3104
+ export declare const setMcCmColor: (mcCmColor: McCmColor, ...ages: CreateColorArgs) => void;
3105
+ /** 根据McCmColor颜色 生成css颜色值 */
3106
+ export declare const getStyle: (mcCmColor: McCmColor | McCmColorJSON) => string;
3107
+ /** 对象继承 */
3108
+ export declare class ObjectInheritance {
3109
+ constructor(obj: any);
3110
+ }
3111
+ export declare const getIndexColors: () => Color[];
3112
+ /***
3113
+ * Color 颜色类
3114
+ * @param ages 与new THREE.Color 的参数一样 也可以是自身
3115
+ * @example
3116
+ * ```js
3117
+ * import { Color, ColorIndexType } from "mxcad"
3118
+ * new Color()
3119
+ * new Color("#fff")
3120
+ * new Color("rgb(255, 255, 255)")
3121
+ * new Color(255, 255, 255)
3122
+ * new Color(0XFFFFFF)
3123
+ * new Color(new Mx.MxFun.getMxFunTHREE().Color())
3124
+ * new Color({
3125
+ * colorIndex: ColorIndexType.kByblock,
3126
+ * })
3127
+ * // 获取css 颜色样式
3128
+ * new Color().getStyle()
3129
+ * ```
3130
+ * */
3131
+ export declare class Color extends ObjectInheritance {
3132
+ /** 全部的颜色索引 */
3133
+ static get indexColors(): Color[];
3134
+ toJSON: () => McCmColorJSON;
3135
+ /** 获取css样式 */
3136
+ getStyle: () => string;
3137
+ /** 设置颜色 */
3138
+ set: (...ages: CreateColorArgs) => this;
3139
+ h: number;
3140
+ s: number;
3141
+ l: number;
3142
+ /** 设置HSL 值 */
3143
+ setHSL: (h: number, s: number, l: number) => this;
3144
+ constructor(...ages: CreateColorArgs | [
3145
+ Color
3146
+ ]);
3147
+ }
3148
+ export interface Color extends McCmColor {
3149
+ }
3007
3150
  /** 绘制文字 */
3008
3151
  export declare function drawText(): Promise<void>;
3009
3152
  /** 绘制圆*/