1
+ /**
2
+ * @typedef {import('vue').Component } VueComponent
3
+ * @typedef {import('vue').DefineComponent } DefineComponent
4
+ * @typedef {import('axios').AxiosInstance } AxiosInstance
5
+ * @typedef {Object<string, any> } AppConfig
6
+ * @typedef {import('./util/FormValidation').Form } Form
7
+ */
8
+ export default class Nova {
9
+ /**
10
+ * @param {AppConfig } config
11
+ */
12
+ constructor ( config : AppConfig ) ;
13
+ /**
14
+ * @protected
15
+ * @type {Function[] }
16
+ */
17
+ protected bootingCallbacks : Function [ ] ;
18
+ /** @readonly */
19
+ readonly appConfig : {
20
+ [ x : string ] : any ;
21
+ } ;
22
+ /**
23
+ * @private
24
+ * @type {boolean }
25
+ */
26
+ private useShortcuts ;
27
+ /**
28
+ * @protected
29
+ * @type {{[key: string]: VueComponent|DefineComponent} }
30
+ */
31
+ protected pages : {
32
+ [ key : string ] : VueComponent | DefineComponent ;
33
+ } ;
34
+ /** @protected */
35
+ protected $toasted : any ;
36
+ /** @public */
37
+ public $progress : any ;
38
+ /** @public */
39
+ public $router : import ( "@inertiajs/core" ) . Router ;
40
+ $testing : {
41
+ timezone : ( timezone : any ) => void ;
42
+ } ;
43
+ /**
44
+ * Register a callback to be called before Nova starts. This is used to bootstrap
45
+ * addons, tools, custom fields, or anything else Nova needs
46
+ *
47
+ * @param {Function } callback
48
+ */
49
+ booting ( callback : Function ) : void ;
50
+ /**
51
+ * Execute all of the booting callbacks.
52
+ */
53
+ boot ( ) : void ;
54
+ store : import ( "vuex" ) . Store < any > ;
55
+ /**
56
+ * @param {Function } callback
57
+ */
58
+ booted ( callback : Function ) : void ;
59
+ countdown ( ) : Promise < void > ;
60
+ /** @protected */
61
+ protected mountTo : Element ;
62
+ /** @protected */
63
+ protected app : import ( "vue" ) . App < Element > ;
64
+ /**
65
+ * Start the Nova app by calling each of the tool's callbacks and then creating
66
+ * the underlying Vue instance.
67
+ */
68
+ liftOff ( ) : void ;
69
+ /** @private */
70
+ private notificationPollingInterval ;
71
+ /**
72
+ * Return configuration value from a key.
73
+ *
74
+ * @param {string } key
75
+ * @returns {any }
76
+ */
77
+ config ( key : string ) : any ;
78
+ /**
79
+ * Return a form object configured with Nova's preconfigured axios instance.
80
+ *
81
+ * @param {{[key: string]: any} } data
82
+ * @returns {Form }
83
+ */
84
+ form ( data : {
85
+ [ key : string ] : any ;
86
+ } ) : Form ;
87
+ /**
88
+ * Return an axios instance configured to make requests to Nova's API
89
+ * and handle certain response codes.
90
+ *
91
+ * @param {any } options
92
+ * @returns {AxiosInstance }
93
+ */
94
+ request ( options : any ) : AxiosInstance ;
95
+ /**
96
+ * Get the URL from base Nova prefix.
97
+ *
98
+ * @param {string } path
99
+ * @param {any } parameters
100
+ * @returns {string }
101
+ */
102
+ url ( path : string , parameters : any ) : string ;
103
+ /**
104
+ * @returns {boolean }
105
+ */
106
+ hasSecurityFeatures ( ) : boolean ;
107
+ /**
108
+ * Register a listener on Nova's built-in event bus
109
+ *
110
+ * @param {string } name
111
+ * @param {Function } callback
112
+ * @param {any } ctx
113
+ */
114
+ $on ( ...args : any [ ] ) : void ;
115
+ /**
116
+ * Register a one-time listener on the event bus
117
+ *
118
+ * @param {string } name
119
+ * @param {Function } callback
120
+ * @param {any } ctx
121
+ */
122
+ $once ( ...args : any [ ] ) : void ;
123
+ /**
124
+ * Unregister an listener on the event bus
125
+ *
126
+ * @param {string } name
127
+ * @param {Function } callback
128
+ */
129
+ $off ( ...args : any [ ] ) : void ;
130
+ /**
131
+ * Emit an event on the event bus
132
+ *
133
+ * @param {string } name
134
+ */
135
+ $emit ( ...args : any [ ] ) : void ;
136
+ /**
137
+ * Determine if Nova is missing the requested resource with the given uri key
138
+ *
139
+ * @param {string } uriKey
140
+ * @returns {boolean }
141
+ */
142
+ missingResource ( uriKey : string ) : boolean ;
143
+ /**
144
+ * Register a keyboard shortcut.
145
+ *
146
+ * @param {string } keys
147
+ * @param {Function } callback
148
+ */
149
+ addShortcut ( keys : string , callback : Function ) : void ;
150
+ /**
151
+ * Unbind a keyboard shortcut.
152
+ *
153
+ * @param {string } keys
154
+ */
155
+ disableShortcut ( keys : string ) : void ;
156
+ /**
157
+ * Pause all keyboard shortcuts.
158
+ */
159
+ pauseShortcuts ( ) : void ;
160
+ /**
161
+ * Resume all keyboard shortcuts.
162
+ */
163
+ resumeShortcuts ( ) : void ;
164
+ /**
165
+ * Register the built-in Vuex modules for each resource
166
+ */
167
+ registerStoreModules ( ) : void ;
168
+ /**
169
+ * Register Inertia component.
170
+ *
171
+ * @param {string } name
172
+ * @param {VueComponent|DefineComponent } component
173
+ */
174
+ inertia ( name : string , component : VueComponent | DefineComponent ) : void ;
175
+ /**
176
+ * Register a custom Vue component.
177
+ *
178
+ * @param {string } name
179
+ * @param {VueComponent|DefineComponent } component
180
+ */
181
+ component ( name : string , component : VueComponent | DefineComponent ) : void ;
182
+ /**
183
+ * Check if custom Vue component exists.
184
+ *
185
+ * @param {string } name
186
+ * @returns {boolean }
187
+ */
188
+ hasComponent ( name : string ) : boolean ;
189
+ /**
190
+ * Show an error message to the user.
191
+ *
192
+ * @param {string } message
193
+ */
194
+ info ( message : string ) : void ;
195
+ /**
196
+ * Show an error message to the user.
197
+ *
198
+ * @param {string } message
199
+ */
200
+ error ( message : string ) : void ;
201
+ /**
202
+ * Show a success message to the user.
203
+ *
204
+ * @param {string } message
205
+ */
206
+ success ( message : string ) : void ;
207
+ /**
208
+ * Show a warning message to the user.
209
+ *
210
+ * @param {string } message
211
+ */
212
+ warning ( message : string ) : void ;
213
+ /**
214
+ * Format a number using numbro.js for consistent number formatting.
215
+ *
216
+ * @param {number } number
217
+ * @param {Object|string } format
218
+ * @returns {string }
219
+ */
220
+ formatNumber ( number : number , format : any | string ) : string ;
221
+ /**
222
+ * Log a message to the console with the NOVA prefix
223
+ *
224
+ * @param {string } message
225
+ * @param {string } [type=log]
226
+ */
227
+ log ( message : string , type ?: string ) : void ;
228
+ /**
229
+ * Log a message to the console for debugging purpose
230
+ *
231
+ * @param {any } message
232
+ * @param {string } [type=log]
233
+ */
234
+ debug ( message : any , type ?: string ) : void ;
235
+ /**
236
+ * Redirect to login path.
237
+ */
238
+ redirectToLogin ( ) : void ;
239
+ /**
240
+ * Visit page using Inertia visit or window.location for remote.
241
+ *
242
+ * @param {{url: string, remote: boolean} | string } path
243
+ * @param {any } [options={}]
244
+ */
245
+ visit ( path : {
246
+ url : string ;
247
+ remote : boolean ;
248
+ } | string , options ?: any ) : void ;
249
+ applyTheme ( ) : void ;
250
+ }
251
+ export type VueComponent = import ( "vue" ) . Component ;
252
+ export type DefineComponent = import ( "vue" ) . DefineComponent ;
253
+ export type AxiosInstance = import ( "axios" ) . AxiosInstance ;
254
+ export type AppConfig = {
255
+ [ x : string ] : any ;
256
+ } ;
257
+ export type Form = import ( "./util/FormValidation" ) . Form ;
258
+ //# sourceMappingURL=nova.d.ts.map
0 commit comments