dynamodb-toolbox icon indicating copy to clipboard operation
dynamodb-toolbox copied to clipboard

[UPDATE] [TYPESCRIPT] Making EntityAttributes generic

Open dheeraj1447 opened this issue 3 years ago • 0 comments

This is an issue to make typings stronger and specifically making the EntityAttributes type generic. This makes defining the data models have strict typings to avoid any inconsistencies.

  export declare type EntityAttributes<T> = {
        [P in keyof T]: DynamoDBTypes | EntityAttributeConfig | EntityCompositeAttributes;
    };

NOTE - Keys related to the table (pk, sk or gsi fields) should be defined in the generic type.

dheeraj1447 avatar Jun 03 '21 14:06 dheeraj1447