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

make Jsf generic on data #16

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AlexErrant
Copy link
Contributor

Before this change, dataChangeCallback's type parameter is unknown:

image

After this change, if you construct Jsf manually, you get the correct type:

image

This (unfortunately) only works for manual construction because it is impossible (AFAIK) for HTMLElementTagNameMap to have a generic that can infer its usage like as below:

declare global {
	interface HTMLElementTagNameMap {
		'json-schema-form': Jsf<T>;
	}
}

However, manual construction is fine for frameworks like Solid (tested in my project - IDK about others).


As an aside, I see #14 and wouldn't mind trying to take a crack at fixing some of the TS and/or CICD issues.

@JulianCataldo
Copy link
Contributor

Hello. Thanks for the suggestion. I'm planning to rehaul quite a few things on this project, but can't make promises right now at when.
I'll definitely add more flexibility and include your changes as this is something lacking now (more type safety on the public API side).

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

Successfully merging this pull request may close these issues.

2 participants