import type { Offer } from './suite-install.ts'; import type { Accepted, Review, ReviewItem } from './review.ts'; /** One thing that vouches, as the window shows it. */ export interface ShownItem { /** Where it can be chosen: its number among the choices; absent when it cannot. */ choice?: number | undefined; /** `signed by`, `certificate`, `attested by`, `WARNING from`. */ label: string; lines: string[]; /** What is known of it: accepted before, trusted by policy, new, or why it does not count. */ standing: string; tone: 'known' | 'new' | 'bad' | 'excluded'; } export interface WindowOptions { /** What the window is called, and says at the top. */ title?: string | undefined; /** * How the page is opened, given its URL: by default in a Chromium app * window, else the default browser (`openPage()`). Tests pass their own. */ open?: ((url: string) => void) | undefined; /** How long a closed window waits to be opened again before its questions are declined (default: 60s). */ grace?: number | undefined; } /** A window an install's decisions are made in. */ export interface DecisionWindow { url: string; log(line: string): void; /** Show what a review found: `onReview`. */ review(review: Review, about: { name: string; url: string; }): void; /** Ask which of a review's items to accept: `decide`. None declines. */ decide(review: Review, about: { name: string; url: string; }): Promise; /** Ask whom, of everyone a suite expects, to accept for its members: `confirm`. */ confirm(offer: Offer, about: { name: string; source: string; }): Promise; /** Say how it ended. The page stays until it is closed, or `close()`. */ finish(ok: boolean, text: string, lines?: string[] | undefined): void; /** Stop serving it. */ close(): Promise; } /** Open a window to make an install's decisions in. */ export declare function openWindow(options?: WindowOptions): Promise; /** A review's items as the window shows them: what each is, what is known of it, and its number where it can be chosen. */ export declare function shown(review: Review): ShownItem[]; /** * A Chromium browser here — Chrome, Edge, Chromium or Brave — whose `--app` * window shows a page as an application of its own: looked for where each * installs itself, never by asking anything to run. Undefined when there is * none. `env`, `platform` and `exists` are for tests. */ export declare function chromium({ env, platform, exists }?: { env?: NodeJS.ProcessEnv | undefined; platform?: NodeJS.Platform | undefined; exists?: ((path: string) => boolean) | undefined; }): string | undefined; /** * Open `url` for a person: as a Chromium app window with a profile of its own * (so it is a window of its own, not a tab in their browser, and leaves their * profile alone), else in the default browser. A browser that does not start * is not an error: the URL is also said where the install says things. */ export declare function openPage(url: string, { profile }?: { profile?: string | undefined; }): void; //# sourceMappingURL=window.d.ts.map