X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Ftypes%2Fregister-client-option.model.ts;h=2c09f15a7c655acf21523ef753fc1a9fc27f3fff;hb=118626c8752bee7b05c4e0b668852e1aba2416f1;hp=7e5356a2b4fe9f35d9c2908b4bd0eb40b1b71f0f;hpb=a786d8a08bf99f339bf16808f46e160404497ae2;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/types/register-client-option.model.ts b/client/src/types/register-client-option.model.ts index 7e5356a2b..2c09f15a7 100644 --- a/client/src/types/register-client-option.model.ts +++ b/client/src/types/register-client-option.model.ts @@ -1,35 +1,53 @@ -import { RegisterClientFormFieldOptions, RegisterClientVideoFieldOptions } from '@shared/models/plugins/register-client-form-field.model' -import { RegisterClientHookOptions } from '@shared/models/plugins/register-client-hook.model' -import { ServerConfig } from '@shared/models/server' +import { + RegisterClientFormFieldOptions, + RegisterClientHookOptions, + RegisterClientRouteOptions, + RegisterClientSettingsScriptOptions, + RegisterClientVideoFieldOptions, + ServerConfig, SettingEntries +} from '@shared/models' export type RegisterClientOptions = { registerHook: (options: RegisterClientHookOptions) => void registerVideoField: (commonOptions: RegisterClientFormFieldOptions, videoFormOptions: RegisterClientVideoFieldOptions) => void + registerSettingsScript: (options: RegisterClientSettingsScriptOptions) => void + + registerClientRoute: (options: RegisterClientRouteOptions) => void + peertubeHelpers: RegisterClientHelpers } export type RegisterClientHelpers = { getBaseStaticRoute: () => string + getBaseRouterRoute: () => string + + // PeerTube >= 5.0 + getBaseWebSocketRoute: () => string + + getBasePluginClientPath: () => string + isLoggedIn: () => boolean - getSettings: () => Promise<{ [ name: string ]: string }> + getAuthHeader: () => { 'Authorization': string } | undefined + + getSettings: () => Promise getServerConfig: () => Promise notifier: { - info: (text: string, title?: string, timeout?: number) => void, - error: (text: string, title?: string, timeout?: number) => void, + 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 }, + title: string + content: string + close?: boolean + cancel?: { value: string, action?: () => void } confirm?: { value: string, action?: () => void } }) => void