Options
All
  • Public
  • Public/Protected
  • All
Menu

Is also a namespace for scoping Table based interfaces and types.

Index

Type aliases

AddExpressionParams: (params: ExpressionParams, attributes: Table.ExpressionAttributes) => void

Type declaration

Supported Table set based values.

AttributeTypes: "B" | "N" | "S" | "BOOL" | "NULL" | "L" | "M" | "BS" | "NS" | "SS"

Attribute types support by Table and DocumentClient.

AttributeValues: null | string | number | boolean | BinaryValue | AttributeSetValues | MapValue | ListValue

Supported Table attribute values.

AttributeValuesMap: {}

Supported Table value map used for put method.

Type declaration

BinarySetValue: DocumentClient.BinarySet

Binary set value supported by Table and DocumentClient.

BinaryValue: DocumentClient.binaryType

Binary value supported by Table and DocumentClient.

ExpressionAttributeParams: { ExpressionAttributeNames?: ExpressionAttributeNameMap; ExpressionAttributeValues?: Table.AttributeValuesMap }

The ExpressionAttributes params used by dynamodb.

Type declaration

  • Optional ExpressionAttributeNames?: ExpressionAttributeNameMap
  • Optional ExpressionAttributeValues?: Table.AttributeValuesMap
ExpressionParams: { ConditionExpression?: string; FilterExpression?: string; KeyConditionExpression?: string; ProjectionExpression?: string; UpdateExpression?: string } & ExpressionAttributeParams

The set of expression params used by dynamodb.

ItemActions: "get" | "delete" | PutItemActions | "update" | "check"

Item actions used by Fields to determine what table operation will be executed.

ListValue: Table.AttributeValues[]

List value supported by Table and DocumentClient.

MapValue: {}

Map value supported by Table and DocumentClient.

Type declaration

NumberSetValue: DocumentClient.NumberSet

Number set value supported by Table and DocumentClient.

Optional<T>: { [ P in keyof T]?: T[P] }

TypeScript utility type that constructs a type consisting of all properties of T set to optional. Does the opposite of Required.

Type parameters

  • T

ProjectionType: "ALL" | "KEYS_ONLY" | "INCLUDE"

Defines what general set of attributes are projected into the secondary index.

param ALL

All of the attributes of an item are projected into the secondary index.

param KEYS_ONLY

The table and the secondary index primary keys are projected into the secondary index.

PutItemActions: "put" | "put-new" | "put-replace"

Put based item actions, used by Fields to determine what put based table operation will be executed.

PutWriteOptions: "Always" | "Exists" | "NotExists"

Put method write options that determine how put will execute.

  • 'Always' - Default put behavior, that will always set the item weather it exists or now.
  • 'Exists' - Only set the item if the item already exists, adds
  • ConditionExpression="attribute_exists(#pk)", where #pk is the partition key name.
  • 'NotExists' - Only set the item if the item does not exist, add ConditionExpression="attribute_not_exists(#pk)", where #pk is the partition key name.
StringSetValue: DocumentClient.StringSet

String set value supported by Table and DocumentClient.

Functions

  • createTable<KEY, ATTRIBUTES>(params: TableParamsT<KEY, ATTRIBUTES>): TableT<KEY, ATTRIBUTES>
  • Creates the generic form of Table used in TypeScript to get strong typing.

    So you may ask, why have createTable over just using new Table.TableT? The reason is that since the method signature is exactly the same (same method names with same params, only typings are more strict) between TableT and Table there is no need to have TableT class with just a bunch of pass through wrapper methods. This also makes the Table TSDocs easier to read without all of the TypeScript Generic types. Same approach is taken with Index and Model.

    Type parameters

    Parameters

    • params: TableParamsT<KEY, ATTRIBUTES>

      Table constructor params.

    Returns TableT<KEY, ATTRIBUTES>

    A new table as TableT.

  • equalMap(keys: string[], item1: {}, item2?: {}): boolean
  • Compare the value of the list of keys between item1 and item2.

    Parameters

    • keys: string[]

      List of keys to compare between item1 and item2.

    • item1: {}

      Item to compare item2 against.

      • [key: string]: any
    • Optional item2: {}

      Item to compare item1 against.

      • [key: string]: any

    Returns boolean

    true if the value of the keys of item1 and item2 are equal.

Generated using TypeDoc