UNPKG

@jbagatta/johnny-locke

Version:

A robust, strongly-consistent distributed locking library that provides atomic operations across multiple processes

14 lines (13 loc) 584 B
import { LockConfiguration, Writable } from "./types"; export declare class WritableObject<T> implements Writable<T> { value: T | null; lockId: string; constructor(value: T | null, lockId: string); update(value: T | null): Writable<T>; } export declare function validateLockConfiguration(config: LockConfiguration): void; export declare class TimeoutError extends Error { constructor(key: string); } export type LockStatus = 'locked' | 'unlocked' | 'expired'; export declare function computeLockDuration(defaultTimeout: number, requestedTimeout?: number): number;