settings
键和默认值来自 manifest.settings。View 只能调用 get,普通命令还可 set 和 reset。文件 hooks 接收已解析的设置快照,而非此接口。
签名、参数及返回类型从 SDK 自动生成;可选成员不保证在每个宿主和上下文中存在。
PluginSettings
Section titled “PluginSettings”PluginSettings.get
Section titled “PluginSettings.get”支持宿主: Lite Mobile
读取已声明的设置。
get(key: string): Promise<SettingValue>;| 参数 | 类型 | 必填 |
|---|---|---|
key |
string |
是 |
返回值: Promise<SettingValue>.
PluginSettings.set
Section titled “PluginSettings.set”支持宿主: Lite Mobile
从普通命令上下文写入已声明的设置。
set(key: string, value: SettingValue): Promise<void>;| 参数 | 类型 | 必填 |
|---|---|---|
key |
string |
是 |
value |
SettingValue |
是 |
返回值: Promise<void>.
PluginSettings.reset
Section titled “PluginSettings.reset”支持宿主: Lite Mobile
将设置恢复为声明的默认值。
reset(key: string): Promise<void>;| 参数 | 类型 | 必填 |
|---|---|---|
key |
string |
是 |
返回值: Promise<void>.
关联类型: SettingValue.