Relative Content

Tag Archive for typescripttypescript-generics

Use argument value as type key in declaration file

I’m working to create a Prisma extension. For reasons, I started with JavaScript, using JSDoc hints for typing. The extension actually works just fine; however, the type hints are terrible, which led me to believe I was doing something wrong. In fact, when I switched to a typescript transpiler, all sorts of errors appeared in my declaration files that were invisible when using esbuild. My biggest current challenge in squashing these is, I need to use a value provided by the user when the initial extension is instantiated as a key in various other type declarations in my declaration files.