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

[ts-command-line] Improve API typings #4554

Merged
merged 1 commit into from
Feb 28, 2024

Conversation

iclanton
Copy link
Member

Summary

This PR makes to minor changes to ts-command-line's types:

  • Choice and choice list parameters can now take a type argument to provide more specificity for the alternatives' types.
  • There is now an overload for the define___Parameter functions when the { required: true } option is passed which returns a new type with a non-nullable value property. This avoids needing a non-null assertion when the required value is used.

How it was tested

Updated consuming projects to use these new types.

Impacted documentation

API docs will need to be updated.

@octogonz octogonz changed the title [ts-command-line] Some types improvements. [ts-command-line] Improve API typings Feb 28, 2024
@iclanton iclanton force-pushed the ts-command-line-tweaks branch from 845d883 to 1144ec0 Compare February 28, 2024 05:45
@iclanton iclanton force-pushed the ts-command-line-tweaks branch from 1144ec0 to edaca3e Compare February 28, 2024 05:57
@iclanton iclanton enabled auto-merge February 28, 2024 05:58
@iclanton iclanton merged commit af0d9e6 into microsoft:main Feb 28, 2024
5 checks passed
@iclanton iclanton deleted the ts-command-line-tweaks branch February 28, 2024 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants