///
import { ConfigContextValueOffBoard } from '@befe/brick-core';
import { ToastProps } from './toast';
export interface ToastItem extends ToastProps {
/**
* 自定义 id
*/
id: string;
}
export interface ToasterProps {
/**
* 自定义 class
*/
className?: string;
/**
* 位置
*/
placement?: 'top-center' | 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left';
}
export interface CreateToasterOptions extends ToasterProps {
/**
* configContext 配置
*
* 由于 confirm() 是在页面上另行取 root 进行 render 的,
* 而 configContext 中除了 `theme`, `i18n` 指向的是模块单例,其他通过 ConfigProvider 配置的值,在不同的 root 间是访问不到的,
* 不同 root 间的组件向上访问 context 只能访问到 context 的默认值。
*
* 所以用于样式隔离方案 `wrapClassName 需要另行提供(相应一样的)配置。
* @private
*/
configContext?: ConfigContextValueOffBoard;
}
/**
* Toaster 对外实例句柄(经 ref 调用)
*/
export interface ToasterHandle {
add: (toast: ToastItem) => void;
remove: (id: string) => void;
}
export declare const Toaster: import("react").ForwardRefExoticComponent>;
export interface ToasterObject {
toast: (toast: ToastItem) => void;
remove: (key: string) => void;
destroy: () => void;
}
export declare const DEFAULT_CLASSNAME_TOASTER_CONTAINER = "brick-toaster-container";
export declare function isToasterContainerExist(containerClassName?: string): boolean;
export declare function getToastContainer(options?: CreateToasterOptions): Element;
export declare function createToaster(options?: CreateToasterOptions): Promise;
export declare function getToaster(props: ToasterProps): Promise;
export declare function resetToaster(): void;
export declare function removeToast(id: string): void;