import { PreparedGetTransaction, BaseConfig, BaseResult, TableCommand } from './index.js'; import { DynamoTable } from '../core/table.js'; import { ObjectLikeZodType, EntitySchema } from '../core/index.js'; /** * Extracts the result item type from a PreparedGetTransaction. */ type ExtractSchema = T extends PreparedGetTransaction ? EntitySchema : never; /** * Maps an array of PreparedGetTransactions to a tuple of their result item arrays. */ type TableTransactGetItems[]> = { [K in keyof Gets]: Array | undefined>; }; /** * Configuration for the TableTransactGet command. * * @template Gets - Tuple of PreparedGetTransaction types, one per entity group. */ type TableTransactGetConfig[]> = BaseConfig & { gets: [...Gets]; }; /** * Result of the TableTransactGet command. * * @template Gets - Tuple of PreparedGetTransaction types, one per entity group. */ type TableTransactGetResult[]> = BaseResult & { items: TableTransactGetItems; }; /** * Table-level command to perform a transactional read across multiple entity types. * * Unlike `TransactGet` which operates on a single entity type, this command accepts * get operations from multiple entities via `entity.prepare(new TransactGet({ keys: [...] }))` * and returns results grouped by entity in a tuple structure. * * @example * ```typescript * const { items } = await table.send(new TableTransactGet({ * gets: [ * userEntity.prepare(new TransactGet({ keys: [{ userId: 'u1' }] })), * orderEntity.prepare(new TransactGet({ keys: [{ orderId: 'o1' }, { orderId: 'o2' }] })), * ], * })) * * const [users, orders] = items * // users: (User | undefined)[] * // orders: (Order | undefined)[] * ``` */ declare class TableTransactGet[]> implements TableCommand> { #private; constructor(config: TableTransactGetConfig); execute(table: DynamoTable): Promise>; } export { TableTransactGet }; export type { TableTransactGetConfig, TableTransactGetResult };