Improve type-safety of adapter code #116
Merged
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.
Improves the type-safety of the adapter code by adding JSDoc comments to most of it, and setting up the TypeScript compiler to run through them to validate correctness. This does not cover all the code, but a significant amount of code to make future refactoring more manageable.
This also converts class based instances to use the actual
class
syntax instead of the traditional prototype based approach, which helps with type annotations. Functionally, there is no impact to end-users, but makes it easier to refactor in the future.The methods of the adapter are still attached in the constructor, as the code heavily relies on scoping, something which will have to be refactored in the future.
Closes #115