[fix] more specific return type for crossfade

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
pull/6927/head
Simon H 5 years ago committed by GitHub
parent 78e02565d2
commit 2c9e161d3e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

Loading…
Cancel
Save