import type { DataFieldManager } from '@univerjs-pro/engine-pivot'; import type { IPivotCacheHandle } from '@univerjs-pro/pivot-cache'; import type { IRange, Worksheet } from '@univerjs/core'; import type { IMoveRangeMutationParams } from '@univerjs/sheets'; import { Disposable, IUniverInstanceService } from '@univerjs/core'; import type { ISheetsPivotCacheSnapshot, IUnitRangeNameWithSubUnitId } from '../const/type'; export interface ISheetsPivotCacheRefreshPayload { dirtyFieldIds: readonly string[]; previousFieldNames: Readonly>; } export interface ISheetsPivotCacheRefreshResult extends ISheetsPivotCacheRefreshPayload { pivotCacheId: string; } export declare class SheetsPivotCacheService extends Disposable { private readonly _univerInstanceService; private readonly _cacheById; private readonly _cacheBySourceKey; private readonly _reportBindings; private readonly _refreshCycleCache; constructor(_univerInstanceService: IUniverInstanceService); getExistingCacheId(source: IUnitRangeNameWithSubUnitId, dataFieldManager: DataFieldManager): string | undefined; updateSource(pivotCacheId: string, source: IUnitRangeNameWithSubUnitId): void; moveSources(params: IMoveRangeMutationParams): { pivotCacheId: string; before: IUnitRangeNameWithSubUnitId; after: IUnitRangeNameWithSubUnitId; }[]; private _findCache; acquireForReport(reportUnitId: string, reportId: string, sourceRangeInfo: IUnitRangeNameWithSubUnitId, dataFieldManager: DataFieldManager, preferredPivotCacheId?: string): IPivotCacheHandle; releaseReport(reportUnitId: string, reportId: string): void; acquireById(ownerUnitId: string, pivotCacheId: string, retainSource?: boolean): IPivotCacheHandle; getSourceRange(ownerUnitId: string, pivotCacheId: string): IUnitRangeNameWithSubUnitId | undefined; getReportPivotCacheId(reportUnitId: string, reportId: string): string | undefined; getReportHandle(reportUnitId: string, reportId: string): IPivotCacheHandle | undefined; toJSON(unitId: string): Record; fromJSON(unitId: string, snapshots: Record, dataFieldManager: DataFieldManager): void; pruneUnreferenced(unitId: string): void; deleteUnitId(unitId: string): void; refreshOnce(pivotCacheId: string, cycleKey: object, refresh: () => ISheetsPivotCacheRefreshPayload): ISheetsPivotCacheRefreshResult; dispose(): void; private _normalizeSource; private _createRecord; private _createHandle; private _deleteRecordIfUnused; } export declare function normalizeSourceRange(range: IRange, sheet: Worksheet): IRange; export declare function getMovedPivotSource(source: IUnitRangeNameWithSubUnitId, params: IMoveRangeMutationParams, sheetName: string): IUnitRangeNameWithSubUnitId | undefined;