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

continuousScrollStep

  • continuousScrollStep(): void

getDuration

  • getDuration(): Promise<number>

getSmooth

  • getSmooth(): Promise<string>

recursiveScroll

  • recursiveScroll(xDistance: number, yDistance: number, node?: 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

    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>

scrollstart

  • scrollstart(aVelocity: any, bVelocity: any, mult: any): void
  • Scroll continuously until scrollstop is called. Pass an x and y velocity, or just a y velocity. If only a single arg is passed, it will be treated as y (vertical scroll). Can also pass a multiplier, intented to be used as a numeric arg when :scrollstart is bound to a key.

    Velocity unit = px/second

    Parameters

    • aVelocity: any
    • bVelocity: any
    • mult: any

    Returns void

scrollstop

  • scrollstop(): void

setCurrentFocus

  • setCurrentFocus(v: any): void

Object literals

Const continuousScrollState

continuousScrollState: object

lastStep

lastStep: number = 0

scrolling

scrolling: boolean = false

xVel

xVel: number = 0

yVel

yVel: number = 0

Const opts

opts: object

duration

duration: null = null

smooth

smooth: null = null