antd-tiny-vue/components/button/interface.ts

22 lines
773 B
TypeScript
Raw Normal View History

2023-03-25 17:16:46 +08:00
import { booleanType, someType, stringType, vNodeType } from '@v-c/utils'
import type { ExtractPropTypes } from 'vue'
import type { SizeType } from '../config-provider/context'
import type { ButtonHTMLType, ButtonShape, ButtonType } from './button-helper'
export const buttonProps = {
type: stringType<ButtonType>('default'),
icon: vNodeType(),
shape: stringType<ButtonShape>(),
size: someType<SizeType | 'default'>([String], 'default'),
disabled: booleanType(),
loading: someType<boolean | { delay?: number }>(),
prefixCls: stringType(),
rootClassName: stringType(),
ghost: booleanType(),
danger: booleanType(),
block: booleanType(),
htmlType: stringType<ButtonHTMLType>('button')
}
export type ButtonProps = ExtractPropTypes<typeof buttonProps>