1
0
Fork 0
peertube/shared/models/plugins/server/managers/plugin-settings-manager.model.ts
lutangar d2d4a5a999 Fix plugin settings manager definition
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.
2022-01-20 13:43:20 +01:00

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
}