mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 02:09:37 +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
|
@ -17,6 +17,7 @@ import {
|
|||
RegisterServerHookOptions,
|
||||
RegisterServerSettingOptions,
|
||||
serverHookObject,
|
||||
SettingsChangeCallback,
|
||||
VideoPlaylistPrivacy,
|
||||
VideoPrivacy
|
||||
} from '@shared/models'
|
||||
|
@ -46,7 +47,7 @@ export class RegisterHelpers {
|
|||
private idAndPassAuths: RegisterServerAuthPassOptions[] = []
|
||||
private externalAuths: RegisterServerAuthExternalOptions[] = []
|
||||
|
||||
private readonly onSettingsChangeCallbacks: ((settings: any) => Promise<any>)[] = []
|
||||
private readonly onSettingsChangeCallbacks: SettingsChangeCallback[] = []
|
||||
|
||||
private readonly router: express.Router
|
||||
private readonly videoConstantManagerFactory: VideoConstantManagerFactory
|
||||
|
@ -256,7 +257,7 @@ export class RegisterHelpers {
|
|||
|
||||
setSetting: (name: string, value: string) => PluginModel.setSetting(this.plugin.name, this.plugin.type, name, value),
|
||||
|
||||
onSettingsChange: (cb: (settings: any) => Promise<any>) => this.onSettingsChangeCallbacks.push(cb)
|
||||
onSettingsChange: (cb: SettingsChangeCallback) => this.onSettingsChangeCallbacks.push(cb)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue