UNPKG

rsuite

Version:

A suite of react components

26 lines (25 loc) 1.13 kB
import React from 'react'; import { WithAsProps, RsRefForwardingComponent } from '../@types/common'; export declare type PlacementType = 'topCenter' | 'bottomCenter' | 'topStart' | 'topEnd' | 'bottomStart' | 'bottomEnd'; export declare const toastPlacements: PlacementType[]; export interface ToastContainerProps extends WithAsProps { /** The placement of the message box */ placement?: PlacementType; /** Set the message to appear in the specified container */ container?: HTMLElement | (() => HTMLElement); } export interface ToastContainerInstance { root: HTMLElement; push: (message: React.ReactNode) => string; remove: (key: string) => void; clear: () => void; destroy: () => void; } export interface NodeProps extends WithAsProps { onClose?: (event?: React.MouseEvent<HTMLDivElement>) => void; } interface ToastContainerComponent extends RsRefForwardingComponent<'div', ToastContainerProps> { getInstance: (props: ToastContainerProps) => [React.RefObject<ToastContainerInstance>, () => void]; } declare const ToastContainer: ToastContainerComponent; export default ToastContainer;