import { StateField, type Transaction } from "@codemirror/state";
import { EditorView, ViewPlugin, type ViewUpdate } from "@codemirror/view";
import type { DiffHunk } from "../diff";
import { Renderer } from "../../../renderer/Renderer";
import type { Theme } from "../../../theme/Theme";
import type { Log } from "../../../core/Log";
export type AIState = {
    phase: "idle";
} | {
    phase: "generating";
    from: number;
    to: number;
    original: string;
    genId: number;
    action: string;
    prompts?: string;
    abortController?: AbortController;
} | {
    phase: "diff";
    hunks: DiffHunk[];
};
export declare const IDLE_STATE: AIState;
export declare const setAIState: import("@codemirror/state").StateEffectType<AIState>;
export declare const aiTransaction: import("@codemirror/state").StateEffectType<null>;
/** 解析事务完成后的 AI 状态。 */
export declare function resolveAIState(tr: Transaction): AIState;
/** 判断事务是否由 AI 差异流程发起。 */
export declare function isAITransaction(tr: Transaction): boolean;
/** 正在生成或仍有待确认差异块时锁定编辑 */
export declare function isAILocked(state: AIState): boolean;
export declare const aiStateField: StateField<AIState>;
/** 分配用于忽略过期 AI 请求结果的递增生成标识 */
export declare function allocGenId(): number;
export declare const aiLockedReadOnly: import("@codemirror/state").Extension;
export declare const aiMaskPlugin: ViewPlugin<{
    mask: HTMLElement | null;
    thinkingDetails: HTMLDetailsElement | null;
    thinkingMount: HTMLElement | null;
    partialMount: HTMLElement | null;
    bodyEl: HTMLElement | null;
    thinkingRenderer: Renderer | null;
    partialRenderer: Renderer | null;
    readonly view: EditorView;
    update(update: ViewUpdate): void;
    /** 流式更新：传入 delta（增量字符），直接 append 到对应 Renderer。
     *  两个 Renderer 共享 theme 和 logger，各自持有私有 EventBus（不订阅全局主题事件）。
     */
    setStream(contentDelta: string | undefined, thinkingDelta: string | undefined, theme: Theme, logger: Log): void;
    sync(): void;
    createMask(): void;
    destroyMask(): void;
    destroy(): void;
}, undefined>;
//# sourceMappingURL=extension.d.ts.map