import { BaseConfig, PreparedWriteTransaction, TableCommand } from './index.js'; import { DynamoTable } from '../core/table.js'; import { ReturnItemCollectionMetrics, ConsumedCapacity, ItemCollectionMetrics } from '@aws-sdk/client-dynamodb'; import { ResponseMetadata } from '@aws-sdk/types'; /** * Configuration for the TableTransactWrite command. */ type TableTransactWriteConfig = BaseConfig & { transactions: PreparedWriteTransaction[]; idempotencyToken?: string; returnItemCollectionMetrics?: ReturnItemCollectionMetrics; }; /** * Result of the TableTransactWrite command. */ type TableTransactWriteResult = { responseMetadata?: ResponseMetadata; consumedCapacity?: ConsumedCapacity[] | undefined; itemCollectionMetrics?: ItemCollectionMetrics; }; /** * Table-level command to perform an atomic write transaction across multiple entity types. * * Unlike `TransactWrite` which operates on a single entity type, this command accepts * operations from multiple entities via `entity.prepare([...])` and executes them as * a single all-or-nothing DynamoDB transaction. * * @example * ```typescript * await table.send(new TableTransactWrite({ * transactions: [ * userEntity.prepare([ * new Put({ item: { userId: 'u1', name: 'Alice' } }), * new Delete({ key: { userId: 'u2', name: 'Bob' } }), * ]), * orderEntity.prepare([ * new Update({ key: { orderId: 'o1' }, update: { status: 'shipped' } }), * ]), * ], * })) * ``` */ declare class TableTransactWrite implements TableCommand { #private; constructor(config: TableTransactWriteConfig); execute(table: DynamoTable): Promise; } export { TableTransactWrite }; export type { TableTransactWriteConfig, TableTransactWriteResult };