ms-types 0.4.19 → 0.4.21

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ms-types",
3
- "version": "0.4.19",
3
+ "version": "0.4.21",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
package/types/draw.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * 绘制模块 包含绘制操作等功能
2
+ * 绘图模块 包含绘制操作等功能
3
3
  */
4
4
  declare namespace draw {
5
5
  /**
@@ -20,7 +20,7 @@ declare namespace draw {
20
20
  ex: number,
21
21
  ey: number,
22
22
  lineWidth?: number,
23
- color?: string
23
+ color?: string,
24
24
  ): string;
25
25
 
26
26
  /**
@@ -39,7 +39,7 @@ declare namespace draw {
39
39
  y: number,
40
40
  radius: number,
41
41
  lineWidth?: number,
42
- color?: string
42
+ color?: string,
43
43
  ): string;
44
44
 
45
45
  /**
@@ -64,7 +64,7 @@ declare namespace draw {
64
64
  ey: number,
65
65
  fontSize?: number,
66
66
  color?: string,
67
- bgColor?: string
67
+ bgColor?: string,
68
68
  ): string;
69
69
 
70
70
  /**
@@ -76,9 +76,23 @@ declare namespace draw {
76
76
  function clear(id?: string): void;
77
77
 
78
78
  /**
79
- * 关闭悬浮窗并清除绘制模块
79
+ * 关闭绘制层并清除绘图模块
80
80
  * @example
81
81
  * draw.close();
82
82
  */
83
83
  function close(): void;
84
+
85
+ /**
86
+ * 显示绘制层
87
+ * @example
88
+ * draw.show();
89
+ */
90
+ function show(): void;
91
+
92
+ /**
93
+ * 隐藏绘制层
94
+ * @example
95
+ * draw.hide();
96
+ */
97
+ function hide(): void;
84
98
  }
@@ -1,5 +1,6 @@
1
1
  /// <reference path="动作模块.d.ts" />
2
2
  /// <reference path="工具模块.d.ts" />
3
+ /// <reference path="绘图模块.d.ts" />
3
4
  /// <reference path="节点模块.d.ts" />
4
5
  /// <reference path="卡密模块.d.ts" />
5
6
  /// <reference path="媒体模块.d.ts" />
@@ -0,0 +1,98 @@
1
+ /**
2
+ * 绘图模块 包含绘制操作等功能
3
+ */
4
+ declare namespace $绘图模块 {
5
+ /**
6
+ * 绘制矩形
7
+ * @param x 矩形左上角x坐标
8
+ * @param y 矩形左上角y坐标
9
+ * @param ex 矩形右下角x坐标
10
+ * @param ey 矩形右下角y坐标
11
+ * @param lineWidth 线宽 默认1
12
+ * @param color 颜色 默认#000000 支持#RRGGBB、#AARRGGBB、rgb(r,g,b)、rgba(r,g,b,a)格式
13
+ * @returns 绘制的矩形ID
14
+ * @example
15
+ * $绘图模块.绘制矩形(0, 0, 100, 100);
16
+ */
17
+ function 绘制矩形(
18
+ x: number,
19
+ y: number,
20
+ ex: number,
21
+ ey: number,
22
+ lineWidth?: number,
23
+ color?: string,
24
+ ): string;
25
+
26
+ /**
27
+ * 绘制圆
28
+ * @param x 圆中心x坐标
29
+ * @param y 圆中心y坐标
30
+ * @param radius 圆半径
31
+ * @param lineWidth 线宽 默认1
32
+ * @param color 颜色 默认#000000 支持#RRGGBB、#AARRGGBB、rgb(r,g,b)、rgba(r,g,b,a)格式
33
+ * @returns 绘制的圆ID
34
+ * @example
35
+ * $绘图模块.绘制圆形(50, 50, 25);
36
+ */
37
+ function 绘制圆形(
38
+ x: number,
39
+ y: number,
40
+ radius: number,
41
+ lineWidth?: number,
42
+ color?: string,
43
+ ): string;
44
+
45
+ /**
46
+ * 绘制文本
47
+ * @param text 文本内容
48
+ * @param x 文本左上角x坐标
49
+ * @param y 文本左上角y坐标
50
+ * @param ex 文本右下角x坐标
51
+ * @param ey 文本右下角y坐标
52
+ * @param fontSize 字体大小 默认12
53
+ * @param color 颜色 默认#000000 支持#RRGGBB、#AARRGGBB、rgb(r,g,b)、rgba(r,g,b,a)格式
54
+ * @param bgColor 背景颜色 默认透明 支持#RRGGBB、#AARRGGBB、rgb(r,g,b)、rgba(r,g,b,a)格式
55
+ * @returns 绘制的文本ID
56
+ * @example
57
+ * $绘图模块.绘制文字("Hello, World!", 0, 0, 100, 100);
58
+ */
59
+ function 绘制文字(
60
+ text: string,
61
+ x: number,
62
+ y: number,
63
+ ex: number,
64
+ ey: number,
65
+ fontSize?: number,
66
+ color?: string,
67
+ bgColor?: string,
68
+ ): string;
69
+
70
+ /**
71
+ * 清除绘制的内容
72
+ * @param id 绘制的内容ID , 不传清除所有绘制内容,传ID清除指定绘制内容
73
+ * @example
74
+ * $绘图模块.清除("rect1");
75
+ */
76
+ function 清除(id?: string): void;
77
+
78
+ /**
79
+ * 关闭绘制层并清除绘图模块
80
+ * @example
81
+ * $绘图模块.关闭绘制();
82
+ */
83
+ function 关闭绘制(): void;
84
+
85
+ /**
86
+ * 显示绘制层
87
+ * @example
88
+ * $绘图模块.显示绘制();
89
+ */
90
+ function 显示绘制(): void;
91
+
92
+ /**
93
+ * 隐藏绘制层
94
+ * @example
95
+ * $绘图模块.隐藏绘制();
96
+ */
97
+ function 隐藏绘制(): void;
98
+ }