UNPKG

dynamodb-toolbox

Version:

Lightweight and type-safe query builder for DynamoDB and TypeScript.

28 lines (27 loc) 2 kB
import type { UpdateCommandInput, UpdateCommandOutput } from '@aws-sdk/lib-dynamodb'; import type { ReturnedAttributes } from '../../../entity/actions/update/updateItemCommand.js'; import { $sentArgs } from '../../../entity/constants.js'; import type { Entity, EntitySendableAction } from '../../../entity/entity.js'; import { EntityAction } from '../../../entity/index.js'; import type { DocumentClientOptions } from '../../../types/documentClientOptions.js'; import type { Merge } from '../../../types/merge.js'; import { $item, $options } from './constants.js'; import type { UpdateAttributesOptions } from './options.js'; import type { UpdateAttributesInput } from './types.js'; export type UpdateAttributesResponse<ENTITY extends Entity, OPTIONS extends UpdateAttributesOptions<ENTITY> = UpdateAttributesOptions<ENTITY>> = Merge<Omit<UpdateCommandOutput, 'Attributes'>, { Attributes?: ReturnedAttributes<ENTITY, OPTIONS>; ToolboxItem: UpdateAttributesInput<ENTITY, true>; }>; export declare class UpdateAttributesCommand<ENTITY extends Entity = Entity, OPTIONS extends UpdateAttributesOptions<ENTITY> = UpdateAttributesOptions<ENTITY>> extends EntityAction<ENTITY> implements EntitySendableAction<ENTITY> { static actionName: "updateAttributes"; [$item]?: UpdateAttributesInput<ENTITY>; [$options]: OPTIONS; constructor(entity: ENTITY, item?: UpdateAttributesInput<ENTITY>, options?: OPTIONS); item(nextItem: UpdateAttributesInput<ENTITY>): UpdateAttributesCommand<ENTITY, OPTIONS>; options<NEXT_OPTIONS extends UpdateAttributesOptions<ENTITY>>(nextOptions: NEXT_OPTIONS | ((prevOptions: OPTIONS) => NEXT_OPTIONS)): UpdateAttributesCommand<ENTITY, NEXT_OPTIONS>; [$sentArgs](): [UpdateAttributesInput<ENTITY>, UpdateAttributesOptions<ENTITY>]; params(): UpdateCommandInput & { ToolboxItem: UpdateAttributesInput<ENTITY, true>; }; send(documentClientOptions?: DocumentClientOptions): Promise<UpdateAttributesResponse<ENTITY, OPTIONS>>; }