export declare const WIN32_PTY_WRITE_CHUNK_CHARS = 1024;
export declare const WIN32_PTY_WRITE_CHUNK_GAP_MS = 8;
/** Split `text` into chunks of at most `size` UTF-16 units without ever cutting
 *  between a high and low surrogate (which would corrupt an astral char — emoji,
 *  etc. — on the UTF-8 PTY write). */
export declare function chunkPreservingSurrogates(text: string, size: number): string[];
/** True when a body of `length` UTF-16 units should be paced into multiple
 *  chunks on win32 rather than written in a single PTY write. */
export declare function shouldChunkWin32Write(length: number): boolean;
/**
 * Drive a paced, surrogate-safe chunked write of `text` over a `write(chunk)`
 * sink, calling `onChunkWritten` after each chunk (e.g. to advance an input-
 * activity timestamp) and `onDone` once the final chunk is out. The optional
 * `setTimer` lets the caller own the timer handle (so it can be cleared on
 * shutdown) and supply a custom scheduler in tests; it defaults to setTimeout.
 *
 * Bodies at or below the chunk threshold are written in a SINGLE write — the
 * common case — so this is a no-op pacing wrapper for normal-sized prompts.
 *
 * Returns the chunks that will be written (useful for assertions/logging).
 */
export interface PacedWin32WriteOptions {
    write: (chunk: string) => void;
    onChunkWritten?: () => void;
    onDone?: () => void;
    /** Schedule the next chunk; must return a handle the caller can clear.
     *  Defaults to setTimeout. */
    setTimer?: (fn: () => void, delayMs: number) => ReturnType<typeof setTimeout>;
    /** Store the pending timer handle so the caller can clear it on shutdown. */
    onTimer?: (handle: ReturnType<typeof setTimeout> | null) => void;
    chunkChars?: number;
    gapMs?: number;
}
export declare function writeWin32Paced(text: string, opts: PacedWin32WriteOptions): string[];
