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

Add strong typing of .opts() using generics #1539

merged 1 commit into from May 30, 2021


Copy link

@shadowspawn shadowspawn commented May 30, 2021

Pull Request


Unable to specify .opts() return type in TypeScript client code.

Issue: #1536

Original Pull Request: #1537 (manually moved code between branches, with co-author credit on commit)


Add generics so can call like:

interface MyCheeseOption {
  cheese: string;
const myCheeseOption = program.opts<MyCheeseOption>();


  • add client typing of .opts() return type using TypeScript generics

Co-authored-by: tyankatsu <>
Copy link

@abetomo abetomo left a comment


@shadowspawn shadowspawn merged commit 03d2147 into tj:release/8.x May 30, 2021
12 checks passed
@shadowspawn shadowspawn deleted the feature/generics-for-opts branch May 30, 2021
@shadowspawn shadowspawn added this to the v8.0.0 milestone May 30, 2021
@shadowspawn shadowspawn added the pending release label May 30, 2021
@shadowspawn shadowspawn removed the pending release label Jun 25, 2021
Copy link
Collaborator Author

shadowspawn commented Aug 14, 2022

For some experimental strong inferred typing see:

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

Successfully merging this pull request may close these issues.

None yet

2 participants