dynamodb-toolbox
Version:
Lightweight and type-safe query builder for DynamoDB and TypeScript.
29 lines (28 loc) • 1.78 kB
TypeScript
import type { GetCommandInput, GetCommandOutput } from '@aws-sdk/lib-dynamodb';
import { $sentArgs } from '../../../entity/constants.js';
import type { Entity, EntitySendableAction } from '../../../entity/entity.js';
import type { FormattedItem } from '../../../entity/index.js';
import { EntityAction } from '../../../entity/index.js';
import type { KeyInputItem } from '../../../entity/index.js';
import type { DocumentClientOptions } from '../../../types/documentClientOptions.js';
import type { Merge } from '../../../types/merge.js';
import { $key, $options } from './constants.js';
import type { GetItemOptions } from './options.js';
export type GetItemResponse<ENTITY extends Entity, OPTIONS extends GetItemOptions<ENTITY> = GetItemOptions<ENTITY>> = Merge<Omit<GetCommandOutput, 'Item'>, {
Item?: FormattedItem<ENTITY, {
attributes: OPTIONS extends {
attributes: string[];
} ? OPTIONS['attributes'][number] : undefined;
}>;
}>;
export declare class GetItemCommand<ENTITY extends Entity = Entity, OPTIONS extends GetItemOptions<ENTITY> = GetItemOptions<ENTITY>> extends EntityAction<ENTITY> implements EntitySendableAction<ENTITY> {
static actionName: "get";
[$key]?: KeyInputItem<ENTITY>;
[$options]: OPTIONS;
constructor(entity: ENTITY, key?: KeyInputItem<ENTITY>, options?: OPTIONS);
key(nextKey: KeyInputItem<ENTITY>): GetItemCommand<ENTITY, OPTIONS>;
options<NEXT_OPTIONS extends GetItemOptions<ENTITY>>(nextOptions: NEXT_OPTIONS | ((prevOptions: OPTIONS) => NEXT_OPTIONS)): GetItemCommand<ENTITY, NEXT_OPTIONS>;
[$sentArgs](): [KeyInputItem<ENTITY>, GetItemOptions<ENTITY>];
params(): GetCommandInput;
send(documentClientOptions?: DocumentClientOptions): Promise<GetItemResponse<ENTITY, OPTIONS>>;
}