1
+ import type {
2
+ App as VueApp ,
3
+ Component as VueComponent
4
+ } from 'vue'
5
+ import type { Router } from '@inertiajs/core'
6
+ import type { AxiosInstance } from 'axios'
7
+ import type { Store } from 'vuex'
8
+ import type { Form } from './form'
9
+ import type { Menu } from './menu'
10
+
11
+ type State = {
12
+ baseUri : string ;
13
+ currentUser : any ;
14
+ mainMenu : any [ ] ;
15
+ userMenu : any [ ] ;
16
+ resources : any [ ] ;
17
+ version : string ;
18
+ mainMenuShown : boolean ;
19
+ canLeaveForm : boolean ;
20
+ canLeaveModal : boolean ;
21
+ pushStateWasTriggered : boolean ;
22
+ validLicense : true ;
23
+ [ key : string ] : any ;
24
+ }
25
+
26
+ type BootingCallback = ( ( app : VueApp , store : Store < State > ) => void ) ;
27
+
28
+ type Color = {
29
+ [ key : string ] : string ;
30
+ }
31
+
32
+ export type AppConfig = {
33
+ algoliaApiKey ?: any ;
34
+ algoliaAppId ?: any ;
35
+ appName : string ;
36
+ base : string ;
37
+ brandColors : Color [ ] ;
38
+ brandColorsCSS : string ;
39
+ customLoginPath : boolean ;
40
+ customLogoutPath : boolean ;
41
+ debounce : number ;
42
+ footer : string ;
43
+ forgotPasswordPath : string | boolean ;
44
+ globalSearchEnabled : boolean ;
45
+ hasGloballySearchableResources : boolean ;
46
+ initialPath : string ;
47
+ locale : string ;
48
+ logo ?: string ;
49
+ mainMenu : Menu [ ] ;
50
+ notificationCenterEnabled : boolean ;
51
+ notificationPollingInterval : number ;
52
+ pagination : string ;
53
+ resetPasswordPath : boolean ;
54
+ resources : Resource [ ] ;
55
+ rtlEnabled : boolean ;
56
+ themeSwitcherEnabled : boolean ;
57
+ timezone : string ;
58
+ translations : Translations ;
59
+ userId : number ;
60
+ userMenu : Menu [ ] ;
61
+ userTimezone ?: any ;
62
+ version : string ;
63
+ withAuthentication : boolean ;
64
+ withPasswordReset : boolean ;
65
+ [ key : string ] : any ;
66
+ }
67
+
68
+ type Resource = {
69
+ uriKey : string ;
70
+ label : string ;
71
+ singularLabel : string ;
72
+ createButtonLabel : string ;
73
+ updateButtonLabel : string ;
74
+ authorizedToCreate : boolean ;
75
+ searchable : boolean ;
76
+ perPageOptions : number [ ] ;
77
+ tableStyle : string ;
78
+ showColumnBorders : boolean ;
79
+ debounce : number ;
80
+ clickAction : string ;
81
+ } ;
82
+
83
+ type Translations = {
84
+ [ key : string ] : string ;
85
+ }
86
+
87
+ export declare type NovaApp = {
88
+ pages : { [ key : string ] : VueComponent | string } ;
89
+ $router : Router ;
90
+ readonly appConfig : AppConfig ;
91
+ store : Store < State > ;
92
+
93
+ boot : ( ) => void ;
94
+ booting : ( callback : BootingCallback ) => void ;
95
+ booted : ( callback : BootingCallback ) => void ;
96
+ config : ( key : string ) => any ;
97
+ countdown ( ) : Promise < void > ;
98
+ form : ( data : { [ key : string ] : any } ) => Form ;
99
+ hasSecurityFeatures ( ) : boolean ;
100
+ liftOff : ( ) => void ;
101
+ missingResource : ( uriKey : string ) => boolean ;
102
+ redirectToLogin : ( ) => void ;
103
+ url : ( path : string , parameters : any ) => string ;
104
+
105
+ request : ( options : Object ) => AxiosInstance ;
106
+
107
+ inertia : ( name : string , component : VueComponent | string ) => void ;
108
+ visit : ( path : ( { url : string ; remote : boolean ; } | string ) , options ?: Object ) => void ;
109
+
110
+ component : ( name : string , component : VueComponent | string ) => void ;
111
+ hasComponent : ( name : string ) => boolean ;
112
+
113
+ debug : ( message : any , type ?: string ) => void ;
114
+ log : ( message : string , type ?: string ) => void ;
115
+
116
+ error : ( message : string ) => void ;
117
+ info : ( message : string ) => void ;
118
+ success : ( message : string ) => void ;
119
+ warning : ( message : string ) => void ;
120
+
121
+ formatNumber : ( number : number , format : any | string ) => string ;
122
+
123
+ $emit : ( event : string , ...args : any [ ] ) => void ;
124
+ $on : ( event : string , callback : Function , ctx ?: any ) => void ;
125
+ $once : ( event : string , callback : Function , ctx ?: any ) => void ;
126
+ $off : ( event : string , callback ?: Function ) => void ;
127
+ }
128
+
129
+ declare global {
130
+ interface Window {
131
+ Nova : NovaApp ;
132
+ }
133
+ }
0 commit comments