From 7d27bedd9b36c6da0155bb8d8902b7fe029d7259 Mon Sep 17 00:00:00 2001 From: lyy <72189350+leoyongyuan@users.noreply.github.com> Date: Tue, 30 Apr 2024 21:30:58 +0800 Subject: [PATCH] docs: add more JSDoc (#48712) * docs: add more JSDoc * docs: add more JSDoc --- components/message/interface.ts | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/components/message/interface.ts b/components/message/interface.ts index 78a9bd04e4..4917025211 100644 --- a/components/message/interface.ts +++ b/components/message/interface.ts @@ -13,14 +13,34 @@ export interface ConfigOptions { } export interface ArgsProps { + /** + * @descCN 消息通知的内容,接收组件或者字符串 + * @descEN The content of the message notification, receiving component or string + */ content: React.ReactNode; + /** + * @descCN 消息通知持续显示的时间 + * @descEN How long the message notification remains displayed + */ duration?: number; + /** + * @descCN 消息通知的类型,可以是 'info'、'success'、'error'、'warning' 或 'loading' + * @descEN The type of message notification, which can be 'info', 'success', 'error', 'warning' or 'loading' + */ type?: NoticeType; + /** + * @descCN 消息通知关闭时进行调用的回调函数 + * @descEN The callback function called when the message notification is closed + */ onClose?: () => void; icon?: React.ReactNode; key?: string | number; style?: React.CSSProperties; className?: string; + /** + * @descCN 消息通知点击时的回调函数 + * @descEN Callback function when message notification is clicked + */ onClick?: (e: React.MouseEvent) => void; } @@ -32,7 +52,15 @@ export interface MessageType extends PromiseLike { export type TypeOpen = ( content: JointContent, - duration?: number | VoidFunction, // Also can use onClose directly + /** + * @descCN 消息通知持续显示的时间,也可以直接使用 onClose。 + * @descEN You can also use onClose directly to determine how long the message notification continues to be displayed. + */ + duration?: number | VoidFunction, + /** + * @descCN 消息通知关闭时进行调用的回调函数 + * @descEN The callback function called when the message notification is closed + */ onClose?: VoidFunction, ) => MessageType;