import { DynamoDB } from "aws-sdk"; import { PartitionAndSortKey, PartitionKey, PartitionKeyAndSortKeyPrefix } from "./keys"; import { QueryBuilder } from "./QueryBuilder"; import { ParallelScanConfig, ScanBuilder } from "./ScanBuilder"; import { Table } from "./Table"; import { ExtractKeyType, GroupedModels, TaggedModel } from "./types"; export interface Options { xRayTracingEnabled?: boolean; consistentReads?: boolean; } export interface GetOptions { consistentRead?: boolean; } export interface QueryOptions { consistentRead?: boolean; } export interface ScanOptions { consistentRead?: boolean; parallel?: ParallelScanConfig; } /** A thin wrapper around the DynamoDB sdk client that * does auto mapping between JSON <=> DynamoDB Items */ export declare class Beyonce { private table; private client; private consistentReads; constructor(table: Table, dynamo: DynamoDB, options?: Options); /** Retrieve a single Item out of Dynamo */ get(key: PartitionAndSortKey, options?: GetOptions): Promise; /** Write an item into Dynamo */ put(item: T): Promise; /** Performs a (partial) update on an existing item in Dynamo.*/ update(key: PartitionAndSortKey, updateFunc: (lens: T) => void): Promise; delete(key: PartitionAndSortKey): Promise; /** BatchGet items */ batchGet>(params: { keys: T[]; consistentRead?: boolean; }): Promise<{ items: GroupedModels>; unprocessedKeys: T[]; }>; batchWrite(params: { putItems?: T[]; deleteItems?: PartitionAndSortKey[]; }): Promise<{ unprocessedPuts: T[]; unprocessedDeletes: PartitionAndSortKey[]; }>; /** * Perform N Dynamo operations in an atomic transaction. * * @param params.putItems Set `failIfNotUnique` to true on a record within putItems to cancel the transaction if a * record with the same partition key and sort key (if applicable) already exists. */ batchWriteWithTransaction(params: { clientRequestToken?: string; putItems?: (T & { failIfNotUnique?: boolean; })[]; deleteItems?: PartitionAndSortKey[]; }): Promise; query(key: PartitionKey | PartitionKeyAndSortKeyPrefix, options?: QueryOptions): QueryBuilder; queryGSI(gsiName: string, gsiKey: PartitionKey, options?: QueryOptions): QueryBuilder; scan(options?: ScanOptions): ScanBuilder; private doSingleBatchGet; } //# sourceMappingURL=Beyonce.d.ts.map