You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
66 lines
1.4 KiB
66 lines
1.4 KiB
import type * as React from 'react';
|
|
|
|
interface DivProps extends React.HTMLProps<HTMLDivElement> {
|
|
'data-testid'?: string;
|
|
}
|
|
|
|
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;
|
|
props?: DivProps;
|
|
}
|
|
|
|
type StaticFn = (args: ArgsProps) => void;
|
|
|
|
export interface NotificationInstance {
|
|
success: StaticFn;
|
|
error: StaticFn;
|
|
info: StaticFn;
|
|
warning: StaticFn;
|
|
open: StaticFn;
|
|
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;
|
|
props?: DivProps;
|
|
}
|
|
|
|
export interface NotificationConfig {
|
|
top?: number;
|
|
bottom?: number;
|
|
prefixCls?: string;
|
|
getContainer?: () => HTMLElement;
|
|
placement?: NotificationPlacement;
|
|
maxCount?: number;
|
|
rtl?: boolean;
|
|
}
|
|
|