ant-design/components/upload/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

28 lines
719 B
TypeScript

import Dragger from './Dragger';
import type { UploadProps } from './Upload';
import InternalUpload, { LIST_IGNORE } from './Upload';
export type { DraggerProps } from './Dragger';
export type {
RcFile,
UploadChangeParam,
UploadFile,
UploadListProps,
UploadProps,
} from './interface';
type InternalUploadType = typeof InternalUpload;
type CompoundedComponent<T = any> = InternalUploadType & {
<U extends T>(
props: React.PropsWithChildren<UploadProps<U>> & React.RefAttributes<any>,
): React.ReactElement;
Dragger: typeof Dragger;
LIST_IGNORE: string;
};
const Upload = InternalUpload as CompoundedComponent;
Upload.Dragger = Dragger;
Upload.LIST_IGNORE = LIST_IGNORE;
export default Upload;