import { DynamoDB } from 'aws-sdk'; export declare type Timestamp = number; export interface IHasId { /** * ID managed by consumer */ id: string; } export interface IHasVersion { /** * Monotomically increasing counter managed by store */ version: number; } export interface IHasMetadata { /** * Unix timestamp of record creation managed by store. * N.B. The store will always silently override this value if specified to support use cases which read an item, modify it and attempt to * write it back. */ created: Timestamp; /** * Unix timestamp of last record modification managed by store. * N.B. The store will always silently override this value if specified to support use cases which read an item, modify it and attempt to * write it back. */ modified: Timestamp; } export interface IConfiguration { client: DynamoDB.DocumentClient; tableName: string; } export interface ICruft { create(item: T & { version: 0; }): Promise; read(item: IHasId): Promise; update(item: T & IHasId & IHasVersion): Promise; find(fields: { [key: string]: string | number | boolean; }): Promise; __findAll(fields: { [key: string]: string | number | boolean; }, options?: { limit?: number; }): Promise>; findAll(fields: { [key: string]: string | number | boolean; }): AsyncIterableIterator; truncate(item: IHasId & IHasVersion): Promise; } declare var _default: ({endpoint, region, tableName}: { endpoint?: any; region?: any; tableName: any; }) => ICruft; export default _default;