chore: better error message for not using snippet type

language tools checks that a function passed to `{@render ..}` is returning a type that adheres to the `Snippet` return type. When it does not, the error message is pretty useless without this additional info text.
pull/9602/head
Simon Holthausen 3 years ago
parent 13c6c273c6
commit df994c4090

@ -195,7 +195,11 @@ declare const SnippetReturn: unique symbol;
* You can only call a snippet through the `{@render ...}` tag.
*/
export interface Snippet<T = void> {
(arg: T): typeof SnippetReturn;
(
arg: T
): typeof SnippetReturn & {
_: 'functions passed to {@render ...} tags must use the `Snippet` type imported from "svelte"';
};
}
interface DispatchOptions {

Loading…
Cancel
Save