UNPKG

tav-ui

Version:
62 lines (61 loc) 1.34 kB
import type { CSSProperties, ExtractPropTypes, PropType } from 'vue'; export interface Axis { x: number; y: number; } export interface Fn<T = any, R = T> { (...arg: T[]): R; } export interface ContextMenuItem { label: string; icon?: string; disabled?: boolean; handler?: Fn; divider?: boolean; children?: ContextMenuItem[]; } export interface ContextMenuOptions { event: MouseEvent; icon?: string; styles?: any; items?: ContextMenuItem[]; } export interface ItemContentProps { showIcon: boolean | undefined; item: ContextMenuItem; handler: Fn; } export declare const contextMenuProps: { width: { type: NumberConstructor; default: number; }; customEvent: { type: PropType<Event>; default: null; }; styles: { type: PropType<CSSProperties>; }; showIcon: { type: BooleanConstructor; default: boolean; }; axis: { type: PropType<Axis>; default(): { x: number; y: number; }; }; items: { type: PropType<ContextMenuItem[]>; default(): { label: string; }[]; }; event: { type: PropType<MouseEvent>; }; }; export declare type ContextMenuProps = ExtractPropTypes<typeof contextMenuProps>;