1
1
/// <reference types="react" />
2
2
3
3
import * as React from 'react' ;
4
- import { Item , Group , Divider } from '../menu' ;
4
+ import { Item , Group , Divider , MenuProps } from '../menu' ;
5
5
import CommonProps from '../util' ;
6
6
import { ButtonProps } from '../button' ;
7
+ import { PopupProps } from '../overlay' ;
7
8
8
9
interface HTMLAttributesWeak extends ButtonProps {
9
10
onSelect ?: any ;
@@ -43,12 +44,12 @@ export interface MenuButtonProps extends HTMLAttributesWeak, CommonProps {
43
44
/**
44
45
* 弹层在显示和隐藏触发的事件
45
46
*/
46
- onVisibleChange ?: ( ) => void ;
47
+ onVisibleChange ?: ( visible : boolean , type : string ) => void ;
47
48
48
49
/**
49
50
* 弹层自定义样式
50
51
*/
51
- popupStyle ?: { } ;
52
+ popupStyle ?: React . CSSProperties ;
52
53
53
54
/**
54
55
* 弹层自定义样式类
@@ -58,7 +59,7 @@ export interface MenuButtonProps extends HTMLAttributesWeak, CommonProps {
58
59
/**
59
60
* 弹层属性透传
60
61
*/
61
- popupProps ?: { } ;
62
+ popupProps ?: PopupProps ;
62
63
63
64
/**
64
65
* 默认激活的菜单项(用法同 Menu 非受控)
@@ -78,17 +79,17 @@ export interface MenuButtonProps extends HTMLAttributesWeak, CommonProps {
78
79
/**
79
80
* 点击菜单项后的回调,同 Menu
80
81
*/
81
- onItemClick ?: ( ) => void ;
82
+ onItemClick ?: ( key : string , item : { } , event : React . MouseEvent < HTMLElement > ) => void ;
82
83
83
84
/**
84
85
* 选择菜单后的回调,同 Menu
85
86
*/
86
- onSelect ?: ( ) => void ;
87
+ onSelect ?: ( selectedKeys : Array < any > , item : any , extra : any ) => void ;
87
88
88
89
/**
89
90
* 菜单属性透传
90
91
*/
91
- menuProps ?: { } ;
92
+ menuProps ?: MenuProps ;
92
93
}
93
94
94
95
export default class MenuButton extends React . Component < MenuButtonProps , any > {
0 commit comments