]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/types/register-client-option.model.ts
Add custom modal to plugin helpers (#2631)
[github/Chocobozzz/PeerTube.git] / client / src / types / register-client-option.model.ts
index 42d689403e5c2eeff3487de35665b9e2db976a41..1c235107a37cc622b9fe35a375c51f0b5086ae84 100644 (file)
@@ -3,7 +3,29 @@ import { RegisterClientHookOptions } from '@shared/models/plugins/register-clien
 export type RegisterClientOptions = {
   registerHook: (options: RegisterClientHookOptions) => void
 
-  peertubeHelpers: {
-    getBaseStaticRoute: () => string
+  peertubeHelpers: RegisterClientHelpers
+}
+
+export type RegisterClientHelpers = {
+  getBaseStaticRoute: () => string
+
+  isLoggedIn: () => boolean
+
+  getSettings: () => Promise<{ [ name: string ]: string }>
+
+  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
   }
+
+  showModal: (input: {
+    title: string,
+    content: string,
+    close?: boolean,
+    cancel?: { value: string, action?: () => void },
+    confirm?: { value: string, action?: () => void }
+  }) => void
+
+  translate: (toTranslate: string) => Promise<string>
 }