mxcad 1.0.93 → 1.0.95
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 +142 -4
- package/dist/mxcad.es.js +1640 -1486
- package/dist/mxcad.umd.js +45 -45
- package/dist/wasm/2d/mxdrawassembly_min.js +342 -342
- package/dist/wasm/2d/mxdrawassembly_min.wasm +0 -0
- package/dist/wasm/2d-st/mxdrawassembly_min.js +335 -335
- package/dist/wasm/2d-st/mxdrawassembly_minst.wasm +0 -0
- package/package.json +2 -2
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
|
*/
|
|
@@ -1458,7 +1468,7 @@ export declare class McDbPolyline extends McDbCurve {
|
|
|
1458
1468
|
* @returns val: 点, ret: 返回值
|
|
1459
1469
|
*/
|
|
1460
1470
|
getPointAt(index: number): {
|
|
1461
|
-
val:
|
|
1471
|
+
val: McGePoint3d;
|
|
1462
1472
|
ret: number;
|
|
1463
1473
|
};
|
|
1464
1474
|
/**
|
|
@@ -1525,6 +1535,11 @@ export declare class McDbBlockReference extends McDbEntity {
|
|
|
1525
1535
|
*/
|
|
1526
1536
|
get blockTransform(): McGeMatrix3d;
|
|
1527
1537
|
set blockTransform(val: McGeMatrix3d);
|
|
1538
|
+
/**
|
|
1539
|
+
* 获取块名
|
|
1540
|
+
* @returns 块名
|
|
1541
|
+
*/
|
|
1542
|
+
get blockName(): string;
|
|
1528
1543
|
}
|
|
1529
1544
|
/**
|
|
1530
1545
|
* MdDbDimension 尺寸类
|
|
@@ -2955,7 +2970,7 @@ export declare class MxCppType {
|
|
|
2955
2970
|
}
|
|
2956
2971
|
export declare let MxCpp: MxCppType;
|
|
2957
2972
|
export declare function loadMxCADassembly(call?: (MxCpp: MxCppType) => void, locateFile?: (fileName: string, base?: string | URL) => string, wasmBinary?: ArrayBuffer, fontspath?: string, networkFonts?: string[]): Promise<MxCppType>;
|
|
2958
|
-
/**
|
|
2973
|
+
/** createMxCad 的参数配置 */
|
|
2959
2974
|
export interface MxCadConfig {
|
|
2960
2975
|
/** 获取加载wasm相关文件(wasm/js/worker.js)路径位置
|
|
2961
2976
|
* @param fileName wasm相关的文件名称
|
|
@@ -3012,8 +3027,131 @@ export interface MxCadConfig {
|
|
|
3012
3027
|
/** 打开文件参数设置 */
|
|
3013
3028
|
openParameter?: object;
|
|
3014
3029
|
}
|
|
3015
|
-
/** 创建MxCad实例
|
|
3030
|
+
/** 创建MxCad实例
|
|
3031
|
+
* @example
|
|
3032
|
+
* 通过创建实例实现图纸展示以下基于vite打包工具
|
|
3033
|
+
* ```ts
|
|
3034
|
+
* createMxCad({
|
|
3035
|
+
* canvas: "#myCanvas",
|
|
3036
|
+
* locateFile: (fileName)=> new URL(`/node_modules/mxcad/dist/wasm/2d/${fileName}`, import.meta.url).href,
|
|
3037
|
+
* fileUrl: new URL("../assets/test.mxweb", import.meta.url).href
|
|
3038
|
+
* })
|
|
3039
|
+
* ```
|
|
3040
|
+
*/
|
|
3016
3041
|
export declare const createMxCad: (config?: MxCadConfig) => Promise<McObject>;
|
|
3042
|
+
/** 排除接口包含某些类型的属性名称 */
|
|
3043
|
+
export type NonPropertyNames<T, P> = {
|
|
3044
|
+
[K in keyof T]: T[K] extends P ? never : K;
|
|
3045
|
+
}[keyof T];
|
|
3046
|
+
/** 排除接口包含某些类型的属性
|
|
3047
|
+
* @param T 需要排除类型的接口
|
|
3048
|
+
* @param P 需要排除类型接口属性的类型
|
|
3049
|
+
* @example
|
|
3050
|
+
* ```ts
|
|
3051
|
+
* interface MyInterface {
|
|
3052
|
+
* name: string;
|
|
3053
|
+
* age: number;
|
|
3054
|
+
* sayHello(): void;
|
|
3055
|
+
* walk(distance: number): void;
|
|
3056
|
+
* }
|
|
3057
|
+
* ExcludePropertiesContainingThisType<MyInterface, Function>
|
|
3058
|
+
* ```
|
|
3059
|
+
*/
|
|
3060
|
+
export type ExcludePropertiesContainingThisType<T, P> = Pick<T, NonPropertyNames<T, P>>;
|
|
3061
|
+
/** 颜色方法类型 */
|
|
3062
|
+
export declare enum ColorMethod {
|
|
3063
|
+
/** 颜色随层 */
|
|
3064
|
+
kByLayer = 1,
|
|
3065
|
+
/** 颜色随块 */
|
|
3066
|
+
kByBlock = 2,
|
|
3067
|
+
/** 颜色值 */
|
|
3068
|
+
kByColor = 3,
|
|
3069
|
+
/** 颜色索引值 */
|
|
3070
|
+
kByACI = 4,
|
|
3071
|
+
kByPen = 5,
|
|
3072
|
+
kForeground = 6,
|
|
3073
|
+
kLayerOff = 7,
|
|
3074
|
+
kLayerFrozen = 8,
|
|
3075
|
+
kNone = 9
|
|
3076
|
+
}
|
|
3077
|
+
/** 颜色索引类型 */
|
|
3078
|
+
export declare enum ColorIndexType {
|
|
3079
|
+
/** 随块 */
|
|
3080
|
+
kByblock = 0,
|
|
3081
|
+
/** 红色 */
|
|
3082
|
+
kRed = 1,
|
|
3083
|
+
/** 黄色 */
|
|
3084
|
+
kYellow = 2,
|
|
3085
|
+
/** 绿色 */
|
|
3086
|
+
kGreen = 3,
|
|
3087
|
+
/** 青色 */
|
|
3088
|
+
KCyan = 4,
|
|
3089
|
+
/** 蓝色*/
|
|
3090
|
+
kBlue = 5,
|
|
3091
|
+
/** 洋红色*/
|
|
3092
|
+
kMagenta = 6,
|
|
3093
|
+
/** 白色(反色)*/
|
|
3094
|
+
kWhite = 7,
|
|
3095
|
+
/** 随层 */
|
|
3096
|
+
kBylayer = 256
|
|
3097
|
+
}
|
|
3098
|
+
export type ConstructorArguments<T> = T extends new (...args: infer U) => any ? U : never;
|
|
3099
|
+
export type McCmColorJSON = ExcludePropertiesContainingThisType<McCmColor, Function>;
|
|
3100
|
+
export type THREEColorArgs = [
|
|
3101
|
+
(string | number | THREE.Color)
|
|
3102
|
+
] | ConstructorArguments<typeof THREE.Color> | [
|
|
3103
|
+
];
|
|
3104
|
+
export type CreateColorArgs = THREEColorArgs | [
|
|
3105
|
+
(Partial<McCmColorJSON> | McCmColor)
|
|
3106
|
+
];
|
|
3107
|
+
export declare const getColorUtils: (...ages: THREEColorArgs) => THREE.Color;
|
|
3108
|
+
export declare const createMcCmColor: (...ages: CreateColorArgs) => McCmColor;
|
|
3109
|
+
export declare const setMcCmColor: (mcCmColor: McCmColor, ...ages: CreateColorArgs) => void;
|
|
3110
|
+
/** 根据McCmColor颜色 生成css颜色值 */
|
|
3111
|
+
export declare const getStyle: (mcCmColor: McCmColor | McCmColorJSON) => string;
|
|
3112
|
+
/** 对象继承 */
|
|
3113
|
+
export declare class ObjectInheritance {
|
|
3114
|
+
constructor(obj: any);
|
|
3115
|
+
}
|
|
3116
|
+
export declare const getIndexColors: () => Color[];
|
|
3117
|
+
/***
|
|
3118
|
+
* Color 颜色类
|
|
3119
|
+
* @param ages 与new THREE.Color 的参数一样 也可以是自身
|
|
3120
|
+
* @example
|
|
3121
|
+
* ```js
|
|
3122
|
+
* import { Color, ColorIndexType } from "mxcad"
|
|
3123
|
+
* new Color()
|
|
3124
|
+
* new Color("#fff")
|
|
3125
|
+
* new Color("rgb(255, 255, 255)")
|
|
3126
|
+
* new Color(255, 255, 255)
|
|
3127
|
+
* new Color(0XFFFFFF)
|
|
3128
|
+
* new Color(new Mx.MxFun.getMxFunTHREE().Color())
|
|
3129
|
+
* new Color({
|
|
3130
|
+
* colorIndex: ColorIndexType.kByblock,
|
|
3131
|
+
* })
|
|
3132
|
+
* // 获取css 颜色样式
|
|
3133
|
+
* new Color().getStyle()
|
|
3134
|
+
* ```
|
|
3135
|
+
* */
|
|
3136
|
+
export declare class Color extends ObjectInheritance {
|
|
3137
|
+
/** 全部的颜色索引 */
|
|
3138
|
+
static get indexColors(): Color[];
|
|
3139
|
+
toJSON: () => McCmColorJSON;
|
|
3140
|
+
/** 获取css样式 */
|
|
3141
|
+
getStyle: () => string;
|
|
3142
|
+
/** 设置颜色 */
|
|
3143
|
+
set: (...ages: CreateColorArgs) => this;
|
|
3144
|
+
h: number;
|
|
3145
|
+
s: number;
|
|
3146
|
+
l: number;
|
|
3147
|
+
/** 设置HSL 值 */
|
|
3148
|
+
setHSL: (h: number, s: number, l: number) => this;
|
|
3149
|
+
constructor(...ages: CreateColorArgs | [
|
|
3150
|
+
Color
|
|
3151
|
+
]);
|
|
3152
|
+
}
|
|
3153
|
+
export interface Color extends McCmColor {
|
|
3154
|
+
}
|
|
3017
3155
|
/** 绘制文字 */
|
|
3018
3156
|
export declare function drawText(): Promise<void>;
|
|
3019
3157
|
/** 绘制圆*/
|