UNPKG

656 BTypeScriptView Raw
1/// <reference types="react" />
2import { Id, ToastContainerProps, Toast, ToastPosition } from '../types';
3export interface ContainerInstance {
4 toastKey: number;
5 displayedToast: number;
6 props: ToastContainerProps;
7 containerId?: Id | null;
8 isToastActive: (toastId: Id) => boolean;
9 getToast: (id: Id) => Toast | null;
10}
11export declare function useToastContainer(props: ToastContainerProps): {
12 getToastToRender: <T>(cb: (position: ToastPosition, toastList: Toast[]) => T) => T[];
13 collection: Record<Id, Toast>;
14 containerRef: import("react").MutableRefObject<null>;
15 isToastActive: (id: Id) => boolean;
16};