// Type definitions for dynamodb-lock-client 0.7 // Project: https://github.com/tristanls/dynamodb-lock-client#readme // Definitions by: RyoshiKayo // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// import { EventEmitter } from "events"; export interface Lock extends EventEmitter { release(callback: (error: Error) => void): void; fencingToken: number; } interface GenericConfig { dynamodb: { delete: (...args: any[]) => any; get: (...args: any[]) => any; put: (...args: any[]) => any; }; lockTable: string; partitionKey: string; sortKey?: string | undefined; owner?: string | undefined; } export interface FailClosedConfig extends GenericConfig { acquirePeriodMs: number; } export interface FailOpenConfig extends GenericConfig { heartbeatPeriodMs?: number | undefined; leaseDurationMs: number; trustLocalTime?: boolean | undefined; } export class LockClient { acquireLock(id: PartitionTableKeyType, callback: (error: Error, lock: Lock) => void): void; } export class FailClosed extends LockClient { constructor(config: FailClosedConfig); } export class FailOpen extends LockClient { constructor(config: FailOpenConfig); } // Disabled automatic exporting export {};