Index

Type aliases

scrollingDirection

scrollingDirection: "scrollLeft" | "scrollTop"

Variables

Let currentFocused

currentFocused: any = document.activeElement as any

Const horizontallyScrolling

horizontallyScrolling: Map<Node, ScrollingData> = new Map<Node, ScrollingData>()

Let lastFocused

lastFocused: any = null

Let lastRecursiveScrolled

lastRecursiveScrolled: any = null

Let lastX

lastX: number = 0

Let lastY

lastY: number = 0

Const verticallyScrolling

verticallyScrolling: Map<Node, ScrollingData> = new Map<Node, ScrollingData>()

Functions

getDuration

  • getDuration(): Promise<number>

getSmooth

  • getSmooth(): Promise<string>

recursiveScroll

  • recursiveScroll(xDistance: number, yDistance: number, node?: Element, stopAt?: Element): Promise<boolean>
  • 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

    • xDistance: number
    • yDistance: number
    • Optional node: Element
    • Optional stopAt: Element

    Returns Promise<boolean>

scroll

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

    Parameters

    • Default value xDistance: number = 0
    • Default value yDistance: number = 0
    • e: Node
    • Optional duration: number

    Returns Promise<boolean>

setCurrentFocus

  • setCurrentFocus(v: any): void

Object literals

Const opts

opts: object

duration

duration: null = null

smooth

smooth: null = null