import { AttributeValue, DynamoDBClient } from '@aws-sdk/client-dynamodb'; import { Brand, Milliseconds } from '@paradoxical-io/types'; import { Monitoring } from '../../monitoring'; import { DynamoDao } from '../mapper'; import { DynamoTableName } from '../util'; type KeyValueNamespace = Brand; export interface KeyValueList { items: T[]; pagePointer?: KeyValueTablePageItem; } export type DynamoKey = Record; export type KeyValueTablePageItem = Brand; export declare class KeyValueTableDao implements DynamoDao { key: KeyValueNamespace; data: string; } /** * The key value table is used for global, unsorted key dumps. This can be used for adhoc keys and * data storage, but should not be used for anything that requires (or even could require) batch retrieval * * For example, good usages of this class are for de-duping global events, storing temporary counters, etc. * * Bad usages of this are storing business level data for users or accounts. Those things should go in the * {@link PartitionedKeyValueTable} which allows things to be partitioned by user or account, etc. The partition table * can then let you store individual keys but then in one go retrieve all the relevant keys by partition (user/etc) * * If you are unsure which to use, prefer the partition table and NOT this table. */ export declare class KeyValueTable { private readonly dynamo; private readonly namespace; private readonly tableName; private readonly logger; constructor({ namespace, dynamo, tableName, monitoring, }: { namespace?: string; dynamo?: DynamoDBClient; tableName: DynamoTableName; monitoring?: Monitoring; }); get(id: string): Promise; getBatch(id: string[]): Promise; set(id: string, data: T): Promise; streamAll(perPage: number, opts?: { minimumDelayBetween?: Milliseconds; keyContains?: string; }): AsyncGenerator<[string, T]>; listAll({ pageItem, limit, keyContains, }?: { pageItem?: KeyValueTablePageItem; limit?: number; keyContains?: string; }): Promise | undefined>; delete(id: string): Promise; private key; private getRaw; private getRawBatch; private setRaw; private deleteRaw; } export {}; //# sourceMappingURL=keyTable.d.ts.map