@@ -55,19 +55,19 @@ export interface AdminJSOptions {
5555 * path, under which, AdminJS will be available. Default to `/admin`
5656 *
5757 */
58- rootPath ?: string ;
58+ rootPath ?: string
5959 /**
6060 * url to a logout action, default to `/admin/logout`
6161 */
62- logoutPath ?: string ;
62+ logoutPath ?: string
6363 /**
6464 * url to a login page, default to `/admin/login`
6565 */
66- loginPath ?: string ;
66+ loginPath ?: string
6767 /**
6868 * Array of all Databases which are supported by AdminJS via adapters
6969 */
70- databases ?: Array < any > ;
70+ databases ?: Array < any >
7171
7272 /**
7373 * List of custom pages which will be visible below all resources
@@ -88,7 +88,7 @@ export interface AdminJSOptions {
8888 * },
8989 * },
9090 */
91- pages ?: AdminPages ;
91+ pages ?: AdminPages
9292 /**
9393 * Array of all Resources which are supported by AdminJS via adapters.
9494 * You can pass either resource or resource with an options and thus modify it.
@@ -98,32 +98,32 @@ export interface AdminJSOptions {
9898 *
9999 * @see ResourceOptions
100100 */
101- resources ?: Array < ResourceWithOptions | any > ;
101+ resources ?: Array < ResourceWithOptions | any >
102102 /**
103103 * Option to modify the dashboard
104104 */
105105 dashboard ?: {
106106 /**
107107 * Handler function which can be triggered using {@link ApiClient#getDashboard}.
108108 */
109- handler ?: PageHandler ;
109+ handler ?: PageHandler
110110 /**
111111 * Bundled component name which should be rendered when user opens the dashboard
112112 */
113- component ?: string ;
114- } ;
113+ component ?: string
114+ }
115115 /**
116116 * Flag which indicates if version number should be visible on the UI
117117 */
118- version ?: VersionSettings ;
118+ version ?: VersionSettings
119119 /**
120120 * Options which are related to the branding.
121121 */
122- branding ?: BrandingOptions | BrandingOptionsFunction ;
122+ branding ?: BrandingOptions | BrandingOptionsFunction
123123 /**
124124 * Custom assets you want to pass to AdminJS
125125 */
126- assets ?: Assets | AssetsFunction ;
126+ assets ?: Assets | AssetsFunction
127127 /**
128128 * Indicates is bundled by AdminJS files like:
129129 * - components.bundle.js
@@ -159,7 +159,7 @@ export interface AdminJSOptions {
159159 * with firebase hosting)
160160 * - point {@link AdminJS.assetsCDN} to this domain
161161 */
162- assetsCDN ?: string ;
162+ assetsCDN ?: string
163163 /**
164164 * Environmental variables passed to the frontend.
165165 *
@@ -178,7 +178,7 @@ export interface AdminJSOptions {
178178 * AdminJS.env.GOOGLE_MAP_API_TOKEN
179179 * ```
180180 */
181- env ?: Record < string , string > ;
181+ env ?: Record < string , string >
182182
183183 /* cspell: disable */
184184
@@ -236,22 +236,22 @@ export interface AdminJSOptions {
236236 * Check out the [i18n tutorial]{@tutorial i18n} to see how
237237 * internationalization in AdminJS works.
238238 */
239- locale ?: Locale ;
239+ locale ?: Locale
240240
241241 /**
242242 * rollup bundle options;
243243 */
244- bundler ?: BundlerOptions ;
244+ bundler ?: BundlerOptions
245245
246246 /**
247247 * Additional settings.
248248 */
249- settings ?: Partial < AdminJSSettings > ;
249+ settings ?: Partial < AdminJSSettings >
250250}
251251
252252export type AdminJSSettings = {
253- defaultPerPage : number ;
254- } ;
253+ defaultPerPage : number
254+ }
255255
256256/* cspell: enable */
257257
@@ -268,16 +268,16 @@ export type Assets = {
268268 /**
269269 * List to urls of custom stylesheets. You can pass your font - icons here (as an example)
270270 */
271- styles ?: Array < string > ;
271+ styles ?: Array < string >
272272 /**
273273 * List of urls to custom scripts. If you use some particular js
274274 * library - you can pass its url here.
275275 */
276- scripts ?: Array < string > ;
276+ scripts ?: Array < string >
277277 /**
278278 * Mapping of core scripts in case you want to version your assets
279279 */
280- coreScripts ?: CoreScripts ;
280+ coreScripts ?: CoreScripts
281281}
282282
283283/**
@@ -299,17 +299,17 @@ export type VersionSettings = {
299299 /**
300300 * if set to true - current admin version will be visible
301301 */
302- admin ?: boolean ;
302+ admin ?: boolean
303303 /**
304304 * Here you can pass any arbitrary version text which will be seen in the US.
305305 * You can pass here your current API version.
306306 */
307- app ?: string ;
307+ app ?: string
308308}
309309
310310export type VersionProps = {
311- admin ?: string ;
312- app ?: string ;
311+ admin ?: string
312+ app ?: string
313313}
314314
315315/**
@@ -334,26 +334,26 @@ export type BrandingOptions = {
334334 /**
335335 * URL to a logo, or `false` if you want to hide the default one.
336336 */
337- logo ?: string | false ;
337+ logo ?: string | false
338338 /**
339339 * Name of your company, which will replace "AdminJS".
340340 */
341- companyName ?: string ;
341+ companyName ?: string
342342 /**
343343 * CSS theme.
344344 */
345- theme ?: Partial < ThemeOverride > ;
345+ theme ?: Partial < ThemeOverride >
346346 /**
347347 * Flag indicates if "made with love" tiny heart icon
348348 * should be visible on the bottom sidebar and login page.
349349 * @new since 6.0.0
350350 */
351- withMadeWithLove ?: boolean ;
351+ withMadeWithLove ?: boolean
352352
353353 /**
354354 * URL to a favicon
355355 */
356- favicon ?: string ;
356+ favicon ?: string
357357}
358358
359359/**
@@ -365,9 +365,7 @@ export type BrandingOptions = {
365365 * @memberof AdminJSOptions
366366 * @returns {BrandingOptions | Promise<BrandingOptions> }
367367 */
368- export type BrandingOptionsFunction = (
369- admin ?: CurrentAdmin
370- ) => BrandingOptions | Promise < BrandingOptions >
368+ export type BrandingOptionsFunction = ( admin ?: CurrentAdmin ) => BrandingOptions | Promise < BrandingOptions >
371369
372370/**
373371 * Object describing regular page in AdminJS
@@ -379,16 +377,21 @@ export type AdminPage = {
379377 /**
380378 * Handler function
381379 */
382- handler ?: PageHandler ;
380+ handler ?: PageHandler
383381 /**
384382 * Component defined by using {@link AdminJS.bundle}
385383 */
386- component : string ;
384+ component : string
387385
388386 /**
389387 * Page icon
390388 */
391- icon ?: string ;
389+ icon ?: string
390+
391+ /**
392+ * Page visibility
393+ */
394+ isShown ?: boolean
392395}
393396
394397/**
@@ -405,9 +408,9 @@ export type AdminPages = Record<string, AdminPage>
405408 * @memberof AdminJSOptions
406409 */
407410export type ResourceWithOptions = {
408- resource : any ;
409- options : ResourceOptions ;
410- features ?: Array < FeatureType > ;
411+ resource : any
412+ options : ResourceOptions
413+ features ?: Array < FeatureType >
411414}
412415
413416/**
@@ -431,11 +434,7 @@ export type FeatureType = (
431434 * @alias PageHandler
432435 * @memberof AdminJSOptions
433436 */
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 >
439438
440439/**
441440 * Bundle options
@@ -453,22 +452,25 @@ export type BundlerOptions = {
453452 /**
454453 * The file path to babel config file or json object of babel config.
455454 */
456- babelConfig ?: BabelConfig | string ;
455+ babelConfig ?: BabelConfig | string
457456}
458457
459458export 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+ >
468470 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' ]
474476}
0 commit comments