Skip to content

Commit 0f3264e

Browse files
authored
make SvelteComponentDev typings more forgiving (#5937)
Add `$$events_def` and `$$slot_def` so that users can do ``` let el: SvelteComponent; <SomeComponent bind:this={el} /> ``` without type errors.
1 parent 842a0b1 commit 0f3264e

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* Throw a parser error for `class:` directives with an empty class name ([#5858](https://github.com/sveltejs/svelte/issues/5858))
66
* Fix type inference for derived stores ([#5935](https://github.com/sveltejs/svelte/pull/5935))
77
* Make parameters of built-in animations and transitions optional ([#5936](https://github.com/sveltejs/svelte/pull/5936))
8+
* Make `SvelteComponentDev` typings more forgiving ([#5937](https://github.com/sveltejs/svelte/pull/5937))
89

910
## 3.32.0
1011

src/runtime/internal/dev.ts

+14
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,20 @@ export class SvelteComponentDev extends SvelteComponent {
115115
* ### DO NOT USE!
116116
*/
117117
$$prop_def: Props;
118+
/**
119+
* @private
120+
* For type checking capabilities only.
121+
* Does not exist at runtime.
122+
* ### DO NOT USE!
123+
*/
124+
$$events_def: any;
125+
/**
126+
* @private
127+
* For type checking capabilities only.
128+
* Does not exist at runtime.
129+
* ### DO NOT USE!
130+
*/
131+
$$slot_def: any;
118132

119133
constructor(options: {
120134
target: Element;

0 commit comments

Comments
 (0)