Options
All
  • Public
  • Public/Protected
  • All
Menu

A class representing a type a Variable.

class
implements

{IVariableParams}

Hierarchy

Implements

Index

Constructors

constructor

  • Creates an instance of a Variable.

    Parameters

    • key: string

      A unique key for the Variable.

    • dataType: string

      The data type of this Variable.

    • initialValue: any

      The initial selected value.

    • Optional callback: IVariableCallback

      The callback to invoke when updated.

    Returns Variable

Properties

Protected _callbacks

_callbacks: IVariableCallback[] = new Array<IVariableCallback>()

Private _initialized

_initialized: boolean = false

Whether this Variable has been initialized.

type

{boolean}

Private _selectedValue

_selectedValue: any

controlType

controlType: string

The rendered control type for this Variable.

type

{string}

dataType

dataType: string

The data type represented by this Variable.

type

{string}

initialValue

initialValue: any

The defalut value for this Variable.

type

{any}

key

key: string

The unique key for this Variable.

type

{string}

title

title: string

The title for this Variable.

type

{string}

Accessors

callbacks

constraintType

  • get constraintType(): string

selectedValue

  • get selectedValue(): any
  • set selectedValue(value: any): void

Methods

addAndExecuteCallback

addCallback

clone

executeCallbacks

  • executeCallbacks(): void

formatValue

  • formatValue(value: any): any
  • Subclass should override this method and return a properly formatted value. For example, a ColorVariable may choose to return an rgba string when provided an RgbaColor object.

    Parameters

    • value: any

      The value that should be formatted.

    Returns any

    Return either the original or formatted value.

restore

  • restore(): void

Private sanitizeKey

  • sanitizeKey(key: string): string
  • Formats the key by removing any whitespaces.

    Parameters

    • key: string

      The key to format

    Returns string

    The formatted key.

save

  • save(): void

serialize

Static deserialize

Generated using TypeDoc