import { type ReactNode, type RefObject } from "react"; type LightboxController = { open: (src: string, caption?: string, source?: HTMLElement | null, label?: string, downloadFilename?: string, controlLabels?: LightboxControlLabels, releaseSource?: () => void) => void; }; export type LightboxControlLabels = { download?: string | undefined; close?: string | undefined; previous?: string | undefined; next?: string | undefined; }; /** One image the open lightbox can page to, resolved only when it is shown. */ export type LightboxGalleryImage = { src: string; caption?: string | undefined; label?: string | undefined; /** Releases a source owned by this load, such as an object URL. */ release?: (() => void) | undefined; }; export type LightboxGalleryEntry = { /** Whether this entry currently resolves to an image; defaults to yes. */ isImage?: (() => Promise) | undefined; load: () => Promise; }; /** * Adds the element's image to the lightbox gallery so an open lightbox can page * to it with the arrow controls, in document order. The entry is resolved only * when it is shown, so deferred images that never scrolled into view still page. * A lightbox opened from inside the element starts at this entry. */ export declare function useLightboxGalleryItem(ref: RefObject, entry: LightboxGalleryEntry | null): void; /** Open the app-level screenshot lightbox. No-op outside a `LightboxProvider`. */ export declare function useLightbox(): LightboxController; /** * The lightbox controller when one is mounted, or `null` outside a * `LightboxProvider`. Lets a media primitive degrade to a non-interactive image * (rather than a dead "Expand" button that announces an action it cannot do). */ export declare function useLightboxOptional(): LightboxController | null; /** @internal Owns one optional retained lightbox source and releases it exactly once. */ export declare function createLightboxSourceOwner(): { replace(release?: (() => void) | undefined): void; release(): void; }; /** * The app-level screenshot lightbox. Render once near the timeline; renderers * call `useLightbox().open(src)`. * * Idempotent by design: when an ancestor `LightboxProvider` already exists (e.g. * a `MessageTimeline` mounted inside an app that already wraps its shell), this * one becomes a pass-through and does NOT mount a second focus-trapping Dialog. * That keeps `MessageTimeline` self-sufficient (it owns its own provider) while * composing cleanly when nested. */ export declare function LightboxProvider({ children }: { children: ReactNode; }): import("react").JSX.Element; /** @internal Exact controls rendered by an open screenshot lightbox. */ export declare function ScreenshotLightboxControls({ src, downloadFilename, controlLabels, }: { src: string; downloadFilename?: string | undefined; controlLabels?: LightboxControlLabels | undefined; }): import("react").JSX.Element; export {};