import { Nullable, Workbook } from '@univerjs/core';
import { BehaviorSubject } from 'rxjs';
import { IRenderContext, IRenderModule } from '@univerjs/engine-render';
import { SheetSkeletonManagerService } from './sheet-skeleton-manager.service';
export interface IScrollState {
    /**
     * offsetX from startRow, coordinate same as viewport, not scrollbar
     */
    offsetX: number;
    /**
     * offsetY from startColumn, coordinate same as viewport, not scrollbar
     */
    offsetY: number;
    /**
     * currrent start row in viewport visible area
     */
    sheetViewStartRow: number;
    /**
     * current start column in viewport visible area
     */
    sheetViewStartColumn: number;
}
export interface IViewportScrollState extends IScrollState {
    scrollX: number;
    scrollY: number;
    viewportScrollX: number;
    viewportScrollY: number;
}
export interface IScrollStateSearchParam {
    unitId: string;
    sheetId: string;
}
export interface IScrollStateWithSearchParam extends IScrollStateSearchParam, IScrollState {
}
export type IScrollStateMap = Map<string, Map<string, IScrollState>>;
/**
 * This service manages and sets the virtual scrolling of the canvas content area.
 * It triggers service changes through SetScrollOperation.
 *
 * ScrollController subscribes to the changes in service data to refresh the view scrolling.
 */
export declare class SheetScrollManagerService implements IRenderModule {
    private readonly _context;
    private readonly _sheetSkeletonManagerService;
    /**
     * a map holds all scroll info for each sheet
     */
    private readonly _scrollStateMap;
    /**
     * a subject for current sheet scrollInfo
     */
    private readonly _scrollInfo$;
    /**
     * a subject for current sheet scrollInfo ( events, ex wheel event and point events add deltaXY to rawScrollInfo$)
     */
    readonly rawScrollInfo$: import('rxjs').Observable<Nullable<IScrollState>>;
    /**
     * a subject for current valid scrollInfo, viewport@_scrollCore would limit rawScrollInfo$ exclude negative value or over max value.
     * use this subject not rawScrollInfo$ when get scrolling state of viewport.
     * The value of this subject is the same as the value of onScrollAfter$
     *
     */
    readonly validViewportScrollInfo$: BehaviorSubject<Nullable<IViewportScrollState>>;
    /**
     * a subject for current valid scrollInfo, viewport@_scrollCore would limit rawScrollInfo$ exclude negative value or over max value.
     * use this subject not rawScrollInfo$ when get scrolling state of viewport.
     */
    private _searchParamForScroll;
    constructor(_context: IRenderContext<Workbook>, _sheetSkeletonManagerService: SheetSkeletonManagerService);
    dispose(): void;
    setSearchParam(param: IScrollStateSearchParam): void;
    setSearchParamAndRefresh(param: IScrollStateSearchParam): void;
    getScrollStateByParam(param: IScrollStateSearchParam): Readonly<Nullable<IScrollState>>;
    getCurrentScrollState(): Readonly<Nullable<IScrollState>>;
    /**
     * set scrollInfo by cmd, call by scroll operation
     * @param param
     */
    setScrollInfoAndEmitEvent(param: IScrollStateWithSearchParam): void;
    /**
     * call by set frozen
     * @param scrollInfo
     */
    setScrollStateToCurrSheetAndEmitEvent(scrollInfo: IScrollState): void;
    /**
     * set _scrollStateMap but no _scrollInfo$.next
     * @param scroll
     */
    setScrollStateToCurrSheet(scroll: IScrollState): void;
    clear(): void;
    calcViewportScrollFromRowColOffset(scrollInfo: Nullable<IViewportScrollState>): {
        viewportScrollX: number;
        viewportScrollY: number;
    };
    private _setScrollState;
    private _clearByParamAndNotify;
    private _getCurrentScroll;
    private _scrollStateNext;
}
