UNPKG

duenamodb

Version:

Simple DynamoDB client written in TypeScript.

8 lines (7 loc) 696 B
import { GetItemCommandInput } from '@aws-sdk/client-dynamodb'; import { DynamoDBTypes, PK } from './types'; type GetItemOptions = Omit<GetItemCommandInput, 'TableName' | 'Key'>; export type GetItemFunction<Attributes extends DynamoDBTypes, PartitionKey extends PK> = (key: PartitionKey, options?: GetItemOptions) => Promise<Attributes | undefined>; export declare const createGetItem: <Attributes extends DynamoDBTypes, PartitionKey extends PK>(tablename: string, partitionKeyName: keyof Attributes) => GetItemFunction<Attributes, PartitionKey>; export declare const getItem: <T>(tablename: string, key: GetItemCommandInput['Key'], options: GetItemOptions) => Promise<T | undefined>; export {};