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 the TypeScript type a union of the HTML tags #5

Merged
merged 3 commits into from
Jun 5, 2020

Conversation

sergeysova
Copy link
Contributor

@sergeysova sergeysova commented Jun 3, 2020

@sergeysova sergeysova marked this pull request as draft June 3, 2020 20:21
@sergeysova sergeysova marked this pull request as ready for review June 3, 2020 20:36
@sindresorhus
Copy link
Owner

What's the use-case?

@sergeysova
Copy link
Contributor Author

sergeysova commented Jun 5, 2020

I want to use the exact type as input for fabric-function.

export function createElement(tag: HTMLTags): Element<HTMLTags> {

Also, I want to use it in a styled-like interface:

https://github.com/sergeysova/foliage/blob/5fcf4081057f8b50236a7e23b27a8c2d681809b0/src/index.ts#L131-L133

index.d.ts Outdated Show resolved Hide resolved
@sindresorhus sindresorhus changed the title set exact typescript type for tag list Make the TypeScript type a union of the HTML tags Jun 5, 2020
@sindresorhus sindresorhus merged commit 5eb6dbc into sindresorhus:master Jun 5, 2020
@sindresorhus
Copy link
Owner

Actually, I just noticed there are more d.ts files in the repo. Can you do those too?

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