These types are used by the ObjectMapper. Here's the magic which makes
object mapper schemas type safe and complete. You generally won't need to
make use of these types within your own code; just ObjectMapper
should be
enough.
A function that takes some input object, and an optional context object, and returns anoutput. This is used as part of an ObjectMapperSchema
.
A callable function, equivalent to calling ObjectMapper#map
.It also exposes ObjectMapperFunction#schema
as a readonly property.
Given some object TInput
, and some value TOutputValue
, allows any keyof TInput
that can be assigned to TOutputValue
.
Lots you use the special symbol OmitProperty
in place of an optional/undefined value.
A mapper function, or input property name, used in an ObjectMapperSchema
.
An object, where every property name must match a property name in the desired output type.Every property value must be a MapperSchemaValue
.
An ObjectMapper can take an optional context. The context type is definedwhen you instantiate an ObjectMapper. If the context type is undefined
,rather than passing undefined
every time, you can just omit the property.(You can still pass undefined
, for parity with the mappers that requirea context.)