import * as React from "react"; import type { NotificationType, NotificationOptions } from "./types"; export interface UseNotificationOptions { /** * 多久后关闭 Notification 组件,默认为 3000。单位为毫秒ms * 如果为 `null`,将不会自动关闭 * * @default 5000 ( = 5000ms ) */ duration?: NotificationOptions["duration"]; /** * 标题 */ title?: React.ReactNode; /** * 内容或描述,可用 children 代替 */ content?: React.ReactNode; /** * 页脚,可用来添加按钮 */ footer?: React.ReactNode; /** * 是否显示 关闭按钮 * * @default true */ closable?: boolean; /** * 自定义关闭按钮的 icon */ closeIcon?: React.ReactNode; /** * 类型 */ type?: NotificationType; /** * 是否展示 */ className?: string; /** * 关闭时的回调 */ onClose?: (key?: React.Key) => void; /** * 关闭后的回调 */ onCloseComplete?: () => void; /** * 是否展示 Notification */ show?: boolean; /** * The `id` of the notification. * * Mostly used when you need to prevent duplicate. * By default, we generate a unique `id` for each notification */ id?: React.Key; } export declare type INotification = UseNotificationOptions; export declare type CreateStandAloneNotificationParam = Partial; export declare const defaultStandaloneParam: CreateStandAloneNotificationParam; /** * Create a notification from outside of React Components */ export declare function createStandaloneNotification(defaultOptions?: CreateStandAloneNotificationParam): { (options?: UseNotificationOptions): React.Key; close: (id: React.Key) => void; closeAll: () => void; update(id: React.Key, options: Omit): void; isActive: (id: React.Key) => boolean; notify(content: React.ReactNode, props?: UseNotificationOptions): React.Key; success(content: React.ReactNode, props?: UseNotificationOptions): React.Key; error(content: React.ReactNode, props?: UseNotificationOptions): React.Key; processing(content: React.ReactNode, props?: UseNotificationOptions): React.Key; warn(content: React.ReactNode, props?: UseNotificationOptions): React.Key; }; /** * React hook used to create a function that can be used * to show notifications in an application. */ export declare function useNotification(options?: UseNotificationOptions): { (options?: UseNotificationOptions): React.Key; close: (id: React.Key) => void; closeAll: () => void; update(id: React.Key, options: Omit): void; isActive: (id: React.Key) => boolean; notify(content: React.ReactNode, props?: UseNotificationOptions): React.Key; success(content: React.ReactNode, props?: UseNotificationOptions): React.Key; error(content: React.ReactNode, props?: UseNotificationOptions): React.Key; processing(content: React.ReactNode, props?: UseNotificationOptions): React.Key; warn(content: React.ReactNode, props?: UseNotificationOptions): React.Key; }; export default useNotification;