mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
refactor: 移动导出类型到ts文件以通过类型检查
This commit is contained in:
parent
a7981d3974
commit
f381226346
@ -43,32 +43,7 @@ import CollapsibleContainer from './CollapsibleContainer.vue'
|
|||||||
import { addComponentListener, getComponentSettings } from '@/core/settings'
|
import { addComponentListener, getComponentSettings } from '@/core/settings'
|
||||||
import { componentsMap } from '@/components/component'
|
import { componentsMap } from '@/components/component'
|
||||||
import OptionWidgetLayout from './OptionWidgetLayout.vue'
|
import OptionWidgetLayout from './OptionWidgetLayout.vue'
|
||||||
|
import { RadioItem } from './radioItem'
|
||||||
export type RadioItem = {
|
|
||||||
/**
|
|
||||||
* 选项名称
|
|
||||||
*
|
|
||||||
* isOption为false时直接显示文本
|
|
||||||
* isOption为true时显示对应选项的displayName
|
|
||||||
*/
|
|
||||||
name: string
|
|
||||||
|
|
||||||
/** 是否为脚本设置选项 */
|
|
||||||
isOption?: boolean
|
|
||||||
|
|
||||||
/** 下拉面板中包含的选项名称,可以是名称数组或正则表达式 */
|
|
||||||
optionsIncluded?: string[] | RegExp
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否选中
|
|
||||||
*
|
|
||||||
* isOption为true时将忽略设置,自动绑定为选项状态
|
|
||||||
*/
|
|
||||||
checked?: boolean
|
|
||||||
|
|
||||||
/** 选项变化时的回调 */
|
|
||||||
onChange?: (checked: boolean) => void
|
|
||||||
}
|
|
||||||
|
|
||||||
type RadioItemVM = RadioItem & {
|
type RadioItemVM = RadioItem & {
|
||||||
/** 最终显示名称 */
|
/** 最终显示名称 */
|
||||||
|
|||||||
@ -23,7 +23,8 @@ export { default as VPopup } from '@/ui/VPopup.vue'
|
|||||||
export { default as VSlider } from '@/ui/VSlider.vue'
|
export { default as VSlider } from '@/ui/VSlider.vue'
|
||||||
export { default as DefaultWidget } from '@/ui/DefaultWidget.vue'
|
export { default as DefaultWidget } from '@/ui/DefaultWidget.vue'
|
||||||
export { default as CollapsibleContainer } from '@/ui/CollapsibleContainer.vue'
|
export { default as CollapsibleContainer } from '@/ui/CollapsibleContainer.vue'
|
||||||
export { default as OptionRadioGroup, type RadioItem } from '@/ui/OptionRadioGroup.vue'
|
export { default as OptionRadioGroup } from '@/ui/OptionRadioGroup.vue'
|
||||||
|
export { type RadioItem } from '@/ui/radioItem'
|
||||||
export { default as OptionWidgetLayout } from '@/ui/OptionWidgetLayout.vue'
|
export { default as OptionWidgetLayout } from '@/ui/OptionWidgetLayout.vue'
|
||||||
export { default as RadioGroupItem } from '@/ui/RadioGroupItem.vue'
|
export { default as RadioGroupItem } from '@/ui/RadioGroupItem.vue'
|
||||||
export { createComponentWithProps } from '@/ui/vue-component-factory'
|
export { createComponentWithProps } from '@/ui/vue-component-factory'
|
||||||
|
|||||||
25
src/ui/radioItem.ts
Normal file
25
src/ui/radioItem.ts
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
export type RadioItem = {
|
||||||
|
/**
|
||||||
|
* 选项名称
|
||||||
|
*
|
||||||
|
* isOption为false时直接显示文本
|
||||||
|
* isOption为true时显示对应选项的displayName
|
||||||
|
*/
|
||||||
|
name: string
|
||||||
|
|
||||||
|
/** 是否为脚本设置选项 */
|
||||||
|
isOption?: boolean
|
||||||
|
|
||||||
|
/** 下拉面板中包含的选项名称,可以是名称数组或正则表达式 */
|
||||||
|
optionsIncluded?: string[] | RegExp
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否选中
|
||||||
|
*
|
||||||
|
* isOption为true时将忽略设置,自动绑定为选项状态
|
||||||
|
*/
|
||||||
|
checked?: boolean
|
||||||
|
|
||||||
|
/** 选项变化时的回调 */
|
||||||
|
onChange?: (checked: boolean) => void
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user