import type { Browser, Page } from 'puppeteer'; import type { ServerState, LogFunction } from './types.js'; export declare const DEFAULT_PAGE_ID = "default"; export declare function createState(): ServerState; export declare function getPage(state: ServerState, pageId: string): Page; export declare function requireBrowser(state: ServerState): Browser; /** * Apply the session-level defaults captured at launch time (viewport, * userAgent, stealth shim) to a page. Used both for the initial blank tab and * any later pages — without this, lazy-created pages would skip the launch * options entirely. */ export declare function applyPageDefaults(page: Page, state: ServerState): Promise; /** * Launch a browser with sane defaults if one isn't already running. Cached * in-flight Promise prevents two concurrent calls from each spawning their * own Chromium and leaking the loser. */ export declare function ensureBrowser(state: ServerState, log: LogFunction): Promise; /** * Get a page, creating it on the fly if missing. Cached in-flight Promise * per pageId prevents two concurrent calls from each opening a tab and * leaking the loser. */ export declare function ensurePage(state: ServerState, pageId: string, log: LogFunction): Promise; //# sourceMappingURL=state.d.ts.map