license import { InjectionToken } from '@angular/core' ; import { Observable } from 'rxjs' ; import { CdkVirtualScrollViewport } from './virtual-scroll-viewport' ; /** The injection token used to specify the virtual scrolling strategy. */ export const VIRTUAL_SCROLL_STRATEGY = new InjectionToken < VirtualScrollStrategy > ( 'VIRTUAL_SCROLL_STRATEGY' ) ; /** A strategy that dictates which items should be rendered in the viewport. */ export interface VirtualScrollStrategy { /** Emits when the index of the first element visible in the viewport changes. */ scrolledIndexChange : Observable < number > ; param viewport attach ( viewport ) : void ; /** Detaches this scroll strategy from the currently attached viewport. */ detach ( ) : void ; /** Called when the viewport is scrolled (debounced using requestAnimationFrame). */ onContentScrolled ( ) : void ; /** Called when the length of the data changes. */ onDataLengthChanged ( ) : void ; /** Called when the range of items rendered in the DOM has changed. */ onContentRendered ( ) : void ; /** Called when the offset of the rendered items changed. */ onRenderedOffsetChanged ( ) : void ; param index param behavior scrollToIndex ( index , behavior ) : void ; }