## Index

### Classes

- Binary
- NullType
- UndefinedType

### Interfaces

- BinaryAttribute
- BinarySetAttribute
- BooleanAttribute
- ListAttribute
- MapAttribute
- MapperForType
- NullAttribute
- NumberAttribute
- NumberSetAttribute
- StringAttribute
- StringSetAttribute

### Type aliases

- Attribute
- AttributeCollectionType
- AttributeType
- AttributeValueType
- Attributes
- CollectionAttributeTypes
- FromDbFn
- ToDbFn

### Functions

- booleanFromDb
- booleanToDb
- collectionFromDb
- collectionToDb
- createToKeyFn
- dateFromDb
- dateFromDb
- dateToDb
- dateToDb
- detectCollectionTypeFromMetadata
- enumFromDb
- enumToDb
- fromDb
- fromDbOne
- nullFromDb
- nullToDb
- numberFromDb
- numberToDb
- objectFromDb
- objectToDb
- stringFromDb
- stringToDb
- toDb
- toDbOne
- toKey

### Object literals

- BooleanMapper
- CollectionMapper
- EnumMapper
- NullMapper
- NumberMapper
- ObjectMapper
- StringMapper
- dateToNumberMapper
- dateToStringMapper

## Type aliases

### Attribute

Attribute: StringAttribute | NumberAttribute | BinaryAttribute | StringSetAttribute | NumberSetAttribute | BinarySetAttribute | MapAttribute | ListAttribute<any> | NullAttribute | BooleanAttribute

- Defined in mapper/type/attribute.type.ts:4

### AttributeCollectionType

AttributeCollectionType: "SS" | "NS" | "BS" | "L"

- Defined in mapper/type/attribute-type.type.ts:4

### AttributeType

AttributeType: "S" | "N" | "B" | "M" | "NULL" | "BOOL" | AttributeCollectionType

- Defined in mapper/type/attribute-type.type.ts:6

### AttributeValueType

AttributeValueType: string | number | boolean | Binary | Set<any> | Map<any, any> | any[] | NullType | UndefinedType | object

- Defined in mapper/type/attribute-value-type.type.ts:8

### Attributes

Attributes: Record<keyof T | string, Attribute>

- Defined in mapper/type/attribute.type.ts:21

the key is either a key of the object T or any string to support for custom property names @Property({name: 'myOtherName'}) and the value is one of Attribute (we can't narrow the type of Attribute)

### CollectionAttributeTypes

CollectionAttributeTypes: StringSetAttribute | NumberSetAttribute | BinarySetAttribute | ListAttribute | NullAttribute

- Defined in mapper/for-type/collection.mapper.ts:19

### FromDbFn

FromDbFn: function

- Defined in mapper/for-type/base.mapper.ts:49

Maps an attribute value coming from dynamoDB to an javascript type

#### Type declaration

- - (attributeValue: R, propertyMetadata?: PropertyMetadata<T, R>): T

  - #### Parameters

    - ##### attributeValue: R

    - ##### Optional propertyMetadata: PropertyMetadata<T, R>

    #### Returns T

### ToDbFn

ToDbFn: function

- Defined in mapper/for-type/base.mapper.ts:31

Maps a js value to an attribute value so it can be stored in dynamoDB, supported types are

S(tring) N(umber) B(inary) BOOL NULL S(tring)S(et) N(umber)S(et) B(inary)S(et) L(ist)

#### Type declaration

- - (propertyValue: T, propertyMetadata?: PropertyMetadata<T, R>): R | null

  - #### Parameters

    - ##### propertyValue: T

    - ##### Optional propertyMetadata: PropertyMetadata<T, R>

    #### Returns R | null

## Functions

### booleanFromDb

- booleanFromDb(dbValue: BooleanAttribute): boolean

- - Defined in mapper/for-type/boolean.mapper.ts:7

  #### Parameters

  - ##### dbValue: BooleanAttribute

  #### Returns boolean

### booleanToDb

- booleanToDb(modelValue: boolean): BooleanAttribute

- - Defined in mapper/for-type/boolean.mapper.ts:14

  #### Parameters

  - ##### modelValue: boolean

  #### Returns BooleanAttribute

### collectionFromDb

- collectionFromDb(attributeValue: CollectionAttributeTypes, propertyMetadata?: PropertyMetadata<any, CollectionAttributeTypes>): any[] | Set<any>

- - Defined in mapper/for-type/collection.mapper.ts:26

  #### Parameters

  - ##### attributeValue: CollectionAttributeTypes

  - ##### Optional propertyMetadata: PropertyMetadata<any, CollectionAttributeTypes>

  #### Returns any[] | Set<any>

### collectionToDb

- collectionToDb(propertyValue: any[] | Set<any>, propertyMetadata?: PropertyMetadata<any, CollectionAttributeTypes>): CollectionAttributeTypes | null

- - Defined in mapper/for-type/collection.mapper.ts:58

  #### Parameters

  - ##### propertyValue: any[] | Set<any>

  - ##### Optional propertyMetadata: PropertyMetadata<any, CollectionAttributeTypes>

  #### Returns CollectionAttributeTypes | null

### createToKeyFn

- createToKeyFn<T>(modelConstructor: ModelConstructor<T>): function

- - Defined in mapper/mapper.ts:154

  returns the function for the given ModelConstructor to create the AttributeMap with HASH (and RANGE) Key of a given item.

  #### Type parameters

  - #### T

  #### Parameters

  - ##### modelConstructor: ModelConstructor<T>

  #### Returns function

  - - (item: Partial<T>): Attributes<T>

    - #### Parameters

      - ##### item: Partial<T>

      #### Returns Attributes<T>

### dateFromDb

- dateFromDb(attributeValue: NumberAttribute): Date

- - Defined in mapper/custom/date-to-number.mapper.ts:7

  #### Parameters

  - ##### attributeValue: NumberAttribute

  #### Returns Date

### dateFromDb

- dateFromDb(attributeValue: StringAttribute): Date

- - Defined in mapper/custom/date-to-string.mapper.ts:7

  #### Parameters

  - ##### attributeValue: StringAttribute

  #### Returns Date

### dateToDb

- dateToDb(modelValue: Date): NumberAttribute

- - Defined in mapper/custom/date-to-number.mapper.ts:15

  #### Parameters

  - ##### modelValue: Date

  #### Returns NumberAttribute

### dateToDb

- dateToDb(modelValue: Date): StringAttribute

- - Defined in mapper/custom/date-to-string.mapper.ts:19

  #### Parameters

  - ##### modelValue: Date

  #### Returns StringAttribute

### detectCollectionTypeFromMetadata

- detectCollectionTypeFromMetadata(propertyMetadata: PropertyMetadata<any, CollectionAttributeTypes>, propertyValue: any): AttributeCollectionType

- - Defined in mapper/for-type/collection.mapper.ts:119

  #### Parameters

  - ##### propertyMetadata: PropertyMetadata<any, CollectionAttributeTypes>

  - ##### propertyValue: any

  #### Returns AttributeCollectionType

### enumFromDb

- enumFromDb(attributeValue: NumberAttribute, propertyMetadata?: PropertyMetadata<any, NumberAttribute>): string | number

- - Defined in mapper/for-type/enum.mapper.ts:19

  #### Parameters

  - ##### attributeValue: NumberAttribute

  - ##### Optional propertyMetadata: PropertyMetadata<any, NumberAttribute>

  #### Returns string | number

### enumToDb

- enumToDb(value: string | number, propertyMetadata?: PropertyMetadata<any, NumberAttribute>): NumberAttribute

- - Defined in mapper/for-type/enum.mapper.ts:8

  #### Parameters

  - ##### value: string | number

  - ##### Optional propertyMetadata: PropertyMetadata<any, NumberAttribute>

  #### Returns NumberAttribute

### fromDb

- fromDb<T>(attributeMap: Attributes<T>, modelConstructor?: ModelConstructor<T>): T

- - Defined in mapper/mapper.ts:213

  parses attributes to a js item according to the given model constructor [its meta data]

  #### Type parameters

  - #### T

  #### Parameters

  - ##### attributeMap: Attributes<T>

  - ##### Optional modelConstructor: ModelConstructor<T>

  #### Returns T

### fromDbOne

- fromDbOne<T>(attributeValue: Attribute, propertyMetadata?: PropertyMetadata<any, any>): T

- - Defined in mapper/mapper.ts:260

  parses an attribute to a js value according to the given property metadata

  #### Type parameters

  - #### T

  #### Parameters

  - ##### attributeValue: Attribute

  - ##### Optional propertyMetadata: PropertyMetadata<any, any>

  #### Returns T

### nullFromDb

- nullFromDb(value: NullAttribute): null

- - Defined in mapper/for-type/null.mapper.ts:7

  #### Parameters

  - ##### value: NullAttribute

  #### Returns null

### nullToDb

- nullToDb(value: null): NullAttribute

- - Defined in mapper/for-type/null.mapper.ts:15

  #### Parameters

  - ##### value: null

  #### Returns NullAttribute

### numberFromDb

- numberFromDb(attributeValue: NumberAttribute): number

- - Defined in mapper/for-type/number.mapper.ts:8

  #### Parameters

  - ##### attributeValue: NumberAttribute

  #### Returns number

### numberToDb

- numberToDb(modelValue: number): NumberAttribute | null

- - Defined in mapper/for-type/number.mapper.ts:20

  #### Parameters

  - ##### modelValue: number

  #### Returns NumberAttribute | null

### objectFromDb

- objectFromDb(val: MapAttribute, propertyMetadata?: PropertyMetadata<any, MapAttribute>): any

- - Defined in mapper/for-type/object.mapper.ts:9

  #### Parameters

  - ##### val: MapAttribute

  - ##### Optional propertyMetadata: PropertyMetadata<any, MapAttribute>

  #### Returns any

### objectToDb

- objectToDb(modelValue: any, propertyMetadata?: PropertyMetadata<any, MapAttribute>): MapAttribute

- - Defined in mapper/for-type/object.mapper.ts:17

  #### Parameters

  - ##### modelValue: any

  - ##### Optional propertyMetadata: PropertyMetadata<any, MapAttribute>

  #### Returns MapAttribute

### stringFromDb

- stringFromDb(attributeValue: StringAttribute): string

- - Defined in mapper/for-type/string.mapper.ts:7

  #### Parameters

  - ##### attributeValue: StringAttribute

  #### Returns string

### stringToDb

- stringToDb(modelValue: string): StringAttribute | null

- - Defined in mapper/for-type/string.mapper.ts:15

  #### Parameters

  - ##### modelValue: string

  #### Returns StringAttribute | null

### toDb

- toDb<T>(item: T, modelConstructor?: ModelConstructor<T>): Attributes<T>

- - Defined in mapper/mapper.ts:31

  mapps an item according to given model constructor [its meta data] to attributes

  #### Type parameters

  - #### T

  #### Parameters

  - ##### item: T

  - ##### Optional modelConstructor: ModelConstructor<T>

  #### Returns Attributes<T>

### toDbOne

- toDbOne(propertyValue: any, propertyMetadata?: PropertyMetadata<any>): Attribute | null
- toDbOne(propertyValue: any, propertyPath: string, propertyMetadata?: PropertyMetadata<any>): Attribute | null

- - Defined in mapper/mapper.ts:100

  maps a js value to its dynamoDB attribute

  #### Parameters

  - ##### propertyValue: any

    The value which should be mapped

  - ##### Optional propertyMetadata: PropertyMetadata<any>

    Some optional metadata

  #### Returns Attribute | null

- - Defined in mapper/mapper.ts:110

  maps a js value to its dynamoDB attribute. You can provide the property path to have a more verbose output

  #### Parameters

  - ##### propertyValue: any

    The value which should be mapped

  - ##### propertyPath: string

    The property path is only used for logging purposes

  - ##### Optional propertyMetadata: PropertyMetadata<any>

    Some optional metadata

  #### Returns Attribute | null

### toKey

- toKey<T>(item: T, modelConstructor: ModelConstructor<T>): Attributes<T>

- - Defined in mapper/mapper.ts:181

  creates toKeyFn and applies item to it.

  see

    createToKeyFn

  #### Type parameters

  - #### T

  #### Parameters

  - ##### item: T

  - ##### modelConstructor: ModelConstructor<T>

  #### Returns Attributes<T>

## Object literals

### Const BooleanMapper

BooleanMapper: object

- Defined in mapper/for-type/boolean.mapper.ts:21

### fromDb

fromDb: booleanFromDb = booleanFromDb

- Defined in mapper/for-type/boolean.mapper.ts:22

### toDb

toDb: booleanToDb = booleanToDb

- Defined in mapper/for-type/boolean.mapper.ts:23

### Const CollectionMapper

CollectionMapper: object

- Defined in mapper/for-type/collection.mapper.ts:113

### fromDb

fromDb: collectionFromDb = collectionFromDb

- Defined in mapper/for-type/collection.mapper.ts:114

### toDb

toDb: collectionToDb = collectionToDb

- Defined in mapper/for-type/collection.mapper.ts:115

### Const EnumMapper

EnumMapper: object

- Defined in mapper/for-type/enum.mapper.ts:40

Enums are mapped to numbers by default

### fromDb

fromDb: enumFromDb = enumFromDb

- Defined in mapper/for-type/enum.mapper.ts:41

### toDb

toDb: enumToDb = enumToDb

- Defined in mapper/for-type/enum.mapper.ts:42

### Const NullMapper

NullMapper: object

- Defined in mapper/for-type/null.mapper.ts:23

### fromDb

fromDb: nullFromDb = nullFromDb

- Defined in mapper/for-type/null.mapper.ts:24

### toDb

toDb: nullToDb = nullToDb

- Defined in mapper/for-type/null.mapper.ts:25

### Const NumberMapper

NumberMapper: object

- Defined in mapper/for-type/number.mapper.ts:32

### fromDb

fromDb: numberFromDb = numberFromDb

- Defined in mapper/for-type/number.mapper.ts:33

### toDb

toDb: numberToDb = numberToDb

- Defined in mapper/for-type/number.mapper.ts:34

### Const ObjectMapper

ObjectMapper: object

- Defined in mapper/for-type/object.mapper.ts:28

### fromDb

fromDb: objectFromDb = objectFromDb

- Defined in mapper/for-type/object.mapper.ts:29

### toDb

toDb: objectToDb = objectToDb

- Defined in mapper/for-type/object.mapper.ts:30

### Const StringMapper

StringMapper: object

- Defined in mapper/for-type/string.mapper.ts:24

### fromDb

fromDb: stringFromDb = stringFromDb

- Defined in mapper/for-type/string.mapper.ts:25

### toDb

toDb: stringToDb = stringToDb

- Defined in mapper/for-type/string.mapper.ts:26

### Const dateToNumberMapper

dateToNumberMapper: object

- Defined in mapper/custom/date-to-number.mapper.ts:24

### fromDb

fromDb: dateFromDb = dateFromDb

- Defined in mapper/custom/date-to-number.mapper.ts:25

### toDb

toDb: dateToDb = dateToDb

- Defined in mapper/custom/date-to-number.mapper.ts:26

### Const dateToStringMapper

dateToStringMapper: object

- Defined in mapper/custom/date-to-string.mapper.ts:28

### fromDb

fromDb: dateFromDb = dateFromDb

- Defined in mapper/custom/date-to-string.mapper.ts:29

### toDb

toDb: dateToDb = dateToDb

- Defined in mapper/custom/date-to-string.mapper.ts:30