import { Block, BlockNoteEditor } from "@blocknote/core";
import { AIRequest } from "../aiRequest/types.js";
import { BlocksWithCursor } from "../promptHelpers/addCursorPosition.js";
/**
 * A serializable version of the document state that can be passed to the backend.
 * This will be used as input to the LLM calls.
 */
export type DocumentState<T> = {
    /**
     * No selection is active
     */
    selection: false;
    /**
     * The entire document and cursor position information.
     * Operations should be issued against these blocks and the cursor position can be used to determine the "attention" of the user
     * (i.e.: the AI suggestions should probably be made in / around the cursor position)
     */
    blocks: BlocksWithCursor<T>[];
    /**
     * Boolean to indicate if the document is empty
     */
    isEmptyDocument: boolean;
} | {
    /**
     * A selection is active
     */
    selection: true;
    /**
     * The selected blocks. Operations should be issued against these blocks.
     */
    selectedBlocks: {
        id: string;
        block: T;
    }[];
    /**
     * The entire document
     */
    blocks: {
        block: T;
    }[];
    /**
     * Boolean to indicate if the document is empty
     */
    isEmptyDocument: boolean;
};
/**
 * A function that builds the document state based on the AIRequest.
 *
 * This is split from the PromptBuilder so that for example, you can build the document state on the client side,
 * and run the PromptBuilder on the server side to modify the Messages sent to the LLM.
 */
export type DocumentStateBuilder<T> = (aiRequest: Omit<AIRequest, "documentState">) => Promise<DocumentState<T>>;
export declare function makeDocumentStateBuilder<T>(convertBlockFn: (editor: BlockNoteEditor<any, any, any>, block: Block<any, any, any>) => Promise<T>): DocumentStateBuilder<T>;
