For example, in electron, we can
var lodash1 = require('./lib/lodash.min')
I want vscode
to automatically prompt 'each...method' when
lodash1.
Then we have ./typings/lodash/index.d.ts
How to specify this lodash1
variable to use such a index.d.ts
Woolen cloth
Notice:
Is there any solution?
lodash.min.js
is just the address in a project, not thenpm
installednode_modules
directorylodash /index.d.ts
is also the address in the project, not the directoryinstalled by
npm
Add a reference at the beginning of the file
///<reference path='index.d.ts' />
That’s probably it. For details, you can check out the typings documentation, it’s very clear