export type ScrollKey = "scrollLeft" | "scrollTop" ; export class TableQuadrantStackCache { private cachedRowHeaderWidth : number ; private cachedColumnHeaderHeight : number ; private cachedScrollLeft : number ; private cachedScrollTop : number ; private cachedScrollContainerClientWidth : number ; private cachedScrollContainerClientHeight : number ; public constructor ( ) { this . reset ( ) ; } public reset ( ) { this . cachedRowHeaderWidth = 0 ; this . cachedColumnHeaderHeight = 0 ; this . cachedScrollLeft = 0 ; this . cachedScrollTop = 0 ; } public getScrollOffset ( scrollKey ) { return scrollKey === "scrollLeft" ? this . cachedScrollLeft : this . cachedScrollTop ; } public getRowHeaderWidth ( ) { return this . cachedRowHeaderWidth ; } public getColumnHeaderHeight ( ) { return this . cachedColumnHeaderHeight ; } public getScrollContainerClientWidth ( ) { return this . cachedScrollContainerClientWidth ; } public getScrollContainerClientHeight ( ) { return this . cachedScrollContainerClientHeight ; } public setColumnHeaderHeight ( height ) { this . cachedColumnHeaderHeight = height ; } public setRowHeaderWidth ( width ) { this . cachedRowHeaderWidth = width ; } public setScrollOffset ( scrollKey , offset ) { if ( scrollKey === "scrollLeft" ) { this . cachedScrollLeft = offset ; } else { this . cachedScrollTop = offset ; } } public setScrollContainerClientWidth ( clientWidth ) { this . cachedScrollContainerClientWidth = clientWidth ; } public setScrollContainerClientHeight ( clientHeight ) { this . cachedScrollContainerClientHeight = clientHeight ; } }