Represents an interface for a model adapter.

interface IModelAdapter<T extends {} = any> {
    data: T;
    refresh(): void;
    setData(data: Partial<T> | (prevData: T) => Partial<T>): void;
    toObject(): T;
}

Type Parameters

  • T extends {} = any

    The type of data that the adapter handles.

Implemented by

Properties

Methods

Properties

data: T

Represents a variable of unknown type T.

Methods

  • Sets the data for the object.

    Parameters

    • data: Partial<T> | (prevData: T) => Partial<T>

      The data to set. It can be a partial object of type T or a function that takes the previous data of type T and returns a partial object of type T.

    Returns void

  • Returns an object representation of the instance.

    Returns T

    The object representation of the instance.