跳转到内容

settings

键和默认值来自 manifest.settings。View 只能调用 get,普通命令还可 set 和 reset。文件 hooks 接收已解析的设置快照,而非此接口。

使用指南: services. API 索引.

签名、参数及返回类型从 SDK 自动生成;可选成员不保证在每个宿主和上下文中存在。

源码

支持宿主: Lite Mobile

读取已声明的设置。

get(key: string): Promise<SettingValue>;
参数 类型 必填
key string 是

返回值: Promise<SettingValue>.

支持宿主: Lite Mobile

从普通命令上下文写入已声明的设置。

set(key: string, value: SettingValue): Promise<void>;
参数 类型 必填
key string 是
value SettingValue 是

返回值: Promise<void>.

支持宿主: Lite Mobile

将设置恢复为声明的默认值。

reset(key: string): Promise<void>;
参数 类型 必填
key string 是

返回值: Promise<void>.

关联类型: SettingValue.