Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ObservableJSON

A concrete Observable map for JSON data.

Hierarchy

Index

Constructors

constructor

Accessors

changed

  • A signal emitted when the map has changed.

    Returns ISignal<this, IChangedArgs<T>>

isDisposed

  • get isDisposed(): boolean
  • Whether this map has been disposed.

    Returns boolean

size

  • get size(): number
  • The number of key-value pairs in the map.

    Returns number

type

  • get type(): "Map"
  • The type of the Observable.

    Returns "Map"

Methods

clear

  • clear(): void
  • Set the ObservableMap to an empty map.

    Returns void

delete

  • delete(key: string): ReadonlyPartialJSONValue
  • Remove a key from the map

    Parameters

    • key: string

      the key to remove.

    Returns ReadonlyPartialJSONValue

    the value of the given key, or undefined if that does not exist.

    Notes

    This is a no-op if the value does not change.

dispose

  • dispose(): void
  • Dispose of the resources held by the map.

    Returns void

get

  • get(key: string): ReadonlyPartialJSONValue
  • Get a value for a given key.

    Parameters

    • key: string

      the key.

    Returns ReadonlyPartialJSONValue

    the value for that key.

has

  • has(key: string): boolean
  • Check whether the map has a key.

    Parameters

    • key: string

      the key to check.

    Returns boolean

    true if the map has the key, false otherwise.

keys

  • keys(): string[]
  • Get a list of the keys in the map.

    Returns string[]

    • a list of keys.

set

  • set(key: string, value: ReadonlyPartialJSONValue): ReadonlyPartialJSONValue
  • Set a key-value pair in the map

    throws

    if the new value is undefined.

    Notes

    This is a no-op if the value does not change.

    Parameters

    • key: string

      The key to set.

    • value: ReadonlyPartialJSONValue

      The value for the key.

    Returns ReadonlyPartialJSONValue

    the old value for the key, or undefined if that did not exist.

toJSON

  • toJSON(): PartialJSONObject
  • Serialize the model to JSON.

    Returns PartialJSONObject

values

  • values(): ReadonlyPartialJSONValue[]
  • Get a list of the values in the map.

    Returns ReadonlyPartialJSONValue[]

    • a list of values.

Generated using TypeDoc