Write the typescript declaration file of the third-party library, indicating that the module cannot be found?

  1. the introduction of a third-party library prompted that the module declaration could not be found, and there was no declaration file maintained on the Internet, so I wrote .d.ts
  2. myself.
  3. declare module "username" {export name: string}
  4. Why does the editor still prompt in the declaration file: the declaration file for the username module cannot be found, / node_modules/username/lib/index.js has an implicit any type, and the require module is not needed in the declaration file, right?
May.22,2021

Brother, have you solved your problem? I have a similar problem

Menu