type: update unknow with UploadListRef (#43054)

This commit is contained in:
lijianan 2023-06-16 18:34:25 +08:00 committed by GitHub
parent 0dcd6e8c22
commit 3b0352178d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,17 +6,22 @@ import classNames from 'classnames';
import type { CSSMotionListProps } from 'rc-motion';
import CSSMotion, { CSSMotionList } from 'rc-motion';
import * as React from 'react';
import type { ButtonProps } from '../../button';
import Button from '../../button';
import { ConfigContext } from '../../config-provider';
import useForceUpdate from '../../_util/hooks/useForceUpdate';
import initCollapseMotion from '../../_util/motion';
import { cloneElement, isValidElement } from '../../_util/reactNode';
import type { ButtonProps } from '../../button';
import Button from '../../button';
import { ConfigContext } from '../../config-provider';
import type { InternalUploadFile, UploadFile, UploadListProps } from '../interface';
import { isImageUrl, previewImage } from '../utils';
import ListItem from './ListItem';
const InternalUploadList: React.ForwardRefRenderFunction<unknown, UploadListProps> = (
interface UploadListRef {
handlePreview: (file: UploadFile, e?: React.SyntheticEvent<HTMLElement>) => void;
handleDownload: (file: UploadFile) => void;
}
const InternalUploadList: React.ForwardRefRenderFunction<UploadListRef, UploadListProps> = (
props,
ref,
) => {
@ -254,7 +259,7 @@ const InternalUploadList: React.ForwardRefRenderFunction<unknown, UploadListProp
);
};
const UploadList = React.forwardRef<unknown, UploadListProps>(InternalUploadList);
const UploadList = React.forwardRef<UploadListRef, UploadListProps>(InternalUploadList);
if (process.env.NODE_ENV !== 'production') {
UploadList.displayName = 'UploadList';