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

Export the RuleValidators type as part of the API #47

Closed
wants to merge 2 commits into from

Conversation

ValdisThomann
Copy link

Hi there!

Thanks for writing such an awesome library - I really appreciate it.

I've used it to great effect in an angular project, extending the angular FormGroup so that you can actually have strongly-typed validation rules (instead of the OOB experience which only allows abstract rules).

I was going to turn this into a little angular library, but I've hit a snag. My implementation creates a custom rule validator, which basically unpacks the value from the angular form field and passes it to ruleForTransformed(). This works fine using the inferred type for that method when the implementation is within my consuming application. However, the compiler blows up when I try to export the type declarations for that inferred type.

There's a pretty easy fix for this - it all works fine if I import RuleValidators and explicitly type my custom rule validator.

Would you be happy to approve this change to the API, to allow me (and others) to extend rule validators?

@AlexJPotter
Copy link
Owner

Hi @ValdisThomann - thanks for your patience on this 🙂 I've just released v3.2.0 that adds the desired type exports - please let me know if you have any further issues!

@AlexJPotter AlexJPotter closed this Mar 5, 2024
@ValdisThomann
Copy link
Author

ValdisThomann commented Mar 5, 2024 via email

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

Successfully merging this pull request may close these issues.

None yet

2 participants