import React, { ReactNode, FunctionComponent } from "react"; export interface BannerEntry { id: string; msg: string; color?: string; timeOut?: number; } export type Variant = "toast" | "default"; export interface BannerState { alertState: BannerEntry[]; infoState: BannerEntry[]; variant?: Variant; } export type BannerAction = { type: "ADD_ALERT"; payload: Omit; } | { type: "ADD_INFO"; payload: Omit; } | { type: "REMOVE_ALERT"; id: string; } | { type: "REMOVE_INFO"; id: string; } | { type: "REMOVE_ALL_INFO"; } | { type: "REMOVE_ALL_ALERT"; } | { type: "SET_VARIANT"; variant: Variant; }; export interface BannerContextType { BANNER_STATE: BannerState; SET_INFO_BANNER: (options_msg: string | Omit, color?: string, timeOut?: number) => string; SET_ALERT_BANNER: (options_msg: string | Omit, color?: string, timeOut?: number) => string; REMOVE_ALERT_BANNER: (e: React.MouseEvent, id: string) => void; REMOVE_INFO_BANNER: (e: React.MouseEvent, id: string) => void; REMOVE_ALL_INFO_BANNERS: (e: React.MouseEvent) => void; REMOVE_ALL_ALERT_BANNERS: (e: React.MouseEvent) => void; SET_VARIANT: (variant: Variant) => void; } export declare const BannerContext: React.Context; export interface BannerProviderProps { children: ReactNode; } /** * @component Renders a context provider component for the banner component. * * - The context value object containing the following properties: * @property {BannerState} BANNER_STATE: The state of the banner. * @property {(options_msg: string | Omit, color?: string, timeOut?: number) => string} SET_INFO_BANNER: A callback function to be called when adding an info banner. The function takes the text to be displayed in the banner, the color of the banner, and the time in milliseconds to wait before removing the banner as arguments. * @property {(options_msg: string | Omit, color?: string, timeOut?: number) => string} SET_ALERT_BANNER: A callback function to be called when adding an alert banner. The function takes the text to be displayed in the banner, the color of the banner, and the time in milliseconds to wait before removing the banner as arguments. * @property {(e: React.MouseEvent | null, id: string) => void} REMOVE_ALERT_BANNER: A callback function to be called when removing an alert banner. The function takes the mouse event and the id of the banner as arguments. * @property {(e: React.MouseEvent | null, id: string) => void} REMOVE_INFO_BANNER: A callback function to be called when removing an info banner. The function takes the mouse event and the id of the banner as arguments. * @property {(e: React.MouseEvent) => void} REMOVE_ALL_INFO_BANNERS: A callback function to be called when removing all info banners. The function takes the mouse event as an argument. * @property {(e: React.MouseEvent) => void} REMOVE_ALL_ALERT_BANNERS: A callback function to be called when removing all alert banners. The function takes the mouse event as an argument. * @return {ReactElement} The rendered context provider component. */ export declare const BannerProvider: FunctionComponent; /** * @hook useBannerContext * * - The props object containing the following properties: * @property {BannerState} BANNER_STATE: The state of the banner. * @property {(options_msg: string | Omit, color?: string, timeOut?: number) => string} SET_INFO_BANNER: A callback function to be called when adding an info banner. The function takes the text to be displayed in the banner, the color of the banner, and the time in milliseconds to wait before removing the banner as arguments. * @property {(options_msg: string | Omit, color?: string, timeOut?: number) => string} SET_ALERT_BANNER: A callback function to be called when adding an alert banner. The function takes the text to be displayed in the banner, the color of the banner, and the time in milliseconds to wait before removing the banner as arguments. * @property {(e: React.MouseEvent | null, id: string) => void} REMOVE_ALERT_BANNER: A callback function to be called when removing an alert banner. The function takes the mouse event and the id of the banner as arguments. * @property {(e: React.MouseEvent | null, id: string) => void} REMOVE_INFO_BANNER: A callback function to be called when removing an info banner. The function takes the mouse event and the id of the banner as arguments. * @property {(e: React.MouseEvent) => void} REMOVE_ALL_INFO_BANNERS: A callback function to be called when removing all info banners. The function takes the mouse event as an argument. * @property {(e: React.MouseEvent) => void} REMOVE_ALL_ALERT_BANNERS: A callback function to be called when removing all alert banners. The function takes the mouse event as an argument. * @return {BannerContextType} The context value. */ export declare const useBannerContext: () => BannerContextType;