ddb-table
Version:
Strongly typed library for querying and modeling DynamoDB documents.
23 lines (22 loc) • 1.16 kB
TypeScript
import { Item, Key, ScanCommandInput } from '../DocumentClient';
import Query from './Query';
import { ConditionExpression, ExpressionAttributeValues, ProjectionExpression } from '../expressions';
import { ProjectionFields } from '../expressions/ProjectionExpression';
import { ConditionGenerator } from '../expressions/ConditionExpression';
import { QueryCommandInput } from '@aws-sdk/lib-dynamodb';
export default class ItemsQuery<T extends K, K extends Item, I extends ScanCommandInput | QueryCommandInput, O extends {
Items?: T[];
LastEvaluatedKey?: K;
}> extends Query<T, I, O> {
protected values: ExpressionAttributeValues;
protected projection: ProjectionExpression<T, K>;
protected filters: ConditionExpression<T>;
protected handleInputUpdated(): void;
protected syncInput(): void;
project<P extends ProjectionFields<T>>(fields: P): this;
filter(fn: ConditionGenerator<T>): this;
select(select: 'ALL_ATTRIBUTES' | 'ALL_PROJECTED_ATTRIBUTES' | 'SPECIFIC_ATTRIBUTES' | 'COUNT'): this;
limit(limit: number): this;
startKey(key: K | Key | null | undefined): this;
entries(): AsyncIterableIterator<T>;
}