mx3d 2025.5.27 → 2025.5.29

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/index.d.ts CHANGED
@@ -196,7 +196,7 @@ declare class Project {
196
196
  optimization(): void;
197
197
  getChildsById(_id: string, _includeSub?: boolean): Array<IBase>;
198
198
  getSceneTree(_id?: string, _excludeTypes?: Array<string>): any;
199
- findObjectById(_id: string): IBase;
199
+ findObjectById(_id: string): IObject;
200
200
  findObjectByCustomNumber(_customNumber: string): IBase;
201
201
  findObjectsByCustomType(_customType: string, queryParameters?: {
202
202
  isCurrent: boolean;
@@ -454,6 +454,7 @@ declare class Icon implements BaseNode {
454
454
  }): void;
455
455
  dispose(): void;
456
456
  isEnabled(_isEnabled: boolean): void;
457
+ setEnabled(_isEnabled: boolean): void;
457
458
  }
458
459
 
459
460
  declare class IconFromMesh implements BaseNode {
@@ -482,6 +483,47 @@ declare class IconFromMesh implements BaseNode {
482
483
  }]): Promise<unknown>;
483
484
  dispose(): void;
484
485
  isEnabled(_bool: boolean): void;
486
+ setEnabled(_bool: boolean): void;
487
+ }
488
+
489
+ declare class HtmlFromMesh {
490
+ id: string;
491
+ scene: Scene;
492
+ private instance;
493
+ private scaling;
494
+ private anchor;
495
+ private material;
496
+ /**
497
+ * @param _id 图标编号、自定义
498
+ * @param _scaling 大小
499
+ * @param _anchor 锚点坐标
500
+ * @param _scene 场景
501
+ */
502
+ constructor(_id: string, _scaling: number, _anchor: Vector3, _scene: Scene);
503
+ setContent(_html: HTMLDivElement): Promise<void>;
504
+ addEventListener(_action: Function): void;
505
+ setEnabled(_isEnabled: boolean): void;
506
+ dispose(): void;
507
+ }
508
+
509
+ declare class HtmlFromIcon {
510
+ id: string;
511
+ app: App;
512
+ private instance;
513
+ private scaling;
514
+ private anchor;
515
+ private _background;
516
+ /**
517
+ * @param _id 图标编号、自定义
518
+ * @param _scaling 大小
519
+ * @param _anchor 锚点坐标
520
+ * @param _scene 场景
521
+ */
522
+ constructor(_id: string, _scaling: number, _anchor: Vector3, _app: App);
523
+ setContent(_html: HTMLDivElement): Promise<void>;
524
+ addEventListener(_action: Function): void;
525
+ setEnabled(_isEnabled: boolean): void;
526
+ dispose(): void;
485
527
  }
486
528
 
487
529
  declare class UI {
@@ -490,6 +532,15 @@ declare class UI {
490
532
  width: number;
491
533
  height: number;
492
534
  }, _height: number): Icon;
535
+ /**
536
+ * @param _id 自定义
537
+ * @param _anchor 锚点物体,挂载到哪个模型上
538
+ * @param _scaling 大小
539
+ * @param _height 离物体中心点位置
540
+ * @returns
541
+ */
542
+ static createHtmlFromMesh(_id: string, _anchor: IObject, _scaling: number, _height: number): HtmlFromMesh;
543
+ static createHtmlFromIcon(_id: string, _anchor: IObject, _scaling: number, _height: number): HtmlFromIcon;
493
544
  }
494
545
 
495
546
  interface IEffect {
@@ -532,7 +583,7 @@ declare class RackModelEditor {
532
583
  private matBady;
533
584
  private matFont;
534
585
  private matBack;
535
- constructor(_container: HTMLCanvasElement, _spec: SpecConfig);
586
+ constructor(_container: HTMLElement, _spec: SpecConfig);
536
587
  perspective(): void;
537
588
  orthogaphic(toward?: boolean): void;
538
589
  set width(w: number);