duenamodb
Version:
Simple DynamoDB client written in TypeScript.
8 lines (7 loc) • 659 B
TypeScript
import { DeleteItemCommandInput } from '@aws-sdk/client-dynamodb';
import { DynamoDBTypes, PK } from './types';
type DeleteItemOptions = Omit<DeleteItemCommandInput, 'TableName' | 'Key'>;
export type DeleteItemFunction<PartitionKey extends PK> = (key: PartitionKey, options?: DeleteItemOptions) => Promise<boolean>;
export declare const createDeleteItem: <Attributes extends DynamoDBTypes, PartitionKey extends PK>(tablename: string, partitionKeyName: keyof Attributes) => DeleteItemFunction<PartitionKey>;
export declare const deleteItem: <T>(tablename: string, key: DeleteItemCommandInput['Key'], options: DeleteItemOptions) => Promise<boolean>;
export {};