ant-design/components/checkbox/index.tsx
Dave d32a1fe274
fix(types): external module type error (CompoundedComponent) (#38666)
* fix(types): external module type error (CompoundedComponent)

* refactor(types): rename and replace internal CompoundedComponent type
2022-11-19 16:56:23 +08:00

23 lines
637 B
TypeScript

import type * as React from 'react';
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';
type CompoundedComponent = React.ForwardRefExoticComponent<
CheckboxProps & React.RefAttributes<HTMLInputElement>
> & {
Group: typeof Group;
/** @internal */
__ANT_CHECKBOX: boolean;
};
const Checkbox = InternalCheckbox as CompoundedComponent;
Checkbox.Group = Group;
Checkbox.__ANT_CHECKBOX = true;
export default Checkbox;