/** * DashboardClient — WebSocket producer that pushes LifecycleEvents to a * persistent DashboardServer. * * Used by CLI run/check commands to stream events to a separately running * `ignition dashboard` process. Register `client.listener` with * `EventBus.on()` to forward events over the network. * * Includes a static `probe()` method that checks whether a dashboard server * is reachable at a given address. */ import type { EventListener } from "../output/events.ts"; type WebSocketLike = { readyState: number; addEventListener(type: "open" | "error" | "close", listener: (event: Event | ErrorEvent) => void, opts?: { once?: boolean | undefined; }): void; send(data: string): void; close(): void; }; type WebSocketFactory = (url: string) => WebSocketLike; type FetchLike = (input: string | URL | Request, init?: RequestInit) => Promise; /** Testability seam for injecting custom network primitives. */ export type DashboardClientDeps = { createWebSocket: WebSocketFactory; fetch: FetchLike; }; /** * WebSocket client that pushes LifecycleEvent JSON messages to a * DashboardServer's `/ws/push` endpoint. * * ```ts * const client = new DashboardClient('ws://127.0.0.1:9090/ws/push') * await client.connect() * const unsub = eventBus.on(client.listener) * // ... run completes ... * unsub() * await client.close() * ``` */ export declare class DashboardClient { #private; constructor(url: string, deps?: Partial); /** EventListener-compatible handler. Register with EventBus.on(). */ listener: EventListener; /** Connect to the dashboard server. Resolves when the WebSocket is open. */ connect(): Promise; /** Close the connection gracefully. */ close(): Promise; /** * Probe whether a dashboard server is reachable at the given address. * Returns true if `/api/health` responds with 200 within the timeout. */ static probe(hostname: string, port: number, timeoutMs?: number, fetchImpl?: FetchLike): Promise; } export {}; //# sourceMappingURL=client.d.ts.map