From 11e086bb2596301302fef27c6a3c9d30aee57da6 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Mon, 19 May 2025 17:18:14 -0400 Subject: [PATCH] get rid of the arg0, arg1 stuff --- packages/svelte/src/attachments/index.js | 6 +++--- packages/svelte/types/index.d.ts | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/svelte/src/attachments/index.js b/packages/svelte/src/attachments/index.js index 514c9433f4..0ff1f60fb1 100644 --- a/packages/svelte/src/attachments/index.js +++ b/packages/svelte/src/attachments/index.js @@ -35,14 +35,14 @@ export function createAttachmentKey() { * @template {EventTarget} E * @template {unknown} T * @overload - * @param {Action | function(E, T): void | ActionReturn} action The action function + * @param {Action | ((element: E, arg: T) => void | ActionReturn)} action The action function * @param {() => T} fn A function that returns the argument for the action * @returns {Attachment} */ /** * @template {EventTarget} E * @overload - * @param {Action | function(E): void | ActionReturn} action The action function + * @param {Action | ((element: E) => void | ActionReturn)} action The action function * @returns {Attachment} */ /** @@ -54,7 +54,7 @@ export function createAttachmentKey() { * * @template {EventTarget} E * @template {unknown} T - * @param {Action | function(E, T): void | ActionReturn} action The action function + * @param {Action | ((element: E, arg: T) => void | ActionReturn)} action The action function * @param {() => T} fn A function that returns the argument for the action * @returns {Attachment} * @since 5.32 diff --git a/packages/svelte/types/index.d.ts b/packages/svelte/types/index.d.ts index 067e04db5b..59c8d7ff15 100644 --- a/packages/svelte/types/index.d.ts +++ b/packages/svelte/types/index.d.ts @@ -625,7 +625,7 @@ declare module 'svelte/animate' { } declare module 'svelte/attachments' { - import type { ActionReturn, Action } from 'svelte/action'; + import type { Action, ActionReturn } from 'svelte/action'; /** * An [attachment](https://svelte.dev/docs/svelte/@attach) is a function that runs when an element is mounted * to the DOM, and optionally returns a function that is called when the element is later removed. @@ -660,9 +660,9 @@ declare module 'svelte/attachments' { */ export function createAttachmentKey(): symbol; - export function fromAction(action: Action | ((arg0: E, arg1: T) => void | ActionReturn), fn: () => T): Attachment; + export function fromAction(action: Action | ((element: E, arg: T) => void | ActionReturn), fn: () => T): Attachment; - export function fromAction(action: Action | ((arg0: E) => void | ActionReturn)): Attachment; + export function fromAction(action: Action | ((element: E) => void | ActionReturn)): Attachment; export {}; }