]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/types/register-client-option.model.ts
Fix dropdown-user placement and menu-left scroll on touchscreens (#2706)
[github/Chocobozzz/PeerTube.git] / client / src / types / register-client-option.model.ts
index 473c2500f0d82e947b47702d0a97d77d444fa808..dff00e9dd93d924c4e6d98f32667dbc4bca5be79 100644 (file)
@@ -3,9 +3,34 @@ 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 }>
 
-    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
+
+  markdownRenderer: {
+    textMarkdownToHTML: (textMarkdown: string) => Promise<string>
+    enhancedMarkdownToHTML: (enhancedMarkdown: string) => Promise<string>
+  }
+
+  translate: (toTranslate: string) => Promise<string>
 }