import type { IFieldsCollectionJSON } from '@univerjs-pro/engine-pivot'; import type { IRange, Nullable, ObjectMatrix } from '@univerjs/core'; import type { IDataFieldManagerJSON, IPivotCellPositionInfo, IPivotCollectionChange, IPivotRangesInfo, IPivotTableCellData, IPivotTableConfig, IPivotTableMatrixInfo, IPivotTableRangeInfo, ISheetsPivotCacheSnapshot } from '../const/type'; import { Disposable, ICommandService, IConfigService, Injector, IResourceManagerService, IUniverInstanceService, LocaleService } from '@univerjs/core'; interface IPivotConfigChange { unitId: string; subUnitId: string; pivotTableId: string; pivotTableConfig: Nullable; } export declare class SheetsPivotTableConfigModel extends Disposable { private _injector; private _commandService; private _univerInstanceService; private _resourceManagerService; private readonly _configService; private readonly _localeService; private _model; private _collectionConfigModel; private readonly _cacheConfigModel; private readonly _retainedSources; private readonly _runtimeIds; private readonly _runtimeStates; private readonly _runtimeState$; readonly runtimeState$: import("rxjs").Observable<{ unitId: string; state: 'initializing' | 'ready' | 'error'; }>; private _pivotTableRangeInfo; private _pivotTableMatrixInfo; private readonly _collectionChange$; readonly collectionChange$: import("rxjs").Observable; private _pendingChanges?; private _pivotInitCompleted$; pivotInitCompleted$: import("rxjs").Observable; private _pivotConfigChange$; pivotConfigChange$: import("rxjs").Observable; private _textInfo; constructor(_injector: Injector, _commandService: ICommandService, _univerInstanceService: IUniverInstanceService, _resourceManagerService: IResourceManagerService, _configService: IConfigService, _localeService: LocaleService); private _trackWorksheetWrites; private _excludeWorksheetOutputCells; /** Publish notifications only after all related synchronous model writes have completed. */ batchUpdate(update: () => T): T; watchPivotTableChanges(unitId: string, subUnitId: string, pivotTableId: string): import("rxjs").Observable; private _emitConfigChange; private _emitCollectionChange; private _moveSources; private _initUnitDisposed; setPivotInitCompleted(): void; beginRuntime(unitId: string, runtimeId: string): void; getRuntimeId(unitId: string): string | undefined; getRuntimeState(unitId: string): 'initializing' | 'ready' | 'error' | undefined; setRuntimeState(unitId: string, state: 'initializing' | 'ready' | 'error'): void; acceptsRuntime(unitId: string, runtimeId?: string): boolean; /** Worker results may refresh derived names, but never replace mutation-owned configuration. */ updateDerivedConfig(unitId: string, subUnitId: string, pivotTableId: string, result: Nullable, collection?: IFieldsCollectionJSON): boolean; private _getDefaultFieldName; private _getCalculationConfig; updateDerivedMetadata(unitId: string, metadata?: IDataFieldManagerJSON, caches?: Record): void; private _initLocale; getTextInfo(): Record; updateViewInfo(unitId: string, subUnitId: string, pivotTableId: string, valueMatrix: ObjectMatrix>, rangesCache: IPivotRangesInfo | undefined, blockedByWorksheet?: boolean, blocked?: boolean): void; getPivotTableConfig(unitId: string, subUnitId: string, pivotTableId: string): Nullable; getTargetByPivotTableId(unitId: string, pivotTableId: string): IPivotCellPositionInfo | undefined; getTargetByPivotId(unitId: string, subUnitId: string, pivotTableId: string): Nullable; getSubUnitPivotConfigs(unitId: string, subUnitId: string): Map | undefined; updateConfigCache(unitId: string, subUnitId: string, pivotTableId: string, pivotTableConfig: Nullable): void; prepareConfigBatch(updates: readonly { unitId: string; subUnitId: string; pivotTableId: string; config: IPivotTableConfig; }[]): { commit(): void; publish(): void; }; applyConfigChange(scope: { unitId: string; subUnitId: string; pivotTableId: string; }, apply: (config: IPivotTableConfig) => void): boolean; getCollection(unitId: string, pivotTableId: string): IFieldsCollectionJSON | undefined; updateCollectionConfig(unitId: string, collectionConfig: IDataFieldManagerJSON): void; updateCacheConfig(unitId: string, configs: Record): void; setRetainedSources(unitId: string, pivotCacheIds: readonly string[]): void; updateCollectionMetadata(unitId: string, reportId: string, collection: IFieldsCollectionJSON, cache?: ISheetsPivotCacheSnapshot): void; removeCollectionMetadata(unitId: string, reportId: string): void; private _ensurePivotMap; private _ensurePivotTableRangeInfo; private _ensurePivotTableMatrixInfo; updatePivotTableRangeInfo(unitId: string, subUnitId: string, pivotTableId: string, rangeInfo: IPivotRangesInfo | undefined, blockedByWorksheet?: boolean): void; updatePivotTableMatrixInfo(unitId: string, subUnitId: string, pivotTableId: string, matrixInfo: ObjectMatrix>): void; /** * - get the pivot table range info for sheet or calc engine * @param {string} unitId - the unit id * @param {string} subUnitId - the sub unit id * @param {string} pivotTableId - the pivot table id * @returns {IPivotTableRangeInfo} - the pivot table range info */ getPivotTableRangeInfo(unitId: string, subUnitId: string, pivotTableId: string): IPivotTableRangeInfo | undefined; getWorksheetOutputRanges(unitId: string, subUnitId: string, pivotTableId: string): IRange[] | undefined; /** * - get the pivot table matrix info for sheet or calc engine * @param {string} unitId - the unit id * @param {string} subUnitId - the sub unit id * @param {string} pivotTableId - the pivot table id * @returns {IPivotTableMatrixInfo} - the pivot table matrix info */ getPivotTableMatrixInfo(unitId: string, subUnitId: string, pivotTableId: string): IPivotTableMatrixInfo | undefined; deleteUnitId(unitId: string): void; private _toJSON; private _initSnapshot; } export {};