mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 10:49:28 +02:00
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.
This commit is contained in:
parent
82b9a1005c
commit
d2d4a5a999
5 changed files with 27 additions and 16 deletions
|
@ -1,9 +1,17 @@
|
|||
export interface PluginSettingsManager {
|
||||
getSetting: (name: string) => Promise<string | boolean>
|
||||
export type SettingValue = string | boolean
|
||||
|
||||
getSettings: (names: string[]) => Promise<{ [settingName: string]: string | boolean }>
|
||||
|
||||
setSetting: (name: string, value: string) => Promise<any>
|
||||
|
||||
onSettingsChange: (cb: (names: string[]) => Promise<any>) => void
|
||||
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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue