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 errors after upgrade #52

Closed
selfagency opened this issue Jan 3, 2022 · 5 comments
Closed

Typescript errors after upgrade #52

selfagency opened this issue Jan 3, 2022 · 5 comments

Comments

@selfagency
Copy link

selfagency commented Jan 3, 2022

After upgrading to the latest version of Sade, I'm getting the following type error on my actions:

Argument of type '(service: string, opts: Options) => Promise<void>' is not assignable to parameter of type 
'Handler<[service: string]>'.\n  Types of parameters 'opts' and 'args_1' are incompatible.\n    
Type 'Argv<Default>' has no properties in common with type 'Options'.
aladdin-add pushed a commit to weiran-zsd/dts-cli that referenced this issue Jan 5, 2022
@aladdin-add
Copy link

aladdin-add commented Jan 5, 2022

@lukeed
Copy link
Owner

lukeed commented Jan 5, 2022

I can make it looser in a patch tomorrow, but there isn’t meant to be any continuation from the previous types because there were no previous types included in sade directly. The strictness is/was a feature

@selfagency
Copy link
Author

So, in practical terms, does that mean that I'm supposed to leave opts as any?

@lukeed lukeed closed this as completed in f75579a Jan 6, 2022
@lukeed
Copy link
Owner

lukeed commented Jan 6, 2022

It was meant to be something like .action<[string]>((value, options) => { ... }) where options was automatically typed with mri.Argv.Default, but that didn't allow you to add more explicit types for options which is/was problematic.

Publishing a patch now. Sorry for the trouble!

@selfagency
Copy link
Author

No worries, thanks for your work on it!

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

3 participants