-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support subclassing Command #1002
Comments
It's not that simple, because the current design is to return a new So to support subclassing, we need to change the design of |
Yes, for action handler based subcommands (no description), |
Workaround: use a wrapper. Example (TypeScript):
|
See #1191 for work in progress which resolves this issue. |
Currently, the return type of the methods in class
Command
isCommand
:I cannot extend
Command
to add more methods, like this:So, please change the return type of the methods in
Command
tothis
.It seems that simply changing the definitions in index.d.ts is not enough. The main source code must also be changed.
See:
microsoft/TypeScript#4910
The text was updated successfully, but these errors were encountered: