/** * The **Toast Queue Manager** — decides which toasts are *visible* versus * *pending* for each screen position, enforcing a per-position `maxVisible` * cap so a burst of notifications never floods the viewport. * * It is pure bookkeeping over opaque string ids (no DOM, no timers), which * keeps it trivially unit-testable and lets the {@link ToastService} own all * rendering. Each position maintains an ordered visible list and a FIFO pending * queue; dismissing a visible toast promotes the next pending one. * * @packageDocumentation */ import { ToastPosition } from './toast.types'; /** The outcome of enqueuing a toast. */ export interface EnqueueResult { /** `true` when the toast can be shown immediately (a visible slot was free). */ readonly visible: boolean; } /** Pure, DOM-free visibility scheduler for toasts. */ export declare class ToastQueueManager { private maxVisible; private readonly queues; /** * @param maxVisible - Max simultaneously-visible toasts per position (min 1). */ constructor(maxVisible: number); /** Updates the per-position visible cap (min 1). Does not retro-actively hide. */ setMaxVisible(maxVisible: number): void; /** Lazily gets (creating if needed) the queue for a position. */ private queueFor; /** * Registers a toast id at a position, marking it visible when a slot is free * or pending otherwise. * * @param id - The toast id. * @param position - The docked position. * @returns Whether the toast is immediately visible. */ enqueue(id: string, position: ToastPosition): EnqueueResult; /** * Removes a toast id from its position (whether visible or pending) and * returns the id promoted from pending to visible as a result, if any. * * @param id - The toast id to remove. * @param position - The docked position. * @returns The newly-promoted id, or `null` when nothing was promoted. */ remove(id: string, position: ToastPosition): string | null; /** @returns `true` if the id is currently in the visible set for its position. */ isVisible(id: string, position: ToastPosition): boolean; /** @returns The ordered visible ids for a position. */ getVisible(position: ToastPosition): readonly string[]; /** @returns Every live id (visible + pending) across all positions. */ getAll(): string[]; /** @returns Every live id at a single position. */ getAllAt(position: ToastPosition): string[]; /** Clears all bookkeeping (used on destroy). */ clear(): void; } //# sourceMappingURL=toast-queue-manager.d.ts.map