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