/**
 * Sheet Engine Pool — manages multiple headless workbooks via @mog-sdk/node.
 *
 * Each workbook is created through the SDK's createWorkbook() function.
 * Uses the full kernel so formulas, undo, and CRDT sync all work correctly.
 *
 * Workbooks are keyed by name (basename):
 * - loadWorkbook("/path/to/Budget.xlsx") → keyed as "Budget.xlsx"
 * - createWorkbook() → auto-named "Book1", "Book2", etc.
 *
 * The pool persists for the entire agent session. Workbook state (cells,
 * formulas, undo history) survives across sandbox executions — same model
 * as Excel staying open in COM mode.
 */
import type { Workbook } from './sdk-types.js';
/** Callback types for pool lifecycle events. */
export type PoolWorkbookCallback = (name: string, workbook: Workbook) => void;
export declare class SheetEnginePool {
    private workbooks;
    /** name → original file path (for loaded workbooks) */
    private sourcePaths;
    private nextBookNum;
    /** The most recently created/loaded workbook name. */
    activeWorkbookName: string | null;
    private onAddedCallbacks;
    /** Subscribe to workbook-added events. Returns unsubscribe function. */
    onWorkbookAdded(cb: PoolWorkbookCallback): () => void;
    private constructor();
    /** Create a pool. The SDK resolves its own platform-native dependency. */
    static init(): Promise<SheetEnginePool>;
    /** Create a blank workbook. Auto-named "Book1", "Book2", etc. Returns the name. */
    createWorkbook(name?: string): Promise<string>;
    /**
     * Open a workbook from XLSX bytes, keyed by name.
     * If a workbook with this name is already open, returns the existing one (idempotent).
     */
    openWorkbook(name: string, xlsxBuffer: Buffer): Promise<string>;
    /** Register an externally-created workbook into the pool (e.g. from CRDT sync). */
    registerWorkbook(name: string, wb: Workbook): void;
    /** Close a workbook and free resources. */
    close(name: string): Promise<void>;
    /** Close all workbooks. */
    closeAll(): Promise<void>;
    get size(): number;
    /** List all open workbook names. */
    listWorkbooks(): string[];
    /** Check if a workbook is open. */
    has(name: string): boolean;
    /** Record the original file path for a loaded workbook. */
    setSourcePath(name: string, path: string): void;
    /** Get the original file path for a loaded workbook (undefined for created workbooks). */
    getSourcePath(name: string): string | undefined;
    getWorkbook(name: string): Workbook;
}
//# sourceMappingURL=sheet-engine.d.ts.map