1 | {"version":3,"file":"virtual-for-of.d.ts","sources":["virtual-for-of.d.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA","sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { CollectionViewer, DataSource, ListRange, _RecycleViewRepeaterStrategy } from '@angular/cdk/collections';\nimport { DoCheck, IterableDiffers, NgIterable, NgZone, OnDestroy, TemplateRef, TrackByFunction, ViewContainerRef } from '@angular/core';\nimport { NumberInput } from '@angular/cdk/coercion';\nimport { Observable, Subject } from 'rxjs';\nimport { CdkVirtualScrollRepeater } from './virtual-scroll-repeater';\nimport { CdkVirtualScrollViewport } from './virtual-scroll-viewport';\n/** The context for an item rendered by `CdkVirtualForOf` */\nexport declare type CdkVirtualForOfContext<T> = {\n /** The item value. */\n $implicit: T;\n /** The DataSource, Observable, or NgIterable that was passed to *cdkVirtualFor. */\n cdkVirtualForOf: DataSource<T> | Observable<T[]> | NgIterable<T>;\n /** The index of the item in the DataSource. */\n index: number;\n /** The number of items in the DataSource. */\n count: number;\n /** Whether this is the first item in the DataSource. */\n first: boolean;\n /** Whether this is the last item in the DataSource. */\n last: boolean;\n /** Whether the index is even. */\n even: boolean;\n /** Whether the index is odd. */\n odd: boolean;\n};\n/**\n * A directive similar to `ngForOf` to be used for rendering data inside a virtual scrolling\n * container.\n */\nexport declare class CdkVirtualForOf<T> implements CdkVirtualScrollRepeater<T>, CollectionViewer, DoCheck, OnDestroy {\n /** The view container to add items to. */\n private _viewContainerRef;\n /** The template to use when stamping out new items. */\n private _template;\n /** The set of available differs. */\n private _differs;\n /** The strategy used to render items in the virtual scroll viewport. */\n private _viewRepeater;\n /** The virtual scrolling viewport that these items are being rendered in. */\n private _viewport;\n /** Emits when the rendered view of the data changes. */\n readonly viewChange: Subject<ListRange>;\n /** Subject that emits when a new DataSource instance is given. */\n private readonly _dataSourceChanges;\n /** The DataSource to display. */\n get cdkVirtualForOf(): DataSource<T> | Observable<T[]> | NgIterable<T> | null | undefined;\n set cdkVirtualForOf(value: DataSource<T> | Observable<T[]> | NgIterable<T> | null | undefined);\n _cdkVirtualForOf: DataSource<T> | Observable<T[]> | NgIterable<T> | null | undefined;\n /**\n * The `TrackByFunction` to use for tracking changes. The `TrackByFunction` takes the index and\n * the item and produces a value to be used as the item's identity when tracking changes.\n */\n get cdkVirtualForTrackBy(): TrackByFunction<T> | undefined;\n set cdkVirtualForTrackBy(fn: TrackByFunction<T> | undefined);\n private _cdkVirtualForTrackBy;\n /** The template used to stamp out new elements. */\n set cdkVirtualForTemplate(value: TemplateRef<CdkVirtualForOfContext<T>>);\n /**\n * The size of the cache used to store templates that are not being used for re-use later.\n * Setting the cache size to `0` will disable caching. Defaults to 20 templates.\n */\n get cdkVirtualForTemplateCacheSize(): number;\n set cdkVirtualForTemplateCacheSize(size: number);\n /** Emits whenever the data in the current DataSource changes. */\n readonly dataStream: Observable<readonly T[]>;\n /** The differ used to calculate changes to the data. */\n private _differ;\n /** The most recent data emitted from the DataSource. */\n private _data;\n /** The currently rendered items. */\n private _renderedItems;\n /** The currently rendered range of indices. */\n private _renderedRange;\n /** Whether the rendered data should be updated during the next ngDoCheck cycle. */\n private _needsUpdate;\n private readonly _destroyed;\n constructor(\n /** The view container to add items to. */\n _viewContainerRef: ViewContainerRef, \n /** The template to use when stamping out new items. */\n _template: TemplateRef<CdkVirtualForOfContext<T>>, \n /** The set of available differs. */\n _differs: IterableDiffers, \n /** The strategy used to render items in the virtual scroll viewport. */\n _viewRepeater: _RecycleViewRepeaterStrategy<T, T, CdkVirtualForOfContext<T>>, \n /** The virtual scrolling viewport that these items are being rendered in. */\n _viewport: CdkVirtualScrollViewport, ngZone: NgZone);\n /**\n * Measures the combined size (width for horizontal orientation, height for vertical) of all items\n * in the specified range. Throws an error if the range includes items that are not currently\n * rendered.\n */\n measureRangeSize(range: ListRange, orientation: 'horizontal' | 'vertical'): number;\n ngDoCheck(): void;\n ngOnDestroy(): void;\n /** React to scroll state changes in the viewport. */\n private _onRenderedDataChange;\n /** Swap out one `DataSource` for another. */\n private _changeDataSource;\n /** Update the `CdkVirtualForOfContext` for all views. */\n private _updateContext;\n /** Apply changes to the DOM. */\n private _applyChanges;\n /** Update the computed properties on the `CdkVirtualForOfContext`. */\n private _updateComputedContextProperties;\n private _getEmbeddedViewArgs;\n static ngAcceptInputType_cdkVirtualForTemplateCacheSize: NumberInput;\n}\n"]} |
---|