diff --git a/antd/antd.d.ts b/antd/antd.d.ts index 96e473c54..ac23dcdc7 100644 --- a/antd/antd.d.ts +++ b/antd/antd.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Antd v0.12.8 +// Type definitions for Antd v0.12.10 // Project: http://ant.design // Definitions by: bang88 // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -11,42 +11,91 @@ declare namespace Antd { // Affix interface AffixProps extends React.Props { + /** + * 达到指定偏移量后触发 + */ offset?: number } + /** + * # Affix + * 将页面元素钉在可视范围。 + * ## 何时使用 + * 当内容区域比较长,需要滚动页面时,这部分内容对应的操作或者导航需要在滚动范围内始终展现。常用于侧边菜单和按钮组合。 + * 页面可视范围过小时,慎用此功能以免遮挡页面内容。 + */ export class Affix extends React.Component{ } // Alert interface AlertProps extends React.Props { + /** + * 必选参数,指定警告提示的样式,有四种选择`success`、`info`、`warn`、`error` + */ type: string, + /**可选参数,默认不显示关闭按钮 */ closable?: boolean, + /**可选参数,自定义关闭按钮 */ closeText?: React.ReactNode, + /**必选参数,警告提示内容 */ message: React.ReactNode, + /**可选参数,警告提示的辅助性文字介绍 */ description?: React.ReactNode, + /**可选参数,关闭时触发的回调函数 */ onClose?: Function, + /**可选参数,是否显示辅助图标 */ showIcon?: boolean } + + + /** + * # Alert + * 警告提示,展现需要关注的信息。 + + * ## 何时使用 + + * - 当某个页面需要向用户显示警告的信息时。 + * - 非浮层的静态展现形式,始终展现,不会自动消失,用户可以点击关闭。 + * */ export class Alert extends React.Component{ } // Badge + /** + * #Badge + * + * 图标右上角的圆形徽标数字。 + + * ## 何时使用 + + * 一般出现在通知图标或头像的右上角,用于显示需要处理的消息条数,通过醒目视觉形式吸引用户处理。 + * + */ export class Badge extends React.Component{ } interface BadgeProps extends React.Props { + /** 展示的数字,大于 overflowCount 时显示为 `${overflowCount}+`,为 0 时隐藏*/ count: number, + /** 展示封顶的数字值*/ overflowCount?: number, + /** 不展示数字,只有一个小红点*/ dot?: boolean } // Button interface ButtonProps extends React.Props