UNPKG

duenamodb

Version:

Simple DynamoDB client written in TypeScript.

28 lines (27 loc) 1.69 kB
import { NativeAttributeValue } from '@aws-sdk/util-dynamodb'; import { DynamoDBTypes } from './types'; export declare const expressionAttributeNameKey: (key: string) => string; export declare const expressionAttributeValueKey: (key: string) => string; export declare const expressionAttributeNames: (names: string[]) => Record<string, string> | undefined; export declare const expressionAttributeValues: <Attributes extends DynamoDBTypes, Options extends FilterOptions<Attributes>>(options: Options) => Record<string, NativeAttributeValue> | undefined; export declare const conditionExpression: <Attributes extends DynamoDBTypes, Options extends FilterOptions<Attributes>>(options: Options) => string | undefined; type NotExpression<Value extends NativeAttributeValue> = { duenamoType: 'not'; value: Value; }; export declare const NOT: <Attribute extends unknown>(value: Attribute) => NotExpression<Attribute>; type InExpression<Value extends NativeAttributeValue> = { duenamoType: 'in'; value: Value[]; }; export declare const IN: <Attribute extends unknown>(...value: Attribute[]) => InExpression<Attribute>; type DuenamoExpression<Value extends NativeAttributeValue> = NotExpression<Value> | InExpression<Value>; export type FilterOptions<Attributes extends DynamoDBTypes> = { [Key in keyof Attributes]?: Attributes[Key] | DuenamoExpression<Attributes[Key]>; }; export declare const createConditionExpression: <Attributes extends DynamoDBTypes, Options extends FilterOptions<Attributes>>(object: Options) => { attributeNames: Record<string, string> | undefined; attributeValues: Record<string, any> | undefined; expression: string | undefined; }; export {};