ant-design-vue/components/radio/interface.ts

32 lines
812 B
TypeScript
Raw Normal View History

2021-06-26 01:35:40 +00:00
import type { RadioProps } from './Radio';
import type { Ref } from 'vue';
2020-10-20 08:58:08 +00:00
export interface RadioChangeEventTarget extends RadioProps {
checked: boolean;
}
export type RadioGroupButtonStyle = 'outline' | 'solid';
export type RadioGroupOptionType = 'default' | 'button';
2020-10-20 08:58:08 +00:00
export interface RadioChangeEvent {
target: RadioChangeEventTarget;
stopPropagation: () => void;
preventDefault: () => void;
nativeEvent: MouseEvent;
}
export interface RadioGroupContext {
2022-05-21 08:29:11 +00:00
onChange: (e: RadioChangeEvent) => void;
value: Ref<any>;
disabled: Ref<boolean>;
name: Ref<string>;
/**
* Control the appearance for Radio to display as button or not
*
* @default 'default'
* @internal
*/
optionType?: Ref<RadioGroupOptionType>;
}
2022-05-21 08:29:11 +00:00
export type RadioOptionTypeContextProps = RadioGroupOptionType;