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 type definitions #318

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open

TypeScript type definitions #318

wants to merge 14 commits into from

Conversation

kettanaito
Copy link
Owner

Introduces a basic typings in TypeScript.

Subjected to merge after a prior discussion.

): (
component: (
props: P & {
fieldProps: React.InputHTMLAttributes<HTMLInputElement>
Copy link

@lemcii lemcii Nov 3, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

React.HTMLAttributes rather than React.InputHTMLAttributes<HTMLInputElement> might be a better choice, I thought about adding all variants but that'd require type assertion.

@kettanaito
Copy link
Owner Author

What do you think about modularizing type definitions, @Ell10t?

@lemcii
Copy link

lemcii commented Nov 12, 2018

No objections here, if it makes it more manageable it's probably not a bad idea.

@kettanaito
Copy link
Owner Author

@Ell10t I will try to break it down then.

Apart from that, the only crucial thing that is left is a type definition of that [valuePropName] in various callbacks. Within createField scope it should be possible to do via generics, but I am not sure how to handle it in Form callback methods.

@lemcii
Copy link

lemcii commented Nov 12, 2018

Alright, if I get time I'll have a look into the generics as well.

@kettanaito kettanaito changed the title WIP Typings TypeScript type definitions Nov 27, 2018
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.

2 participants