feat: IDE type navigation assistance for command classes #1373
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.
closes #1366
This PR creates
declare protected static
fields on classes pointing to commonly sought after associated type declarations.This is needed because the type declaration position of commands can be distant from the type declaration of the operation's input and output.
In the future, the list of modeled Exception classes could also be listed here.
Reasoning
declare
this allows the field to have a type annotation without assigning any runtime value. In the runtime JavaScript code, these types do not appear at all. This avoids wasting runtime artifact size on what is essentially documentation.static
avoids autocomplete proposing this field on instances of the Command class.protected
avoids autocomplete proposing this field on the Command class constructor.Source code
.d.ts
dist-typesType references now appear very close to the Command type declaration for easier navigation.
.js
dist-esInvisible to the runtime.