import { DynamoEntity } from '../core/entity.js'; import { ObjectLikeZodType, EntitySchema, TransactWriteOperation } from '../core/index.js'; import { ReturnValue, ReturnItemCollectionMetrics, ItemCollectionMetrics } from '@aws-sdk/client-dynamodb'; import { BaseConfig, BaseResult, BaseCommand, WriteTransactable } from './index.js'; /** * Configuration for the Delete command. * * @template Schema - The Zod schema defining the structure of the entity. */ type DeleteConfig = BaseConfig & { key: Partial>; returnValues?: ReturnValue; returnItemCollectionMetrics?: ReturnItemCollectionMetrics; }; /** * Result of the Delete command. * * @template Schema - The Zod schema defining the structure of the entity. */ type DeleteResult = BaseResult & { deletedItem?: Partial> | undefined; itemCollectionMetrics?: ItemCollectionMetrics; }; /** * Command to remove an item from a DynamoDB table. * * @template Schema - The Zod schema defining the structure of the entity. * * @example * ```typescript * import { DynamoTable, DynamoEntity, key, Delete } 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 deleteCommand = new Delete({ * key: { userId: 'user123' }, * returnValues: 'ALL_OLD', * }); * * const { deletedItem } = await userEntity.send(deleteCommand); * ``` */ declare class Delete implements BaseCommand, Schema>, WriteTransactable { #private; constructor(config: DeleteConfig); execute(entity: DynamoEntity): Promise>; prepareWriteTransaction(entity: DynamoEntity): Promise; } export { Delete }; export type { DeleteConfig, DeleteResult };