[proper-lockfile] Add retry *options * to union (next to number) (#35375)

* Add `retry` *options * to union (next to `number`)

* Update TS version (because of the new "retry" dependency)

* Increase the version number

* Add definition author
This commit is contained in:
ulrichb
2019-05-14 13:43:36 -07:00
committed by Nathan Shively-Sanders
parent 14effc6d16
commit ba4b237d16
2 changed files with 9 additions and 2 deletions
+6 -2
View File
@@ -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 <https://github.com/qlonik>
// Linus Unnebäck <https://github.com/LinusU>
// ulrichb <https://github.com/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
@@ -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 } });