import { DynamoDBDocumentClient } from '@aws-sdk/lib-dynamodb'; import { KVNamespacePutOptions } from '@cloudflare/workers-types'; /** * Represents an item stored in DynamoDB. */ export interface DynamoDBItem { key: string; value: string; expiresAt?: number; } /** * Options for the put operation in DynamoDB, extending KVNamespacePutOptions. */ export interface PutOptions extends KVNamespacePutOptions { expirationTtl?: number; } /** * A class to interact with DynamoDB for basic CRUD operations. */ export declare class DynamoDB { private readonly client; private readonly tableName; /** * Constructs a new DynamoDB instance. * * @param client - The DynamoDBDocumentClient instance. * @param tableName - The name of the DynamoDB table. */ constructor(client: DynamoDBDocumentClient, tableName: string); /** * Retrieves a value from DynamoDB by key. * * @param key - The key of the item to retrieve. * @returns A promise that resolves to the value associated with the key, or null if not found. * @throws Will throw an error if the DynamoDB operation fails. */ get(key: string): Promise; /** * Puts a value into DynamoDB with an optional expiration time. * * @param key - The key of the item to store. * @param value - The value of the item to store. * @param options - Optional settings for the put operation, including expiration time. * @returns A promise that resolves when the operation is complete. * @throws Will throw an error if the DynamoDB operation fails. */ put(key: string, value: string, options?: PutOptions): Promise; /** * Deletes an item from DynamoDB by key. * * @param key - The key of the item to delete. * @returns A promise that resolves when the operation is complete. * @throws Will throw an error if the DynamoDB operation fails. */ delete(key: string): Promise; }