More exact types and testing of types for validity #2622
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Not sure if you want to merge this or not, but basically the old types.d.ts was inaccurate in places and also used any in quite a few places making it problematic to work with in a strict typescript codebase.
Not each language get's its own .d.ts file, mysql.d.ts is the only one I worked through making accurate. The others would be fairly formulaic to generate. It maintains the old types.d.ts for other languages and for people depending on those types. If you import from node-sql-parser/build/mysql you'll get the types from mysql.d.ts.
This includes a large number of tests in test/types/mysql that validate most of the surface area the parser is willing to output an AST and then validates the AST produced fits the types in mysql.d.ts. Its actually fairly useful for parser development too because you can inspect the types and see where the AST might be lacking.