import type { Duplex } from "node:stream"; import { type RemoteTerminalAttachOptions, type RemoteTerminalProtocolMetrics } from "@slopus/ghostty-web"; import type { RemoteTerminalConfinement, RemoteTerminalProcessFactory, RemoteTerminalProcessOptions } from "./RemoteTerminalProcess.js"; import type { RemoteTerminalSummary } from "./types.js"; export declare class RemoteTerminal { #private; readonly id: `${string}-${string}-${string}-${string}-${string}`; /** * Where this terminal's process actually runs. * * Recorded at creation from the factory that started it, so anything asking * whether this terminal may be shown to another person gets the truth about * this terminal rather than a fresh reading of a project setting that may * have changed since. A project that gains a container configuration does * not retroactively confine the host terminals already running in it. */ readonly confinement: RemoteTerminalConfinement; private constructor(); static create(options: { cols: number; maxScrollback: number; processFactory: RemoteTerminalProcessFactory; processOptions: RemoteTerminalProcessOptions; rows: number; onChange?: (summary: RemoteTerminalSummary) => void; }): Promise; /** * Add one attachment to this terminal. * * `input: false` attaches a viewer. It is the same call every other client * makes, so snapshot-then-deltas, resize barriers, epoch invalidation, and * credit-based flow control all apply to it unchanged; the only difference * is that it is never issued a lease that may write. */ attach(stream: Duplex, options?: RemoteTerminalAttachOptions): () => void; dispose(): Promise; metrics(): Readonly; resize(cols: number, rows: number): Promise; stop(): Promise; summary(): RemoteTerminalSummary; }