Interface IObservableJSON

An observable JSON value.

interface IObservableJSON {
    changed: ISignal<
        IObservableJSON,
        IObservableMap.IChangedArgs<undefined | ReadonlyPartialJSONValue>,
    >;
    isDisposed: boolean;
    size: number;
    type: "Map";
    clear(): void;
    delete(key: string): undefined | ReadonlyPartialJSONValue;
    dispose(): void;
    get(key: string): undefined | ReadonlyPartialJSONValue;
    has(key: string): boolean;
    keys(): string[];
    set(
        key: string,
        value: undefined | ReadonlyPartialJSONValue,
    ): undefined | ReadonlyPartialJSONValue;
    toJSON(): PartialJSONObject;
    values(): (undefined | ReadonlyPartialJSONValue)[];
}

Hierarchy (View Summary)

Properties

changed: ISignal<
    IObservableJSON,
    IObservableMap.IChangedArgs<undefined | ReadonlyPartialJSONValue>,
>

A signal emitted when the map has changed.

isDisposed: boolean

Test whether the object has been disposed.

This property is always safe to access.

size: number

The number of key-value pairs in the map.

type: "Map"

The type of the Observable.

Methods

  • Remove a key from the map

    Parameters

    • key: string

      the key to remove.

    Returns undefined | ReadonlyPartialJSONValue

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

  • Set a key-value pair in the map

    Parameters

    • key: string

      The key to set.

    • value: undefined | ReadonlyPartialJSONValue

      The value for the key.

    Returns undefined | ReadonlyPartialJSONValue

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