import { type SessionHostEndpoint, type SessionHostRequest, type SessionHostResponse, type SessionTerminalSnapshot, type SessionTerminalState } from '@adhdev/session-host-core';
type LowercaseLetter = 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'h' | 'i' | 'j' | 'k' | 'l' | 'm' | 'n' | 'o' | 'p' | 'q' | 'r' | 's' | 't' | 'u' | 'v' | 'w' | 'x' | 'y' | 'z';
type FunctionKey = 'f1' | 'f2' | 'f3' | 'f4' | 'f5' | 'f6' | 'f7' | 'f8' | 'f9' | 'f10' | 'f11' | 'f12';
type BaseNamedKey = 'enter' | 'escape' | 'tab' | 'backspace' | 'up' | 'down' | 'left' | 'right' | 'home' | 'end' | 'pageup' | 'pagedown' | 'space' | FunctionKey;
type ShiftNamedKey = BaseNamedKey | LowercaseLetter | `ctrl+${LowercaseLetter}` | `alt+${LowercaseLetter}`;
export type NamedKey = BaseNamedKey | `ctrl+${LowercaseLetter}` | `alt+${LowercaseLetter}` | `shift+${ShiftNamedKey}`;
export declare function namedKeyToAnsi(key: NamedKey | string): string;
export declare function namedKeysToAnsi(keys: readonly (NamedKey | string)[]): string;
export interface RawTerminalSessionHostClient {
    connect(): Promise<void>;
    request<T = unknown>(request: SessionHostRequest): Promise<SessionHostResponse<T>>;
    close(): Promise<void>;
}
export interface RawTerminalAttachmentOptions {
    endpoint?: SessionHostEndpoint;
    sessionId: string;
    mode?: 'read' | 'write';
    clientId?: string;
    client?: RawTerminalSessionHostClient;
}
export declare class RawTerminalAttachment {
    readonly sessionId: string;
    private readonly clientId;
    private readonly mode;
    private readonly client;
    private closed;
    private constructor();
    static attach(options: RawTerminalAttachmentOptions): Promise<RawTerminalAttachment>;
    readSnapshot(): Promise<SessionTerminalSnapshot>;
    readScreenText(): Promise<string>;
    readState(): Promise<SessionTerminalState>;
    writeInput(text: string): Promise<void>;
    writeKeys(keys: readonly (NamedKey | string)[]): Promise<void>;
    close(): Promise<void>;
}
export declare function withRawTerminalAttachment<T>(options: RawTerminalAttachmentOptions, operation: (attachment: RawTerminalAttachment) => Promise<T>): Promise<T>;
export {};
