diff --git a/types/proper-lockfile/index.d.ts b/types/proper-lockfile/index.d.ts index 3e49e79fe3..85a5267791 100644 --- a/types/proper-lockfile/index.d.ts +++ b/types/proper-lockfile/index.d.ts @@ -1,13 +1,17 @@ -// Type definitions for proper-lockfile 3.0 +// Type definitions for proper-lockfile 4.1 // Project: https://github.com/moxystudio/node-proper-lockfile // Definitions by: Nikita Volodin // Linus Unnebäck +// ulrichb // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { TimeoutsOptions } from "retry"; export interface LockOptions { stale?: number; // default: 10000 update?: number; // default: stale/2 - retries?: number; // default: 0 + retries?: number | TimeoutsOptions; // default: 0 realpath?: boolean; // default: true fs?: any; // default: graceful-fs onCompromised?: (err: Error) => any; // default: (err) => throw err diff --git a/types/proper-lockfile/proper-lockfile-tests.ts b/types/proper-lockfile/proper-lockfile-tests.ts index 344e7be3f8..a4970ced40 100644 --- a/types/proper-lockfile/proper-lockfile-tests.ts +++ b/types/proper-lockfile/proper-lockfile-tests.ts @@ -48,3 +48,6 @@ unlockSync('some/file'); // $ExpectType void unlockSync('', { lockfilePath: 'some/file-lock' }); // $ExpectType void checkSync('some/file'); // $ExpectType boolean checkSync('', { lockfilePath: 'some/file-lock' }); // $ExpectType boolean + +lock('', { retries: 5 }); +lock('', { retries: { retries: 5, factor: 2, minTimeout: 100, randomize: true } });