Skip to main content

Type alias: SerializerConfig<Record, Related, Data>

SerializerConfig<Record, Related, Data>: object

Type parameters

Record

Related

Data

Type declaration

circularRelationBehavior()?

optional circularRelationBehavior: (serializerContext, parents) => Awaitable <SerializerCircularRelationBehavior>

Parameters

serializerContext: SerializerContext<Record, Related, Data, ModelRelation>

parents: SerializerParents

Returns

Awaitable <SerializerCircularRelationBehavior>

createData()?

optional createData: (records, context) => Awaitable<Data>

Parameters

records: Arrayable<Record> | null

context

Returns

Awaitable<Data>

createRecord

createRecord: SerializerRecordFactory<Record, Related, Data>

isCircularRelation()?

optional isCircularRelation: (serializerContext, parents) => Awaitable<boolean>

Parameters

serializerContext: SerializerContext<Record, Related, Data, ModelRelation>

parents: SerializerParents

Returns

Awaitable<boolean>

serializeAttribute()?

optional serializeAttribute: (serializerContext) => Awaitable<unknown>

Parameters

serializerContext: SerializerContext<Record, Related, Data, ModelAttribute>

Returns

Awaitable<unknown>

serializeKey()?

optional serializeKey: (serializerContext) => Awaitable<string>

Parameters

serializerContext: SerializerContext<Record, Related, Data>

Returns

Awaitable<string>

serializeRelated()?

optional serializeRelated: (serializerContext, related, parents) => Awaitable <Arrayable<Related> | null>

Parameters

serializerContext: SerializerContext<Record, Related, Data, ModelRelation>

related: ModelInstance

parents: SerializerParents

Returns

Awaitable <Arrayable<Related> | null>

serializeRelation()?

optional serializeRelation: (serializerContext, related, parents) => Awaitable<unknown>

Parameters

serializerContext: SerializerContext<Record, Related, Data, ModelRelation>

related: ModelInstance

parents: SerializerParents

Returns

Awaitable<unknown>

shouldSerialize()?

optional shouldSerialize: (serializerContext) => Awaitable<boolean>

Parameters

serializerContext: SerializerContext<Record, Related, Data>

Returns

Awaitable<boolean>

Source

serialization/src/types.ts:164