import type { ExprResult, IndexDefinition } from './types.js'; /** * A compiled key condition operation for DynamoDB queries. */ export type KeyconditionOperation = { type: 'key-condition-operation'; exprResult: ExprResult; }; /** * Parameters for building a key condition expression. * * @typeParam T - The type of sort key values (defaults to string) */ export interface KeyConditionExprParameters { /** The partition key value */ pk: string; /** Optional sort key condition */ sk?: undefined | string | SortKeyparameter | null; } /** * Sort key condition parameter options. * Supports equality (string), begins_with, between, and comparison operators. * * @typeParam Type - The type of sort key values */ export type SortKeyparameter = { beginsWith: string | null; } | { between: [Type, Type] | null; } | { '<': Type | null; } | { '<=': Type | null; } | { '>': Type | null; } | { '>=': Type | null; }; /** * Builds a key condition expression for DynamoDB queries. * * @param index - The index definition with pk and sk attribute names * @param params - The key condition parameters with pk value and optional sk condition * @returns A compiled key condition operation * * @example * ```ts * // Exact match on both keys * keyConditionExpr(index, { pk: "USER#123", sk: "PROFILE" }); * * // Begins with sort key * keyConditionExpr(index, { pk: "USER#123", sk: { beginsWith: "ORDER#" } }); * * // Range query * keyConditionExpr(index, { pk: "USER#123", sk: { between: ["2024-01", "2024-12"] } }); * ``` */ export declare function keyConditionExpr(index: IndexDefinition, { pk, sk }: KeyConditionExprParameters): KeyconditionOperation; //# sourceMappingURL=key-condition.d.ts.map