chore: fix settings component type
This commit is contained in:
parent
d63c24851a
commit
6afec69642
@ -3,7 +3,11 @@ export type SettingComponentProps = {
|
||||
title: string
|
||||
description: string
|
||||
controllerType: ControllerType
|
||||
controllerProps: SliderComponentProps | CheckboxComponentProps | InputComponentProps
|
||||
controllerProps:
|
||||
| SliderComponentProps
|
||||
| CheckboxComponentProps
|
||||
| InputComponentProps
|
||||
| DropdownComponentProps
|
||||
|
||||
extensionName?: string
|
||||
requireModelReload?: boolean
|
||||
@ -12,13 +16,26 @@ export type SettingComponentProps = {
|
||||
|
||||
export type ConfigType = 'runtime' | 'setting'
|
||||
|
||||
export type ControllerType = 'slider' | 'checkbox' | 'input' | 'tag'
|
||||
export type ControllerType =
|
||||
| 'slider'
|
||||
| 'checkbox'
|
||||
| 'input'
|
||||
| 'tag'
|
||||
| 'dropdown'
|
||||
|
||||
export type InputType = 'password' | 'text' | 'email' | 'number' | 'tel' | 'url'
|
||||
export type InputType =
|
||||
| 'password'
|
||||
| 'text'
|
||||
| 'email'
|
||||
| 'number'
|
||||
| 'tel'
|
||||
| 'url'
|
||||
| 'dropdown'
|
||||
|
||||
const InputActions = ['unobscure', 'copy'] as const
|
||||
export type InputActionsTuple = typeof InputActions
|
||||
export type InputAction = InputActionsTuple[number]
|
||||
export type DropdownOption = { label: string; value: string }
|
||||
|
||||
export type InputComponentProps = {
|
||||
placeholder: string
|
||||
@ -38,3 +55,9 @@ export type SliderComponentProps = {
|
||||
export type CheckboxComponentProps = {
|
||||
value: boolean
|
||||
}
|
||||
|
||||
export type DropdownComponentProps = {
|
||||
value: string
|
||||
type?: InputType
|
||||
options?: DropdownOption[]
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user