import type { OutlineItem, NavigationTarget, ScrollAlignment } from "./navigation";
import type { Annotation } from "./annotation";
import type { JsLayoutPage } from "../../wasm/udoc.js";
import type { PageInfo } from "../../worker/index.js";
/** A single search match with its location and geometry. */
export interface SearchMatch {
    /** 0-based page index. */
    pageIndex: number;
    /** Character offset within the concatenated page text. */
    charOffset: number;
    /** Length of the matched text. */
    length: number;
    /** Bounding rectangles for this match (in PDF points, for highlight rendering). */
    rects: Array<{
        x: number;
        y: number;
        width: number;
        height: number;
        angle: number;
    }>;
    /** Context snippet: [before, match, after] text for display in result list. */
    context: [string, string, string];
}
export interface VisibilityGroup {
    id: string;
    name: string;
    visible: boolean;
    locked: boolean;
}
export type LeftPanelTab = "thumbnail" | "outline" | "bookmarks" | "layers" | "attachments" | "fonts";
export type RightPanelTab = "search" | "comments";
export type PanelTab = LeftPanelTab | RightPanelTab;
export declare function isLeftPanelTab(tab: PanelTab): tab is LeftPanelTab;
export type ScrollMode = "spread" | "continuous";
export type LayoutMode = "single-page" | "double-page" | "double-page-odd-right" | "double-page-odd-left";
export type ZoomMode = "fit-spread-width" | "fit-spread-width-max" | "fit-spread-height" | "fit-spread" | "custom";
export type PageRotation = 0 | 90 | 180 | 270;
export type SpacingMode = "all" | "none" | "spread-only" | "page-only";
export type ThemeMode = "light" | "dark" | "system";
/** Document format as detected during loading */
export type DocumentFormat = "pdf" | "pptx" | "docx" | "xlsx" | "image";
/** Subset of view mode state that can be overridden per format */
export interface ViewModeDefaults {
    scrollMode?: ScrollMode;
    layoutMode?: LayoutMode;
    zoomMode?: ZoomMode;
    zoom?: number;
    effectiveZoom?: number | null;
    pageRotation?: PageRotation;
    spacingMode?: SpacingMode;
    pageSpacing?: number;
    spreadSpacing?: number;
}
/** Returns format-specific view mode defaults */
export declare function getFormatDefaults(format: DocumentFormat): ViewModeDefaults;
/** Default zoom steps for zoom in/out actions */
export declare const DEFAULT_ZOOM_STEPS: readonly [0.1, 0.25, 0.5, 0.75, 1, 1.25, 1.5, 2, 3, 4, 5];
export type { PageInfo };
/** PDF points are defined at 72 DPI */
export declare const PDF_DPI = 72;
/** Default display DPI (CSS standard) */
export declare const DEFAULT_DPI = 96;
/** Scale factor to convert PDF points to pixels at 100% zoom */
export declare const POINTS_TO_PIXELS: number;
/** Calculate the scale factor for a given display DPI */
export declare function getPointsToPixels(dpi: number): number;
export interface ViewerState {
    doc: {
        id: string;
    } | null;
    page: number;
    pageCount: number;
    pageInfos: readonly PageInfo[];
    /** Whether the document requires a password to open */
    needsPassword: boolean;
    /** Error message when password authentication fails */
    passwordError: string | null;
    /** Whether authentication is currently in progress */
    isAuthenticating: boolean;
    /** Document outline/bookmarks (null = not loaded yet) */
    outline: OutlineItem[] | null;
    /** Whether outline is currently being loaded */
    outlineLoading: boolean;
    /** Visibility groups (null = not loaded yet) */
    visibilityGroups: VisibilityGroup[] | null;
    /** Whether visibility groups are currently being loaded */
    visibilityGroupsLoading: boolean;
    /** Annotations by page index (0-based). Undefined = not loaded, [] = loaded but empty */
    pageAnnotations: Map<number, Annotation[]>;
    /** Set of page indices currently being loaded */
    annotationsLoading: Set<number>;
    /** Page layouts by page index (0-based). Undefined = not loaded yet */
    pageText: Map<number, JsLayoutPage>;
    /** Set of page indices currently being loaded */
    textLoading: Set<number>;
    /** Set of page indices that failed to load (prevents retry loops) */
    textFailed: Set<number>;
    /** Target for navigation (null = no pending navigation) */
    navigationTarget: NavigationTarget | null;
    /** Default scroll alignment for navigation (outline, links, goToDestination) */
    navigationScrollAlignment: ScrollAlignment;
    /** Default scroll alignment for search result navigation */
    searchScrollAlignment: ScrollAlignment;
    scrollMode: ScrollMode;
    layoutMode: LayoutMode;
    zoomMode: ZoomMode;
    zoom: number;
    /** Derived zoom for fit modes (null when not applicable). */
    effectiveZoom: number | null;
    zoomSteps: readonly number[];
    pageRotation: PageRotation;
    spacingMode: SpacingMode;
    dpi: number;
    pageSpacing: number;
    spreadSpacing: number;
    /** Width of thumbnail images in CSS pixels */
    thumbnailWidth: number;
    activePanel: PanelTab | null;
    /** Left panel width in pixels (null = use CSS default) */
    leftPanelWidth: number | null;
    /** Right panel width in pixels (null = use CSS default) */
    rightPanelWidth: number | null;
    /** Whether the top toolbar is visible */
    toolbarVisible: boolean;
    /** Whether the floating toolbar (page nav + zoom) is visible */
    floatingToolbarVisible: boolean;
    /** Whether the left panel area is visible */
    leftPanelVisible: boolean;
    /** Whether the right panel area is visible */
    rightPanelVisible: boolean;
    /** Set of panel tabs that are disabled (removed from the UI) */
    disabledPanels: ReadonlySet<PanelTab>;
    /** Whether the fullscreen button is visible in the toolbar */
    fullscreenButtonVisible: boolean;
    /** Whether the download button is visible in the toolbar */
    downloadButtonVisible: boolean;
    /** Whether the print button is visible in the toolbar */
    printButtonVisible: boolean;
    /** Current color theme mode */
    theme: ThemeMode;
    /** Whether the theme toggle button is hidden */
    themeSwitchingDisabled: boolean;
    /** Whether text selection is disabled */
    textSelectionDisabled: boolean;
    /** Whether slide transition animations are enabled (PPTX only) */
    transitionsEnabled: boolean;
    /** Minimum zoom level */
    minZoom: number;
    /** Maximum zoom level */
    maxZoom: number;
    /** Currently highlighted annotation (null = none) */
    highlightedAnnotation: {
        pageIndex: number;
        bounds: {
            x: number;
            y: number;
            width: number;
            height: number;
        };
    } | null;
    /** Whether the viewer is in fullscreen mode */
    isFullscreen: boolean;
    /** Current search query string */
    searchQuery: string;
    /** Whether search is case-sensitive */
    searchCaseSensitive: boolean;
    /** All search matches across all pages */
    searchMatches: SearchMatch[];
    /** Index of the currently active/focused match (-1 = none) */
    searchActiveIndex: number;
    /** Incremented each time the user explicitly navigates to a match. */
    searchNavGen: number;
    /** Per-call scroll alignment override for the current search navigation (cleared after use). */
    searchNavScrollAlignment: ScrollAlignment | null;
    /** Whether all page text has been loaded for search */
    searchTextLoaded: boolean;
    /** Whether search text is currently being loaded */
    searchTextLoading: boolean;
    /** Whether document is currently being downloaded or print is being prepared */
    isDownloading: boolean;
    /** Download progress: loaded bytes */
    downloadLoaded: number;
    /** Download progress: total bytes (0 if unknown) */
    downloadTotal: number;
    /** Whether document is being processed (WASM load, page info extraction) after download */
    isProcessing: boolean;
    /** Whether print preparation is in progress */
    isPrinting: boolean;
    /** Print progress: current page being rendered (1-based) */
    printCurrentPage: number;
    /** Print progress: total pages to render */
    printTotalPages: number;
    /** Whether the print dialog is visible */
    showPrintDialog: boolean;
    /** When true, panel open/close should skip CSS transitions (reset automatically after one frame) */
    panelTransitionsDisabled: boolean;
}
export declare const initialState: ViewerState;
//# sourceMappingURL=state.d.ts.map