diff --git a/CHANGELOG.md b/CHANGELOG.md index be41b229dd..1c4a4ab92e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Unreleased * Fix overly restrictive preprocessor types ([#6904](https://github.com/sveltejs/svelte/pull/6904)) +* More specific typing for crossfade function - returns a tuple, not an array ([#6926](https://github.com/sveltejs/svelte/issues/6926)) ## 3.44.1 diff --git a/src/runtime/transition/index.ts b/src/runtime/transition/index.ts index 8f5a9521b6..9315cd77d5 100644 --- a/src/runtime/transition/index.ts +++ b/src/runtime/transition/index.ts @@ -212,7 +212,20 @@ type ClientRectMap = Map; export function crossfade({ fallback, ...defaults }: CrossfadeParams & { fallback?: (node: Element, params: CrossfadeParams, intro: boolean) => TransitionConfig; -}) { +}): [ + ( + node: Element, + params: CrossfadeParams & { + key: any; + } + ) => () => TransitionConfig, + ( + node: Element, + params: CrossfadeParams & { + key: any; + } + ) => () => TransitionConfig +] { const to_receive: ClientRectMap = new Map(); const to_send: ClientRectMap = new Map();