1 | import { DynamoDB } from "aws-sdk";
|
2 | import { CallbackType } from "./General";
|
3 | export declare enum TransactionReturnOptions {
|
4 | request = "request",
|
5 | documents = "documents"
|
6 | }
|
7 | declare enum TransactionType {
|
8 | get = "get",
|
9 | write = "write"
|
10 | }
|
11 | export interface TransactionSettings {
|
12 | return: TransactionReturnOptions;
|
13 | type?: TransactionType;
|
14 | }
|
15 | export declare type GetTransactionInput = {
|
16 | Get: DynamoDB.GetItemInput;
|
17 | };
|
18 | export declare type CreateTransactionInput = {
|
19 | Put: DynamoDB.PutItemInput;
|
20 | };
|
21 | export declare type DeleteTransactionInput = {
|
22 | Delete: DynamoDB.DeleteItemInput;
|
23 | };
|
24 | export declare type UpdateTransactionInput = {
|
25 | Update: DynamoDB.UpdateItemInput;
|
26 | };
|
27 | export declare type ConditionTransactionInput = {
|
28 | ConditionCheck: DynamoDB.ConditionCheck;
|
29 | };
|
30 | declare type Transaction = GetTransactionInput | CreateTransactionInput | DeleteTransactionInput | UpdateTransactionInput | ConditionTransactionInput;
|
31 | declare type Transactions = (Transaction | Promise<Transaction>)[];
|
32 | declare type TransactionCallback = CallbackType<any, any>;
|
33 | declare type TransactionReturnType = any;
|
34 | declare function Transaction(transactions: Transactions): TransactionReturnType;
|
35 | declare function Transaction(transactions: Transactions, settings: TransactionSettings): TransactionReturnType;
|
36 | declare function Transaction(transactions: Transactions, callback: TransactionCallback): TransactionReturnType;
|
37 | declare function Transaction(transaction: Transactions, settings: TransactionSettings, callback: TransactionCallback): TransactionReturnType;
|
38 | export default Transaction;
|