UNPKG

vue-router-view-transition

Version:

A transition wrapper for router-view that is compatible with scrollBehavior

17 lines (16 loc) 653 B
import { RouterOptions } from 'vue-router'; interface ScrollWaiter { resolve: (() => void) | null; promise: Promise<void> | null; add: () => void; flush: () => void; wait: () => Promise<void>; } export declare const scrollWaiter: ScrollWaiter; declare type ScrollBehaviorMethod = Required<RouterOptions>['scrollBehavior']; /** * Wraps a scrollBehavior method to asynchronously await for the entering view to be visible. It requires you to use the `router-view-transition` component * @param guard */ export declare function waitForTransition(scrollBehavior: ScrollBehaviorMethod): ScrollBehaviorMethod; export {};