import React, { ReactNode } from 'react'; import { ItemParams, InternalProps, BooleanPredicate } from '../types'; export interface ItemProps extends InternalProps, Omit, 'hidden' | 'disabled' | 'onClick'> { /** * Any valid node that can be rendered */ children: ReactNode; /** * Passed to the `Item` onClick callback. Accessible via `data` */ data?: any; /** * Disable `Item`. If a function is used, a boolean must be returned * * @param props The props passed when you called `show(e, {props: yourProps})` * @param data The data defined on the `Item` * @param triggerEvent The event that triggered the context menu * * * ``` * function isItemDisabled({ triggerEvent, props, data }: PredicateParams): boolean * content * ``` */ disabled?: BooleanPredicate; /** * Hide the `Item`. If a function is used, a boolean must be returned * * @param props The props passed when you called `show(e, {props: yourProps})` * @param data The data defined on the `Item` * @param triggerEvent The event that triggered the context menu * * * ``` * function isItemHidden({ triggerEvent, props, data }: PredicateParams): boolean * * ``` */ hidden?: BooleanPredicate; /** * Callback when the `Item` is clicked. * * @param event The event that occured on the Item node * @param props The props passed when you called `show(e, {props: yourProps})` * @param data The data defined on the `Item` * @param triggerEvent The event that triggered the context menu * * ``` * function handleItemClick({ triggerEvent, event, props, data }: ItemParams){ * // retrieve the id of the Item or any other dom attribute * const id = e.currentTarget.id; * * // access the props and the data * console.log(props, data); * * // access the coordinate of the mouse when the menu has been displayed * const { clientX, clientY } = triggerEvent; * * } * * Something * ``` */ onClick?: (args: ItemParams) => void; } export declare const Item: React.FC;