Typescript errors after upgrade
selfagency opened this issue · comments
After upgrading to the latest version of Sade, I'm getting the following type error on my action
s:
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'.
a repro: https://github.com/weiran-zsd/dts-cli/runs/4710239843?check_suite_focus=true
sade v1.7.4 => v1.8.0
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
So, in practical terms, does that mean that I'm supposed to leave opts
as any
?
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!
No worries, thanks for your work on it!