1 | import type { CSSMotionProps } from 'rc-motion';
|
2 | import * as React from 'react';
|
3 | import type { NotificationsProps } from '../Notifications';
|
4 | import type { OpenConfig, Placement, StackConfig } from '../interface';
|
5 | type OptionalConfig = Partial<OpenConfig>;
|
6 | export interface NotificationConfig {
|
7 | prefixCls?: string;
|
8 |
|
9 | getContainer?: () => HTMLElement | ShadowRoot;
|
10 | motion?: CSSMotionProps | ((placement: Placement) => CSSMotionProps);
|
11 | closeIcon?: React.ReactNode;
|
12 | closable?: boolean | ({
|
13 | closeIcon?: React.ReactNode;
|
14 | } & React.AriaAttributes);
|
15 | maxCount?: number;
|
16 | duration?: number;
|
17 | showProgress?: boolean;
|
18 | pauseOnHover?: boolean;
|
19 | /** @private. Config for notification holder style. Safe to remove if refactor */
|
20 | className?: (placement: Placement) => string;
|
21 |
|
22 | style?: (placement: Placement) => React.CSSProperties;
|
23 |
|
24 | onAllRemoved?: VoidFunction;
|
25 | stack?: StackConfig;
|
26 |
|
27 | renderNotifications?: NotificationsProps['renderNotifications'];
|
28 | }
|
29 | export interface NotificationAPI {
|
30 | open: (config: OptionalConfig) => void;
|
31 | close: (key: React.Key) => void;
|
32 | destroy: () => void;
|
33 | }
|
34 | export default function useNotification(rootConfig?: NotificationConfig): [NotificationAPI, React.ReactElement];
|
35 | export {};
|