]>
Commit | Line | Data |
---|---|---|
1 | import { | |
2 | RegisterClientFormFieldOptions, | |
3 | RegisterClientHookOptions, | |
4 | RegisterClientSettingsScript, | |
5 | RegisterClientVideoFieldOptions, | |
6 | ServerConfig | |
7 | } from '@shared/models' | |
8 | ||
9 | export type RegisterClientOptions = { | |
10 | registerHook: (options: RegisterClientHookOptions) => void | |
11 | ||
12 | registerVideoField: (commonOptions: RegisterClientFormFieldOptions, videoFormOptions: RegisterClientVideoFieldOptions) => void | |
13 | ||
14 | registerSettingsScript: (options: RegisterClientSettingsScript) => void | |
15 | ||
16 | peertubeHelpers: RegisterClientHelpers | |
17 | } | |
18 | ||
19 | export type RegisterClientHelpers = { | |
20 | getBaseStaticRoute: () => string | |
21 | ||
22 | getBaseRouterRoute: () => string | |
23 | ||
24 | isLoggedIn: () => boolean | |
25 | ||
26 | getAuthHeader: () => { 'Authorization': string } | undefined | |
27 | ||
28 | getSettings: () => Promise<{ [ name: string ]: string }> | |
29 | ||
30 | getServerConfig: () => Promise<ServerConfig> | |
31 | ||
32 | notifier: { | |
33 | info: (text: string, title?: string, timeout?: number) => void | |
34 | error: (text: string, title?: string, timeout?: number) => void | |
35 | success: (text: string, title?: string, timeout?: number) => void | |
36 | } | |
37 | ||
38 | showModal: (input: { | |
39 | title: string | |
40 | content: string | |
41 | close?: boolean | |
42 | cancel?: { value: string, action?: () => void } | |
43 | confirm?: { value: string, action?: () => void } | |
44 | }) => void | |
45 | ||
46 | markdownRenderer: { | |
47 | textMarkdownToHTML: (textMarkdown: string) => Promise<string> | |
48 | enhancedMarkdownToHTML: (enhancedMarkdown: string) => Promise<string> | |
49 | } | |
50 | ||
51 | translate: (toTranslate: string) => Promise<string> | |
52 | } |