import type { PlayerConfig, FeatureFlags, LicenseResult } from '@vizor-vr/shared'; import { HTMLElementBase } from './html-element.js'; import { PlayerState } from './player-state.js'; import { VzEventEmitter } from './event-emitter.js'; /** * Abstract base class for all Vizor custom elements. * * Responsibilities: * - Shadow DOM creation * - Attribute observation and reflection to config * - Meta tag configuration reading * - Responsive sizing via ResizeObserver * - Poster image display * - Event emission */ export declare abstract class VzBaseElement extends HTMLElementBase { static get observedAttributes(): string[]; protected shadow: ShadowRoot; protected state: PlayerState; protected events: VzEventEmitter; protected config: PlayerConfig; protected license: LicenseResult | null; private resizeObserver; private metaConfig; private watermarkEl; /** * True while an async beforeConnect() (delivery hydration) is in flight. A * remove + re-append during that window re-enters connectedCallback(); this * flag stops it starting a second hydration (double fetch, duplicate injected * children, onConnected() twice) — the in-flight settle handler owns the * single finishConnect() call. */ private hydrating; constructor(); connectedCallback(): void; /** * Optional async hook run after config/styles are resolved but BEFORE * onConnected(). Return a promise to defer onConnected() until it settles * (e.g. to inject fetched DOM children); return void (default) to keep the * connect path synchronous. Subclasses override. */ protected beforeConnect(): Promise | void; private finishConnect; disconnectedCallback(): void; attributeChangedCallback(name: string, oldVal: string | null, newVal: string | null): void; /** Get the resolved player configuration */ getConfig(): Readonly; /** Get the reactive state store */ getState(): PlayerState; /** Get the current license result (null until validated) */ getLicense(): Readonly | null; /** Check if a feature is enabled by the current license */ protected hasFeature(feature: keyof FeatureFlags): boolean; protected abstract onConnected(): void; protected abstract onDisconnected(): void; protected abstract onAttributeChanged(name: string, oldVal: string | null, newVal: string | null): void; protected abstract onResize(): void; /** Called after license validation completes (override for post-license setup) */ protected onLicenseResolved(): void; /** Async license validation (non-blocking) */ private checkLicenseAsync; /** Build config from defaults + meta tags + element attributes */ private buildConfig; /** Apply width/height/aspect styling to the host element */ private applySizing; /** Inject minimal base styles into shadow DOM */ private injectBaseStyles; } //# sourceMappingURL=base-element.d.ts.map