@solazah/solazah-runtime 0.1.17 → 0.1.19
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 +1 -1
- package/types/Plugin.d.ts +25 -0
package/package.json
CHANGED
package/types/Plugin.d.ts
CHANGED
|
@@ -39,6 +39,31 @@ export default class Plugin {
|
|
|
39
39
|
* @returns 无返回。窗口不存在时静默忽略。
|
|
40
40
|
*/
|
|
41
41
|
setHeight: (height: number) => Promise<any>;
|
|
42
|
+
/**
|
|
43
|
+
* 读发起方插件窗口当前的位置与尺寸。
|
|
44
|
+
* 用 -webkit-app-region 拖动时页面收不到任何鼠标事件,窗口位置只有主进程知道 ——
|
|
45
|
+
* 挂件要把用户拖到的位置存下来,就靠它(配合 plugin.onMoved 事件按需读取)。
|
|
46
|
+
*
|
|
47
|
+
* @returns `{x, y, width, height}`;窗口不存在时返回 null
|
|
48
|
+
*/
|
|
49
|
+
getBounds: () => Promise<{
|
|
50
|
+
x: number;
|
|
51
|
+
y: number;
|
|
52
|
+
width: number;
|
|
53
|
+
height: number;
|
|
54
|
+
} | null>;
|
|
55
|
+
/**
|
|
56
|
+
* 设置发起方插件窗口的位置与尺寸,各字段可选,缺省沿用当前值。
|
|
57
|
+
* 只给 x/y 走纯移动(不动尺寸);恢复上次保存的挂件位置用它。
|
|
58
|
+
*
|
|
59
|
+
* @param bounds `{x?, y?, width?, height?}`
|
|
60
|
+
*/
|
|
61
|
+
setBounds: (bounds: {
|
|
62
|
+
x?: number;
|
|
63
|
+
y?: number;
|
|
64
|
+
width?: number;
|
|
65
|
+
height?: number;
|
|
66
|
+
}) => Promise<any>;
|
|
42
67
|
/**
|
|
43
68
|
* 把发起方插件的当前视图移入一个浮动窗口(floating)承载并显示到前台。
|
|
44
69
|
* 浮窗按插件名(带当前视图 hash)缓存复用;插件视图未加载时不做任何操作。
|