Skip to main content

Interface: SerializerI<Record, Related, Data>

Serializer converting model instances to adapter data source format.

Extended by

Type parameters

Record

Serialized value for an instance.

Related

Serialized value for a related instance.

Data

Serialized value for one/many/none instances.

Methods

serialize()

serialize(records, context): Awaitable<Data>

Serialize a set of already serialized records. This can be used to "wrap" records.

Parameters

records: null | Arrayable<Record | Related>

context

Returns

Awaitable<Data>

Source

packages/core/src/types.ts:138


serializeInstance()

serializeInstance(value, context): Awaitable<Record>

Serialize a given instance value.

Parameters

value: ModelInstance

context

Returns

Awaitable<Record>

Source

packages/core/src/types.ts:114


serializeRelation()

serializeRelation(instance, def, value, context): Awaitable<null | Arrayable<Related>>

Serialize a given instance's relation value.

Parameters

instance: ModelInstance

def: ModelRelation

value: null | Arrayable <ModelInstance>

context

Returns

Awaitable<null | Arrayable<Related>>

Source

packages/core/src/types.ts:124