ant-design/components/checkbox/index.ts
Aleksei Mamaev 242769e0fb
fix: checkbox ref type (#44746)
* fix: checkbox ref

* fix: Checkbox reference type test

* fix eslint warning
2023-09-12 11:38:40 +08:00

29 lines
794 B
TypeScript

import type * as React from 'react';
import type { CheckboxRef } from 'rc-checkbox';
import type { CheckboxProps } from './Checkbox';
import InternalCheckbox from './Checkbox';
import Group from './Group';
export type { CheckboxChangeEvent, CheckboxProps } from './Checkbox';
export type { CheckboxGroupProps, CheckboxOptionType } from './Group';
export type { CheckboxRef };
type CompoundedComponent = React.ForwardRefExoticComponent<
CheckboxProps & React.RefAttributes<CheckboxRef>
> & {
Group: typeof Group;
/** @internal */
__ANT_CHECKBOX: boolean;
};
const Checkbox = InternalCheckbox as CompoundedComponent;
Checkbox.Group = Group;
Checkbox.__ANT_CHECKBOX = true;
if (process.env.NODE_ENV !== 'production') {
Checkbox.displayName = 'Checkbox';
}
export default Checkbox;