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