import { ConsumedCapacity, DynamoDBClient } from '@aws-sdk/client-dynamodb'; import { AttributeValue } from "@aws-sdk/client-dynamodb/dist-types/models/models_0"; import { DynamoDbPaginatorInterface } from './DynamoDbPaginatorInterface'; import { DynamoDbResultsPage } from './DynamoDbResultsPage'; import { ParallelScanInput } from './ParallelScanInput'; /** * Pagination state for a scan segment for which the first page has not yet been * retrieved. */ export interface UninitializedScanState { initialized: false; LastEvaluatedKey?: undefined; } /** * Pagination state for a scan segment for which one or more pages have been * retrieved. If `LastEvaluatedKey` is defined, there are more pages to fetch; * otherwise, all pages for this segment have been returned. */ export interface InitializedScanState { initialized: true; LastEvaluatedKey?: Record; } export type ScanState = UninitializedScanState | InitializedScanState; /** * ParallelScanState is represented as an array whose length is equal to the * number of segments being scanned independently, with each segment's state * being stored at the array index corresponding to its segment number. * * Segment state is represented with a tagged union with the following keys: * - `initialized` -- whether the first page of results has been retrieved * - `LastEvaluatedKey` -- the key to provide (if any) when requesting the * next page of results. * * If `LastEvaluatedKey` is undefined and `initialized` is true, then all pages * for the given segment have been returned. */ export type ParallelScanState = Array; export declare class ParallelScanPaginator implements DynamoDbPaginatorInterface { private readonly _scanState; private readonly iterators; private readonly pending; private lastResolved; constructor(client: DynamoDBClient, input: ParallelScanInput, scanState?: ParallelScanState); /** * @inheritDoc */ [Symbol.asyncIterator](): AsyncIterableIterator; /** * @inheritDoc */ get consumedCapacity(): ConsumedCapacity | undefined; /** * @inheritDoc */ get count(): number; /** * @inheritDoc */ next(): Promise>; private getNext; /** * @inheritDoc */ return(): Promise>; /** * @inheritDoc */ get scannedCount(): number; /** * A snapshot of the current state of a parallel scan. May be used to resume * a parallel scan with a separate paginator. */ get scanState(): ParallelScanState; private refillPending; }