UNPKG

@sap-cloud-sdk/core

Version:
19 lines 1.22 kB
import { Constructable, Entity, ComplexTypeNamespace, EdmTypeShared } from '../odata-common'; /** * Interface representing the return type of the builder function [[entitySerializer]]. */ export interface EntitySerializer<EntityT extends Entity = any, ComplexTypeNamespaceT extends ComplexTypeNamespace<any> = any> { serializeEntity: (entity: EntityT, entityConstructor: Constructable<EntityT>, diff?: boolean) => Record<string, any>; serializeComplexType: (fieldValue: any, complexTypeNameSpace: ComplexTypeNamespaceT) => any; serializeEntityNonCustomFields: (entity: EntityT, entityConstructor: Constructable<EntityT>) => Record<string, any>; } declare type TsToEdmType = (value: any, edmType: EdmTypeShared<'v2'> | EdmTypeShared<'v4'>) => any; /** * Constructs an entitySerializer given the OData v2 or v4 specific tsToEdm method. * The concrete serializers are created in odata/v2/entity-serializer.ts and odata/v4/entity-serializer.ts * @param tsToEdm - Converters ts input to EDM values * @returns a entity serializer as defined by [[EntitySerializer]] */ export declare function entitySerializer(tsToEdm: TsToEdmType): EntitySerializer; export {}; //# sourceMappingURL=entity-serializer.d.ts.map