chore(type): improve TS type definition (#49602)

This commit is contained in:
2024-06-26 12:40:11 +08:00 committed by GitHub
parent 9ce5cbcf64
commit a15fcfa1dc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4,8 +4,17 @@ import type { ConfigConsumerProps } from '.';
import { ConfigContext } from '.';
import Empty from '../empty';
type ComponentName =
| 'Table'
| 'List'
| 'Select'
| 'TreeSelect'
| 'Cascader'
| 'Transfer'
| 'Mentions';
interface EmptyProps {
componentName?: string;
componentName?: ComponentName;
}
const DefaultRenderEmpty: React.FC<EmptyProps> = (props) => {
@ -29,6 +38,6 @@ const DefaultRenderEmpty: React.FC<EmptyProps> = (props) => {
}
};
export type RenderEmptyHandler = (componentName?: string) => React.ReactNode;
export type RenderEmptyHandler = (componentName?: ComponentName) => React.ReactNode;
export default DefaultRenderEmpty;