UNPKG

yzsd

Version:
22 lines (21 loc) 750 B
import React from 'react'; import { type Placement, type OpenConfig } from './notifications'; type OptionalConfig = Partial<OpenConfig>; export interface RootConfig { prefixCls?: string; getContainer?: () => HTMLElement; closeIcon?: React.ReactNode; closable?: boolean; maxCount?: number; duration?: number; className?: (placement: Placement) => string; style?: (placement: Placement) => React.CSSProperties; onAllRemoved?: VoidFunction; } export interface NotificationApi { open: (config: OptionalConfig) => void; close: (key: React.Key) => void; destroy: () => void; } declare const useNotification: (rootConfig?: RootConfig) => [NotificationApi, React.ReactElement]; export default useNotification;