import React, { Component, CSSProperties, KeyboardEvent, ReactNode } from "react"; import { BaseProps } from "../../wui-core/src/iCore"; export type NotiPosition = 'topRight' | 'bottomRight' | 'top' | 'bottom' | 'topLeft' | 'bottomLeft' | ''; export interface NotificationProps extends BaseProps { getPopupContainer?: ((node?: HTMLElement) => HTMLElement) | HTMLElement; getContainer?: ((node?: HTMLElement) => HTMLElement) | HTMLElement; container?: ((node?: HTMLElement) => HTMLElement) | HTMLElement; show?: boolean; style?: CSSProperties; position?: NotiPosition; transitionName?: string; keyboard?: boolean; onEscapeKeyUp?: (e?: KeyboardEvent) => void; animation?: string; maxCount?: number; } export type Color = 'info' | 'success' | 'danger' | 'warning' | 'light' | 'dark' | 'news' | 'infolight' | 'successlight' | 'dangerlight' | 'warninglight'; export type MappingColor = { success: string; info: string; danger: string; warning: string; [key: string]: string; }; export type Content = ReactNode | Object; export interface NoticeProps extends BaseProps { duration?: number; onClose?: () => void; children?: ReactNode; color?: Color; title?: string; closable?: boolean; style?: CSSProperties; content?: Content; onEnd?: () => void; key?: string | number; getPopupContainer?: ((node?: HTMLElement) => HTMLElement) | HTMLElement; getContainer?: ((node?: HTMLElement) => HTMLElement) | HTMLElement; container?: ((node?: HTMLElement) => HTMLElement) | HTMLElement; transitionName?: string; icon?: ReactNode; closeIcon?: ReactNode; btn?: ReactNode; onClick?: (e: React.MouseEvent) => void; } export interface NewInstanceCbArg { notice: (notice: NoticeProps) => void; removeNotice: (key: string | number) => void; component: Component; destroy: () => void; } export type NewInstanceCb = (arg: NewInstanceCbArg) => void;