Closed crystalfp closed 3 years ago
When I use nano from typescript I cannot specify, for example, only timeout. I should specify all three timeout, agent, headers or not use requestDefaults at all.
nano
timeout
timeout, agent, headers
requestDefaults
In a previous version (8?) the following code was valid:
const nano = Nano({ url: databaseURL, requestDefaults: {timeout: 60000} });
The call generates the following error message during typescript compilation:
Type '{ timeout: any; }' is missing the following properties from type 'requestDefaultsOptions': agent, headers ts(2739)
In nano.d.ts change the interface requestDefaultsOptions to:
nano.d.ts
interface requestDefaultsOptions { timeout?: number; agent?: any; headers?: object; }
bug.ts
import Nano from "nano";
databaseURL
I simply don't specify a timeout hoping for the best.
Fixed in nano 9.0.2! Thanks!
When I use
nano
from typescript I cannot specify, for example, onlytimeout
. I should specify all threetimeout, agent, headers
or not userequestDefaults
at all.Expected Behavior
In a previous version (8?) the following code was valid:
Current Behavior
The call generates the following error message during typescript compilation:
Possible Solution
In
nano.d.ts
change the interface requestDefaultsOptions to:Steps to Reproduce (for bugs)
bug.ts
file containingimport Nano from "nano";
and the Nano instantiation above.databaseURL
Context
I simply don't specify a timeout hoping for the best.
Your Environment