UNPKG

1.02 kBTypeScriptView Raw
1import * as React from 'react';
2import type { CSSMotionProps } from 'rc-motion';
3import type { NoticeConfig } from './Notice';
4export interface OpenConfig extends NoticeConfig {
5 key: React.Key;
6 placement?: Placement;
7 content?: React.ReactNode;
8 duration?: number | null;
9}
10export interface NotificationsProps {
11 prefixCls?: string;
12 motion?: CSSMotionProps | ((placement: Placement) => CSSMotionProps);
13 container?: HTMLElement | ShadowRoot;
14 maxCount?: number;
15 className?: (placement: Placement) => string;
16 style?: (placement: Placement) => React.CSSProperties;
17 onAllRemoved?: VoidFunction;
18}
19export type Placement = 'top' | 'topLeft' | 'topRight' | 'bottom' | 'bottomLeft' | 'bottomRight';
20export interface NotificationsRef {
21 open: (config: OpenConfig) => void;
22 close: (key: React.Key) => void;
23 destroy: () => void;
24}
25declare const Notifications: React.ForwardRefExoticComponent<NotificationsProps & React.RefAttributes<NotificationsRef>>;
26export default Notifications;