You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Typings for Nano are not exposed or able to import through TypeScript
Expected Behavior
being able to define types and add Nano.ServerScope as a typings to my objects and functions const NanoInstances = new Map<string,Nano.ServerScope>();
Current Behavior
instead, we have to create a dummy instance to localhost and extract the reference as follows
constnanoInstance=Nano('http://localhost:5894');typeNanoType=typeofnanoInstance;// Now you can use NanoType to reference the typingsconstNanoServers=newMap<string,NanoType>();functionfindDoc(instance: NanoType,doc: string){//...}
Possible Solution
just need to expose the types through an entry point or export them directly
Context
I am building a modular platform that allows multiple Nano instances to be present and are configured dynamically.
since we are using strict type safety, its better to use the correct typing's vs any or unknown
Your Environment
Version used: "nano": "^10.1.3",
Browser Name and version: node v18.17.0
The text was updated successfully, but these errors were encountered:
Typings for Nano are not exposed or able to import through TypeScript
Expected Behavior
being able to define types and add Nano.ServerScope as a typings to my objects and functions
const NanoInstances = new Map<string,Nano.ServerScope>();
Current Behavior
instead, we have to create a dummy instance to localhost and extract the reference as follows
Possible Solution
just need to expose the types through an entry point or export them directly
Context
I am building a modular platform that allows multiple Nano instances to be present and are configured dynamically.
since we are using strict type safety, its better to use the correct typing's vs
any
orunknown
Your Environment
The text was updated successfully, but these errors were encountered: