@base-ui-components/react
Version:
Base UI is a library of headless ('unstyled') React components and low-level hooks. You gain complete control over your app's CSS and accessibility features.
18 lines • 801 B
TypeScript
import { useToastManager } from "./useToastManager.js";
export interface ToastManagerEvent {
action: 'add' | 'close' | 'update' | 'promise';
options: any;
}
/**
* Creates a new toast manager.
*/
export declare function createToastManager(): createToastManager.ToastManager;
export declare namespace createToastManager {
interface ToastManager {
' subscribe': (listener: (data: ToastManagerEvent) => void) => () => void;
add: <Data extends object>(options: useToastManager.AddOptions<Data>) => string;
close: (id: string) => void;
update: <Data extends object>(id: string, updates: useToastManager.UpdateOptions<Data>) => void;
promise: <Value, Data extends object>(promiseValue: Promise<Value>, options: useToastManager.PromiseOptions<Value, Data>) => Promise<Value>;
}
}