]>
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 | getBasePluginClientPath: () => string | |
28 | ||
29 | isLoggedIn: () => boolean | |
30 | ||
31 | getAuthHeader: () => { 'Authorization': string } | undefined | |
32 | ||
33 | getSettings: () => Promise<SettingEntries> | |
34 | ||
35 | getServerConfig: () => Promise<ServerConfig> | |
36 | ||
37 | notifier: { | |
38 | info: (text: string, title?: string, timeout?: number) => void | |
39 | error: (text: string, title?: string, timeout?: number) => void | |
40 | success: (text: string, title?: string, timeout?: number) => void | |
41 | } | |
42 | ||
43 | showModal: (input: { | |
44 | title: string | |
45 | content: string | |
46 | close?: boolean | |
47 | cancel?: { value: string, action?: () => void } | |
48 | confirm?: { value: string, action?: () => void } | |
49 | }) => void | |
50 | ||
51 | markdownRenderer: { | |
52 | textMarkdownToHTML: (textMarkdown: string) => Promise<string> | |
53 | enhancedMarkdownToHTML: (enhancedMarkdown: string) => Promise<string> | |
54 | } | |
55 | ||
56 | translate: (toTranslate: string) => Promise<string> | |
57 | } |