Skip to content

Commit

Permalink
tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich-Harris committed Jun 29, 2024
1 parent f7daad9 commit 7446888
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions packages/svelte/src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,18 +265,18 @@ declare const SnippetReturn: unique symbol;
*
* https://svelte-5-preview.vercel.app/docs/snippets
*
* @template Arguments Parameters that the snippet expects (if any) as a tuple. The default type is no parameters.
* @template Parameters the parameters that the snippet expects (if any) as a tuple.
*/
export type Snippet<Arguments extends unknown[] = []> =
export type Snippet<Parameters extends unknown[] = []> =
// this conditional allows tuples but not arrays. Arrays would indicate a
// rest parameter type, which is not supported. If rest parameters are added
// in the future, the condition can be removed.
number extends Arguments['length']
number extends Parameters['length']
? never
: {
(
this: void,
...args: Arguments
...args: Parameters
): typeof SnippetReturn & {
_: 'functions passed to {@render ...} tags must use the `Snippet` type imported from "svelte"';
};
Expand Down
8 changes: 4 additions & 4 deletions packages/svelte/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,18 +262,18 @@ declare module 'svelte' {
*
* https://svelte-5-preview.vercel.app/docs/snippets
*
* @template Arguments Parameters that the snippet expects (if any) as a tuple. The default type is no parameters.
* @template Parameters the parameters that the snippet expects (if any) as a tuple.
*/
type Snippet<Arguments extends unknown[] = []> =
type Snippet<Parameters extends unknown[] = []> =
// this conditional allows tuples but not arrays. Arrays would indicate a
// rest parameter type, which is not supported. If rest parameters are added
// in the future, the condition can be removed.
number extends Arguments['length']
number extends Parameters['length']
? never
: {
(
this: void,
...args: Arguments
...args: Parameters
): typeof SnippetReturn & {
_: 'functions passed to {@render ...} tags must use the `Snippet` type imported from "svelte"';
};
Expand Down

0 comments on commit 7446888

Please sign in to comment.