diff options
Diffstat (limited to 'shared')
-rw-r--r-- | shared/models/plugins/server/managers/plugin-settings-manager.model.ts | 16 | ||||
-rw-r--r-- | shared/models/plugins/server/settings/public-server.setting.ts | 4 |
2 files changed, 15 insertions, 5 deletions
diff --git a/shared/models/plugins/server/managers/plugin-settings-manager.model.ts b/shared/models/plugins/server/managers/plugin-settings-manager.model.ts index 3c28c0565..b628718dd 100644 --- a/shared/models/plugins/server/managers/plugin-settings-manager.model.ts +++ b/shared/models/plugins/server/managers/plugin-settings-manager.model.ts | |||
@@ -1,9 +1,17 @@ | |||
1 | export type SettingValue = string | boolean | ||
2 | |||
3 | export interface SettingEntries { | ||
4 | [settingName: string]: SettingValue | ||
5 | } | ||
6 | |||
7 | export type SettingsChangeCallback = (settings: SettingEntries) => Promise<any> | ||
8 | |||
1 | export interface PluginSettingsManager { | 9 | export interface PluginSettingsManager { |
2 | getSetting: (name: string) => Promise<string | boolean> | 10 | getSetting: (name: string) => Promise<SettingValue> |
3 | 11 | ||
4 | getSettings: (names: string[]) => Promise<{ [settingName: string]: string | boolean }> | 12 | getSettings: (names: string[]) => Promise<SettingEntries> |
5 | 13 | ||
6 | setSetting: (name: string, value: string) => Promise<any> | 14 | setSetting: (name: string, value: SettingValue) => Promise<any> |
7 | 15 | ||
8 | onSettingsChange: (cb: (names: string[]) => Promise<any>) => void | 16 | onSettingsChange: (cb: SettingsChangeCallback) => void |
9 | } | 17 | } |
diff --git a/shared/models/plugins/server/settings/public-server.setting.ts b/shared/models/plugins/server/settings/public-server.setting.ts index 9802c4d7d..d38e5424a 100644 --- a/shared/models/plugins/server/settings/public-server.setting.ts +++ b/shared/models/plugins/server/settings/public-server.setting.ts | |||
@@ -1,3 +1,5 @@ | |||
1 | import { SettingEntries } from '../managers/plugin-settings-manager.model' | ||
2 | |||
1 | export interface PublicServerSetting { | 3 | export interface PublicServerSetting { |
2 | publicSettings: { [ name: string ]: string } | 4 | publicSettings: SettingEntries |
3 | } | 5 | } |