import { Dimension } from "../../../../base/browser/dom.js"; import { Disposable } from "../../../../base/common/lifecycle.js"; import { IObservable, ITransaction } from "../../../../base/common/observable.js"; import { INewScrollPosition, IScrollPosition } from "../../../../base/common/scrollable.js"; import { OffsetRange } from "../../../common/core/ranges/offsetRange.js"; import { ICompressedVirtualizedScrollLayout, ILogicalPosition, ISizeEdit, LayoutRevision } from "./compressedVirtualizedScrollLayout.js"; export interface ICompressedVirtualizedScrollItem { readonly size: IObservable; readonly maxScroll: IObservable<{ readonly maxScroll: number; }>; render(renderedRange: OffsetRange, scrollOffset: number, width: number, renderedViewport: OffsetRange, context: ICompressedVirtualizedScrollItemContext): void; hide(): void; } export interface ICompressedVirtualizedScrollViewContext { readonly contentDomNode: HTMLElement; readonly overflowWidgetsDomNode: HTMLElement; readonly scrollLeft: IObservable; } export interface ICompressedVirtualizedScrollItemContext { runWithScrollAnchor(getItemOffset: () => number, update: (tx: ITransaction) => void): void; } export interface ICompressedVirtualizedGeometryEdit { readonly fromRevision: LayoutRevision; readonly toRevision: LayoutRevision; readonly edits: readonly ISizeEdit[]; readonly anchorKind: "viewportTop" | "viewportBottom" | "logical" | "item"; readonly anchorOffset: number; readonly mappedAnchorOffset: number; readonly anchorViewportOffset: number; readonly desiredScrollTop: number; readonly appliedScrollTop: number; readonly leadingScrollSlack: number; readonly trailingScrollSlack: number; } /** * Virtualizes complete-height items into viewport-capped rows whose removed height is represented by item-local scrolling. */ export declare class CompressedVirtualizedScrollView extends Disposable { private readonly _scrollableElements; private readonly _scrollable; private readonly _scrollableElement; private readonly _sizeObserver; private readonly _items; private readonly _layout; private readonly _scrollDimensions; private readonly _lastGeometryEdit; private readonly _itemAnchorEditSignal; private _revision; private _leadingScrollSlack; private _trailingScrollSlack; private _previousItems; private _previousItemHeights; private _previousItemGap; private _lastScrollTop; private _lastScrollDirection; private readonly _clearScrollDirection; private _isUpdating; private _pendingAnchor; readonly domNode: HTMLElement; readonly scrollTop: IObservable; readonly scrollLeft: IObservable; readonly layout: IObservable; readonly scrollDimensions: IObservable<{ readonly width: number; readonly height: number; readonly scrollWidth: number; readonly scrollHeight: number; }>; readonly lastGeometryEdit: IObservable; constructor(elementToObserve: HTMLElement, dimension: IObservable, itemGap: IObservable, createItems: (context: ICompressedVirtualizedScrollViewContext) => IObservable); setScrollPosition(position: INewScrollPosition, smooth?: boolean): void; setLogicalScrollPosition(scrollTop: number, smooth?: boolean): void; getScrollPosition(): IScrollPosition; runWithScrollAnchor(anchor: ILogicalPosition, update: (tx: ITransaction) => void): void; private _runWithItemScrollAnchor; private _runWithPendingAnchor; private _update; private _render; }