import { ReactStore } from '../store/ReactStore'; import type { ToastManagerAddOptions, ToastManagerPromiseOptions, ToastManagerUpdateOptions, ToastObject } from './useToastManager'; type ToastInternalUpdateOptions = Partial, 'id'>>; /** * React Native adaptation of Base UI's toast store. * * The queue, the limit and the timer machinery are ported as-is — they are pure * state. What is gone is everything that touched the DOM: focus management * (`viewport`/`prevFocusElement`, `handleFocusManagement`, `restoreFocusToPrevElement`) * and the document pointerdown listener. * * Two state fields change meaning: * - `hovering` becomes `pressed`. A touch screen has no hover, but holding a * finger on a toast is the same intent — do not dismiss this yet. * - `isWindowFocused` becomes `isAppActive`, driven by RN's `AppState`, so a * toast does not expire while the app is in the background. */ /** The screen coordinates of the viewport's top-left corner. */ export type ToastViewportOrigin = { x: number; y: number; }; export type State = { toasts: ToastObject[]; toastMetadata: Map; pressed: boolean; focused: boolean; timeout: number; limit: number; isAppActive: boolean; /** * Where the viewport sits on screen. `Toast.Positioner` needs it because * `useAnchorPositioning` measures anchors in screen coordinates while the * viewport — not being a Modal — can be anywhere. */ viewportOrigin: ToastViewportOrigin; }; type ToastMetadata = { value: ToastObject; index: number; visibleIndex: number; offsetY: number; }; type InitialState = Omit; export declare const selectors: { toasts: (state: State) => ToastObject[]; isEmpty: (state: State) => boolean; toast: (args_0: State, id: string) => ToastObject | undefined; toastIndex: (args_0: State, id: string) => number; toastOffsetY: (args_0: State, id: string) => number; toastVisibleIndex: (args_0: State, id: string) => number; focused: (state: State) => boolean; viewportOrigin: (state: State) => ToastViewportOrigin; expanded: (state: State) => boolean; expandedOrInactive: (state: State) => boolean; }; export declare class ToastStore extends ReactStore { private timers; private areTimersPaused; constructor(initialState: InitialState); syncProviderProps(timeout: number, limit: number): void; disposeEffect: () => () => void; removeToast: (toastId: string, skipOnRemove?: boolean) => void; addToast: (toast: ToastManagerAddOptions) => string; updateToast: (id: string, updates: ToastManagerUpdateOptions) => void; updateToastInternal: (id: string, updates: ToastInternalUpdateOptions, resetTimer?: boolean, markUpdated?: boolean) => void; closeToast: (toastId?: string) => void; promiseToast: (promiseValue: Promise, options: ToastManagerPromiseOptions) => Promise; pauseTimers(): void; resumeTimers(): void; private scheduleTimer; private clearTimers; private clearTimer; private handleTimerFired; private resetPausedStateIfNoTimersRemain; private setToasts; } export {}; //# sourceMappingURL=store.d.ts.map