utility class for optimized row context access

Constructors

Properties

context to use

key: ((rowIndex) => string)

key function

Type declaration

    • (rowIndex): string
    • key function

      Parameters

      • rowIndex: number

      Returns string

Methods

  • see heightOf but ignores padding and optional null in case of default height

    Parameters

    • index: number

      row index

    • Optional returnDefault: boolean

      return null if default height

    Returns null | number

  • Parameters

    • index: number
    • returnDefault: true

    Returns number

  • returns the height of the row identified by index

    Parameters

    • index: number

    Returns number

  • returns the position of the given index

    Parameters

    • index: number

      index to look for

    Returns number

  • returns the position of the given given or -1 if not found

    Parameters

    • key: string

    Returns {
        index: number;
        pos: number;
    }

    • index: number
    • pos: number
  • computes the positions and keys for a range of given indices

    Parameters

    • first: number

      first row index

    • last: number

      last row index

    • offset: number

      pos offset for the first row index

    • Optional callback: ((index, key, pos) => void)

      callback for each identified index

        • (index, key, pos): void
        • Parameters

          • index: number
          • key: string
          • pos: number

          Returns void

    Returns void