Open rom1504 opened 2 years ago
Hope this can work soon. I really want to use typescript to replace javascript in my project.
This will not change a single thing with support of typescript. You can already use mineflayer in your typescript project
It's just the problem of autocomplete. I just solved it. When I tried to use mineflayer in the way of your example, vscode didn't give any suggestions.
But if I code something like "import mineflayer from ‘mineflayer’", it worked.
But if I code something like "import mineflayer from ‘mineflayer’", it worked.
Yes because typescript dose not add types without import
when using require
. To get types with require
you would need to do something like this import mineflayer = require('mineflayer')
.
example https://github.com/PrismarineJS/node-minecraft-data/blob/master/package.json#L10 https://github.com/PrismarineJS/node-minecraft-data/blob/master/typings/test-typings.ts