import React from 'react'; import PropTypes from 'prop-types'; import { ComponentProps } from '../utils/types'; type ItemClickHandler = (data: { itemId?: string; name: string; index: number; }) => void; interface ItemPropsBase { disabled?: boolean; /** * A React ref which is set to the DOM element when the component mounts and null when it unmounts. */ elementRef?: React.Ref; /** Show the Item in an error state. */ error?: boolean; /** * The icon or thumbnail image to show before the label. * If not passed this will be generated from the filename extension. * @private */ icon?: React.ReactNode; /** A unique for this file. */ itemId?: string; /** The name is displayed on the item. */ name: string; /** @private */ index?: number; /** If the uploadPercentage is 0, the item is assumed to be queued. If the upload is complete or * not applicable, uploadPercentage must be undefined. */ uploadPercentage?: number; } type ItemProps = ComponentProps; declare function Item({ disabled, elementRef, error, icon, itemId, name, index, uploadPercentage, ...otherProps }: ItemProps): React.JSX.Element; declare namespace Item { var propTypes: { disabled: PropTypes.Requireable; elementRef: PropTypes.Requireable; error: PropTypes.Requireable; /** @private */ icon: PropTypes.Requireable; /** @private */ index: PropTypes.Requireable; itemId: PropTypes.Requireable; name: PropTypes.Validator; /** If the uploadPercentage is 0, the item is assumed to be queued. If the upload is complete or * not applicable, uploadPercentage must be undefined. */ uploadPercentage: PropTypes.Requireable; }; } export default Item; export { ItemClickHandler };