/**
 * Finalizable draft lifecycle helpers for draft streaming.
 */
import { type DraftStreamLoop } from './draft-stream-loop.js';
export type FinalizableDraftStreamState = {
    stopped: boolean;
    final: boolean;
};
type StopAndClearMessageIdParams<T> = {
    stopForClear: () => Promise<void>;
    readMessageId: () => T | undefined;
    clearMessageId: () => void;
};
type ClearFinalizableDraftMessageParams<T> = StopAndClearMessageIdParams<T> & {
    isValidMessageId: (value: unknown) => value is T;
    deleteMessage: (messageId: T) => Promise<void>;
    onDeleteSuccess?: (messageId: T) => void;
    warn?: (message: string) => void;
    warnPrefix: string;
};
type FinalizableDraftLifecycleParams<T> = Omit<ClearFinalizableDraftMessageParams<T>, 'stopForClear'> & {
    throttleMs: number;
    state: FinalizableDraftStreamState;
    sendOrEditStreamMessage: (text: string) => Promise<boolean>;
};
export declare function createFinalizableDraftStreamControlsForState(params: {
    throttleMs: number;
    state: FinalizableDraftStreamState;
    sendOrEditStreamMessage: (text: string) => Promise<boolean>;
}): {
    loop: DraftStreamLoop;
    update: (text: string) => void;
    stop: () => Promise<void>;
    stopForClear: () => Promise<void>;
};
export declare function clearFinalizableDraftMessage<T>(params: ClearFinalizableDraftMessageParams<T>): Promise<void>;
export declare function createFinalizableDraftLifecycle<T>(params: FinalizableDraftLifecycleParams<T>): {
    clear: () => Promise<void>;
    loop: DraftStreamLoop;
    update: (text: string) => void;
    stop: () => Promise<void>;
    stopForClear: () => Promise<void>;
};
export {};
