aboutsummaryrefslogtreecommitdiffhomepage
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
parent74c2dece42d387506421623fbfadc83da811ebcd (diff)
downloadPeerTube-f757be65b8dc2d3b286b5d8b22c64637d7bc2fb8.tar.gz
PeerTube-f757be65b8dc2d3b286b5d8b22c64637d7bc2fb8.tar.zst
PeerTube-f757be65b8dc2d3b286b5d8b22c64637d7bc2fb8.zip
Better plugin notifier typings
-rw-r--r--client/src/app/core/plugins/plugin.service.ts6
-rw-r--r--client/src/types/register-client-option.model.ts7
-rw-r--r--shared/__ngcc_entry_points__.json1
3 files changed, 10 insertions, 4 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}
diff --git a/shared/__ngcc_entry_points__.json b/shared/__ngcc_entry_points__.json
deleted file mode 100644
index 179bdcda3..000000000
--- a/shared/__ngcc_entry_points__.json
+++ /dev/null
@@ -1 +0,0 @@
1{"ngccVersion":"9.1.0","configFileHash":"87c535c3ce0eac2a54c246892e0e21a1","lockFileHash":"d04bf20520f2518af162e882d32081e4","entryPointPaths":[]} \ No newline at end of file