duenamodb
Version:
Simple, strongly-typed helpers around the AWS SDK DynamoDB client.
11 lines (10 loc) • 703 B
TypeScript
import { type PutItemCommandInput } from "@aws-sdk/client-dynamodb";
import type { DynamoDBTypes } from "./types";
type PutItemOptions = Omit<PutItemCommandInput, "TableName" | "Item">;
export type PutItemFunction<Attributes extends DynamoDBTypes> = (item: Attributes, options?: PutItemOptions) => Promise<Attributes>;
export type CreatePutItemOptions<_Attributes extends DynamoDBTypes> = {
tablename: string;
};
export declare const createPutItem: <Attributes extends DynamoDBTypes>(options: CreatePutItemOptions<Attributes>) => PutItemFunction<Attributes>;
export declare const putItem: <T>(tableName: string, input: PutItemCommandInput["Item"], options: PutItemOptions) => Promise<T>;
export {};