Skip to main content

Interface: PayloadConverterWithEncoding

common.PayloadConverterWithEncoding

Implemented by

Properties

encodingType

Readonly encodingType: string


validateConverterHint

Optional validateConverterHint: (hint: ConverterHint<unknown>) => boolean

Return whether this converter can handle the supplied converter hint.

Implementations may also use this method to validate hints within toPayload and fromPayload.

Type declaration

▸ (hint): boolean

Parameters
NameType
hintConverterHint<unknown>
Returns

boolean

Methods

fromPayload

fromPayload<T>(payload, context?, hint?): T

Converts a Payload back to a value.

Type parameters

Name
T

Parameters

NameType
payloadIPayload
context?SerializationContext
hint?ConverterHint<T>

Returns

T


toPayload

toPayload<T>(value, context?, hint?): undefined | IPayload

Converts a value to a Payload.

Type parameters

Name
T

Parameters

NameTypeDescription
valueTThe value to convert. Example values include the Workflow args sent from the Client and the values returned by a Workflow or Activity.
context?SerializationContext-
hint?ConverterHint<T>-

Returns

undefined | IPayload

The Payload, or undefined if unable to convert.