import type { ProductId } from "@parity/truapi"; import type { MockHostConfig } from "../web/create-mock-host.js"; /** Host configuration the page understands. */ export interface HostPageConfig { /** URL of the product under test. */ productUrl: string; /** dotNS identifier the host runs the product under. */ productId?: ProductId; /** Behaviour knobs forwarded to the mock host. */ mock?: MockHostConfig; /** Overrides merged into the host's runtime config. */ runtimeConfig?: Record; /** * Accounts the host can sign as: a built-in name, or a name with the 32 * bytes of entropy its session activates from. * * Explicit entropy is how a test signs as an identity the built-ins cannot * be -- one enrolled in a personhood ring, for instance, which allowance * allocation requires and a fixed dev account never satisfies. */ accounts?: (string | { name: string; entropy: Uint8Array; })[]; /** Whether the host starts signed in. */ loginBehavior?: "auto" | "manual"; /** * Where the core runs. `"worker"` is the production topology and the * default. `"main-thread"` is the debugging one: the core's log output * reaches the page console, where `page.on("console")` can read it, instead * of the worker console Playwright does not observe. */ topology?: "worker" | "main-thread"; /** * How resource allocation is answered: `"granted"` (the default) without * performing it, or `"chain"` for the real path. */ allowances?: "granted" | "chain"; /** * Resource tags answered as refused, whatever `allowances` would otherwise * say. Withholding one while the rest stay granted is what makes a product's * refusal path reachable. */ withheldResources?: string[]; /** * Core log level (`off`/`error`/`warn`/`info`/`debug`/`trace`). Raising it * is what turns a bare failure outcome into the reason behind it: the core * logs why a call failed before mapping it to a protocol answer. */ logLevel?: string; /** * Product storage the host holds before the product loads, by the product's * own keys, stored as UTF-8. It travels in the page URL, so a reload of the * host page starts from it again. */ productStorage?: Record; } /** * The URL the product loads, as a real host builds it from the address bar: * the host page's path is appended to the product's own path, its query * parameters other than the host's configuration are added, and its hash * replaces the product's. A relative `productUrl` resolves against `host`. */ export declare function productUrlFor(productUrl: string, host: { href: string; pathname: string; search: string; hash: string; }): string; /** * The host page URL that opens the product at `link`, a path with an optional * query and hash such as `/notes/1?view=raw#top`. * * `hostUrl` is a configured host page URL, as `createTestHostServer` returns * one. The link's path and hash replace the host page's, and its query * parameters are added to the host's configuration. */ export declare function deepLinkUrl(hostUrl: string, link: string): string; /** Apply `config` to a host page URL, returning the configured URL. */ export declare function hostPageUrl(base: string, config: HostPageConfig): string; /** Account names for the page URL, rejecting anything the host cannot honour. */ export declare function accountNames(accounts: (string | { name: string; uri?: string; entropy?: Uint8Array; })[]): (string | { name: string; entropy: Uint8Array; })[];