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

createFacade type error with interface #2

Closed
Aaronkala opened this issue Jul 5, 2022 · 3 comments
Closed

createFacade type error with interface #2

Aaronkala opened this issue Jul 5, 2022 · 3 comments

Comments

@Aaronkala
Copy link

createFacade errors when being used with the interface type. Typescript recommends interfaces over intersections.

type Type = { useX: () => void };
interface Interface { useX: () => void };
createFacade<Type>;
createFacade<Interface>; // Type 'Interface' does not satisfy the constraint 'FacadeInterface'. Index signature for type 'string' is missing in type 'Interface'.

Codesandbox

Maybe the type could be improved, or is the only way around using type instead of interface? I am using this rule to enforce the use of interfaces over types so it will require an exception to the rule :)

Great library btw! Looking forward to start using it more

@garbles
Copy link
Owner

garbles commented Jul 5, 2022

Hey, that's definitely unintentional.

I can take a look at it in a few days, but feel free to open a PR (with a noop test to verify its working) if you've got a working solution now.

Edit: I found a solution, so I'll push that once I've cleaned it up.

@garbles
Copy link
Owner

garbles commented Jul 6, 2022

@Aaronkala just published 0.3.1 and this should be fixed.

@Aaronkala
Copy link
Author

Wow that was fast. Thanks!

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

2 participants