Index

Type aliases

scrollingDirection

scrollingDirection: "scrollLeft" | "scrollTop"

Variables

Let horizontallyScrolling

horizontallyScrolling: Map<any, any> = new Map()

Let lastRecursiveScrolled

lastRecursiveScrolled: any = null

Let lastX

lastX: number = 0

Let lastY

lastY: number = 0

Let verticallyScrolling

verticallyScrolling: Map<any, any> = new Map()

Functions

getDuration

  • getDuration(): Promise<number>

getSmooth

  • getSmooth(): Promise<any>

recursiveScroll

  • recursiveScroll(x: number, y: number, nodes?: Element[], ignore?: Element[]): Promise<void>
  • Tries to find a node which can be scrolled either x pixels to the right or y pixels down among the Elements in {nodes} and children of these Elements.

    This function used to be recursive but isn't anymore due to various attempts at optimizing the function in order to reduce GC pressure.

    Parameters

    • x: number
    • y: number
    • Default value nodes: Element[] = undefined
    • Default value ignore: Element[] = []

    Returns Promise<void>

scroll

  • scroll(x: number, y: number, e: HTMLElement, duration?: number): Promise<boolean>
  • Tries to scroll e by x and y pixel, make the smooth scrolling animation last duration milliseconds

    Parameters

    • x: number
    • y: number
    • e: HTMLElement
    • Default value duration: number = undefined

    Returns Promise<boolean>

Object literals

Let opts

opts: object

duration

duration: null = null

smooth

smooth: null = null