]>
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 | isLoggedIn: () => boolean | |
23 | ||
24 | getSettings: () => Promise<{ [ name: string ]: string }> | |
25 | ||
26 | getServerConfig: () => Promise<ServerConfig> | |
27 | ||
28 | notifier: { | |
29 | info: (text: string, title?: string, timeout?: number) => void, | |
30 | error: (text: string, title?: string, timeout?: number) => void, | |
31 | success: (text: string, title?: string, timeout?: number) => void | |
32 | } | |
33 | ||
34 | showModal: (input: { | |
35 | title: string, | |
36 | content: string, | |
37 | close?: boolean, | |
38 | cancel?: { value: string, action?: () => void }, | |
39 | confirm?: { value: string, action?: () => void } | |
40 | }) => void | |
41 | ||
42 | markdownRenderer: { | |
43 | textMarkdownToHTML: (textMarkdown: string) => Promise<string> | |
44 | enhancedMarkdownToHTML: (enhancedMarkdown: string) => Promise<string> | |
45 | } | |
46 | ||
47 | translate: (toTranslate: string) => Promise<string> | |
48 | } |