Open ludwigbacklund opened 4 months ago
@stalniy WDYT? :)
Is the resulting type you get keeps all generic types and overloading of corresponding AbilityBuilder
functions?
what I can tell about AbilityBuilder types is that they are super complicated and uses advanced type system features and HKT hacks in order to produce desired outcome. So, I’d not like to spread this type because very likely it may be broken with the next release (at least I can’t guarantee backward compatibility in this case)
When using
"moduleResolution": "Bundler"
in tsconfig.json for a TypeScript project, and implicitly referencingAddRule
you get this error:These errors can be resolved by explicitly exporting these implicitly referenced types from
@casl/ability
, like in this PR.My use case is something like this:
Where I then use these two types so that I can pass around
can
's andcannot
's from my built ability into different functions.Thanks!