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

fix: correct create type definitions #13

Merged
merged 1 commit into from
Apr 4, 2023
Merged

fix: correct create type definitions #13

merged 1 commit into from
Apr 4, 2023

Conversation

nikku
Copy link
Member

@nikku nikku commented Apr 3, 2023

Add (optional attrs) in all cases.

Return SVGElement instead of Element as an escape.


The following would otherwise return Element, which is an entirely wrong type (i.e. does not support dataset and friends:

import { create } from 'tiny-svg';

const svg = create('svg', { fill: 'blue' });

svg.dataset; // non-existing according to type checking

Add (optional `attrs`) in all cases.

Return `SVGElement` instead of `Element` as an escape.
@nikku nikku requested review from a team, marstamm and barmac and removed request for a team April 3, 2023 19:42
@fake-join fake-join bot merged commit 32a5e81 into master Apr 4, 2023
3 checks passed
@fake-join fake-join bot deleted the fix-types branch April 4, 2023 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants