mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 11:10:01 +08:00
58 lines
1.3 KiB
TypeScript
58 lines
1.3 KiB
TypeScript
|
import type * as React from 'react';
|
||
|
|
||
|
export type NotificationPlacement =
|
||
|
| 'top'
|
||
|
| 'topLeft'
|
||
|
| 'topRight'
|
||
|
| 'bottom'
|
||
|
| 'bottomLeft'
|
||
|
| 'bottomRight';
|
||
|
|
||
|
export type IconType = 'success' | 'info' | 'error' | 'warning';
|
||
|
|
||
|
export interface ArgsProps {
|
||
|
message: React.ReactNode;
|
||
|
description?: React.ReactNode;
|
||
|
btn?: React.ReactNode;
|
||
|
key?: React.Key;
|
||
|
onClose?: () => void;
|
||
|
duration?: number | null;
|
||
|
icon?: React.ReactNode;
|
||
|
placement?: NotificationPlacement;
|
||
|
style?: React.CSSProperties;
|
||
|
className?: string;
|
||
|
readonly type?: IconType;
|
||
|
onClick?: () => void;
|
||
|
closeIcon?: React.ReactNode;
|
||
|
}
|
||
|
|
||
|
export interface NotificationInstance {
|
||
|
success(args: ArgsProps): void;
|
||
|
error(args: ArgsProps): void;
|
||
|
info(args: ArgsProps): void;
|
||
|
warning(args: ArgsProps): void;
|
||
|
open(args: ArgsProps): void;
|
||
|
destroy(key?: React.Key): void;
|
||
|
}
|
||
|
|
||
|
export interface GlobalConfigProps {
|
||
|
top?: number;
|
||
|
bottom?: number;
|
||
|
duration?: number;
|
||
|
prefixCls?: string;
|
||
|
getContainer?: () => HTMLElement;
|
||
|
placement?: NotificationPlacement;
|
||
|
closeIcon?: React.ReactNode;
|
||
|
rtl?: boolean;
|
||
|
maxCount?: number;
|
||
|
}
|
||
|
|
||
|
export interface NotificationConfig {
|
||
|
top?: number;
|
||
|
bottom?: number;
|
||
|
prefixCls?: string;
|
||
|
getContainer?: () => HTMLElement;
|
||
|
maxCount?: number;
|
||
|
rtl?: boolean;
|
||
|
}
|