UNPKG

duenamodb

Version:

Simple, strongly-typed helpers around the AWS SDK DynamoDB client.

17 lines (16 loc) 1.01 kB
import { type ScanCommandInput } from "@aws-sdk/client-dynamodb"; import { type FilterCondition } from "./expression"; import type { DynamoDBTypes } from "./types"; type DynamoDBOptions = Omit<ScanCommandInput, "TableName">; export type ScanOptions<Attributes extends DynamoDBTypes> = { filter?: FilterCondition<Attributes>; dynamodbOptions?: DynamoDBOptions; }; export type ScanItemsFunction<Attributes extends DynamoDBTypes> = (options?: ScanOptions<Attributes>) => Promise<Attributes[]>; type CreateScanItemsOptions<_Attributes extends DynamoDBTypes> = { tablename: string; }; export declare const createScanItems: <Attributes extends DynamoDBTypes>(options: CreateScanItemsOptions<Attributes>) => ScanItemsFunction<Attributes>; export declare const createScanOptions: <Attributes extends DynamoDBTypes>(filter?: FilterCondition<Attributes> | undefined) => Partial<DynamoDBOptions>; export declare const scanItems: <T>(tablename: string, options: DynamoDBOptions) => Promise<T[]>; export {};