interface.d.ts 1.5 KB

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