Interface: Serializer<Record, Related, Data>
Serializer converting model instances to adapter data source format.
Extends
SerializerI
<Record
,Related
,Data
>
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
>
Inherited from
Source
serializeInstance()
serializeInstance(
instance
,context
,parents
?):Awaitable
<Record
>
Serialize a given instance value.
Parameters
• instance: ModelInstance
• context
• parents?: SerializerParents
Returns
Awaitable
<Record
>
Overrides
SerializerI
. serializeInstance
Source
serialization/src/types.ts:197
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
>>
Inherited from
SerializerI
. serializeRelation