aboutsummaryrefslogtreecommitdiffhomepage
path: root/packages/models/src/plugins/server/managers/plugin-settings-manager.model.ts
blob: b628718dda98515e07829f3b0df5ff5d570462df (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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
}