import { aws_dynamodb } from "aws-cdk-lib"; import { FormatObject, JsonFormat } from "typesafe-dynamodb/lib/json-format"; import { TableKey } from "typesafe-dynamodb/lib/key"; import { Narrow } from "typesafe-dynamodb/lib/narrow"; import { ITable } from "./table"; import { AttributeKeyToObject } from "./util"; export interface BatchWriteItemInput, Format extends JsonFormat = JsonFormat.Document> extends Omit { RequestItems: WriteRequest[]; } export declare type WriteRequest, Format extends JsonFormat> = { PutRequest: PutRequest; DeleteRequest?: never; } | { PutRequest?: never; DeleteRequest: DeleteRequest; }; export interface DeleteRequest, Format extends JsonFormat> { Key: Key; } export interface PutRequest { Item: FormatObject; } export interface BatchWriteItemOutput, Format extends JsonFormat> { UnprocessedItems: WriteRequest[]; } export declare type BatchWriteItem = >(request: BatchWriteItemInput) => Promise>; export declare function createBatchWriteItemIntegration(table: aws_dynamodb.ITable, format: Format): BatchWriteItem; /** * @see https://docs.aws.amazon.com/appsync/latest/devguide/resolver-mapping-template-reference-dynamodb.html#aws-appsync-resolver-mapping-template-reference-dynamodb-batch-delete-item */ export declare type BatchDeleteItemAppsync = >(keys: Key[]) => Promise<{ data: (TableKey, JsonFormat.Document>, PartitionKey, RangeKey, JsonFormat.Document> | null)[]; unprocessedKeys: AttributeKeyToObject[]; }>; export declare function createBatchDeleteItemAppsyncIntegration(table: ITable): BatchDeleteItemAppsync; /** * @see https://docs.aws.amazon.com/appsync/latest/devguide/resolver-mapping-template-reference-dynamodb.html#aws-appsync-resolver-mapping-template-reference-dynamodb-batch-delete-item */ export declare type BatchPutItemAppsync = >(items: FormatObject[]) => Promise<{ items: Narrow, JsonFormat.Document>[]; unprocessedItems: Narrow, JsonFormat.Document>[]; }>; export declare function createBatchPutItemAppsyncIntegration(table: ITable): BatchPutItemAppsync; //# sourceMappingURL=batch-write-item.d.ts.map