aboutsummaryrefslogtreecommitdiffhomepage
path: root/client
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-04-15 09:21:06 +0200
committerChocobozzz <me@florianbigard.com>2020-04-15 09:21:06 +0200
commitf757be65b8dc2d3b286b5d8b22c64637d7bc2fb8 (patch)
treefb0d8e7913a685ede5673fdef8cfc8c9affbd3ef /client
parent74c2dece42d387506421623fbfadc83da811ebcd (diff)
downloadPeerTube-f757be65b8dc2d3b286b5d8b22c64637d7bc2fb8.tar.gz
PeerTube-f757be65b8dc2d3b286b5d8b22c64637d7bc2fb8.tar.zst
PeerTube-f757be65b8dc2d3b286b5d8b22c64637d7bc2fb8.zip
Better plugin notifier typings
Diffstat (limited to 'client')
-rw-r--r--client/src/app/core/plugins/plugin.service.ts6
-rw-r--r--client/src/types/register-client-option.model.ts7
2 files changed, 10 insertions, 3 deletions
diff --git a/client/src/app/core/plugins/plugin.service.ts b/client/src/app/core/plugins/plugin.service.ts
index b9d55a7e4..aa6823060 100644
--- a/client/src/app/core/plugins/plugin.service.ts
+++ b/client/src/app/core/plugins/plugin.service.ts
@@ -273,7 +273,11 @@ export class PluginService implements ClientHook {
273 return this.authService.isLoggedIn() 273 return this.authService.isLoggedIn()
274 }, 274 },
275 275
276 notifier: this.notifier, 276 notifier: {
277 info: (text: string, title?: string, timeout?: number) => this.notifier.info(text, title, timeout),
278 error: (text: string, title?: string, timeout?: number) => this.notifier.error(text, title, timeout),
279 success: (text: string, title?: string, timeout?: number) => this.notifier.success(text, title, timeout)
280 },
277 281
278 translate: (value: string) => { 282 translate: (value: string) => {
279 return this.translationsObservable 283 return this.translationsObservable
diff --git a/client/src/types/register-client-option.model.ts b/client/src/types/register-client-option.model.ts
index 1faf13c42..b64652a0f 100644
--- a/client/src/types/register-client-option.model.ts
+++ b/client/src/types/register-client-option.model.ts
@@ -1,5 +1,4 @@
1import { RegisterClientHookOptions } from '@shared/models/plugins/register-client-hook.model' 1import { RegisterClientHookOptions } from '@shared/models/plugins/register-client-hook.model'
2import { Notifier } from '@app/core'
3 2
4export type RegisterClientOptions = { 3export type RegisterClientOptions = {
5 registerHook: (options: RegisterClientHookOptions) => void 4 registerHook: (options: RegisterClientHookOptions) => void
@@ -14,7 +13,11 @@ export type RegisterClientHelpers = {
14 13
15 getSettings: () => Promise<{ [ name: string ]: string }> 14 getSettings: () => Promise<{ [ name: string ]: string }>
16 15
17 notifier: Notifier 16 notifier: {
17 info: (text: string, title?: string, timeout?: number) => void,
18 error: (text: string, title?: string, timeout?: number) => void,
19 success: (text: string, title?: string, timeout?: number) => void
20 }
18 21
19 translate: (toTranslate: string) => Promise<string> 22 translate: (toTranslate: string) => Promise<string>
20} 23}