[6a3a178] | 1 | /**
|
---|
| 2 | * @license
|
---|
| 3 | * Copyright Google LLC All Rights Reserved.
|
---|
| 4 | *
|
---|
| 5 | * Use of this source code is governed by an MIT-style license that can be
|
---|
| 6 | * found in the LICENSE file at https://angular.io/license
|
---|
| 7 | */
|
---|
| 8 | import { NumberInput } from '@angular/cdk/coercion';
|
---|
| 9 | import { OnChanges } from '@angular/core';
|
---|
| 10 | import { Observable } from 'rxjs';
|
---|
| 11 | import { VirtualScrollStrategy } from './virtual-scroll-strategy';
|
---|
| 12 | import { CdkVirtualScrollViewport } from './virtual-scroll-viewport';
|
---|
| 13 | /** Virtual scrolling strategy for lists with items of known fixed size. */
|
---|
| 14 | import * as ɵngcc0 from '@angular/core';
|
---|
| 15 | export declare class FixedSizeVirtualScrollStrategy implements VirtualScrollStrategy {
|
---|
| 16 | private readonly _scrolledIndexChange;
|
---|
| 17 | /** @docs-private Implemented as part of VirtualScrollStrategy. */
|
---|
| 18 | scrolledIndexChange: Observable<number>;
|
---|
| 19 | /** The attached viewport. */
|
---|
| 20 | private _viewport;
|
---|
| 21 | /** The size of the items in the virtually scrolling list. */
|
---|
| 22 | private _itemSize;
|
---|
| 23 | /** The minimum amount of buffer rendered beyond the viewport (in pixels). */
|
---|
| 24 | private _minBufferPx;
|
---|
| 25 | /** The number of buffer items to render beyond the edge of the viewport (in pixels). */
|
---|
| 26 | private _maxBufferPx;
|
---|
| 27 | /**
|
---|
| 28 | * @param itemSize The size of the items in the virtually scrolling list.
|
---|
| 29 | * @param minBufferPx The minimum amount of buffer (in pixels) before needing to render more
|
---|
| 30 | * @param maxBufferPx The amount of buffer (in pixels) to render when rendering more.
|
---|
| 31 | */
|
---|
| 32 | constructor(itemSize: number, minBufferPx: number, maxBufferPx: number);
|
---|
| 33 | /**
|
---|
| 34 | * Attaches this scroll strategy to a viewport.
|
---|
| 35 | * @param viewport The viewport to attach this strategy to.
|
---|
| 36 | */
|
---|
| 37 | attach(viewport: CdkVirtualScrollViewport): void;
|
---|
| 38 | /** Detaches this scroll strategy from the currently attached viewport. */
|
---|
| 39 | detach(): void;
|
---|
| 40 | /**
|
---|
| 41 | * Update the item size and buffer size.
|
---|
| 42 | * @param itemSize The size of the items in the virtually scrolling list.
|
---|
| 43 | * @param minBufferPx The minimum amount of buffer (in pixels) before needing to render more
|
---|
| 44 | * @param maxBufferPx The amount of buffer (in pixels) to render when rendering more.
|
---|
| 45 | */
|
---|
| 46 | updateItemAndBufferSize(itemSize: number, minBufferPx: number, maxBufferPx: number): void;
|
---|
| 47 | /** @docs-private Implemented as part of VirtualScrollStrategy. */
|
---|
| 48 | onContentScrolled(): void;
|
---|
| 49 | /** @docs-private Implemented as part of VirtualScrollStrategy. */
|
---|
| 50 | onDataLengthChanged(): void;
|
---|
| 51 | /** @docs-private Implemented as part of VirtualScrollStrategy. */
|
---|
| 52 | onContentRendered(): void;
|
---|
| 53 | /** @docs-private Implemented as part of VirtualScrollStrategy. */
|
---|
| 54 | onRenderedOffsetChanged(): void;
|
---|
| 55 | /**
|
---|
| 56 | * Scroll to the offset for the given index.
|
---|
| 57 | * @param index The index of the element to scroll to.
|
---|
| 58 | * @param behavior The ScrollBehavior to use when scrolling.
|
---|
| 59 | */
|
---|
| 60 | scrollToIndex(index: number, behavior: ScrollBehavior): void;
|
---|
| 61 | /** Update the viewport's total content size. */
|
---|
| 62 | private _updateTotalContentSize;
|
---|
| 63 | /** Update the viewport's rendered range. */
|
---|
| 64 | private _updateRenderedRange;
|
---|
| 65 | }
|
---|
| 66 | /**
|
---|
| 67 | * Provider factory for `FixedSizeVirtualScrollStrategy` that simply extracts the already created
|
---|
| 68 | * `FixedSizeVirtualScrollStrategy` from the given directive.
|
---|
| 69 | * @param fixedSizeDir The instance of `CdkFixedSizeVirtualScroll` to extract the
|
---|
| 70 | * `FixedSizeVirtualScrollStrategy` from.
|
---|
| 71 | */
|
---|
| 72 | export declare function _fixedSizeVirtualScrollStrategyFactory(fixedSizeDir: CdkFixedSizeVirtualScroll): FixedSizeVirtualScrollStrategy;
|
---|
| 73 | /** A virtual scroll strategy that supports fixed-size items. */
|
---|
| 74 | export declare class CdkFixedSizeVirtualScroll implements OnChanges {
|
---|
| 75 | /** The size of the items in the list (in pixels). */
|
---|
| 76 | get itemSize(): number;
|
---|
| 77 | set itemSize(value: number);
|
---|
| 78 | _itemSize: number;
|
---|
| 79 | /**
|
---|
| 80 | * The minimum amount of buffer rendered beyond the viewport (in pixels).
|
---|
| 81 | * If the amount of buffer dips below this number, more items will be rendered. Defaults to 100px.
|
---|
| 82 | */
|
---|
| 83 | get minBufferPx(): number;
|
---|
| 84 | set minBufferPx(value: number);
|
---|
| 85 | _minBufferPx: number;
|
---|
| 86 | /**
|
---|
| 87 | * The number of pixels worth of buffer to render for when rendering new items. Defaults to 200px.
|
---|
| 88 | */
|
---|
| 89 | get maxBufferPx(): number;
|
---|
| 90 | set maxBufferPx(value: number);
|
---|
| 91 | _maxBufferPx: number;
|
---|
| 92 | /** The scroll strategy used by this directive. */
|
---|
| 93 | _scrollStrategy: FixedSizeVirtualScrollStrategy;
|
---|
| 94 | ngOnChanges(): void;
|
---|
| 95 | static ngAcceptInputType_itemSize: NumberInput;
|
---|
| 96 | static ngAcceptInputType_minBufferPx: NumberInput;
|
---|
| 97 | static ngAcceptInputType_maxBufferPx: NumberInput;
|
---|
| 98 | static ɵfac: ɵngcc0.ɵɵFactoryDeclaration<CdkFixedSizeVirtualScroll, never>;
|
---|
| 99 | static ɵdir: ɵngcc0.ɵɵDirectiveDeclaration<CdkFixedSizeVirtualScroll, "cdk-virtual-scroll-viewport[itemSize]", never, { "itemSize": "itemSize"; "minBufferPx": "minBufferPx"; "maxBufferPx": "maxBufferPx"; }, {}, never>;
|
---|
| 100 | }
|
---|
| 101 |
|
---|
| 102 | //# sourceMappingURL=fixed-size-virtual-scroll.d.ts.map |
---|