UNPKG

ddb-table

Version:

Strongly typed library for querying and modeling DynamoDB documents.

18 lines (17 loc) 766 B
import DynamoDBDocument, { GetCommandInput, GetCommandOutput, Item } from '../DocumentClient'; import Query from './Query'; import { ItemProjection, ProjectionFields } from '../expressions/ProjectionExpression'; type QueryInput<K> = Omit<GetCommandInput, 'Key'> & { Key: K; }; type QueryOutput<T> = Omit<GetCommandOutput, 'Item'> & { Item?: T; }; export default class GetQuery<T extends K, K extends Item> extends Query<T, QueryInput<K>, QueryOutput<T>> { private projection; constructor(client: DynamoDBDocument, params: QueryInput<K>); protected handleInputUpdated(): void; protected syncInput(): void; project<P extends ProjectionFields<Omit<T, keyof K>>>(fields: P): GetQuery<ItemProjection<Omit<T, keyof K>, P> & K, K>; } export {};