import type { AssistantMessage, StopReason, Usage } from "../types.js";
/**
 * Centralizes the mutable bits of an in-flight stream — the output message as
 * it accumulates, usage counters, the stop reason, and a completion flag.
 * Provider handlers lean on this single holder rather than tracking those
 * pieces independently.
 */
export declare class StreamingStateManager {
    /** The assistant message that grows in place as events arrive. */
    readonly output: AssistantMessage;
    private _stopReason;
    private _isComplete;
    /**
     * @param initialOutput - Starting assistant message; this instance edits it directly.
     */
    constructor(initialOutput: AssistantMessage);
    /**
     * Fold the supplied usage values into the output's running totals.
     *
     * @param update - Partial set of usage counters to apply.
     */
    setUsage(update: Partial<Usage>): void;
    /**
     * Note why streaming stopped and reflect that choice onto the output.
     *
     * @param reason - The stop reason to remember.
     */
    setStopReason(reason: StopReason): void;
    /** The most recently set stop reason. */
    get stopReason(): StopReason;
    /** Mark the stream as done. */
    complete(): void;
    /** True once the stream has been marked done. */
    get isComplete(): boolean;
    /**
     * Mark the stream as failed: completes it, switches the stop reason to
     * `error`, and records the failure text on the output.
     *
     * @param errorMessage - Human-readable description of the failure.
     */
    error(errorMessage: string): void;
}
