import { a as CursorShape } from "./escapes-CB_6CWOE.js"; import { n as TerminalProgressState, t as ClipboardSelection } from "./osc-Cn0fw77g.js"; import { i as OutputStream, t as CapabilitiesStore } from "./store-C1P5fOUi.js"; import { t as ColorProfile } from "./color-profile-CyeHnG1T.js"; import { t as ColorPolicy } from "./color-policy-CCxuHIdD.js"; import { n as Screen } from "./screen-CgC2WlVM.js"; import { t as CursorPosition } from "./cursor-position-D2LAkRG0.js"; //#region src/input-parser.d.ts type InputEvent = string | { readonly paste: string; }; //#endregion //#region src/terminal/input.d.ts export type MouseButton = "left" | "middle" | "right" | "none" | "wheel-up" | "wheel-down"; export type TerminalMouseEvent = { readonly type: "press" | "release" | "move" | "wheel"; readonly x: number; readonly y: number; readonly button: MouseButton; readonly shift: boolean; readonly alt: boolean; readonly ctrl: boolean; }; /** Stateful stdin decoder that separates terminal reports from application input. */ export declare class TerminalInput { #private; constructor(capabilities: CapabilitiesStore); push(chunk: string): InputEvent[]; subscribeMouse(listener: (event: TerminalMouseEvent) => void): () => void; hasPendingEscape(): boolean; flushPendingEscape(): string | undefined; reset(): void; } export declare function parseMouseEvent(sequence: string): TerminalMouseEvent | undefined; //#endregion //#region src/terminal/session.d.ts export type TerminalSessionOptions = { readonly stdin: NodeJS.ReadableStream; readonly stdout: OutputStream; readonly stderr: OutputStream; readonly colorPolicy?: ColorPolicy; readonly onCapabilitiesChange?: () => void; }; export type TerminalMode = { readonly id: string; readonly enable: string; readonly disable: string; }; export type TerminalCursor = { readonly position?: CursorPosition; readonly visible: boolean; readonly shape: CursorShape; readonly blinking: boolean; readonly color?: string; }; /** Instance-scoped terminal state and lifecycle ownership. */ export declare class TerminalSession { #private; readonly stdin: NodeJS.ReadableStream; readonly stdout: OutputStream; readonly stderr: OutputStream; readonly capabilities: CapabilitiesStore; readonly input: TerminalInput; cursor: TerminalCursor; suspended: boolean; alternateScreen: boolean; inlineScreen: boolean; constructor(options: TerminalSessionOptions); get colorProfile(): ColorProfile; /** Encodes a structured frame at the terminal boundary. */ encode(screen: Screen): string; present(screen: Screen, options?: { readonly fullscreen?: boolean; readonly forceRewrite?: boolean; }): boolean; willPresent(screen: Screen, options?: { readonly fullscreen?: boolean; readonly forceRewrite?: boolean; }): boolean; /** Erases the presented frame; pass the current `columns` after a resize so the erase covers rows the emulator rewrapped. */ clearFrame(options?: { readonly columns?: number; }): void; resetFrame(): void; finishFrame(): void; setColorPolicy(policy: ColorPolicy): void; /** Writes through the session and tracks callback-based backpressure completion. */ write(data: string): boolean; flush(): Promise; /** Copy text through OSC 52, including tmux passthrough when required. */ copyToClipboard(text: string, selection?: ClipboardSelection): boolean; setTitle(title: string): boolean; publishTitle(owner: symbol, title?: string): boolean; setWorkingDirectory(directory: URL | string): boolean; notify(title: string): boolean; setPointerShape(shape: string): boolean; publishProgress(owner: symbol, state: TerminalProgressState, value?: number): boolean; /** * Update terminal-native progress. Active progress is reset during cleanup * so a completed or failed process cannot leave a stale terminal indicator. */ setProgress(state: TerminalProgressState, value?: number): boolean; enableMode(mode: TerminalMode): void; enableMode(enable: string, disable: string): void; disableMode(idOrDisable: string): void; setCursor(position: CursorPosition | undefined): void; setCursorAppearance(options: { readonly visible?: boolean; readonly shape?: CursorShape; readonly blinking?: boolean; readonly color?: string | null; }): void; setAlternateScreen(enabled: boolean, options?: { hideCursor?: boolean; }): void; beginSuspension(): void; resume(): void; cleanup(): void; } //#endregion