Search code examples
typescriptnpmrestify

No @types declaration for restify-client with TypeScript


I am trying to move to the latest version of restify (6.4.2). We are using TypeScript in our application. The clients have been moved into their own package since the version of restify we have been using (4.3.2) - they are now in restify-clients.

I am getting an error that there are no TypeScript declarations for @types/restify-clients, so I cannot compile my application. I have searched on npm, but cannot find anything there for this package.

Does anyone know where I can find the types for this package? Or do they just not exist, and I'm out of luck?


Solution

  • As unional already pointed out in the comments type definitions are not necessary for compiling. You can consider typings as help for developing your application, but they are not necessary at all.

    So you have two options now:

    1. Create the Type definitions yourself. You could probably use the @types/restify for getting started.
    2. You can contact the authors of the @types/restify definitions and ask them if they plan to create definitions for the new library too. You can find the authors of these definitions here: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/restify/index.d.ts

    However you said you weren't able to transpile your typescript because of these types. Since you haven't provided any compiler errors my best guess is that you are disallowing implicitAny in your tsconfig.