I am currently trying to import my own created grammar in a typescript node project in the following way:
import Parser = require('tree-sitter');
import Language = require('tree-sitter-own');
This throws the error:
Cannot find module 'tree-sitter-own' or its corresponding type declarations.
In the package file under dependencies it is imported as follows:
"dependencies": {
"tree-sitter-own": "file:../../tree-sitter-own"
}
If I check the node_modules
folder it got correctly installed and copied over. There are however no type definition files in the tree-sitter grammar. How can you correctly import a grammar in node or how can you correctly add type declarations so typescript can use it?