UNPKG

react-snackbar-ui-customizable

Version:
25 lines (24 loc) 912 B
import React, { Dispatch } from "react"; import { ISnackbarPortal } from "../components/SnackbarPortal/SnackbarPortal"; import { Action, Snackbar } from "./snackbarContainerReducer"; export declare type PortalID = string | number; interface State { /** snackbar portal unique id */ id?: PortalID; /** list including snackbar items */ snackbars: Snackbar[]; /** dispatcher function to able on or off snackbar */ dispatch: SnackbarDispatch; } interface Props { /** portal id */ id?: PortalID; /** portal option */ option?: Omit<ISnackbarPortal, "snackbar">; /** React Child Components */ children: React.ReactNode; } declare type SnackbarDispatch = Dispatch<Action>; export declare const SnackbarContext: React.Context<State | null>; export declare const SnackbarContextProvider: ({ id, option, children, }: Props) => JSX.Element; export {};