fix: make static `element` property available (#11079)

for the SvelteComponent type
closes #8936
pull/11094/head
Simon H 9 months ago committed by GitHub
parent 6b7f1162ad
commit b1a8038f8b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
"svelte": patch
---
fix: make static `element` property available for the SvelteComponent type

@ -59,6 +59,9 @@ export class SvelteComponent<
Events extends Record<string, any> = any,
Slots extends Record<string, any> = any
> {
/** The custom element version of the component. Only present if compiled with the `customElement` compiler option */
static element?: typeof HTMLElement;
[prop: string]: any;
/**
* @deprecated This constructor only exists when using the `asClassComponent` compatibility helper, which

@ -8,6 +8,8 @@ import {
hydrate
} from 'svelte';
SvelteComponent.element === HTMLElement;
// --------------------------------------------------------------------------- legacy: classes
class LegacyComponent extends SvelteComponent<

@ -60,6 +60,9 @@ declare module 'svelte' {
Events extends Record<string, any> = any,
Slots extends Record<string, any> = any
> {
/** The custom element version of the component. Only present if compiled with the `customElement` compiler option */
static element?: typeof HTMLElement;
[prop: string]: any;
/**
* @deprecated This constructor only exists when using the `asClassComponent` compatibility helper, which

Loading…
Cancel
Save