/**
 * Runtime Context Types
 *
 * The RuntimeContext represents the current state of the page, session, viewport,
 * and other environmental factors that can be used for adaptive decision-making.
 */
/**
 * Page context - information about the current page.
 */
export interface PageContext {
    /** Current page URL */
    url: string;
    /** Matched route pattern from RouteFilter (e.g., "/products/:id") */
    routeId?: string;
    /** Document title */
    title?: string;
    /** Page locale (e.g., "en-US") */
    locale?: string;
}
/**
 * Page history entry for session tracking.
 */
export interface PageHistoryEntry {
    /** Page URL */
    url: string;
    /** Timestamp when page was visited */
    ts: number;
}
/**
 * Session context - information about the current session.
 */
export interface SessionContext {
    /** Unique session ID (from PostHog) */
    sessionId: string;
    /** Session start timestamp */
    startTs: number;
    /** Page history within this session */
    pageHistory?: PageHistoryEntry[];
}
/**
 * Viewport context - information about the viewport size.
 */
export interface ViewportContext {
    /** Viewport width in pixels */
    width: number;
    /** Viewport height in pixels */
    height: number;
}
/**
 * Bounding box for anchor elements.
 */
export interface BoundingBox {
    x: number;
    y: number;
    w: number;
    h: number;
}
/**
 * Anchor state - tracks visibility and position of anchored elements.
 */
export interface AnchorState {
    /** Anchor element ID */
    anchorId: string;
    /** Whether the element is present in the DOM */
    present: boolean;
    /** Whether the element is visible in the viewport */
    visible?: boolean;
    /** Element's bounding box (when visible) */
    boundingBox?: BoundingBox;
}
/**
 * Augmentation data from ML models (Phase 3).
 * Placeholder for future implementation.
 */
export interface Augmentation {
    /** Augmentation confidence scores by field name */
    [field: string]: number | string | boolean | undefined;
}
/**
 * The complete runtime context available to adaptives.
 */
export interface RuntimeContext {
    /** Current page information */
    page: PageContext;
    /** Current session information */
    session: SessionContext;
    /** Current viewport size */
    viewport: ViewportContext;
    /** Tracked anchor element states (optional) */
    anchors?: AnchorState[];
    /** ML-derived augmentation data (Phase 3) */
    augmented?: Augmentation;
}
/**
 * Callback for context changes.
 */
export type ContextChangeCallback = (context: RuntimeContext, previousContext: RuntimeContext) => void;
/**
 * Unsubscribe function returned by subscribe().
 */
export type Unsubscribe = () => void;
