@solazah/solazah-runtime 0.1.148 → 0.1.149
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 +13 -1
package/package.json
CHANGED
package/types/Plugin.d.ts
CHANGED
|
@@ -15,6 +15,16 @@ export interface PluginTool {
|
|
|
15
15
|
schema: object | null;
|
|
16
16
|
timeoutMs?: number;
|
|
17
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* 宿主自身的信息,随 `plugin.info()` 一起给到插件。
|
|
20
|
+
*
|
|
21
|
+
* 有了它,插件就能对**单个能力**降级,而不必在 manifest 里声明 minHostVersion 把整个插件挡在门外:
|
|
22
|
+
* 老宿主上少一个特性、其余照常可用,好过装不上。声明下界只留给「核心功能就依赖新宿主」的情形。
|
|
23
|
+
*/
|
|
24
|
+
export interface PluginHostInfo {
|
|
25
|
+
/** 桌面端版本,如 "0.1.148"。 */
|
|
26
|
+
version: string;
|
|
27
|
+
}
|
|
18
28
|
export interface PluginToolOptions {
|
|
19
29
|
/** 宿主等待回执的上限(毫秒),给执行耗时长的工具(如跑一段脚本)用 */
|
|
20
30
|
timeoutMs?: number;
|
|
@@ -141,7 +151,9 @@ export default class Plugin {
|
|
|
141
151
|
*
|
|
142
152
|
* @returns 包含插件字段、commands 数组和 settings 键值对的对象;无法定位发起方插件时返回 undefined。
|
|
143
153
|
*/
|
|
144
|
-
info: () => Promise<any
|
|
154
|
+
info: () => Promise<(Record<string, any> & {
|
|
155
|
+
host: PluginHostInfo;
|
|
156
|
+
}) | undefined>;
|
|
145
157
|
/**
|
|
146
158
|
* 按命令名批量注销发起方插件的运行时命令,从启动器移除。
|
|
147
159
|
* 按命令名(name)和插件名(pluginName)联合匹配删除;仅删运行时命令,manifest 命令不受影响。
|