Skip to content

Commit 512bd78

Browse files
committed
Fix ziggy related global types
1 parent 0d354b8 commit 512bd78

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

resources/js/types/ziggy.d.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
import { Config, RouteParams } from 'ziggy-js';
1+
import { Router as ZiggyRouter } from 'ziggy-js';
22

3-
declare global {
4-
function route(): Config;
5-
function route(name: string, params?: RouteParams<typeof name> | undefined, absolute?: boolean): string;
6-
}
3+
type AppRouter = {
4+
(): ZiggyRouter;
5+
(name: string, params?: any, absolute?: boolean): string;
6+
};
77

8-
declare module '@vue/runtime-core' {
9-
interface ComponentCustomProperties {
10-
route: typeof route;
11-
}
8+
declare global {
9+
// eslint-disable-next-line no-var
10+
var route: AppRouter;
1211
}

0 commit comments

Comments
 (0)