import { LitElement, PropertyValueMap } from 'lit';
import { Ref } from 'lit/directives/ref.js';
import { WeavyType } from '../contexts/weavy-context';
import { ShadowPartsController } from '../controllers/shadow-parts-controller';
import { OnProgressParameters, PDFDocumentLoadingTask, PDFDocumentProxy } from 'pdfjs-dist';
import { EventBus, GenericL10n, PDFHistory, PDFLinkService, PDFViewer } from 'pdfjs-dist/web/pdf_viewer.mjs';
type pdfjsLibType = typeof import("pdfjs-dist");
type pdfjsViewerType = typeof import("pdfjs-dist/web/pdf_viewer.mjs");
declare global {
    interface HTMLElementTagNameMap {
        "wy-pdf-viewer": WyPdfViewer;
    }
}
/**
 * PDF Viewer component based on pdf.js examples.
 *
 * @see https://github.com/mozilla/pdf.js/blob/master/examples/mobile-viewer
 * @see https://github.com/mozilla/pdf.js/blob/master/examples/components/
 *
 * **Used sub components:**
 *
 * - [`<wy-button>`](./ui/wy-button.ts)
 * - [`<wy-icon>`](./ui/wy-icon.ts)
 *
 * @csspart wy-toolbars-bottom - Bottom toolbar wrapper.
 * @csspart wy-toolbar - Toolbar container.
 * @csspart wy-toolbar-center - Centered toolbar area.
 * @csspart wy-toolbar-buttons - Button group inside toolbar.
 * @csspart wy-input - Inputs in toolbars (page number / zoom).
 * @csspart wy-toolbar-center-text - Centered text in toolbar.
 * @csspart wy-toolbar-text - Text elements in the toolbar.
 * @csspart wy-pdf-container - Viewer container for PDF pages.
 *
 * @fires {FilePreviewLoadedEventType} file-preview-loaded - The file preview is considered loaded.
 */
export declare class WyPdfViewer extends LitElement {
    static styles: import('lit').CSSResult[];
    /** @internal */
    protected exportParts: ShadowPartsController;
    /** @internal */
    weavy?: WeavyType;
    /**
     * Emit `file-preview-loaded` once the viewer has initialized.
     *
     * @returns {boolean} True if the event was not canceled.
     */
    protected dispatchLoaded(): boolean;
    /**
     * Deferred resolver used while lazily loading pdf.js modules.
     *
     * @internal
     */
    whenPdfjsResolve?: (value: {
        pdfjsLib: pdfjsLibType;
        pdfjsViewer: pdfjsViewerType;
    }) => void;
    /**
     * Promise that resolves when both pdf.js core and viewer modules are available.
     *
     * @internal
     */
    whenPdfjs: Promise<{
        pdfjsLib: pdfjsLibType;
        pdfjsViewer: pdfjsViewerType;
    }>;
    /**
     * Cached pdf.js core module.
     *
     * @internal
     */
    pdfjsLib?: pdfjsLibType;
    /**
     * Cached pdf.js viewer helpers.
     *
     * @internal
     */
    pdfjsViewer?: pdfjsViewerType;
    MAX_CANVAS_PIXELS: number;
    TEXT_LAYER_MODE: number;
    MAX_IMAGE_SIZE: number;
    CMAP_URL?: URL;
    CMAP_PACKED: boolean;
    DEFAULT_SCALE_DELTA: number;
    MIN_SCALE: number;
    MAX_SCALE: number;
    DEFAULT_SCALE_VALUE: string;
    ENABLE_XFA: boolean;
    DEFAULT_WORKER_URL: string;
    DEFAULT_CMAPS_URL: string;
    DEFAULT_WASM_URL: string;
    DEFAULT_ICC_URL: string;
    DEFAULT_FONTS_URL: string;
    WORKER_URL?: URL;
    WASM_URL?: URL;
    ICC_URL?: URL;
    FONTS_URL?: URL;
    /**
     * Source URL for the PDF to display.
     */
    src?: string;
    /** The length of the pdf file, used to enhance loading. */
    size?: number;
    /**
     * Input reference controlling the current page number.
     *
     * @internal
     */
    pageNumberRef: Ref<HTMLInputElement>;
    /**
     * Span reference showing the total number of pages.
     *
     * @internal
     */
    totalPagesRef: Ref<HTMLSpanElement>;
    /**
     * Input reference controlling zoom level.
     *
     * @internal
     */
    zoomLevelRef: Ref<HTMLInputElement>;
    /**
     * Container that hosts the PDF viewer.
     *
     * @internal
     */
    viewerContainerRef: Ref<HTMLDivElement>;
    pdfDocument?: PDFDocumentProxy;
    /**
     * Localization helper provided by pdf.js.
     *
     * @internal
     */
    l10n?: GenericL10n;
    /**
     * Browser history helper for the PDF viewer.
     *
     * @internal
     */
    pdfHistory?: PDFHistory;
    /**
     * Active PDF viewer instance.
     *
     * @internal
     */
    pdfViewer?: PDFViewer;
    /**
     * Event bus used by pdf.js sub-components.
     *
     * @internal
     */
    pdfEventBus?: EventBus;
    /**
     * Link service used to handle internal navigation.
     *
     * @internal
     */
    pdfLinkService?: PDFLinkService;
    protected pdfLoadingTask?: PDFDocumentLoadingTask;
    progress?: OnProgressParameters;
    protected delayedResize?: number;
    protected resizer: ResizeObserver;
    /**
     * Open the configured PDF source in the viewer.
     *
     * @internal
     */
    protected open(): Promise<void>;
    /**
     * Close any currently loaded PDF and release resources.
     *
     * @internal
     */
    protected close(): Promise<void>;
    /**
     * Log a pdf.js related error with contextual metadata.
     *
     * @internal
     * @param pdfjsLib - pdf.js core library.
     * @param message - Human readable error.
     * @param moreInfo - Additional error metadata.
     */
    protected pdfViewError(pdfjsLib: pdfjsLibType, message: string, moreInfo: Partial<Error & {
        filename: string;
        lineNumber: number;
    }>): void;
    /**
     * Navigate to the provided page number.
     *
     * @param pageNumber - One-based page index.
     */
    setPage(pageNumber: number): void;
    /**
     * Increase zoom level by the configured delta.
     *
     * @param ticks - Number of zoom steps to apply.
     */
    zoomIn(ticks?: number): void;
    /**
     * Decrease zoom level by the configured delta.
     *
     * @param ticks - Number of zoom steps to apply.
     */
    zoomOut(ticks?: number): void;
    /**
     * Apply an absolute zoom level or named scale preset.
     *
     * @param scale - Numeric zoom or preset name.
     */
    setScale(scale: number | string): void;
    /**
     * Validate and update the current page based on the input value.
     */
    updatePage(): void;
    /**
     * Select all text inside an input, aiding quick replacement.
     *
     * @param e - Input focus event.
     */
    select(e: Event): void;
    /**
     * Fit the PDF to the current viewport height.
     */
    fitToPage(): void;
    /**
     * Fit the PDF to the current viewport width.
     */
    fitToWidth(): void;
    /**
     * Validate and persist zoom level from the input field.
     */
    updateZoom(): void;
    willUpdate(changedProperties: PropertyValueMap<this>): Promise<void>;
    update(changedProperties: PropertyValueMap<this>): void;
    updated(): Promise<void>;
    render(): import('../../node_modules/lit-html/node/lit-html.js').TemplateResult<1>;
    connectedCallback(): void;
    disconnectedCallback(): void;
}
export {};
//# sourceMappingURL=wy-pdf-viewer.d.ts.map