@@ -55,19 +55,19 @@ export interface AdminJSOptions {
55
55
* path, under which, AdminJS will be available. Default to `/admin`
56
56
*
57
57
*/
58
- rootPath ?: string ;
58
+ rootPath ?: string
59
59
/**
60
60
* url to a logout action, default to `/admin/logout`
61
61
*/
62
- logoutPath ?: string ;
62
+ logoutPath ?: string
63
63
/**
64
64
* url to a login page, default to `/admin/login`
65
65
*/
66
- loginPath ?: string ;
66
+ loginPath ?: string
67
67
/**
68
68
* Array of all Databases which are supported by AdminJS via adapters
69
69
*/
70
- databases ?: Array < any > ;
70
+ databases ?: Array < any >
71
71
72
72
/**
73
73
* List of custom pages which will be visible below all resources
@@ -88,7 +88,7 @@ export interface AdminJSOptions {
88
88
* },
89
89
* },
90
90
*/
91
- pages ?: AdminPages ;
91
+ pages ?: AdminPages
92
92
/**
93
93
* Array of all Resources which are supported by AdminJS via adapters.
94
94
* You can pass either resource or resource with an options and thus modify it.
@@ -98,32 +98,32 @@ export interface AdminJSOptions {
98
98
*
99
99
* @see ResourceOptions
100
100
*/
101
- resources ?: Array < ResourceWithOptions | any > ;
101
+ resources ?: Array < ResourceWithOptions | any >
102
102
/**
103
103
* Option to modify the dashboard
104
104
*/
105
105
dashboard ?: {
106
106
/**
107
107
* Handler function which can be triggered using {@link ApiClient#getDashboard}.
108
108
*/
109
- handler ?: PageHandler ;
109
+ handler ?: PageHandler
110
110
/**
111
111
* Bundled component name which should be rendered when user opens the dashboard
112
112
*/
113
- component ?: string ;
114
- } ;
113
+ component ?: string
114
+ }
115
115
/**
116
116
* Flag which indicates if version number should be visible on the UI
117
117
*/
118
- version ?: VersionSettings ;
118
+ version ?: VersionSettings
119
119
/**
120
120
* Options which are related to the branding.
121
121
*/
122
- branding ?: BrandingOptions | BrandingOptionsFunction ;
122
+ branding ?: BrandingOptions | BrandingOptionsFunction
123
123
/**
124
124
* Custom assets you want to pass to AdminJS
125
125
*/
126
- assets ?: Assets | AssetsFunction ;
126
+ assets ?: Assets | AssetsFunction
127
127
/**
128
128
* Indicates is bundled by AdminJS files like:
129
129
* - components.bundle.js
@@ -159,7 +159,7 @@ export interface AdminJSOptions {
159
159
* with firebase hosting)
160
160
* - point {@link AdminJS.assetsCDN} to this domain
161
161
*/
162
- assetsCDN ?: string ;
162
+ assetsCDN ?: string
163
163
/**
164
164
* Environmental variables passed to the frontend.
165
165
*
@@ -178,7 +178,7 @@ export interface AdminJSOptions {
178
178
* AdminJS.env.GOOGLE_MAP_API_TOKEN
179
179
* ```
180
180
*/
181
- env ?: Record < string , string > ;
181
+ env ?: Record < string , string >
182
182
183
183
/* cspell: disable */
184
184
@@ -236,22 +236,22 @@ export interface AdminJSOptions {
236
236
* Check out the [i18n tutorial]{@tutorial i18n} to see how
237
237
* internationalization in AdminJS works.
238
238
*/
239
- locale ?: Locale ;
239
+ locale ?: Locale
240
240
241
241
/**
242
242
* rollup bundle options;
243
243
*/
244
- bundler ?: BundlerOptions ;
244
+ bundler ?: BundlerOptions
245
245
246
246
/**
247
247
* Additional settings.
248
248
*/
249
- settings ?: Partial < AdminJSSettings > ;
249
+ settings ?: Partial < AdminJSSettings >
250
250
}
251
251
252
252
export type AdminJSSettings = {
253
- defaultPerPage : number ;
254
- } ;
253
+ defaultPerPage : number
254
+ }
255
255
256
256
/* cspell: enable */
257
257
@@ -268,16 +268,16 @@ export type Assets = {
268
268
/**
269
269
* List to urls of custom stylesheets. You can pass your font - icons here (as an example)
270
270
*/
271
- styles ?: Array < string > ;
271
+ styles ?: Array < string >
272
272
/**
273
273
* List of urls to custom scripts. If you use some particular js
274
274
* library - you can pass its url here.
275
275
*/
276
- scripts ?: Array < string > ;
276
+ scripts ?: Array < string >
277
277
/**
278
278
* Mapping of core scripts in case you want to version your assets
279
279
*/
280
- coreScripts ?: CoreScripts ;
280
+ coreScripts ?: CoreScripts
281
281
}
282
282
283
283
/**
@@ -299,17 +299,17 @@ export type VersionSettings = {
299
299
/**
300
300
* if set to true - current admin version will be visible
301
301
*/
302
- admin ?: boolean ;
302
+ admin ?: boolean
303
303
/**
304
304
* Here you can pass any arbitrary version text which will be seen in the US.
305
305
* You can pass here your current API version.
306
306
*/
307
- app ?: string ;
307
+ app ?: string
308
308
}
309
309
310
310
export type VersionProps = {
311
- admin ?: string ;
312
- app ?: string ;
311
+ admin ?: string
312
+ app ?: string
313
313
}
314
314
315
315
/**
@@ -334,26 +334,26 @@ export type BrandingOptions = {
334
334
/**
335
335
* URL to a logo, or `false` if you want to hide the default one.
336
336
*/
337
- logo ?: string | false ;
337
+ logo ?: string | false
338
338
/**
339
339
* Name of your company, which will replace "AdminJS".
340
340
*/
341
- companyName ?: string ;
341
+ companyName ?: string
342
342
/**
343
343
* CSS theme.
344
344
*/
345
- theme ?: Partial < ThemeOverride > ;
345
+ theme ?: Partial < ThemeOverride >
346
346
/**
347
347
* Flag indicates if "made with love" tiny heart icon
348
348
* should be visible on the bottom sidebar and login page.
349
349
* @new since 6.0.0
350
350
*/
351
- withMadeWithLove ?: boolean ;
351
+ withMadeWithLove ?: boolean
352
352
353
353
/**
354
354
* URL to a favicon
355
355
*/
356
- favicon ?: string ;
356
+ favicon ?: string
357
357
}
358
358
359
359
/**
@@ -365,9 +365,7 @@ export type BrandingOptions = {
365
365
* @memberof AdminJSOptions
366
366
* @returns {BrandingOptions | Promise<BrandingOptions> }
367
367
*/
368
- export type BrandingOptionsFunction = (
369
- admin ?: CurrentAdmin
370
- ) => BrandingOptions | Promise < BrandingOptions >
368
+ export type BrandingOptionsFunction = ( admin ?: CurrentAdmin ) => BrandingOptions | Promise < BrandingOptions >
371
369
372
370
/**
373
371
* Object describing regular page in AdminJS
@@ -379,16 +377,21 @@ export type AdminPage = {
379
377
/**
380
378
* Handler function
381
379
*/
382
- handler ?: PageHandler ;
380
+ handler ?: PageHandler
383
381
/**
384
382
* Component defined by using {@link AdminJS.bundle}
385
383
*/
386
- component : string ;
384
+ component : string
387
385
388
386
/**
389
387
* Page icon
390
388
*/
391
- icon ?: string ;
389
+ icon ?: string
390
+
391
+ /**
392
+ * Page visibility
393
+ */
394
+ isShown ?: boolean
392
395
}
393
396
394
397
/**
@@ -405,9 +408,9 @@ export type AdminPages = Record<string, AdminPage>
405
408
* @memberof AdminJSOptions
406
409
*/
407
410
export type ResourceWithOptions = {
408
- resource : any ;
409
- options : ResourceOptions ;
410
- features ?: Array < FeatureType > ;
411
+ resource : any
412
+ options : ResourceOptions
413
+ features ?: Array < FeatureType >
411
414
}
412
415
413
416
/**
@@ -431,11 +434,7 @@ export type FeatureType = (
431
434
* @alias PageHandler
432
435
* @memberof AdminJSOptions
433
436
*/
434
- export type PageHandler = (
435
- request : any ,
436
- response : any ,
437
- context : PageContext ,
438
- ) => Promise < any >
437
+ export type PageHandler = ( request : any , response : any , context : PageContext ) => Promise < any >
439
438
440
439
/**
441
440
* Bundle options
@@ -453,22 +452,25 @@ export type BundlerOptions = {
453
452
/**
454
453
* The file path to babel config file or json object of babel config.
455
454
*/
456
- babelConfig ?: BabelConfig | string ;
455
+ babelConfig ?: BabelConfig | string
457
456
}
458
457
459
458
export interface AdminJSOptionsWithDefault extends AdminJSOptions {
460
- rootPath : string ;
461
- logoutPath : string ;
462
- loginPath : string ;
463
- databases ?: Array < BaseDatabase > ;
464
- resources ?: Array < BaseResource | {
465
- resource : BaseResource ;
466
- options : ResourceOptions ;
467
- } > ;
459
+ rootPath : string
460
+ logoutPath : string
461
+ loginPath : string
462
+ databases ?: Array < BaseDatabase >
463
+ resources ?: Array <
464
+ | BaseResource
465
+ | {
466
+ resource : BaseResource
467
+ options : ResourceOptions
468
+ }
469
+ >
468
470
dashboard : {
469
- handler ?: PageHandler ;
470
- component ?: string ;
471
- } ;
472
- bundler : BundlerOptions ;
473
- pages : AdminJSOptions [ 'pages' ] ;
471
+ handler ?: PageHandler
472
+ component ?: string
473
+ }
474
+ bundler : BundlerOptions
475
+ pages : AdminJSOptions [ 'pages' ]
474
476
}
0 commit comments