Skip to content

Commit eab2d1b

Browse files
new name顾洪波
new name
and
顾洪波
authored
fix(Typescript): update menubutton d.ts
* fix(Typescript): update menubutton d.ts Co-authored-by: 顾洪波 <wb-ghb226150@alibaba-inc.com>
1 parent 9d6f206 commit eab2d1b

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

types/menu-button/index.d.ts

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
/// <reference types="react" />
22

33
import * as React from 'react';
4-
import { Item, Group, Divider } from '../menu';
4+
import { Item, Group, Divider, MenuProps } from '../menu';
55
import CommonProps from '../util';
66
import { ButtonProps } from '../button';
7+
import { PopupProps } from '../overlay';
78

89
interface HTMLAttributesWeak extends ButtonProps {
910
onSelect?: any;
@@ -43,12 +44,12 @@ export interface MenuButtonProps extends HTMLAttributesWeak, CommonProps {
4344
/**
4445
* 弹层在显示和隐藏触发的事件
4546
*/
46-
onVisibleChange?: () => void;
47+
onVisibleChange?: (visible: boolean, type: string) => void;
4748

4849
/**
4950
* 弹层自定义样式
5051
*/
51-
popupStyle?: {};
52+
popupStyle?: React.CSSProperties;
5253

5354
/**
5455
* 弹层自定义样式类
@@ -58,7 +59,7 @@ export interface MenuButtonProps extends HTMLAttributesWeak, CommonProps {
5859
/**
5960
* 弹层属性透传
6061
*/
61-
popupProps?: {};
62+
popupProps?: PopupProps;
6263

6364
/**
6465
* 默认激活的菜单项(用法同 Menu 非受控)
@@ -78,17 +79,17 @@ export interface MenuButtonProps extends HTMLAttributesWeak, CommonProps {
7879
/**
7980
* 点击菜单项后的回调,同 Menu
8081
*/
81-
onItemClick?: () => void;
82+
onItemClick?: (key: string, item: {}, event: React.MouseEvent<HTMLElement>) => void;
8283

8384
/**
8485
* 选择菜单后的回调,同 Menu
8586
*/
86-
onSelect?: () => void;
87+
onSelect?: (selectedKeys: Array<any>, item: any, extra: any) => void;
8788

8889
/**
8990
* 菜单属性透传
9091
*/
91-
menuProps?: {};
92+
menuProps?: MenuProps;
9293
}
9394

9495
export default class MenuButton extends React.Component<MenuButtonProps, any> {

0 commit comments

Comments
 (0)