Skip to content

Commit 72e46d3

Browse files
ejb7nik
andauthored
fix: add types for SVG bindable attributes (#16525)
* fix: types for SVG bind: attributes * add changeset and tweak --------- Co-authored-by: 7nik <kifiranet@gmail.com>
1 parent f5950f8 commit 72e46d3

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

.changeset/cuddly-feet-doubt.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'svelte': patch
3+
---
4+
5+
fix: add bindable dimension attributes types to SVG and MathML elements

packages/svelte/elements.d.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,14 @@ export interface DOMAttributes<T extends EventTarget> {
464464
onfullscreenerror?: EventHandler<Event, T> | undefined | null;
465465
onfullscreenerrorcapture?: EventHandler<Event, T> | undefined | null;
466466

467+
// Dimensions
468+
readonly 'bind:contentRect'?: DOMRectReadOnly | undefined | null;
469+
readonly 'bind:contentBoxSize'?: Array<ResizeObserverSize> | undefined | null;
470+
readonly 'bind:borderBoxSize'?: Array<ResizeObserverSize> | undefined | null;
471+
readonly 'bind:devicePixelContentBoxSize'?: Array<ResizeObserverSize> | undefined | null;
472+
readonly 'bind:clientWidth'?: number | undefined | null;
473+
readonly 'bind:clientHeight'?: number | undefined | null;
474+
467475
xmlns?: string | undefined | null;
468476
}
469477

@@ -839,13 +847,7 @@ export interface HTMLAttributes<T extends EventTarget> extends AriaAttributes, D
839847
*/
840848
'bind:innerText'?: string | undefined | null;
841849

842-
readonly 'bind:contentRect'?: DOMRectReadOnly | undefined | null;
843-
readonly 'bind:contentBoxSize'?: Array<ResizeObserverSize> | undefined | null;
844-
readonly 'bind:borderBoxSize'?: Array<ResizeObserverSize> | undefined | null;
845-
readonly 'bind:devicePixelContentBoxSize'?: Array<ResizeObserverSize> | undefined | null;
846850
readonly 'bind:focused'?: boolean | undefined | null;
847-
readonly 'bind:clientWidth'?: number | undefined | null;
848-
readonly 'bind:clientHeight'?: number | undefined | null;
849851
readonly 'bind:offsetWidth'?: number | undefined | null;
850852
readonly 'bind:offsetHeight'?: number | undefined | null;
851853

0 commit comments

Comments
 (0)