chore: fix settings component type

This commit is contained in:
Louis 2025-01-08 06:38:15 +07:00
parent d63c24851a
commit 6afec69642
No known key found for this signature in database
GPG Key ID: 44FA9F4D33C37DE2

View File

@ -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[]
}