Options
All
  • Public
  • Public/Protected
  • All
Menu

Class LayoutState

The state object describes the information to visualize for an entire layout. Use this with care, as invalid usage will result in a panic.

Specifically, you should avoid doing the following:

  • Using out of bounds indices.
  • Using the wrong getter function on the wrong type of component.

Hierarchy

Index

Constructors

constructor

Properties

ptr

ptr: number

Methods

asJson

  • asJson(): any
  • Encodes the layout state as JSON. You can use this to visualize all of the components of a layout.

    Returns any

componentAsBlankSpace

componentAsDetailedTimer

componentAsGraph

componentAsKeyValue

componentAsSeparator

componentAsSplits

componentAsText

componentAsTimer

componentAsTitle

componentType

  • componentType(index: number): string
  • Returns a string describing the type of the Component at the specified index.

    Parameters

    • index: number

    Returns string

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

len

  • len(): number
  • Gets the number of Components in the Layout State.

    Returns number

with

  • 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 new

  • Creates a new empty Layout State. This is useful for creating an empty layout state that gets updated over time.

    Returns LayoutState

Generated using TypeDoc