pull/10320/head
S. Elliott Johnson 2 years ago
parent 11086f30ce
commit f9ac0cf39c

@ -237,10 +237,12 @@ You can import the `Snippet` type from `'svelte'`:
The `Snippet` type is generic. Here's how you'd type various cases: The `Snippet` type is generic. Here's how you'd type various cases:
```ts ```ts
type SnippetWithNoArgs = Snippet type SnippetWithNoArgs = Snippet;
type SnippetWithOneArg = Snippet<[argOne: number]> type SnippetWithOneArg = Snippet<[argOne: number]>;
type SnippetWithMultipleArgs = Snippet<[argOne: number, argTwo: string]> type SnippetWithMultipleArgs = Snippet<
type SnippetWithAnyNumberOfArgs = Snippet<number[]> [argOne: number, argTwo: string]
>;
type SnippetWithAnyNumberOfArgs = Snippet<number[]>;
``` ```
And here are the snippet declarations matching those cases (note: this example uses TypeScript): And here are the snippet declarations matching those cases (note: this example uses TypeScript):

Loading…
Cancel
Save