diff options
author | lutangar <johan.dufour@gmail.com> | 2022-01-20 12:07:15 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2022-01-20 13:43:20 +0100 |
commit | d2d4a5a999746ae0f01a2ce89b844252346bab27 (patch) | |
tree | 428c6b0767c78398ce093b4969f59c3b174ed7e4 /server/lib/plugins/register-helpers.ts | |
parent | 82b9a1005cd5f5d3c338270839a24f217594b35d (diff) | |
download | PeerTube-d2d4a5a999746ae0f01a2ce89b844252346bab27.tar.gz PeerTube-d2d4a5a999746ae0f01a2ce89b844252346bab27.tar.zst PeerTube-d2d4a5a999746ae0f01a2ce89b844252346bab27.zip |
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.
Diffstat (limited to 'server/lib/plugins/register-helpers.ts')
-rw-r--r-- | server/lib/plugins/register-helpers.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/server/lib/plugins/register-helpers.ts b/server/lib/plugins/register-helpers.ts index acca9309a..d1756040a 100644 --- a/server/lib/plugins/register-helpers.ts +++ b/server/lib/plugins/register-helpers.ts | |||
@@ -17,6 +17,7 @@ import { | |||
17 | RegisterServerHookOptions, | 17 | RegisterServerHookOptions, |
18 | RegisterServerSettingOptions, | 18 | RegisterServerSettingOptions, |
19 | serverHookObject, | 19 | serverHookObject, |
20 | SettingsChangeCallback, | ||
20 | VideoPlaylistPrivacy, | 21 | VideoPlaylistPrivacy, |
21 | VideoPrivacy | 22 | VideoPrivacy |
22 | } from '@shared/models' | 23 | } from '@shared/models' |
@@ -46,7 +47,7 @@ export class RegisterHelpers { | |||
46 | private idAndPassAuths: RegisterServerAuthPassOptions[] = [] | 47 | private idAndPassAuths: RegisterServerAuthPassOptions[] = [] |
47 | private externalAuths: RegisterServerAuthExternalOptions[] = [] | 48 | private externalAuths: RegisterServerAuthExternalOptions[] = [] |
48 | 49 | ||
49 | private readonly onSettingsChangeCallbacks: ((settings: any) => Promise<any>)[] = [] | 50 | private readonly onSettingsChangeCallbacks: SettingsChangeCallback[] = [] |
50 | 51 | ||
51 | private readonly router: express.Router | 52 | private readonly router: express.Router |
52 | private readonly videoConstantManagerFactory: VideoConstantManagerFactory | 53 | private readonly videoConstantManagerFactory: VideoConstantManagerFactory |
@@ -256,7 +257,7 @@ export class RegisterHelpers { | |||
256 | 257 | ||
257 | setSetting: (name: string, value: string) => PluginModel.setSetting(this.plugin.name, this.plugin.type, name, value), | 258 | setSetting: (name: string, value: string) => PluginModel.setSetting(this.plugin.name, this.plugin.type, name, value), |
258 | 259 | ||
259 | onSettingsChange: (cb: (settings: any) => Promise<any>) => this.onSettingsChangeCallbacks.push(cb) | 260 | onSettingsChange: (cb: SettingsChangeCallback) => this.onSettingsChangeCallbacks.push(cb) |
260 | } | 261 | } |
261 | } | 262 | } |
262 | 263 | ||