aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/models/plugins/client/register-client-form-field.model.ts
blob: 30fd632669894e3b52c63c8b7fd6281b31e655b3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
export type RegisterClientFormFieldOptions = {
  name?: string
  label?: string
  type: 'input' | 'input-checkbox' | 'input-password' | 'input-textarea' | 'markdown-text' | 'markdown-enhanced' | 'select' | 'html'

  // For select type
  options?: { value: string, label: string }[]

  // For html type
  html?: string

  descriptionHTML?: string

  // Default setting value
  default?: string | boolean

  // Not supported by plugin setting registration, use registerSettingsScript instead
  hidden?: (options: any) => boolean

  // Return undefined | null if there is no error or return a string with the detailed error
  // Not supported by plugin setting registration
  error?: (options: any) => { error: boolean, text?: string }
}

export interface RegisterClientVideoFieldOptions {
  type: 'update' | 'upload' | 'import-url' | 'import-torrent' | 'go-live'

  // Default to 'plugin-settings'
  tab?: 'main' | 'plugin-settings'
}