import type { DomicileHost, DomicileWindow } from "../domicile-host"; import type { Defined } from "./defined"; import type { On } from "./subscribe"; import type { System } from "./system-calls"; /** A client window, as the compositor last described it. */ export type ClientWindow = Defined; /** A box in the page's CSS pixels. */ export type Box = { x: number; y: number; width: number; height: number; }; export type WindowsListeners = { /** A window appeared, closed or changed. */ change: () => void; /** {@link Windows.focused} may have moved. */ focuschange: () => void; /** A client asked for the keyboard. Grant it with {@link Windows.focus}. */ focusrequest: (appId: string) => void; }; export type Windows = { /** Every client window, in the order they appeared. */ readonly list: readonly ClientWindow[]; /** The window holding the keyboard, or `undefined` while the shell holds it. */ readonly focused: string | undefined; /** Give `appId` the keyboard. */ focus: (appId: string) => void; /** Take the keyboard back to the shell's page. */ focusShell: () => void; /** Ask a client to close. The client may refuse. */ close: (appId: string) => void; /** * Say the page took the pointer for `appId`'s * {@link ClientWindow.pointerConstraint} (`active`), or let it go. Only once * taken is the client told its pointer is locked or confined. */ pointerConstrained: (appId: string, active: boolean) => void; /** Where the shell put `appId`'s ``; the client draws at that monitor's scale. */ setBounds: (appId: string, box: Box) => void; /** Say the page renders each window's `frame` as its ``. */ syncFrames: () => void; setStates: System["setWindowStates"]; requests: System["windowRequests"]; bells: System["bells"]; on: On; }; export type WindowsHost = Pick; export declare const windows: (host: WindowsHost, calls: Pick) => Windows;