Open kristianmandrup opened 6 years ago
Interesting; if I ever get a free moment to mess around with TS, I'll look into this. Or if anyone else wants to put forward an explanation, that'd be awesome!
Thanks for pointing this out @kristianmandrup !
Late reply but related. This is due to the FastifyInstance
interface in fastify
npm package not having ws
defined.
https://github.com/fastify/fastify/blob/78bef60c97c7ade1cd491569302a706b9df613bc/fastify.d.ts#L343
As specified on the TypeScript website (https://www.typescriptlang.org/docs/handbook/modules.html):
If you don’t want to take the time to write out declarations before using a new module, you can use a shorthand declaration to get started quickly.
declarations.d.ts
declare module "hot-new-module";
Errors
Had to tweak it to the following to make it compile