UNPKG

@nutui/nutui-react-taro

Version:

京东风格的轻量级移动端 React 组件库,支持一套代码生成 H5 和小程序

44 lines (43 loc) 1.11 kB
import { FunctionComponent } from 'react'; import { BasicComponent } from '../../utils/typings'; export type NotifyPosition = 'top' | 'bottom'; export type NotifyType = 'primary' | 'success' | 'danger' | 'warning'; export interface NotifyProps extends BasicComponent { id?: string; /** * 展示时长(ms),值为 0 时,notify 不会消失 * @default 3000 */ duration: number /** * 提示的信息类型(primary,success ,danger,warning) * @default danger */ type: NotifyType /** * 自定义位置 (top, bottom) * @default top */ position: NotifyPosition /** * 消息框是否展示 * @default false */ visible: boolean /** * 关闭事件回调 * @default - */ onClose: () => void /** * 点击事件回调 * @default - */ onClick: () => void } export declare const Notify: FunctionComponent<Partial<NotifyProps>> & { open: typeof open; close: typeof close; }; export declare function open(selector: string): void; export declare function close(selector: string): void;