41 lines
1.3 KiB
TypeScript
41 lines
1.3 KiB
TypeScript
|
import * as React from 'react';
|
||
|
import type { CheckboxRef } from 'rc-checkbox';
|
||
|
export interface AbstractCheckboxProps<T> {
|
||
|
prefixCls?: string;
|
||
|
className?: string;
|
||
|
rootClassName?: string;
|
||
|
defaultChecked?: boolean;
|
||
|
checked?: boolean;
|
||
|
style?: React.CSSProperties;
|
||
|
disabled?: boolean;
|
||
|
title?: string;
|
||
|
onChange?: (e: T) => void;
|
||
|
onClick?: React.MouseEventHandler<HTMLElement>;
|
||
|
onMouseEnter?: React.MouseEventHandler<HTMLElement>;
|
||
|
onMouseLeave?: React.MouseEventHandler<HTMLElement>;
|
||
|
onKeyPress?: React.KeyboardEventHandler<HTMLElement>;
|
||
|
onKeyDown?: React.KeyboardEventHandler<HTMLElement>;
|
||
|
value?: any;
|
||
|
tabIndex?: number;
|
||
|
name?: string;
|
||
|
children?: React.ReactNode;
|
||
|
id?: string;
|
||
|
autoFocus?: boolean;
|
||
|
type?: string;
|
||
|
skipGroup?: boolean;
|
||
|
}
|
||
|
export interface CheckboxChangeEventTarget extends CheckboxProps {
|
||
|
checked: boolean;
|
||
|
}
|
||
|
export interface CheckboxChangeEvent {
|
||
|
target: CheckboxChangeEventTarget;
|
||
|
stopPropagation: () => void;
|
||
|
preventDefault: () => void;
|
||
|
nativeEvent: MouseEvent;
|
||
|
}
|
||
|
export interface CheckboxProps extends AbstractCheckboxProps<CheckboxChangeEvent> {
|
||
|
indeterminate?: boolean;
|
||
|
}
|
||
|
declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<CheckboxRef>>;
|
||
|
export default Checkbox;
|