d2d4a5a999
This mainly fix the `onSettingsChange` argument typing. I'm not 100% sure the setting `value` can be a boolean though. But this is how it was typed before so I just made it consistent. Feel free to change - or suggest change - to the type names / location.
17 lines
484 B
TypeScript
17 lines
484 B
TypeScript
export type SettingValue = string | boolean
|
|
|
|
export interface SettingEntries {
|
|
[settingName: string]: SettingValue
|
|
}
|
|
|
|
export type SettingsChangeCallback = (settings: SettingEntries) => Promise<any>
|
|
|
|
export interface PluginSettingsManager {
|
|
getSetting: (name: string) => Promise<SettingValue>
|
|
|
|
getSettings: (names: string[]) => Promise<SettingEntries>
|
|
|
|
setSetting: (name: string, value: SettingValue) => Promise<any>
|
|
|
|
onSettingsChange: (cb: SettingsChangeCallback) => void
|
|
}
|