import type { HostPageConfig } from "./host-page-url.js"; export { deepLinkUrl } from "./host-page-url.js"; import { type NetworkConfig } from "./networks.js"; /** Options for {@link createTestHostServer}. */ export interface TestHostServerOptions extends Partial { /** Port to listen on. `0` (the default) picks a free one. */ port?: number; /** * Chains to serve, expanded the way the Playwright fixture expands them. * Explicit `mock` and `runtimeConfig` values win over what they derive. * Needs `productUrl`: without one the server returns a bare base and the * fixture configures each test, so pass chains to the fixture instead. */ networks?: NetworkConfig[]; /** A single chain, exactly `networks: [chain]`. Passing both is refused. */ chain?: NetworkConfig; /** Whether statements are served in-page. Same default as the fixture's. */ loopbackStatements?: boolean; /** * Accepted only to fail with an explanation: TrUAPI derives a product * account from (session root, product id), so it cannot be mapped to a * chosen one. See the error text for what to do instead. */ productAccounts?: Record; /** * Do not keep the process alive for this server. * * Set when the fixture starts the server itself: nothing then calls `close`, * and a referenced listener would stall worker exit at the end of a run. */ unref?: boolean; } /** A running test host server. */ export interface TestHostServer { /** * URL to open. With a `productUrl` it carries the host configuration passed * here and is complete: open it directly rather than passing it to the * fixture as `hostUrl`, whose own options replace what it carries. Without * one it is the bare base the fixture appends its configuration to. */ url: string; /** Stop listening. */ close(): Promise; } /** * Start the test host server. * * ```ts * const server = await createTestHostServer(); * const test = base.extend(createTestHostFixture({ * productUrl: "http://127.0.0.1:5173", * hostUrl: server.url, * })); * ``` */ export declare function createTestHostServer(options?: TestHostServerOptions): Promise;