mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
[proper-lockfile] Patches options.retries with the correct type (#37313)
* Types options.retries with correct type `proper-lockfile` is calling `retry.operation()` underneath so the correct type to use for `LockOptions.retries` is `retry.OperationOptions` and not the more restricted `retry.TimeoutsOptions`. * Adds regression test for #37313
This commit is contained in:
parent
0f0adf38ab
commit
64fcb11aae
4
types/proper-lockfile/index.d.ts
vendored
4
types/proper-lockfile/index.d.ts
vendored
@ -6,12 +6,12 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import { TimeoutsOptions } from "retry";
|
||||
import { OperationOptions } from "retry";
|
||||
|
||||
export interface LockOptions {
|
||||
stale?: number; // default: 10000
|
||||
update?: number; // default: stale/2
|
||||
retries?: number | TimeoutsOptions; // default: 0
|
||||
retries?: number | OperationOptions; // default: 0
|
||||
realpath?: boolean; // default: true
|
||||
fs?: any; // default: graceful-fs
|
||||
onCompromised?: (err: Error) => any; // default: (err) => throw err
|
||||
|
||||
@ -51,3 +51,6 @@ checkSync('', { lockfilePath: 'some/file-lock' }); // $ExpectType boolean
|
||||
|
||||
lock('', { retries: 5 });
|
||||
lock('', { retries: { retries: 5, factor: 2, minTimeout: 100, randomize: true } });
|
||||
|
||||
// regression test for #37313
|
||||
lock('', { retries: { maxRetryTime: 20, unref: true } });
|
||||
|
||||
Loading…
Reference in New Issue
Block a user