import { a as DatabaseAdapter, c as DatabaseOptions } from '../../drivers-ClN4eGOp.js'; import 'knex'; import 'kysely'; import 'ioredis'; import '@aws-sdk/client-dynamodb'; /** * A store that uses a database to store locks * * You should provide an adapter that will handle the database interactions */ declare class DatabaseStore { #private; constructor(adapter: DatabaseAdapter, config: DatabaseOptions); /** * Save the lock in the store if not already locked by another owner * * We basically rely on primary key constraint to ensure the lock is * unique. * * If the lock already exists, we check if it's expired. If it is, we * update it with the new owner and expiration date. */ save(key: string, owner: string, ttl: number | null): Promise; /** * Delete the lock from the store if it is owned by the owner * Otherwise throws a E_LOCK_NOT_OWNED error */ delete(key: string, owner: string): Promise; /** * Force delete the lock from the store. No check is made on the owner */ forceDelete(key: string): Promise; /** * Extend the lock expiration. Throws an error if the lock is not owned by the owner * Duration is in milliseconds */ extend(key: string, owner: string, duration: number): Promise; /** * Check if the lock exists */ exists(key: string): Promise; } export { DatabaseStore };