import * as React from "react";
import { type MarkdownComponentOverrides } from "./MarkdownDisplay";
/**
 * Returns true when a file should be treated as Markdown, based on its
 * extension or content type. Content-type parameters (e.g.
 * `text/markdown; charset=utf-8`) are stripped before comparison.
 */
export declare function isMarkdownFileName(fileName: string, contentType?: string | null): boolean;
type LazyState = {
    status: "idle";
} | {
    status: "loading";
} | {
    status: "loaded";
    text: string;
} | {
    status: "error";
    message: string;
};
/**
 * Lazily resolves async markdown content the first time `open` becomes true.
 *
 * - Caches a successful result so reopening does not refetch.
 * - Does NOT cache errors, so the next open retries.
 * - Guards against stale completions: a resolve/reject after unmount, or after
 *   `cacheKey` changes, never updates state.
 *
 * `loadSource` is read through a ref so an inline `() => fetch(...)` (new
 * identity every render) does not retrigger the fetch; pair an inline loader
 * with a stable `cacheKey` (e.g. an id) when the underlying content can change.
 */
export declare function useLazyMarkdownContent(open: boolean, loadSource: (() => Promise<string>) | undefined, cacheKey: string | number | undefined): LazyState;
export type MarkdownViewerPopoverProps = {
    /** Markdown text to render. Provide this OR `loadSource`. */
    source?: string;
    /** Lazy async content, invoked the first time the popover opens. */
    loadSource?: () => Promise<string>;
    /** Stable key for `loadSource`; changing it resets cached content. */
    cacheKey?: string | number;
    /** Optional header shown above the content (e.g. property key / file name). */
    title?: React.ReactNode;
    /**
     * Custom trigger, rendered via `asChild` (a single ref-accepting element).
     * When omitted, a default Eye icon button is rendered using `label`.
     */
    children?: React.ReactNode;
    /** Accessible label / tooltip for the default trigger. */
    label?: string;
    /** Icon for the default trigger. Ignored when `children` is provided. */
    triggerIcon?: React.ReactNode;
    /** Disables the default trigger. Ignored when `children` is provided. */
    disabled?: boolean;
    /** Width class; overrides PopoverContent's default `w-72`. */
    widthClassName?: string;
    /** Max-height of the scroll area. */
    maxHeightClassName?: string;
    /** Base className forwarded to MarkdownDisplay (e.g. text size). */
    contentClassName?: string;
    components?: MarkdownComponentOverrides;
    /** Shown when the resolved content is empty/whitespace. */
    emptyState?: React.ReactNode;
    align?: "start" | "center" | "end";
    side?: "top" | "right" | "bottom" | "left";
    sideOffset?: number;
    container?: HTMLElement | null;
    /** Defaults to false; the Popover root defaults this to true. */
    enableIframeClickDetection?: boolean;
    open?: boolean;
    onOpenChange?: (open: boolean) => void;
    className?: string;
};
export declare function MarkdownViewerPopover({ source, loadSource, cacheKey, title, children, label, triggerIcon, disabled, widthClassName, maxHeightClassName, contentClassName, components, emptyState, align, side, sideOffset, container, enableIframeClickDetection, open, onOpenChange, className, }: MarkdownViewerPopoverProps): React.JSX.Element;
export {};
