Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Layout

A Layout allows you to combine multiple components together to visualize a variety of information the runner is interested in.

Hierarchy

Index

Constructors

constructor

  • new Layout(ptr: number): Layout
  • This constructor is an implementation detail. Do not use this.

    Parameters

    • ptr: number

    Returns Layout

Properties

ptr

ptr: number

Methods

clone

dispose

  • dispose(): void
  • Disposes the object, allowing it to clean up all of its memory. You need to call this for every object that you don't use anymore and hasn't already been disposed.

    Returns void

push

  • Adds a new component to the end of the layout.

    Parameters

    Returns void

remount

  • remount(): void
  • Remounts all the components as if they were freshly initialized. Some components may only provide some information whenever it changes or when their state is first queried. Remounting returns this information again, whenever the layout's state is queried the next time.

    Returns void

scrollDown

  • scrollDown(): void
  • Scrolls down all the components in the layout that can be scrolled down.

    Returns void

scrollUp

  • scrollUp(): void
  • Scrolls up all the components in the layout that can be scrolled up.

    Returns void

settingsAsJson

  • settingsAsJson(): any
  • Encodes the settings of the layout as JSON.

    Returns any

state

  • Calculates and returns the layout's state based on the timer provided.

    Parameters

    Returns LayoutState

stateAsJson

  • Calculates the layout's state based on the timer provided and encodes it as JSON. You can use this to visualize all of the components of a layout.

    Parameters

    Returns any

updateState

updateStateAsJson

with

  • with<T>(closure: (obj: Layout) => T): T
  • Allows for scoped usage of the object. The object is guaranteed to get disposed once this function returns. You are free to dispose the object early yourself anywhere within the scope. The scope's return value gets carried to the outside of this function.

    Type parameters

    • T

    Parameters

    Returns T

Static defaultLayout

  • Creates a new default layout that contains a default set of components in order to provide a good default layout for runners. Which components are provided by this and how they are configured may change in the future.

    Returns Layout

Static new

  • Creates a new empty layout with no components.

    Returns Layout

Static parseFileHandle

  • parseFileHandle(handle: number): Layout
  • Attempts to parse a layout from a given file. null is returned it couldn't be parsed. This will not close the file descriptor / handle.

    Parameters

    • handle: number

    Returns Layout

Static parseJson

  • parseJson(settings: any): Layout
  • Parses a layout from the given JSON description of its settings. null is returned if it couldn't be parsed.

    Parameters

    • settings: any

    Returns Layout

Static parseOriginalLivesplit

  • parseOriginalLivesplit(data: number, length: number): Layout
  • Parses a layout saved by the original LiveSplit. This is lossy, as not everything can be converted completely. null is returned if it couldn't be parsed at all.

    Parameters

    • data: number
    • length: number

    Returns Layout

Static parseOriginalLivesplitArray

  • parseOriginalLivesplitArray(data: Int8Array): Layout
  • Parameters

    • data: Int8Array

    Returns Layout

Static parseOriginalLivesplitString

  • parseOriginalLivesplitString(text: string): Layout
  • Parameters

    • text: string

    Returns Layout

Generated using TypeDoc