Skip to content

Commit e827578

Browse files
committed
fix: make static element property available
for the SvelteComponent type closes #8936
1 parent 6b7f116 commit e827578

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

.changeset/eight-hornets-punch.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: make static `element` property available for the SvelteComponent type

packages/svelte/src/index.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ export class SvelteComponent<
5959
Events extends Record<string, any> = any,
6060
Slots extends Record<string, any> = any
6161
> {
62+
/** The custom element version of the component. Only present if compiled with the `customElement` compiler option */
63+
static element?: typeof HTMLElement;
64+
6265
[prop: string]: any;
6366
/**
6467
* @deprecated This constructor only exists when using the `asClassComponent` compatibility helper, which

packages/svelte/types/index.d.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ declare module 'svelte' {
6060
Events extends Record<string, any> = any,
6161
Slots extends Record<string, any> = any
6262
> {
63+
/** The custom element version of the component. Only present if compiled with the `customElement` compiler option */
64+
static element?: typeof HTMLElement;
65+
6366
[prop: string]: any;
6467
/**
6568
* @deprecated This constructor only exists when using the `asClassComponent` compatibility helper, which
@@ -2215,7 +2218,7 @@ declare module 'svelte/transition' {
22152218
* https://svelte.dev/docs/svelte-transition#crossfade
22162219
* */
22172220
export function crossfade({ fallback, ...defaults }: CrossfadeParams & {
2218-
fallback?: (node: Element, params: CrossfadeParams, intro: boolean) => TransitionConfig;
2221+
fallback?: ((node: Element, params: CrossfadeParams, intro: boolean) => TransitionConfig) | undefined;
22192222
}): [(node: any, params: CrossfadeParams & {
22202223
key: any;
22212224
}) => () => TransitionConfig, (node: any, params: CrossfadeParams & {

0 commit comments

Comments
 (0)