From 5864570d5e5467f22e362d550259ab330c82af10 Mon Sep 17 00:00:00 2001 From: ehsan Date: Wed, 9 Feb 2022 12:53:03 +0330 Subject: [PATCH] [docs] separates fallback parameter from the rest in crossfade --- src/runtime/transition/index.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/runtime/transition/index.ts b/src/runtime/transition/index.ts index abc7da6c74..d6eab5ad24 100644 --- a/src/runtime/transition/index.ts +++ b/src/runtime/transition/index.ts @@ -510,6 +510,9 @@ export interface CrossfadeParams { duration?: number | ((len: number) => number); /** (`function`, default `cubicOut`) — an [easing function](https://svelte.dev/docs#run-time-svelte-easing) */ easing?: EasingFunction; +} + +export interface CrossfadeInput extends CrossfadeParams { /** (`function`) — A fallback [transition](https://svelte.dev/docs#template-syntax-element-directives-transition-fn) to use for send when there is no matching element being received, and for receive when there is no element being sent. */ fallback?: (node: Element, params: CrossfadeParams, intro: boolean) => TransitionConfig; } @@ -551,7 +554,7 @@ type ClientRectMap = Map; * @param options * @returns a pair of transitions */ -export function crossfade({ fallback, ...defaults }: CrossfadeParams): [ +export function crossfade({ fallback, ...defaults }: CrossfadeInput): [ ( node: Element, params: CrossfadeParams & {