@linkdesk/contracts 0.1.31 → 0.1.32
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/linkdesk.d.ts +36 -3
- package/package.json +1 -1
package/linkdesk.d.ts
CHANGED
|
@@ -52,13 +52,15 @@ export interface LinkDeskConfigProperty {
|
|
|
52
52
|
description?: string;
|
|
53
53
|
enum?: string[];
|
|
54
54
|
enumDescriptions?: string[];
|
|
55
|
-
/** 控件提示——uiHint 优先:plugin.json 声明式控件选择(renderControl
|
|
55
|
+
/** 控件提示——uiHint 优先:plugin.json 声明式控件选择(renderControl 读它切控件)。
|
|
56
|
+
* 已知值清单见 `SettingsUiHint`(正典);**开放 string**——第三方可声明自定义 hint。 */
|
|
56
57
|
uiHint?: string;
|
|
57
58
|
/** 数值下限——uiHint 数值控件 min 校验 */
|
|
58
59
|
minimum?: number;
|
|
59
60
|
/** 数值上限——uiHint 数值控件 max 校验 */
|
|
60
61
|
maximum?: number;
|
|
61
|
-
/** 渲染提示——renderControl
|
|
62
|
+
/** 渲染提示——renderControl 第二判据(已知值见 `SettingsRenderHint`:action 操作按钮 / readonly 只读状态行
|
|
63
|
+
* / color 色块预览)。**开放 string**——未知值降级为只读展示。 */
|
|
62
64
|
renderHint?: string;
|
|
63
65
|
/** 等宽限定——仅 uiHint "fontFamily" 有意义。true/缺省 = 只列等宽族(编辑器字体);false = 全字族(UI 字体)。 */
|
|
64
66
|
monoOnly?: boolean;
|
|
@@ -323,6 +325,17 @@ export interface AppearanceAPI {
|
|
|
323
325
|
revealStorage(): Promise<void>;
|
|
324
326
|
};
|
|
325
327
|
}
|
|
328
|
+
/** 存储命名空间面——当前生效缓存目录的读数口与打开口(解析单点在主进程 storage-handlers) */
|
|
329
|
+
export interface StorageAPI {
|
|
330
|
+
storage?: {
|
|
331
|
+
/** 打开缓存目录(资源管理器窗口,非模态)——主进程解析当前生效路径,**先建目录再开**
|
|
332
|
+
* (目录缺省也建——刚装完没跑过也有得开,绝不弹"找不到");openPath 失败抛错 fail-loud */
|
|
333
|
+
revealCache(): Promise<void>;
|
|
334
|
+
/** 当前生效的缓存目录绝对路径——settings.json 的 `app.storage.cacheDir`(空/缺 = userData 默认位);
|
|
335
|
+
* 🔴 解析唯一入口(落点契约铁律 3:任何地方不存第二份路径,取不抄) */
|
|
336
|
+
cacheDir(): Promise<string>;
|
|
337
|
+
};
|
|
338
|
+
}
|
|
326
339
|
/**
|
|
327
340
|
* 跨模块共享窗口类型。core/types = 跨模块共享 type(壳目录规范:只放类型)。
|
|
328
341
|
*
|
|
@@ -2992,7 +3005,27 @@ export interface UpdateAPI {
|
|
|
2992
3005
|
* 由 15 个命名空间域接口交叉组装(interface→type intersection,
|
|
2993
3006
|
* 索引访问 LinkDeskAPI["pool"]/["configuration"] 等消费方契约不变)。
|
|
2994
3007
|
*/
|
|
2995
|
-
export type LinkDeskAPI = CommandsAPI & AppearanceAPI & TabsAPI & KeybindingsAPI & UiAPI & DataAPI & WorkspaceAPI & EditorAPI & PluginsAPI & ShellAPI & PanelAPI & SettingsAPI & FactorySlotsAPI & AppAPI & UpdateAPI;
|
|
3008
|
+
export type LinkDeskAPI = CommandsAPI & AppearanceAPI & StorageAPI & TabsAPI & KeybindingsAPI & UiAPI & DataAPI & WorkspaceAPI & EditorAPI & PluginsAPI & ShellAPI & PanelAPI & SettingsAPI & FactorySlotsAPI & AppAPI & UpdateAPI;
|
|
3009
|
+
/**
|
|
3010
|
+
* 🔥 设置控件词表**正典**(`uiHint`)——宿主声明与渲染层之间的唯一词表(判据 B)。
|
|
3011
|
+
*
|
|
3012
|
+
* 13 个值 = 设置页分发器能渲染的控件形态全集(与设置插件 `renderControl.tsx` 的 switch 逐 case 同源)。
|
|
3013
|
+
* 消费方:① 宿主 `ConfigurationRegistry.ConfigProperty`(编译期收窄 ⇒ 声明写错当场红)
|
|
3014
|
+
* ② 设置插件分发表 ③ 作者面 `plugin.schema.json` 的 description(给第三方作者看的正典表)。
|
|
3015
|
+
* ⚠️ **声明字段本身保持开放 `string`**(本文件 `LinkDeskConfigProperty.uiHint` 与作者面 schema 都是)
|
|
3016
|
+
* ——第三方自定义 hint 合法(承诺不收回);渲染器不认识的 hint ⇒ **只读展示 + title 说明**降级,
|
|
3017
|
+
* ⛔ 不再落进可编辑兜底(防裸字符串写穿值域)。
|
|
3018
|
+
* 运行时名单与类型守卫在 `@linkdesk/ui`(`SETTINGS_UI_HINTS` / `isSettingsUiHint`)——
|
|
3019
|
+
* 本契约包是**纯类型生成产物、零运行时**,只能带类型。
|
|
3020
|
+
*/
|
|
3021
|
+
export type SettingsUiHint = "themePicker" | "select" | "accentSource" | "slider" | "image" | "fontTone" | "fontFamily" | "color" | "file" | "directory" | "fontSize" | "segmented" | "stringList";
|
|
3022
|
+
/**
|
|
3023
|
+
* 设置行渲染提示正典(`renderHint`)——三值。
|
|
3024
|
+
* `readonly` 只读状态行(值来自 `statusCommand` 运行时数据源,不来自配置存储);
|
|
3025
|
+
* `action` 操作按钮(文案 = `description`,点击执行 `actionCommand`);`color` 色块预览
|
|
3026
|
+
* (壳 `app.accentColor` / `app.glassTint` 在用)。同 uiHint:声明面保持开放 `string`,未知值降级。
|
|
3027
|
+
*/
|
|
3028
|
+
export type SettingsRenderHint = "readonly" | "action" | "color";
|
|
2996
3029
|
/** 图标映射条目——字体 glyph 形态(单色/带色字体,seti 类每图标一色;codicon 即保底单色) */
|
|
2997
3030
|
export interface IconThemeGlyph {
|
|
2998
3031
|
/** CSS 类名(codicon 保底 / 自定义图标字体资产) */
|