Skip to content

Commit

Permalink
[fix] more specific return type for crossfade
Browse files Browse the repository at this point in the history
People with "noUncheckedIndexedAccess" set to true in their tsconfig would get false errors when accessing the return type because without this spefici tuple typing, TS infers this as being an array of functions, not a tuple of functions.
Fixes #6926
  • Loading branch information
dummdidumm authored Nov 14, 2021
1 parent 78e0256 commit 2c9e161
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/runtime/transition/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,20 @@ type ClientRectMap = Map<any, { rect: ClientRect }>;

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();

Expand Down

0 comments on commit 2c9e161

Please sign in to comment.