Better plugin notifier typings

pull/2654/head
Chocobozzz 2020-04-15 09:21:06 +02:00
parent 74c2dece42
commit f757be65b8
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
3 changed files with 10 additions and 4 deletions

View File

@ -273,7 +273,11 @@ export class PluginService implements ClientHook {
return this.authService.isLoggedIn()
},
notifier: this.notifier,
notifier: {
info: (text: string, title?: string, timeout?: number) => this.notifier.info(text, title, timeout),
error: (text: string, title?: string, timeout?: number) => this.notifier.error(text, title, timeout),
success: (text: string, title?: string, timeout?: number) => this.notifier.success(text, title, timeout)
},
translate: (value: string) => {
return this.translationsObservable

View File

@ -1,5 +1,4 @@
import { RegisterClientHookOptions } from '@shared/models/plugins/register-client-hook.model'
import { Notifier } from '@app/core'
export type RegisterClientOptions = {
registerHook: (options: RegisterClientHookOptions) => void
@ -14,7 +13,11 @@ export type RegisterClientHelpers = {
getSettings: () => Promise<{ [ name: string ]: string }>
notifier: Notifier
notifier: {
info: (text: string, title?: string, timeout?: number) => void,
error: (text: string, title?: string, timeout?: number) => void,
success: (text: string, title?: string, timeout?: number) => void
}
translate: (toTranslate: string) => Promise<string>
}

View File

@ -1 +0,0 @@
{"ngccVersion":"9.1.0","configFileHash":"87c535c3ce0eac2a54c246892e0e21a1","lockFileHash":"d04bf20520f2518af162e882d32081e4","entryPointPaths":[]}