File tree Expand file tree Collapse file tree 2 files changed +29
-16
lines changed
Expand file tree Collapse file tree 2 files changed +29
-16
lines changed Original file line number Diff line number Diff line change @@ -7,19 +7,6 @@ import { createApp, h } from 'vue';
77import { ZiggyVue } from 'ziggy-js' ;
88import { initializeTheme } from './composables/useAppearance' ;
99
10- // Extend ImportMeta interface for Vite...
11- declare module 'vite/client' {
12- interface ImportMetaEnv {
13- readonly VITE_APP_NAME : string ;
14- [ key : string ] : string | boolean | undefined ;
15- }
16-
17- interface ImportMeta {
18- readonly env : ImportMetaEnv ;
19- readonly glob : < T > ( pattern : string ) => Record < string , ( ) => Promise < T > > ;
20- }
21- }
22-
2310const appName = import . meta. env . VITE_APP_NAME || 'Laravel' ;
2411
2512createInertiaApp ( {
Original file line number Diff line number Diff line change 1- import type { route as routeFn } from 'ziggy-js' ;
1+ import { AppPageProps } from '@/types/index' ;
2+ import { createHeadManager , Page , Router } from '@inertiajs/core' ;
23
3- declare global {
4- const route : typeof routeFn ;
4+ // Extend ImportMeta interface for Vite...
5+ declare module 'vite/client' {
6+ interface ImportMetaEnv {
7+ readonly VITE_APP_NAME : string ;
8+
9+ [ key : string ] : string | boolean | undefined ;
10+ }
11+
12+ interface ImportMeta {
13+ readonly env : ImportMetaEnv ;
14+ readonly glob : < T > ( pattern : string ) => Record < string , ( ) => Promise < T > > ;
15+ }
16+ }
17+
18+ // Declare shared props for Inertia and App pages...
19+ declare module '@inertiajs/core' {
20+ interface PageProps extends InertiaPageProps , AppPageProps { }
21+ }
22+
23+ // Add typings for Inertia's $page and $headManager properties...
24+ declare module '@vue/runtime-core' {
25+ interface ComponentCustomProperties {
26+ $inertia : typeof Router ;
27+ $page : Page ;
28+ $headManager : ReturnType < typeof createHeadManager > ;
29+ route : AppRouter ;
30+ }
531}
You can’t perform that action at this time.
0 commit comments