import { CreateTableCommandInput, CreateTableCommandOutput, DynamoDBClientConfig } from '@aws-sdk/client-dynamodb'; import { Key, DocumentItem, OperationData, Operation, PutItem } from './types'; export interface Options { /** * Logging method */ log?: (ctx: { level: 'info' | 'warn'; table: string; itemKey?: any; }, message: string) => void; /** * Whether wrapping function or not */ wrapFunc?: boolean; } /** * DynamoProcessor */ export declare class DynamoProcessor { #private; private log; constructor(opts: Options & DynamoDBClientConfig); /** * getItem * @param {string} table - TableName * @param {object} key - Key */ get(table: string, key: Key): Promise; get(table: string, key: Key): Function; /** * batchGetItem * @param {string} table - TableName * @param {Array} keys - Keys */ batchGet(table: string, keys: Key[]): Promise; batchGet(table: string, keys: Key[]): Function; /** * putItem * @param {String} table - table name * @param {Object} item - Item */ put(table: string, item: PutItem): Promise; put(table: string, item: PutItem): Function; /** * deleteItem * @param {string} table - TableName * @param {object} key - Key */ delete(table: string, key: Key): Promise; delete(table: string, key: Key): Function; /** * batchWriteItems * @param {String} table - table name * @param {Array} items - Items * @return Promise - unprocessedItems */ batchWrite(table: string, items: PutItem[]): Promise[]>; batchWrite(table: string, items: PutItem[]): Function; /** * batch delete items by batchWriteItems * @param {String} table - table name * @param {Array} keys - Keys * @return Promise - keys of unprocessedItems */ batchDelete(table: string, keys: Key[]): Promise<(Key | null)[]>; batchDelete(table: string, keys: Key[]): Function; /** * updateItem * @param {string} table - TableName * @param {object} key - Key * @param {object} ope - Operations * @param {object} initFields - Initial fields */ update(table: string, key: Key, ope: Operation, initFields?: Partial): Promise; update(table: string, key: Key, ope: Operation, initFields?: Partial): Function; /** * Create a set from array * @param {array} list - values * @return number set, string set or binary set */ createSet(array: any[]): Set; /** * Create a table * @param {string|object} table - TableName if string, pass as params to createTable if object * @param {object} keySet - Table key Hash or, Hash + Range * @param {Integer} opts.readCU - Read capacity unit (default: 5) * @param {Integer} opts.writeCU - Write capacity unit (default: 5) */ createTable(table: string, keySet: Record, opts?: { readCU?: number; writeCU?: number; }): Promise; createTable(input: CreateTableCommandInput): Promise; /** * Delete a table * @param {string} table - Table name */ deleteTable(table: string): Promise; proc(data: OperationData, opts?: { useBatch?: boolean; table?: string; initFields?: Partial; }): (Promise | Function | any); private getKey; } //# sourceMappingURL=dynamo-processor.d.ts.map