See type-sitter for more information. This provides procedural macros which will generate typed node wrappers. However, it's highly recommended to use type-sitter-cli instead, as it's more tested and will give your IDE better inference.
If a project depends on this (and as with type-sitter-cli), it must also depend on type-sitter-lib and tree-sitter.