import { type ViewerHandle } from '@embedpdf/viewer-chrome'; import type { Engine, EngineFactory } from '@embedpdf/engine-core/runtime'; import { type ElementConfig } from './config'; /** * Turns a config's `engine` field — that door's options bag, or nothing — into * the delivery's default engine. A DOOR registers one (see ../local/register); * the engine-agnostic door registers none, which is precisely what makes its * `engine` field required. */ export type DefaultEngineProvider = (engineOption: unknown) => Engine | EngineFactory; /** * The base class, resolved defensively so THIS MODULE IS IMPORT-SAFE IN NODE. * `class … extends HTMLElement` evaluates `HTMLElement` at module scope, which * is a ReferenceError under SSR — the reason a Next/Nuxt/SvelteKit consumer * otherwise has to hide the entire viewer import behind a client-only dynamic * import. With this, importing is safe anywhere and the element simply upgrades * once it reaches a real DOM; deferring the *render* stays an optimization * (you rarely want to boot an engine server-side), not a requirement. */ declare const ElementBase: typeof HTMLElement; export declare class EmbedPdfViewerElement extends ElementBase { #private; static observedAttributes: string[]; /** * The door's default engine, registered by importing a door that has one * (`../local/register`). A static rather than a module-level registry so the * mechanism is discoverable exactly where it is consumed — `engineOf` below. * `null` on the engine-agnostic door, on purpose. */ static defaultEngineProvider: DefaultEngineProvider | null; /** Full config — takes precedence over the declarative attributes. */ set config(config: ElementConfig); get config(): ElementConfig; /** * The DRIVE surface: public capability lenses (`viewer.get(AnnotationToken)`), * one `watch` primitive, and the command trio. Null until `epdf:ready` fires * (once per (re)mount); re-minted if the viewer is rebuilt by a config set. */ get viewer(): ViewerHandle | null; connectedCallback(): void; disconnectedCallback(): void; attributeChangedCallback(): void; } export {};