Skip to content

Commit b167fb6

Browse files
authored
$$restProps, question about type strictness
1 parent 4f7bb52 commit b167fb6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

text/svelte-component-interface.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,14 @@ class Svelte2TsxComponent<
6666

6767
constructor(options: {
6868
// ...
69-
props?: Props; // <-- typed as Props
69+
props?: Props & Record<string, any>; // <-- typed as Props, Record<string, any> for the $$restProps possibility
7070
});
7171

7272
$on<K extends keyof Events>(
7373
event: K,
7474
handler: (e: Events[K]) => any
7575
): () => void; // <-- typed
76-
$set(props: Partial<Props>): void; // <-- typed
76+
$set(props: Partial<Props> & Record<string, any>): void; // <-- typed, Record<string, any> for the $$restProps possibility
7777
// ...
7878
}
7979
```
@@ -102,3 +102,4 @@ We need to provide these type definitions for a clear path forward, so the only
102102
## Unresolved questions
103103

104104
- Anything that can be fine-tuned on the proposed class type definition?
105+
- Anything that I forgot that is no longer possible/throws a type error when the types are more strict?

0 commit comments

Comments
 (0)