Better plugin notifier typings
authorChocobozzz <me@florianbigard.com>
Wed, 15 Apr 2020 07:21:06 +0000 (09:21 +0200)
committerChocobozzz <me@florianbigard.com>
Wed, 15 Apr 2020 07:21:06 +0000 (09:21 +0200)
client/src/app/core/plugins/plugin.service.ts
client/src/types/register-client-option.model.ts
shared/__ngcc_entry_points__.json [deleted file]

index b9d55a7e49ef7fb3c5bd4786f3d2547030c298ba..aa6823060f648449a961febc00f795166e658eda 100644 (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
index 1faf13c42c494c46d5f8c1b593fce0a58ade4753..b64652a0ff8ca4bd99a6ad13c9bc9527bd214997 100644 (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>
 }
diff --git a/shared/__ngcc_entry_points__.json b/shared/__ngcc_entry_points__.json
deleted file mode 100644 (file)
index 179bdcd..0000000
+++ /dev/null
@@ -1 +0,0 @@
-{"ngccVersion":"9.1.0","configFileHash":"87c535c3ce0eac2a54c246892e0e21a1","lockFileHash":"d04bf20520f2518af162e882d32081e4","entryPointPaths":[]}
\ No newline at end of file