UNPKG

@da440dil/js-locker

Version:
18 lines (17 loc) 588 B
import { LockerScript } from './LockerScript'; import { ILockResult } from './LockResult'; export declare class Locker implements ILocker { private locker; constructor(locker: LockerScript); lock(key: string, ttl: number): Promise<ILockResult>; private randomString; } /** Defines parameters for creating new lock. */ export interface ILocker { /** * Creates and applies new lock. * @param key The lock key. * @param ttl TTL of the lock key. Must be positive integer. */ lock(key: string, ttl: number): Promise<ILockResult>; }