Skip to content
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

TypeScript definitions missing Option.envVar #1972

Closed
shadowspawn opened this issue Aug 15, 2023 · 5 comments
Closed

TypeScript definitions missing Option.envVar #1972

shadowspawn opened this issue Aug 15, 2023 · 5 comments

Comments

@shadowspawn
Copy link
Collaborator

shadowspawn commented Aug 15, 2023

Option.envVar is a public property of the JavaScript class.

The index.d.ts TypeScript definition is missing the envVar property for the Option class.

(Raised in #1971)

@shadowspawn shadowspawn added the bug Commander is not working as intended label Aug 15, 2023
@aweebit
Copy link
Contributor

aweebit commented Aug 15, 2023

presetArg, conflictsWith and implied are also missing.

Same with parseArg, defaultValue, defaultValueDescription and argChoices in the Argument class. Also might want to consider making _name public (for comparison, option-argument names can be accessed by extracting them from the public flags property).

Update: Oh, I see there is Argument.name() for that. Yikes.

@aweebit
Copy link
Contributor

aweebit commented Aug 15, 2023

In Command,

  • .missingArgument(),
  • .optionMissingArgument(),
  • .missingMandatoryOptionValue(),
  • .unknownOption(),
  • .unknownCommand()

are all explicitly marked as private in JSDoc despite having no underscores in their names. Historical reasons, I guess?

@shadowspawn
Copy link
Collaborator Author

are all explicitly marked as private in JSDoc despite having no underscores in their names. Historical reasons, I guess?

Yes indeed. I did add an issue about renaming those, but decided to minimise breakages and leave them alone: #1104

@shadowspawn
Copy link
Collaborator Author

The TypeScript has never had 1:1 match with properties visible from JavaScript, but adding them as needed, and intend to usually add them for new properties.

(The dual purpose getter/setter does at least reduce the number of properties exposed, much as I dislike the overload on return type!)

@shadowspawn shadowspawn added pending release Merged into a branch for a future release, but not released yet and removed bug Commander is not working as intended labels Sep 21, 2023
@shadowspawn shadowspawn removed the pending release Merged into a branch for a future release, but not released yet label Oct 13, 2023
@shadowspawn
Copy link
Collaborator Author

Shipped in Commander v11.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants