mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 12:30:18 +00:00
[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:
committed by
Nathan Shively-Sanders
parent
14effc6d16
commit
ba4b237d16
Vendored
+6
-2
@@ -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 } });
|
||||
|
||||
Reference in New Issue
Block a user