scrolling-module.d-ud2XrbF8.d.ts 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552
  1. import * as i0 from '@angular/core';
  2. import { OnDestroy, ElementRef, OnInit, NgZone, InjectionToken, OnChanges, NgIterable, DoCheck, TrackByFunction, TemplateRef } from '@angular/core';
  3. import { D as Directionality, B as BidiModule } from './bidi-module.d-D-fEBKdS.js';
  4. import { Observable, Subscription, Subject } from 'rxjs';
  5. import { L as ListRange, D as DataSource, C as CollectionViewer } from './data-source.d-Bblv7Zvh.js';
  6. import { N as NumberInput } from './number-property.d-CJVxXUcb.js';
  7. /**
  8. * An item to be repeated by the VirtualScrollViewport
  9. */
  10. interface CdkVirtualScrollRepeater<T> {
  11. readonly dataStream: Observable<readonly T[]>;
  12. measureRangeSize(range: ListRange, orientation: 'horizontal' | 'vertical'): number;
  13. }
  14. /** Time in ms to throttle the scrolling events by default. */
  15. declare const DEFAULT_SCROLL_TIME = 20;
  16. /**
  17. * Service contained all registered Scrollable references and emits an event when any one of the
  18. * Scrollable references emit a scrolled event.
  19. */
  20. declare class ScrollDispatcher implements OnDestroy {
  21. private _ngZone;
  22. private _platform;
  23. private _renderer;
  24. private _cleanupGlobalListener;
  25. constructor(...args: unknown[]);
  26. /** Subject for notifying that a registered scrollable reference element has been scrolled. */
  27. private readonly _scrolled;
  28. /** Keeps track of the amount of subscriptions to `scrolled`. Used for cleaning up afterwards. */
  29. private _scrolledCount;
  30. /**
  31. * Map of all the scrollable references that are registered with the service and their
  32. * scroll event subscriptions.
  33. */
  34. scrollContainers: Map<CdkScrollable, Subscription>;
  35. /**
  36. * Registers a scrollable instance with the service and listens for its scrolled events. When the
  37. * scrollable is scrolled, the service emits the event to its scrolled observable.
  38. * @param scrollable Scrollable instance to be registered.
  39. */
  40. register(scrollable: CdkScrollable): void;
  41. /**
  42. * De-registers a Scrollable reference and unsubscribes from its scroll event observable.
  43. * @param scrollable Scrollable instance to be deregistered.
  44. */
  45. deregister(scrollable: CdkScrollable): void;
  46. /**
  47. * Returns an observable that emits an event whenever any of the registered Scrollable
  48. * references (or window, document, or body) fire a scrolled event. Can provide a time in ms
  49. * to override the default "throttle" time.
  50. *
  51. * **Note:** in order to avoid hitting change detection for every scroll event,
  52. * all of the events emitted from this stream will be run outside the Angular zone.
  53. * If you need to update any data bindings as a result of a scroll event, you have
  54. * to run the callback using `NgZone.run`.
  55. */
  56. scrolled(auditTimeInMs?: number): Observable<CdkScrollable | void>;
  57. ngOnDestroy(): void;
  58. /**
  59. * Returns an observable that emits whenever any of the
  60. * scrollable ancestors of an element are scrolled.
  61. * @param elementOrElementRef Element whose ancestors to listen for.
  62. * @param auditTimeInMs Time to throttle the scroll events.
  63. */
  64. ancestorScrolled(elementOrElementRef: ElementRef | HTMLElement, auditTimeInMs?: number): Observable<CdkScrollable | void>;
  65. /** Returns all registered Scrollables that contain the provided element. */
  66. getAncestorScrollContainers(elementOrElementRef: ElementRef | HTMLElement): CdkScrollable[];
  67. /** Returns true if the element is contained within the provided Scrollable. */
  68. private _scrollableContainsElement;
  69. static ɵfac: i0.ɵɵFactoryDeclaration<ScrollDispatcher, never>;
  70. static ɵprov: i0.ɵɵInjectableDeclaration<ScrollDispatcher>;
  71. }
  72. type _Without<T> = {
  73. [P in keyof T]?: never;
  74. };
  75. type _XOR<T, U> = (_Without<T> & U) | (_Without<U> & T);
  76. type _Top = {
  77. top?: number;
  78. };
  79. type _Bottom = {
  80. bottom?: number;
  81. };
  82. type _Left = {
  83. left?: number;
  84. };
  85. type _Right = {
  86. right?: number;
  87. };
  88. type _Start = {
  89. start?: number;
  90. };
  91. type _End = {
  92. end?: number;
  93. };
  94. type _XAxis = _XOR<_XOR<_Left, _Right>, _XOR<_Start, _End>>;
  95. type _YAxis = _XOR<_Top, _Bottom>;
  96. /**
  97. * An extended version of ScrollToOptions that allows expressing scroll offsets relative to the
  98. * top, bottom, left, right, start, or end of the viewport rather than just the top and left.
  99. * Please note: the top and bottom properties are mutually exclusive, as are the left, right,
  100. * start, and end properties.
  101. */
  102. type ExtendedScrollToOptions = _XAxis & _YAxis & ScrollOptions;
  103. /**
  104. * Sends an event when the directive's element is scrolled. Registers itself with the
  105. * ScrollDispatcher service to include itself as part of its collection of scrolling events that it
  106. * can be listened to through the service.
  107. */
  108. declare class CdkScrollable implements OnInit, OnDestroy {
  109. protected elementRef: ElementRef<HTMLElement>;
  110. protected scrollDispatcher: ScrollDispatcher;
  111. protected ngZone: NgZone;
  112. protected dir?: Directionality | null | undefined;
  113. protected _scrollElement: EventTarget;
  114. protected readonly _destroyed: Subject<void>;
  115. private _renderer;
  116. private _cleanupScroll;
  117. private _elementScrolled;
  118. constructor(...args: unknown[]);
  119. ngOnInit(): void;
  120. ngOnDestroy(): void;
  121. /** Returns observable that emits when a scroll event is fired on the host element. */
  122. elementScrolled(): Observable<Event>;
  123. /** Gets the ElementRef for the viewport. */
  124. getElementRef(): ElementRef<HTMLElement>;
  125. /**
  126. * Scrolls to the specified offsets. This is a normalized version of the browser's native scrollTo
  127. * method, since browsers are not consistent about what scrollLeft means in RTL. For this method
  128. * left and right always refer to the left and right side of the scrolling container irrespective
  129. * of the layout direction. start and end refer to left and right in an LTR context and vice-versa
  130. * in an RTL context.
  131. * @param options specified the offsets to scroll to.
  132. */
  133. scrollTo(options: ExtendedScrollToOptions): void;
  134. private _applyScrollToOptions;
  135. /**
  136. * Measures the scroll offset relative to the specified edge of the viewport. This method can be
  137. * used instead of directly checking scrollLeft or scrollTop, since browsers are not consistent
  138. * about what scrollLeft means in RTL. The values returned by this method are normalized such that
  139. * left and right always refer to the left and right side of the scrolling container irrespective
  140. * of the layout direction. start and end refer to left and right in an LTR context and vice-versa
  141. * in an RTL context.
  142. * @param from The edge to measure from.
  143. */
  144. measureScrollOffset(from: 'top' | 'left' | 'right' | 'bottom' | 'start' | 'end'): number;
  145. static ɵfac: i0.ɵɵFactoryDeclaration<CdkScrollable, never>;
  146. static ɵdir: i0.ɵɵDirectiveDeclaration<CdkScrollable, "[cdk-scrollable], [cdkScrollable]", never, {}, {}, never, never, true, never>;
  147. }
  148. declare const VIRTUAL_SCROLLABLE: InjectionToken<CdkVirtualScrollable>;
  149. /**
  150. * Extending the {@link CdkScrollable} to be used as scrolling container for virtual scrolling.
  151. */
  152. declare abstract class CdkVirtualScrollable extends CdkScrollable {
  153. constructor(...args: unknown[]);
  154. /**
  155. * Measure the viewport size for the provided orientation.
  156. *
  157. * @param orientation The orientation to measure the size from.
  158. */
  159. measureViewportSize(orientation: 'horizontal' | 'vertical'): number;
  160. /**
  161. * Measure the bounding DOMRect size including the scroll offset.
  162. *
  163. * @param from The edge to measure from.
  164. */
  165. abstract measureBoundingClientRectWithScrollOffset(from: 'left' | 'top' | 'right' | 'bottom'): number;
  166. static ɵfac: i0.ɵɵFactoryDeclaration<CdkVirtualScrollable, never>;
  167. static ɵdir: i0.ɵɵDirectiveDeclaration<CdkVirtualScrollable, never, never, {}, {}, never, never, true, never>;
  168. }
  169. /** A viewport that virtualizes its scrolling with the help of `CdkVirtualForOf`. */
  170. declare class CdkVirtualScrollViewport extends CdkVirtualScrollable implements OnInit, OnDestroy {
  171. elementRef: ElementRef<HTMLElement>;
  172. private _changeDetectorRef;
  173. private _scrollStrategy;
  174. scrollable: CdkVirtualScrollable;
  175. private _platform;
  176. /** Emits when the viewport is detached from a CdkVirtualForOf. */
  177. private readonly _detachedSubject;
  178. /** Emits when the rendered range changes. */
  179. private readonly _renderedRangeSubject;
  180. /** The direction the viewport scrolls. */
  181. get orientation(): "horizontal" | "vertical";
  182. set orientation(orientation: 'horizontal' | 'vertical');
  183. private _orientation;
  184. /**
  185. * Whether rendered items should persist in the DOM after scrolling out of view. By default, items
  186. * will be removed.
  187. */
  188. appendOnly: boolean;
  189. /** Emits when the index of the first element visible in the viewport changes. */
  190. readonly scrolledIndexChange: Observable<number>;
  191. /** The element that wraps the rendered content. */
  192. _contentWrapper: ElementRef<HTMLElement>;
  193. /** A stream that emits whenever the rendered range changes. */
  194. readonly renderedRangeStream: Observable<ListRange>;
  195. /**
  196. * The total size of all content (in pixels), including content that is not currently rendered.
  197. */
  198. private _totalContentSize;
  199. /** A string representing the `style.width` property value to be used for the spacer element. */
  200. _totalContentWidth: string;
  201. /** A string representing the `style.height` property value to be used for the spacer element. */
  202. _totalContentHeight: string;
  203. /**
  204. * The CSS transform applied to the rendered subset of items so that they appear within the bounds
  205. * of the visible viewport.
  206. */
  207. private _renderedContentTransform;
  208. /** The currently rendered range of indices. */
  209. private _renderedRange;
  210. /** The length of the data bound to this viewport (in number of items). */
  211. private _dataLength;
  212. /** The size of the viewport (in pixels). */
  213. private _viewportSize;
  214. /** the currently attached CdkVirtualScrollRepeater. */
  215. private _forOf;
  216. /** The last rendered content offset that was set. */
  217. private _renderedContentOffset;
  218. /**
  219. * Whether the last rendered content offset was to the end of the content (and therefore needs to
  220. * be rewritten as an offset to the start of the content).
  221. */
  222. private _renderedContentOffsetNeedsRewrite;
  223. /** Whether there is a pending change detection cycle. */
  224. private _isChangeDetectionPending;
  225. /** A list of functions to run after the next change detection cycle. */
  226. private _runAfterChangeDetection;
  227. /** Subscription to changes in the viewport size. */
  228. private _viewportChanges;
  229. private _injector;
  230. private _isDestroyed;
  231. constructor(...args: unknown[]);
  232. ngOnInit(): void;
  233. ngOnDestroy(): void;
  234. /** Attaches a `CdkVirtualScrollRepeater` to this viewport. */
  235. attach(forOf: CdkVirtualScrollRepeater<any>): void;
  236. /** Detaches the current `CdkVirtualForOf`. */
  237. detach(): void;
  238. /** Gets the length of the data bound to this viewport (in number of items). */
  239. getDataLength(): number;
  240. /** Gets the size of the viewport (in pixels). */
  241. getViewportSize(): number;
  242. /** Get the current rendered range of items. */
  243. getRenderedRange(): ListRange;
  244. measureBoundingClientRectWithScrollOffset(from: 'left' | 'top' | 'right' | 'bottom'): number;
  245. /**
  246. * Sets the total size of all content (in pixels), including content that is not currently
  247. * rendered.
  248. */
  249. setTotalContentSize(size: number): void;
  250. /** Sets the currently rendered range of indices. */
  251. setRenderedRange(range: ListRange): void;
  252. /**
  253. * Gets the offset from the start of the viewport to the start of the rendered data (in pixels).
  254. */
  255. getOffsetToRenderedContentStart(): number | null;
  256. /**
  257. * Sets the offset from the start of the viewport to either the start or end of the rendered data
  258. * (in pixels).
  259. */
  260. setRenderedContentOffset(offset: number, to?: 'to-start' | 'to-end'): void;
  261. /**
  262. * Scrolls to the given offset from the start of the viewport. Please note that this is not always
  263. * the same as setting `scrollTop` or `scrollLeft`. In a horizontal viewport with right-to-left
  264. * direction, this would be the equivalent of setting a fictional `scrollRight` property.
  265. * @param offset The offset to scroll to.
  266. * @param behavior The ScrollBehavior to use when scrolling. Default is behavior is `auto`.
  267. */
  268. scrollToOffset(offset: number, behavior?: ScrollBehavior): void;
  269. /**
  270. * Scrolls to the offset for the given index.
  271. * @param index The index of the element to scroll to.
  272. * @param behavior The ScrollBehavior to use when scrolling. Default is behavior is `auto`.
  273. */
  274. scrollToIndex(index: number, behavior?: ScrollBehavior): void;
  275. /**
  276. * Gets the current scroll offset from the start of the scrollable (in pixels).
  277. * @param from The edge to measure the offset from. Defaults to 'top' in vertical mode and 'start'
  278. * in horizontal mode.
  279. */
  280. measureScrollOffset(from?: 'top' | 'left' | 'right' | 'bottom' | 'start' | 'end'): number;
  281. /**
  282. * Measures the offset of the viewport from the scrolling container
  283. * @param from The edge to measure from.
  284. */
  285. measureViewportOffset(from?: 'top' | 'left' | 'right' | 'bottom' | 'start' | 'end'): number;
  286. /** Measure the combined size of all of the rendered items. */
  287. measureRenderedContentSize(): number;
  288. /**
  289. * Measure the total combined size of the given range. Throws if the range includes items that are
  290. * not rendered.
  291. */
  292. measureRangeSize(range: ListRange): number;
  293. /** Update the viewport dimensions and re-render. */
  294. checkViewportSize(): void;
  295. /** Measure the viewport size. */
  296. private _measureViewportSize;
  297. /** Queue up change detection to run. */
  298. private _markChangeDetectionNeeded;
  299. /** Run change detection. */
  300. private _doChangeDetection;
  301. /** Calculates the `style.width` and `style.height` for the spacer element. */
  302. private _calculateSpacerSize;
  303. static ɵfac: i0.ɵɵFactoryDeclaration<CdkVirtualScrollViewport, never>;
  304. static ɵcmp: i0.ɵɵComponentDeclaration<CdkVirtualScrollViewport, "cdk-virtual-scroll-viewport", never, { "orientation": { "alias": "orientation"; "required": false; }; "appendOnly": { "alias": "appendOnly"; "required": false; }; }, { "scrolledIndexChange": "scrolledIndexChange"; }, never, ["*"], true, never>;
  305. static ngAcceptInputType_appendOnly: unknown;
  306. }
  307. /** The injection token used to specify the virtual scrolling strategy. */
  308. declare const VIRTUAL_SCROLL_STRATEGY: InjectionToken<VirtualScrollStrategy>;
  309. /** A strategy that dictates which items should be rendered in the viewport. */
  310. interface VirtualScrollStrategy {
  311. /** Emits when the index of the first element visible in the viewport changes. */
  312. scrolledIndexChange: Observable<number>;
  313. /**
  314. * Attaches this scroll strategy to a viewport.
  315. * @param viewport The viewport to attach this strategy to.
  316. */
  317. attach(viewport: CdkVirtualScrollViewport): void;
  318. /** Detaches this scroll strategy from the currently attached viewport. */
  319. detach(): void;
  320. /** Called when the viewport is scrolled (debounced using requestAnimationFrame). */
  321. onContentScrolled(): void;
  322. /** Called when the length of the data changes. */
  323. onDataLengthChanged(): void;
  324. /** Called when the range of items rendered in the DOM has changed. */
  325. onContentRendered(): void;
  326. /** Called when the offset of the rendered items changed. */
  327. onRenderedOffsetChanged(): void;
  328. /**
  329. * Scroll to the offset for the given index.
  330. * @param index The index of the element to scroll to.
  331. * @param behavior The ScrollBehavior to use when scrolling.
  332. */
  333. scrollToIndex(index: number, behavior: ScrollBehavior): void;
  334. }
  335. /** Virtual scrolling strategy for lists with items of known fixed size. */
  336. declare class FixedSizeVirtualScrollStrategy implements VirtualScrollStrategy {
  337. private readonly _scrolledIndexChange;
  338. /** @docs-private Implemented as part of VirtualScrollStrategy. */
  339. scrolledIndexChange: Observable<number>;
  340. /** The attached viewport. */
  341. private _viewport;
  342. /** The size of the items in the virtually scrolling list. */
  343. private _itemSize;
  344. /** The minimum amount of buffer rendered beyond the viewport (in pixels). */
  345. private _minBufferPx;
  346. /** The number of buffer items to render beyond the edge of the viewport (in pixels). */
  347. private _maxBufferPx;
  348. /**
  349. * @param itemSize The size of the items in the virtually scrolling list.
  350. * @param minBufferPx The minimum amount of buffer (in pixels) before needing to render more
  351. * @param maxBufferPx The amount of buffer (in pixels) to render when rendering more.
  352. */
  353. constructor(itemSize: number, minBufferPx: number, maxBufferPx: number);
  354. /**
  355. * Attaches this scroll strategy to a viewport.
  356. * @param viewport The viewport to attach this strategy to.
  357. */
  358. attach(viewport: CdkVirtualScrollViewport): void;
  359. /** Detaches this scroll strategy from the currently attached viewport. */
  360. detach(): void;
  361. /**
  362. * Update the item size and buffer size.
  363. * @param itemSize The size of the items in the virtually scrolling list.
  364. * @param minBufferPx The minimum amount of buffer (in pixels) before needing to render more
  365. * @param maxBufferPx The amount of buffer (in pixels) to render when rendering more.
  366. */
  367. updateItemAndBufferSize(itemSize: number, minBufferPx: number, maxBufferPx: number): void;
  368. /** @docs-private Implemented as part of VirtualScrollStrategy. */
  369. onContentScrolled(): void;
  370. /** @docs-private Implemented as part of VirtualScrollStrategy. */
  371. onDataLengthChanged(): void;
  372. /** @docs-private Implemented as part of VirtualScrollStrategy. */
  373. onContentRendered(): void;
  374. /** @docs-private Implemented as part of VirtualScrollStrategy. */
  375. onRenderedOffsetChanged(): void;
  376. /**
  377. * Scroll to the offset for the given index.
  378. * @param index The index of the element to scroll to.
  379. * @param behavior The ScrollBehavior to use when scrolling.
  380. */
  381. scrollToIndex(index: number, behavior: ScrollBehavior): void;
  382. /** Update the viewport's total content size. */
  383. private _updateTotalContentSize;
  384. /** Update the viewport's rendered range. */
  385. private _updateRenderedRange;
  386. }
  387. /**
  388. * Provider factory for `FixedSizeVirtualScrollStrategy` that simply extracts the already created
  389. * `FixedSizeVirtualScrollStrategy` from the given directive.
  390. * @param fixedSizeDir The instance of `CdkFixedSizeVirtualScroll` to extract the
  391. * `FixedSizeVirtualScrollStrategy` from.
  392. */
  393. declare function _fixedSizeVirtualScrollStrategyFactory(fixedSizeDir: CdkFixedSizeVirtualScroll): FixedSizeVirtualScrollStrategy;
  394. /** A virtual scroll strategy that supports fixed-size items. */
  395. declare class CdkFixedSizeVirtualScroll implements OnChanges {
  396. /** The size of the items in the list (in pixels). */
  397. get itemSize(): number;
  398. set itemSize(value: NumberInput);
  399. _itemSize: number;
  400. /**
  401. * The minimum amount of buffer rendered beyond the viewport (in pixels).
  402. * If the amount of buffer dips below this number, more items will be rendered. Defaults to 100px.
  403. */
  404. get minBufferPx(): number;
  405. set minBufferPx(value: NumberInput);
  406. _minBufferPx: number;
  407. /**
  408. * The number of pixels worth of buffer to render for when rendering new items. Defaults to 200px.
  409. */
  410. get maxBufferPx(): number;
  411. set maxBufferPx(value: NumberInput);
  412. _maxBufferPx: number;
  413. /** The scroll strategy used by this directive. */
  414. _scrollStrategy: FixedSizeVirtualScrollStrategy;
  415. ngOnChanges(): void;
  416. static ɵfac: i0.ɵɵFactoryDeclaration<CdkFixedSizeVirtualScroll, never>;
  417. static ɵdir: i0.ɵɵDirectiveDeclaration<CdkFixedSizeVirtualScroll, "cdk-virtual-scroll-viewport[itemSize]", never, { "itemSize": { "alias": "itemSize"; "required": false; }; "minBufferPx": { "alias": "minBufferPx"; "required": false; }; "maxBufferPx": { "alias": "maxBufferPx"; "required": false; }; }, {}, never, never, true, never>;
  418. }
  419. /** The context for an item rendered by `CdkVirtualForOf` */
  420. type CdkVirtualForOfContext<T> = {
  421. /** The item value. */
  422. $implicit: T;
  423. /** The DataSource, Observable, or NgIterable that was passed to *cdkVirtualFor. */
  424. cdkVirtualForOf: DataSource<T> | Observable<T[]> | NgIterable<T>;
  425. /** The index of the item in the DataSource. */
  426. index: number;
  427. /** The number of items in the DataSource. */
  428. count: number;
  429. /** Whether this is the first item in the DataSource. */
  430. first: boolean;
  431. /** Whether this is the last item in the DataSource. */
  432. last: boolean;
  433. /** Whether the index is even. */
  434. even: boolean;
  435. /** Whether the index is odd. */
  436. odd: boolean;
  437. };
  438. /**
  439. * A directive similar to `ngForOf` to be used for rendering data inside a virtual scrolling
  440. * container.
  441. */
  442. declare class CdkVirtualForOf<T> implements CdkVirtualScrollRepeater<T>, CollectionViewer, DoCheck, OnDestroy {
  443. private _viewContainerRef;
  444. private _template;
  445. private _differs;
  446. private _viewRepeater;
  447. private _viewport;
  448. /** Emits when the rendered view of the data changes. */
  449. readonly viewChange: Subject<ListRange>;
  450. /** Subject that emits when a new DataSource instance is given. */
  451. private readonly _dataSourceChanges;
  452. /** The DataSource to display. */
  453. get cdkVirtualForOf(): DataSource<T> | Observable<T[]> | NgIterable<T> | null | undefined;
  454. set cdkVirtualForOf(value: DataSource<T> | Observable<T[]> | NgIterable<T> | null | undefined);
  455. _cdkVirtualForOf: DataSource<T> | Observable<T[]> | NgIterable<T> | null | undefined;
  456. /**
  457. * The `TrackByFunction` to use for tracking changes. The `TrackByFunction` takes the index and
  458. * the item and produces a value to be used as the item's identity when tracking changes.
  459. */
  460. get cdkVirtualForTrackBy(): TrackByFunction<T> | undefined;
  461. set cdkVirtualForTrackBy(fn: TrackByFunction<T> | undefined);
  462. private _cdkVirtualForTrackBy;
  463. /** The template used to stamp out new elements. */
  464. set cdkVirtualForTemplate(value: TemplateRef<CdkVirtualForOfContext<T>>);
  465. /**
  466. * The size of the cache used to store templates that are not being used for re-use later.
  467. * Setting the cache size to `0` will disable caching. Defaults to 20 templates.
  468. */
  469. get cdkVirtualForTemplateCacheSize(): number;
  470. set cdkVirtualForTemplateCacheSize(size: NumberInput);
  471. /** Emits whenever the data in the current DataSource changes. */
  472. readonly dataStream: Observable<readonly T[]>;
  473. /** The differ used to calculate changes to the data. */
  474. private _differ;
  475. /** The most recent data emitted from the DataSource. */
  476. private _data;
  477. /** The currently rendered items. */
  478. private _renderedItems;
  479. /** The currently rendered range of indices. */
  480. private _renderedRange;
  481. /** Whether the rendered data should be updated during the next ngDoCheck cycle. */
  482. private _needsUpdate;
  483. private readonly _destroyed;
  484. constructor(...args: unknown[]);
  485. /**
  486. * Measures the combined size (width for horizontal orientation, height for vertical) of all items
  487. * in the specified range. Throws an error if the range includes items that are not currently
  488. * rendered.
  489. */
  490. measureRangeSize(range: ListRange, orientation: 'horizontal' | 'vertical'): number;
  491. ngDoCheck(): void;
  492. ngOnDestroy(): void;
  493. /** React to scroll state changes in the viewport. */
  494. private _onRenderedDataChange;
  495. /** Swap out one `DataSource` for another. */
  496. private _changeDataSource;
  497. /** Update the `CdkVirtualForOfContext` for all views. */
  498. private _updateContext;
  499. /** Apply changes to the DOM. */
  500. private _applyChanges;
  501. /** Update the computed properties on the `CdkVirtualForOfContext`. */
  502. private _updateComputedContextProperties;
  503. private _getEmbeddedViewArgs;
  504. static ngTemplateContextGuard<T>(directive: CdkVirtualForOf<T>, context: unknown): context is CdkVirtualForOfContext<T>;
  505. static ɵfac: i0.ɵɵFactoryDeclaration<CdkVirtualForOf<any>, never>;
  506. static ɵdir: i0.ɵɵDirectiveDeclaration<CdkVirtualForOf<any>, "[cdkVirtualFor][cdkVirtualForOf]", never, { "cdkVirtualForOf": { "alias": "cdkVirtualForOf"; "required": false; }; "cdkVirtualForTrackBy": { "alias": "cdkVirtualForTrackBy"; "required": false; }; "cdkVirtualForTemplate": { "alias": "cdkVirtualForTemplate"; "required": false; }; "cdkVirtualForTemplateCacheSize": { "alias": "cdkVirtualForTemplateCacheSize"; "required": false; }; }, {}, never, never, true, never>;
  507. }
  508. /**
  509. * Provides as virtual scrollable for the global / window scrollbar.
  510. */
  511. declare class CdkVirtualScrollableWindow extends CdkVirtualScrollable {
  512. constructor(...args: unknown[]);
  513. measureBoundingClientRectWithScrollOffset(from: 'left' | 'top' | 'right' | 'bottom'): number;
  514. static ɵfac: i0.ɵɵFactoryDeclaration<CdkVirtualScrollableWindow, never>;
  515. static ɵdir: i0.ɵɵDirectiveDeclaration<CdkVirtualScrollableWindow, "cdk-virtual-scroll-viewport[scrollWindow]", never, {}, {}, never, never, true, never>;
  516. }
  517. /**
  518. * Provides a virtual scrollable for the element it is attached to.
  519. */
  520. declare class CdkVirtualScrollableElement extends CdkVirtualScrollable {
  521. constructor(...args: unknown[]);
  522. measureBoundingClientRectWithScrollOffset(from: 'left' | 'top' | 'right' | 'bottom'): number;
  523. static ɵfac: i0.ɵɵFactoryDeclaration<CdkVirtualScrollableElement, never>;
  524. static ɵdir: i0.ɵɵDirectiveDeclaration<CdkVirtualScrollableElement, "[cdkVirtualScrollingElement]", never, {}, {}, never, never, true, never>;
  525. }
  526. declare class CdkScrollableModule {
  527. static ɵfac: i0.ɵɵFactoryDeclaration<CdkScrollableModule, never>;
  528. static ɵmod: i0.ɵɵNgModuleDeclaration<CdkScrollableModule, never, [typeof CdkScrollable], [typeof CdkScrollable]>;
  529. static ɵinj: i0.ɵɵInjectorDeclaration<CdkScrollableModule>;
  530. }
  531. /**
  532. * @docs-primary-export
  533. */
  534. declare class ScrollingModule {
  535. static ɵfac: i0.ɵɵFactoryDeclaration<ScrollingModule, never>;
  536. static ɵmod: i0.ɵɵNgModuleDeclaration<ScrollingModule, never, [typeof BidiModule, typeof CdkScrollableModule, typeof CdkVirtualScrollViewport, typeof CdkFixedSizeVirtualScroll, typeof CdkVirtualForOf, typeof CdkVirtualScrollableWindow, typeof CdkVirtualScrollableElement], [typeof BidiModule, typeof CdkScrollableModule, typeof CdkFixedSizeVirtualScroll, typeof CdkVirtualForOf, typeof CdkVirtualScrollViewport, typeof CdkVirtualScrollableWindow, typeof CdkVirtualScrollableElement]>;
  537. static ɵinj: i0.ɵɵInjectorDeclaration<ScrollingModule>;
  538. }
  539. export { CdkScrollable as C, DEFAULT_SCROLL_TIME as D, FixedSizeVirtualScrollStrategy as F, ScrollDispatcher as S, VIRTUAL_SCROLL_STRATEGY as V, _fixedSizeVirtualScrollStrategyFactory as _, CdkScrollableModule as a, CdkFixedSizeVirtualScroll as b, CdkVirtualForOf as c, CdkVirtualScrollViewport as d, CdkVirtualScrollableWindow as e, CdkVirtualScrollableElement as f, ScrollingModule as g, VIRTUAL_SCROLLABLE as u, CdkVirtualScrollable as v };
  540. export type { ExtendedScrollToOptions as E, _Without as h, _XOR as i, _Top as j, _Bottom as k, _Left as l, _Right as m, _Start as n, _End as o, _XAxis as p, _YAxis as q, CdkVirtualForOfContext as r, VirtualScrollStrategy as s, CdkVirtualScrollRepeater as t };