UNPKG

1.27 kBTypeScriptView Raw
1import * as React from 'react';
2import { AbstractCheckboxGroupProps } from '../checkbox/Group';
3import { AbstractCheckboxProps } from '../checkbox/Checkbox';
4import { SizeType } from '../config-provider/SizeContext';
5export declare type RadioGroupButtonStyle = 'outline' | 'solid';
6export declare type RadioGroupOptionType = 'default' | 'button';
7export interface RadioGroupProps extends AbstractCheckboxGroupProps {
8 defaultValue?: any;
9 value?: any;
10 onChange?: (e: RadioChangeEvent) => void;
11 size?: SizeType;
12 onMouseEnter?: React.MouseEventHandler<HTMLDivElement>;
13 onMouseLeave?: React.MouseEventHandler<HTMLDivElement>;
14 name?: string;
15 children?: React.ReactNode;
16 id?: string;
17 optionType?: RadioGroupOptionType;
18 buttonStyle?: RadioGroupButtonStyle;
19}
20export interface RadioGroupContextProps {
21 onChange: (e: RadioChangeEvent) => void;
22 value: any;
23 disabled?: boolean;
24 name?: string;
25}
26export declare type RadioProps = AbstractCheckboxProps<RadioChangeEvent>;
27export interface RadioChangeEventTarget extends RadioProps {
28 checked: boolean;
29}
30export interface RadioChangeEvent {
31 target: RadioChangeEventTarget;
32 stopPropagation: () => void;
33 preventDefault: () => void;
34 nativeEvent: MouseEvent;
35}