forked from quasarframework/quasar
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprefetch.d.ts
More file actions
23 lines (20 loc) · 796 Bytes
/
prefetch.d.ts
File metadata and controls
23 lines (20 loc) · 796 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import { RouteLocationRaw, RouteLocationNormalizedLoaded } from "vue-router";
import { HasSsrParam } from "./ssr";
import { HasStoreParam } from "./store";
interface PreFetchOptions<TState> extends HasSsrParam, HasStoreParam<TState> {
currentRoute: RouteLocationNormalizedLoaded;
previousRoute: RouteLocationNormalizedLoaded;
redirect: (url: RouteLocationRaw) => void;
urlPath: string;
publicPath: string;
}
// https://github.com/quasarframework/quasar/issues/6576#issuecomment-603787603
// Promise<{}> allow nearly any type of Promise to be used
export type PrefetchCallback<TState = any> = (
options: PreFetchOptions<TState>
) => void | Promise<void> | Promise<{}>;
declare module "@vue/runtime-core" {
interface ComponentCustomOptions {
preFetch?: PrefetchCallback;
}
}