oui-kit
Version:
🎯 *UI toolkit with a French touch* 🇫🇷
13 lines (12 loc) • 715 B
TypeScript
import { OuiMenuItem } from './_types';
type OuiMenuCreator<T = any> = (value: T, ...args: any) => OuiMenuItem[];
type OuiMenuItemSource<T = any> = (OuiMenuItem | false | undefined | null)[] | OuiMenuCreator<T>;
/**
* Context menu emulation.
*
* If triggered by BUTTON it will show as a drop down, else close to the mouse position.
*/
export declare function useMenu<T = any>(itemsSource: OuiMenuItemSource<T>): (...args: any) => void;
/** Menu function where an argument can be passed, like: `const menu = useMenuWithValue(value => [...])` then in HTML `v-menu="menu(item)"` */
export declare function useMenuWithValue<T = any>(itemsSource: OuiMenuCreator<T>): (value: T) => (...args: any) => void;
export {};