import type * as Protocol from '@bilig/protocol';
import type { StructuralAxisTransform } from '@bilig/formula';
import type { SheetGridAxisRemapScope } from './sheet-grid.js';
import { CellStore } from './cell-store.js';
import type { StructuralTransaction } from './engine/structural-transaction.js';
import type { EngineCounters } from './perf/engine-counters.js';
import { type WorkbookMetadataService } from './workbook-metadata-service.js';
import { type WorkbookAxisMetadataRecord, type WorkbookCalculationSettingsRecord, type WorkbookChartRecord, type WorkbookConditionalFormatRecord, type WorkbookSheetConditionalFormatArtifactsRecord, type WorkbookDataValidationRecord, type WorkbookDrawingArtifactsRecord, type WorkbookExternalLinkArtifactsRecord, type WorkbookCellNumberFormatRecord, type WorkbookCellStyleRecord, type WorkbookDefinedNameRecord, type WorkbookFilterRecord, type WorkbookFormatRangeRecord, type WorkbookFreezePaneRecord, type WorkbookHyperlinkRecord, type WorkbookImageRecord, type WorkbookMacroPayloadRecord, type WorkbookMergeRangeRecord, type WorkbookMetadataRecord, type WorkbookPivotRecord, type WorkbookProtectionRecord, type WorkbookPropertyRecord, type WorkbookRangeProtectionRecord, type WorkbookSheetDrawingArtifactsRecord, type WorkbookSheetProtectionRecord, type WorkbookSheetTabColorRecord, type WorkbookShapeRecord, type WorkbookSortKeyRecord, type WorkbookSortRecord, type WorkbookSpillRecord, type WorkbookStyleRangeRecord, type WorkbookTableRecord, type WorkbookVolatileContextRecord, type WorkbookNoteRecord } from './workbook-metadata-types.js';
import { type EnsuredCell } from './workbook-cell-record-store.js';
import { type WorkbookAxisGeometryPatch } from './workbook-axis-metadata-store.js';
import type { SheetRecord } from './workbook-sheet-record.js';
import { WorkbookStoreCommentAccessors } from './workbook-store-comment-accessors.js';
export { makeCellKey, makeLogicalCellKey } from './workbook-cell-key-index.js';
export { normalizeDefinedName, normalizeWorkbookObjectName, imageKey, pivotKey, shapeKey } from './workbook-metadata-types.js';
export type * from './workbook-store-types.js';
export declare class WorkbookStore extends WorkbookStoreCommentAccessors {
    private readonly counters?;
    static readonly defaultStyleId = "style-0";
    static readonly defaultFormatId = "format-0";
    readonly cellStore: CellStore;
    readonly sheetsByName: Map<string, SheetRecord>;
    readonly sheetsById: Map<number, SheetRecord>;
    readonly cellKeyToIndex: Map<number, number>;
    readonly cellFormats: Map<number, string>;
    readonly cellStyles: Map<string, WorkbookCellStyleRecord>;
    readonly styleKeys: Map<string, string>;
    readonly cellNumberFormats: Map<string, WorkbookCellNumberFormatRecord>;
    readonly numberFormatKeys: Map<string, string>;
    readonly metadata: WorkbookMetadataRecord;
    private readonly idAllocator;
    private metadataServiceValue;
    private readonly sheetRegistry;
    private readonly cellRecordStore;
    private readonly axisEntryStore;
    private readonly axisMetadataStore;
    private readonly columnVersionStore;
    private readonly structuralCellStore;
    private readonly structuralAxisOperations;
    workbookName: string;
    constructor(workbookName?: string, counters?: EngineCounters | undefined);
    protected get metadataService(): WorkbookMetadataService;
    hasStructuralMetadataForSheet(sheetName: string): boolean;
    hasProtectionMetadataForSheet(sheetName: string): boolean;
    createSheet(name: string, order?: number, id?: number): SheetRecord;
    moveSheet(name: string, order: number): SheetRecord | undefined;
    deleteSheet(name: string): void;
    renameSheet(oldName: string, nextName: string): SheetRecord | undefined;
    renameSheetById(sheetId: number, trimmedName: string): SheetRecord | undefined;
    renameSheetByIdTrustedPrevalidated(sheetId: number, oldName: string, trimmedName: string): SheetRecord | undefined;
    getSheet(name: string): SheetRecord | undefined;
    getSheetColumnVersion(sheetName: string, col: number): number;
    getSheetStructureVersion(sheetName: string): number;
    getSheetById(id: number): SheetRecord | undefined;
    getOrCreateSheet(name: string): SheetRecord;
    ensureCell(sheetName: string, address: string): number;
    ensureCellRecord(sheetName: string, address: string): EnsuredCell;
    ensureCellAt(sheetId: number, row: number, col: number): EnsuredCell;
    attachAllocatedCell(sheetId: number, row: number, col: number, cellIndex: number): void;
    ensureLogicalAxisId(sheetId: number, axis: 'row' | 'column', index: number): string;
    createLogicalAxisIdEnsurer(sheetId: number, axis: 'row' | 'column'): (index: number) => string;
    createDenseLogicalAxisIds(sheetId: number, axis: 'row' | 'column', start: number, count: number): string[];
    attachAllocatedCellWithLogicalAxisIds(sheetId: number, row: number, col: number, cellIndex: number, rowId: string, colId: string): void;
    withBatchedColumnVersionUpdates<T>(execute: () => T): T;
    notifyCellValueWritten(cellIndex: number): void;
    notifyColumnsWritten(sheetId: number, columns: readonly number[] | Uint32Array): void;
    notifyColumnWritten(sheetId: number, col: number): void;
    notifyColumnPairWritten(sheetId: number, firstCol: number, secondCol: number): void;
    getCellIndex(sheetName: string, address: string): number | undefined;
    getCellIndexAt(sheetId: number, row: number, col: number): number | undefined;
    getFreshCellIndexAt(sheetId: number, row: number, col: number): number | undefined;
    getSheetNameById(id: number): string;
    getAddress(index: number): string;
    getQualifiedAddress(index: number): string;
    getCellPosition(index: number): {
        sheetId: number;
        row: number;
        col: number;
    } | undefined;
    getCellAxisIndex(index: number, axis: 'row' | 'column'): number | undefined;
    detachCellIndex(index: number): boolean;
    pruneCellIfEmpty(index: number): boolean;
    setCellFormat(index: number, format: string | null | undefined): void;
    getCellFormat(index: number): string | undefined;
    upsertCellStyle(style: Protocol.CellStyleRecord): WorkbookCellStyleRecord;
    internCellStyle(style: Omit<WorkbookCellStyleRecord, 'id'>): WorkbookCellStyleRecord;
    getCellStyle(id: string | undefined): WorkbookCellStyleRecord | undefined;
    getCellStyleProtection(sheetName: string, row: number, col: number): Protocol.CellStyleRecord['protection'] | undefined;
    listCellStyles(): WorkbookCellStyleRecord[];
    upsertCellNumberFormat(format: Protocol.CellNumberFormatRecord): WorkbookCellNumberFormatRecord;
    internCellNumberFormat(format: string | Protocol.CellNumberFormatRecord): WorkbookCellNumberFormatRecord;
    getCellNumberFormat(id: string | undefined): WorkbookCellNumberFormatRecord | undefined;
    listCellNumberFormats(): WorkbookCellNumberFormatRecord[];
    setStyleRange(range: Protocol.CellRangeRef, styleId: string): WorkbookStyleRangeRecord;
    coalesceStyleRanges(sheetName: string): WorkbookStyleRangeRecord[];
    listStyleRanges(sheetName: string): WorkbookStyleRangeRecord[];
    setStyleRanges(sheetName: string, ranges: readonly Protocol.SheetStyleRangeSnapshot[]): WorkbookStyleRangeRecord[];
    getStyleId(sheetName: string, row: number, col: number): string;
    setFormatRange(range: Protocol.CellRangeRef, formatId: string): WorkbookFormatRangeRecord;
    listFormatRanges(sheetName: string): WorkbookFormatRangeRecord[];
    setFormatRanges(sheetName: string, ranges: readonly Protocol.SheetFormatRangeSnapshot[]): WorkbookFormatRangeRecord[];
    getRangeFormatId(sheetName: string, row: number, col: number): string;
    setWorkbookProperty(key: string, value: Protocol.LiteralInput): WorkbookPropertyRecord | undefined;
    getWorkbookProperty(key: string): WorkbookPropertyRecord | undefined;
    listWorkbookProperties(): WorkbookPropertyRecord[];
    setWorkbookProtection(record: Protocol.WorkbookProtectionSnapshot): WorkbookProtectionRecord;
    getWorkbookProtection(): WorkbookProtectionRecord | undefined;
    setMacroPayload(record: Protocol.WorkbookMacroPayloadSnapshot): WorkbookMacroPayloadRecord;
    listMacroPayloads(): WorkbookMacroPayloadRecord[];
    setCalculationSettings(settings: Protocol.WorkbookCalculationSettingsSnapshot): WorkbookCalculationSettingsRecord;
    getCalculationSettings(): WorkbookCalculationSettingsRecord;
    setVolatileContext(context: Protocol.WorkbookVolatileContextSnapshot): WorkbookVolatileContextRecord;
    getVolatileContext(): WorkbookVolatileContextRecord;
    setDrawingArtifacts(artifacts: Protocol.WorkbookDrawingArtifactsSnapshot): WorkbookDrawingArtifactsRecord;
    getDrawingArtifacts(): WorkbookDrawingArtifactsRecord | undefined;
    clearDrawingArtifacts(): boolean;
    setExternalLinkArtifacts(artifacts: Protocol.WorkbookExternalLinkArtifactsSnapshot): WorkbookExternalLinkArtifactsRecord;
    getExternalLinkArtifacts(): WorkbookExternalLinkArtifactsRecord | undefined;
    clearExternalLinkArtifacts(): boolean;
    setDefinedName(name: string, value: Protocol.WorkbookDefinedNameValueSnapshot, scopeSheetName?: string): WorkbookDefinedNameRecord;
    getDefinedName(name: string, scopeSheetName?: string): WorkbookDefinedNameRecord | undefined;
    deleteDefinedName(name: string, scopeSheetName?: string): boolean;
    listDefinedNames(): WorkbookDefinedNameRecord[];
    setTable(record: Protocol.WorkbookTableSnapshot): WorkbookTableRecord;
    getTable(name: string): WorkbookTableRecord | undefined;
    deleteTable(name: string): boolean;
    hasTables(): boolean;
    listTables(): WorkbookTableRecord[];
    setRowMetadata(sheetName: string, start: number, count: number, size: number | null, hidden: boolean | null, geometry?: WorkbookAxisGeometryPatch, filterHidden?: boolean | null): WorkbookAxisMetadataRecord | undefined;
    getRowMetadata(sheetName: string, start: number, count: number): WorkbookAxisMetadataRecord | undefined;
    listRowMetadata(sheetName: string): WorkbookAxisMetadataRecord[];
    setColumnMetadata(sheetName: string, start: number, count: number, size: number | null, hidden: boolean | null, geometry?: WorkbookAxisGeometryPatch, filterHidden?: boolean | null): WorkbookAxisMetadataRecord | undefined;
    getColumnMetadata(sheetName: string, start: number, count: number): WorkbookAxisMetadataRecord | undefined;
    listColumnMetadata(sheetName: string): WorkbookAxisMetadataRecord[];
    setSheetFormatPr(sheetName: string, sheetFormatPr: Protocol.WorkbookSheetFormatPrSnapshot): void;
    getSheetFormatPr(sheetName: string): Protocol.WorkbookSheetFormatPrSnapshot | undefined;
    setSheetVisibility(sheetName: string, visibility: Protocol.WorkbookSheetVisibilitySnapshot | undefined): void;
    getSheetVisibility(sheetName: string): Protocol.WorkbookSheetVisibilitySnapshot | undefined;
    listRowAxisEntries(sheetName: string): Protocol.WorkbookAxisEntrySnapshot[];
    listColumnAxisEntries(sheetName: string): Protocol.WorkbookAxisEntrySnapshot[];
    snapshotRowAxisEntries(sheetName: string, start: number, count: number): Protocol.WorkbookAxisEntrySnapshot[];
    snapshotColumnAxisEntries(sheetName: string, start: number, count: number): Protocol.WorkbookAxisEntrySnapshot[];
    materializeRowAxisEntries(sheetName: string, start: number, count: number): Protocol.WorkbookAxisEntrySnapshot[];
    materializeColumnAxisEntries(sheetName: string, start: number, count: number): Protocol.WorkbookAxisEntrySnapshot[];
    private bumpProvidedAxisEntryIds;
    insertRows(sheetName: string, start: number, count: number, entries?: readonly Protocol.WorkbookAxisEntrySnapshot[]): void;
    deleteRows(sheetName: string, start: number, count: number): Protocol.WorkbookAxisEntrySnapshot[];
    moveRows(sheetName: string, start: number, count: number, target: number): void;
    insertColumns(sheetName: string, start: number, count: number, entries?: readonly Protocol.WorkbookAxisEntrySnapshot[]): void;
    deleteColumns(sheetName: string, start: number, count: number): Protocol.WorkbookAxisEntrySnapshot[];
    moveColumns(sheetName: string, start: number, count: number, target: number): void;
    setFreezePane(sheetName: string, rows: number, cols: number, options?: Pick<Protocol.WorkbookFreezePaneSnapshot, 'topLeftCell' | 'activePane'>): WorkbookFreezePaneRecord;
    getFreezePane(sheetName: string): WorkbookFreezePaneRecord | undefined;
    clearFreezePane(sheetName: string): boolean;
    setSheetTabColor(sheetName: string, tabColor: Protocol.WorkbookSheetTabColorSnapshot): WorkbookSheetTabColorRecord;
    getSheetTabColor(sheetName: string): WorkbookSheetTabColorRecord | undefined;
    clearSheetTabColor(sheetName: string): boolean;
    setMergeRange(range: Protocol.CellRangeRef): WorkbookMergeRangeRecord;
    setMergeRanges(sheetName: string, ranges: readonly Protocol.CellRangeRef[]): WorkbookMergeRangeRecord[];
    getMergeRange(sheetName: string, address: string): WorkbookMergeRangeRecord | undefined;
    getMergeRangeByRange(range: Protocol.CellRangeRef): WorkbookMergeRangeRecord | undefined;
    clearMergeRanges(range: Protocol.CellRangeRef): WorkbookMergeRangeRecord[];
    listMergeRanges(sheetName: string): WorkbookMergeRangeRecord[];
    setSheetProtection(record: Protocol.WorkbookSheetProtectionSnapshot): WorkbookSheetProtectionRecord;
    getSheetProtection(sheetName: string): WorkbookSheetProtectionRecord | undefined;
    clearSheetProtection(sheetName: string): boolean;
    setFilter(sheetName: string, range: Protocol.WorkbookAutoFilterSnapshot): WorkbookFilterRecord;
    getFilter(sheetName: string, range: Protocol.CellRangeRef): WorkbookFilterRecord | undefined;
    deleteFilter(sheetName: string, range: Protocol.CellRangeRef): boolean;
    listFilters(sheetName: string): WorkbookFilterRecord[];
    setSort(sheetName: string, range: Protocol.CellRangeRef, keys: readonly WorkbookSortKeyRecord[]): WorkbookSortRecord;
    getSort(sheetName: string, range: Protocol.CellRangeRef): WorkbookSortRecord | undefined;
    deleteSort(sheetName: string, range: Protocol.CellRangeRef): boolean;
    listSorts(sheetName: string): WorkbookSortRecord[];
    setDataValidation(record: Protocol.WorkbookDataValidationSnapshot): WorkbookDataValidationRecord;
    getDataValidation(sheetName: string, range: Protocol.CellRangeRef): WorkbookDataValidationRecord | undefined;
    deleteDataValidation(sheetName: string, range: Protocol.CellRangeRef): boolean;
    listDataValidations(sheetName: string): WorkbookDataValidationRecord[];
    setConditionalFormat(record: Protocol.WorkbookConditionalFormatSnapshot): WorkbookConditionalFormatRecord;
    getConditionalFormat(id: string): WorkbookConditionalFormatRecord | undefined;
    deleteConditionalFormat(id: string): boolean;
    listConditionalFormats(sheetName: string): WorkbookConditionalFormatRecord[];
    setConditionalFormatArtifacts(sheetName: string, artifacts: Protocol.WorkbookSheetConditionalFormatArtifactsSnapshot): WorkbookSheetConditionalFormatArtifactsRecord;
    getConditionalFormatArtifacts(sheetName: string): WorkbookSheetConditionalFormatArtifactsRecord | undefined;
    deleteConditionalFormatArtifacts(sheetName: string): boolean;
    setSheetDrawingArtifacts(sheetName: string, artifacts: Protocol.WorkbookSheetDrawingArtifactsSnapshot): WorkbookSheetDrawingArtifactsRecord;
    getSheetDrawingArtifacts(sheetName: string): WorkbookSheetDrawingArtifactsRecord | undefined;
    deleteSheetDrawingArtifacts(sheetName: string): boolean;
    setRangeProtection(record: Protocol.WorkbookRangeProtectionSnapshot): WorkbookRangeProtectionRecord;
    getRangeProtection(id: string): WorkbookRangeProtectionRecord | undefined;
    deleteRangeProtection(id: string): boolean;
    listRangeProtections(sheetName: string): WorkbookRangeProtectionRecord[];
    setNote(record: Protocol.WorkbookNoteSnapshot): WorkbookNoteRecord;
    getNote(sheetName: string, address: string): WorkbookNoteRecord | undefined;
    deleteNote(sheetName: string, address: string): boolean;
    listNotes(sheetName: string): WorkbookNoteRecord[];
    setHyperlink(record: Protocol.WorkbookHyperlinkSnapshot): WorkbookHyperlinkRecord;
    getHyperlink(sheetName: string, address: string): WorkbookHyperlinkRecord | undefined;
    deleteHyperlink(sheetName: string, address: string): boolean;
    listHyperlinks(sheetName: string): WorkbookHyperlinkRecord[];
    setSpill(sheetName: string, address: string, rows: number, cols: number): WorkbookSpillRecord;
    getSpill(sheetName: string, address: string): WorkbookSpillRecord | undefined;
    deleteSpill(sheetName: string, address: string): boolean;
    listSpills(): WorkbookSpillRecord[];
    setPivot(record: Protocol.WorkbookPivotSnapshot): WorkbookPivotRecord;
    getPivot(sheetName: string, address: string): WorkbookPivotRecord | undefined;
    getPivotByKey(key: string): WorkbookPivotRecord | undefined;
    deletePivot(sheetName: string, address: string): boolean;
    hasPivots(): boolean;
    listPivots(): WorkbookPivotRecord[];
    setChart(record: Protocol.WorkbookChartSnapshot): WorkbookChartRecord;
    getChart(id: string): WorkbookChartRecord | undefined;
    deleteChart(id: string): boolean;
    listCharts(): WorkbookChartRecord[];
    setImage(record: Protocol.WorkbookImageSnapshot): WorkbookImageRecord;
    getImage(id: string): WorkbookImageRecord | undefined;
    deleteImage(id: string): boolean;
    listImages(): WorkbookImageRecord[];
    setShape(record: Protocol.WorkbookShapeSnapshot): WorkbookShapeRecord;
    getShape(id: string): WorkbookShapeRecord | undefined;
    deleteShape(id: string): boolean;
    listShapes(): WorkbookShapeRecord[];
    remapSheetCells(sheetName: string, axis: 'row' | 'column', remapIndex: (index: number) => number | undefined, scope?: SheetGridAxisRemapScope): {
        changedCellIndices: number[];
        removedCellIndices: number[];
    };
    planStructuralAxisTransform(sheetName: string, transform: StructuralAxisTransform): StructuralTransaction | undefined;
    applyPlannedStructuralTransaction(transaction: StructuralTransaction): StructuralTransaction | undefined;
    applyStructuralAxisTransform(sheetName: string, transform: StructuralAxisTransform): StructuralTransaction | undefined;
    reset(workbookName?: string): void;
    releaseReusableBuffers(): void;
    private bumpSheetStructureVersion;
    private createLogicalAxisId;
    private createLogicalAxisIds;
}
