import { DynamoEntity } from '../core/entity.js'; import { BaseConfig, BaseResult, BaseCommand, GetTransactable } from './index.js'; import { ObjectLikeZodType, EntitySchema } from '../core/index.js'; /** * Configuration for the TransactGet command. * * @template Schema - The Zod schema defining the structure of the entity. */ type TransactGetConfig = BaseConfig & { keys: Array>>; }; /** * Result of the TransactGet command. * * @template Schema - The Zod schema defining the structure of the entity. */ type TransactGetResult = BaseResult & { items: Array | undefined>; }; /** * Command to perform a transactional read of multiple items (all-or-nothing, strongly consistent). * * @template Schema - The Zod schema defining the structure of the entity. * * @example * ```typescript * import { DynamoTable, DynamoEntity, key, TransactGet } from 'dynamo-document-builder'; * * const table = new DynamoTable({ * tableName: 'ExampleTable', * documentClient, * }); * * const userEntity = new DynamoEntity({ * table, * schema: z.object({ * userId: z.string(), * name: z.string(), * }), * partitionKey: user => key('USER', user.userId), * sortKey: () => 'METADATA', * }); * * const transactGetCommand = new TransactGet({ * keys: [ * { userId: 'user1' }, * { userId: 'user2' }, * ], * }); * * const { items } = await userEntity.send(transactGetCommand); * // items array has same order as keys, undefined if not found * ``` */ declare class TransactGet implements BaseCommand, Schema>, GetTransactable { #private; constructor(config: TransactGetConfig); get keys(): Array>>; execute(entity: DynamoEntity): Promise>; } export { TransactGet }; export type { TransactGetConfig, TransactGetResult };