The state restoration configuration options.

Typeparam

T - The type of object held by the restorable collection.

interface IOptions<T> {
    args?: ((obj) => ReadonlyPartialJSONObject);
    command: string;
    connector: IDataConnector<ReadonlyPartialJSONValue, ReadonlyPartialJSONValue, string, string>;
    name: ((obj) => string);
    registry: CommandRegistry;
    when?: Promise<any> | Promise<any>[];
}

Type Parameters

Hierarchy (view full)

Properties

args?: ((obj) => ReadonlyPartialJSONObject)

A function that returns the args needed to restore an instance.

Type declaration

command: string

The command to execute when restoring instances.

connector: IDataConnector<ReadonlyPartialJSONValue, ReadonlyPartialJSONValue, string, string>

The data connector to fetch restore data.

name: ((obj) => string)

A function that returns a unique persistent name for this instance.

Type declaration

    • (obj): string
    • Parameters

      • obj: T

      Returns string

registry: CommandRegistry

The command registry which holds the restore command.

when?: Promise<any> | Promise<any>[]

The point after which it is safe to restore state.