1 | import { Exception } from '@microsoft.azure/tasks';
|
2 | export declare class UnableToReadLockException extends Exception {
|
3 | exitCode: number;
|
4 | constructor(path: string, exitCode?: number);
|
5 | }
|
6 | export interface UnlockOptions {
|
7 | realpath?: boolean;
|
8 | delay?: number;
|
9 | }
|
10 | export interface CheckOptions extends UnlockOptions {
|
11 | stale?: number;
|
12 | }
|
13 | export interface LockOptions extends CheckOptions {
|
14 | update?: number;
|
15 | retries?: number;
|
16 | }
|
17 | export declare type release = () => Promise<void>;
|
18 | export declare type _release = () => void;
|
19 | export 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 | }
|