@lobehub/ui
Version:
Lobe UI is an open-source UI component library for building AIGC web apps
45 lines (44 loc) • 1.13 kB
text/typescript
import { ToastAPI, ToastPosition } from "./type.mjs";
import * as react11 from "react";
//#region src/Toast/imperative.d.ts
declare const toast: ToastAPI;
declare const TOAST_CONTAINER_ATTR = "data-lobe-ui-toast-container";
interface ToastHostProps {
className?: string;
/**
* Default duration for toasts
* @default 5000
*/
duration?: number;
/**
* Maximum number of toasts
* @default 5
*/
limit?: number;
/**
* Toast position
* @default 'bottom-right'
*/
position?: ToastPosition;
/**
* Root element for portal
*/
root?: HTMLElement | ShadowRoot | null;
/**
* Swipe direction to dismiss
* @default ['down', 'right']
*/
swipeDirection?: ('left' | 'right' | 'up' | 'down') | ('left' | 'right' | 'up' | 'down')[];
}
declare const ToastHost: react11.MemoExoticComponent<({
root,
className,
duration,
limit,
position,
swipeDirection
}: ToastHostProps) => react11.ReactPortal | null>;
declare const useToast: () => ToastAPI;
//#endregion
export { TOAST_CONTAINER_ATTR, ToastHost, ToastHostProps, toast, useToast };
//# sourceMappingURL=imperative.d.mts.map