UNPKG

913 BTypeScriptView Raw
1import { Exception } from '@microsoft.azure/tasks';
2export declare class UnableToReadLockException extends Exception {
3 exitCode: number;
4 constructor(path: string, exitCode?: number);
5}
6export interface UnlockOptions {
7 realpath?: boolean;
8 delay?: number;
9}
10export interface CheckOptions extends UnlockOptions {
11 stale?: number;
12}
13export interface LockOptions extends CheckOptions {
14 update?: number;
15 retries?: number;
16}
17export declare type release = () => Promise<void>;
18export declare type _release = () => void;
19export declare class Lock {
20 private static _exclusive;
21 static check: (path: string, options?: CheckOptions) => Promise<boolean>;
22 static exclusive(path: string, options?: LockOptions): Promise<release>;
23 static waitForExclusive(path: string, timeout?: number): Promise<release | null>;
24 static read(path: string, options?: LockOptions): Promise<release>;
25}