antd
Version:
An enterprise-class UI design language and React-based implementation
73 lines (72 loc) • 2.17 kB
TypeScript
/// <reference types="react" />
import React from 'react';
import Item from './MenuItem';
export interface SelectParam {
key: string;
keyPath: Array<string>;
item: any;
domEvent: any;
selectedKeys: Array<string>;
}
export interface ClickParam {
key: string;
keyPath: Array<string>;
item: any;
domEvent: any;
}
export interface MenuProps {
id?: string;
/** `light` `dark` */
theme?: 'light' | 'dark';
/** enum: `vertical` `horizontal` `inline` */
mode?: 'vertical' | 'horizontal' | 'inline';
selectable?: boolean;
selectedKeys?: Array<string>;
defaultSelectedKeys?: Array<string>;
openKeys?: Array<string>;
defaultOpenKeys?: Array<string>;
onOpenChange?: (openKeys: string[]) => void;
onSelect?: (param: SelectParam) => void;
onDeselect?: (param: SelectParam) => void;
onClick?: (param: ClickParam) => void;
style?: React.CSSProperties;
openAnimation?: string | Object;
openTransitionName?: string | Object;
className?: string;
prefixCls?: string;
multiple?: boolean;
inlineIndent?: number;
inlineCollapsed?: boolean;
}
export default class Menu extends React.Component<MenuProps, any> {
static Divider: any;
static Item: typeof Item;
static SubMenu: any;
static ItemGroup: any;
static defaultProps: {
prefixCls: string;
className: string;
theme: string;
};
static childContextTypes: {
inlineCollapsed: any;
};
static contextTypes: {
siderCollapsed: any;
};
switchModeFromInline: boolean;
leaveAnimationExecutedWhenInlineCollapsed: boolean;
inlineOpenKeys: never[];
constructor(props: any);
getChildContext(): {
inlineCollapsed: any;
};
componentWillReceiveProps(nextProps: any, nextContext: any): void;
handleClick: (e: any) => void;
handleOpenChange: (openKeys: string[]) => void;
setOpenKeys(openKeys: any): void;
getRealMenuMode(): "vertical" | "horizontal" | "inline" | undefined;
getInlineCollapsed(): any;
getMenuOpenAnimation(menuMode: any): string | Object | undefined;
render(): JSX.Element;
}