import type { DapCapabilities, DapClientState, DapEventMessage, DapInitializeArguments, DapRequestMessage, DapResolvedAdapter } from "./types.js";
interface DapSpawnOptions {
    adapter: DapResolvedAdapter;
    cwd: string;
    /**
     * Cap on how long the socket-mode helpers wait for the adapter to open its
     * socket (unix) or dial back into our listener (TCP). Exposed for tests;
     * production callers rely on the default.
     *
     * @internal
     */
    socketReadyTimeoutMs?: number;
}
/** Minimal write interface shared by Bun.FileSink and Bun TCP sockets. */
interface DapWriteSink {
    write(data: string | Uint8Array): number | Promise<number>;
    flush(): number | Promise<number> | undefined;
}
type DapEventHandler = (body: unknown, event: DapEventMessage) => void | Promise<void>;
type DapReverseRequestHandler = (args: unknown) => unknown | Promise<unknown>;
export declare class DapClient {
    #private;
    readonly adapter: DapResolvedAdapter;
    readonly cwd: string;
    readonly proc: DapClientState["proc"];
    constructor(adapter: DapResolvedAdapter, cwd: string, proc: DapClientState["proc"], options?: {
        readable?: ReadableStream<Uint8Array>;
        writeSink?: DapWriteSink;
        socket?: {
            end(): void;
        };
    });
    static spawn({ adapter, cwd, socketReadyTimeoutMs }: DapSpawnOptions): Promise<DapClient>;
    get capabilities(): DapCapabilities | undefined;
    get lastActivity(): number;
    isAlive(): boolean;
    initialize(args: DapInitializeArguments, signal?: AbortSignal, timeoutMs?: number): Promise<DapCapabilities>;
    onEvent(event: string, handler: DapEventHandler): () => void;
    onAnyEvent(handler: DapEventHandler): () => void;
    onReverseRequest(command: string, handler: DapReverseRequestHandler): () => void;
    waitForEvent<TBody>(event: string, predicate?: (body: TBody) => boolean, signal?: AbortSignal, timeoutMs?: number): Promise<TBody>;
    sendRequest<TBody = unknown>(command: string, args?: unknown, signal?: AbortSignal, timeoutMs?: number): Promise<TBody>;
    sendResponse(request: DapRequestMessage, success: boolean, body?: unknown, message?: string): Promise<void>;
    dispose(): Promise<void>;
}
export {};
