@8btc/whiteboard 0.0.2 → 0.0.3

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/index.d.ts CHANGED
@@ -27,9 +27,16 @@ export declare class CanvasApi extends CanvasCore {
27
27
  }): void;
28
28
  /**
29
29
  * 在当前所有节点的左下角插入图片,并将其居中显示
30
+ * 如果没有节点,插入到画布中心
30
31
  * @param imageUrl - 图片 URL
32
+ * @param options - 配置选项
33
+ * @param options.width - 图片宽度
34
+ * @param options.height - 图片高度
31
35
  */
32
- insertImageAtBottomLeft(imageUrl: string): void;
36
+ insertImageAtBottomLeft(imageUrl: string, options?: {
37
+ width?: number;
38
+ height?: number;
39
+ }): void;
33
40
  /**
34
41
  * 导出全部图形为图片
35
42
  * @param options - 导出配置
@@ -64,15 +71,18 @@ export declare class CanvasApi extends CanvasCore {
64
71
  deleteNodes(nodeIds: string[]): void;
65
72
  /**
66
73
  * 滚动到内容区域
67
- * - 如果有选中的节点,将选中节点居中显示
74
+ * - 如果提供了 nodeIds,将指定的节点居中显示
75
+ * - 如果没有提供 nodeIds 但有选中的节点,将选中节点居中显示
68
76
  * - 如果没有选中节点,将所有内容居中显示
69
77
  * @param options - 配置选项
70
78
  * @param options.padding - 内容周围的留白,默认 50px
71
79
  * @param options.scale - 是否自动调整缩放以适应内容,默认 false
80
+ * @param options.nodeIds - 要滚动到的节点 ID 数组
72
81
  */
73
82
  scrollToContent(options?: {
74
83
  padding?: number;
75
84
  scale?: boolean;
85
+ nodeIds?: string[];
76
86
  }): void;
77
87
  }
78
88