import { StateField, type Transaction } from "@codemirror/state";
import { EditorView, ViewPlugin, type ViewUpdate } from "@codemirror/view";
import type { DiffHunk } from "../diff";
export type AIState = {
    phase: "idle";
} | {
    phase: "generating";
    from: number;
    to: number;
    original: string;
    genId: number;
    action: string;
    prompts?: string;
} | {
    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;
    readonly view: EditorView;
    update(update: ViewUpdate): void;
    sync(): void;
    destroy(): void;
}, undefined>;
//# sourceMappingURL=extension.d.ts.map