export = constructorProxy; /** * @param {DynamoConnectOptions} options * @return {DynamoDB} */ declare function constructorProxy(options: DynamoConnectOptions): DynamoDB; declare namespace constructorProxy { export { DynamoDB as class, DynamoConnectOptions }; } type DynamoConnectOptions = { prefix?: string; ttl?: number; tableName?: string; }; /** * @typedef {{ * prefix?: string, * ttl?: number, * tableName?: string * }} DynamoConnectOptions */ /** * Class represents DynamoDB Cache */ declare class DynamoDB { /** * @param {any[]} data Array of DynamoDB items * @param {number} [maxPerGroup=25] Max number of items per group * @returns {any[][]} * @static * @description Breaks large group of items into smaller groups that can be used for batch writes. */ static breakArrayIntoGroups(data: any[], maxPerGroup?: number): any[][]; /** * @param {number} [offset=0] Number of seconds to offset current epoch time * @returns {number} Current time in epoch format plus any offset. * @static * @Description Get current time in epoch format plus any offset. */ static epoch(offset?: number): number; /** * @param {any} Data to deflate * @returns {Buffer} Deflated buffer * @static * @Description Deflate object using zlib */ static deflate(data: any): Buffer; /** * @param {Buffer} Deflated Buffer * @returns {String} Inflated string * @static * @Description Inflate zlib buffer */ static inflate(buffer: any): string; /** * @param {DynamoConnectOptions} options */ constructor(options?: DynamoConnectOptions); endpoint: any; prefix: any; tableName: any; tableCreated: boolean; ttl: any; cache: any; /** * @param {String} pattern * @returns {Promise} List of keys deleted * @description Deletes keys by a pattern * @async */ deleteByPattern(pattern: string): Promise; /** * @returns {Promise} List of keys deleted * @description Deletes all keys in the table * @async */ flush(): Promise; /** * @param {String} key A string key * @description Retrieves data from cache with the given key * @return {any} Returns the data sorted in the given key. * @async */ get(key: string): any; /** * @param {String || Array} key A string key or a an array of parts to a composite key * @param {any} data The data to store in cache. * @param {Object} options.ttl The TTL is seconds in which the cache should be accessible * @description Stores data in cache at the given key. * @return {Promise} Returns the key the data is stored in. * @async */ set(key: any, data?: any, options?: {}): Promise; /** * @param {String} key A string key * @description Removes data from cache at the given key. * @return {Promise} Returns the key that was deleted. * @async */ delete(key: string): Promise; middleware(keys?: any[]): (req: any, res: any, next: any) => Promise; /** * @description Fake function. Does nothing but let's Dynamo be backwards compatible with Redis */ close(): void; } //# sourceMappingURL=dynamo.d.ts.map