import { JupyterFrontEnd , JupyterFrontEndPlugin , } from '@jupyterlab/application' ; import { PageConfig } from '@jupyterlab/coreutils' ; import { IShell , Shell } from './shell' ; /**
 * App is the main application class. It is instantiated once and shared.
 */ export class App extends JupyterFrontEnd < IShell > { param options constructor ( options = { shell : new Shell ( ) } ) { super ( { shell : options . shell , } ) ; } /**
     * The name of the application.
     */ readonly name = 'JupyterLab Custom App' ; /**
     * A namespace/prefix plugins may use to denote their provenance.
     */ readonly namespace = this . name ; /**
     * The version of the application.
     */ readonly version = 'unknown' ; /**
     * The JupyterLab application paths dictionary.
     */ get paths ( ) : JupyterFrontEnd . IPaths { return { urls : { base : PageConfig . getOption ( 'baseUrl' ) , notFound : PageConfig . getOption ( 'notFoundUrl' ) , app : PageConfig . getOption ( 'appUrl' ) , static : PageConfig . getOption ( 'staticUrl' ) , settings : PageConfig . getOption ( 'settingsUrl' ) , themes : PageConfig . getOption ( 'themesUrl' ) , doc : PageConfig . getOption ( 'docUrl' ) , translations : PageConfig . getOption ( 'translationsApiUrl' ) , hubHost : PageConfig . getOption ( 'hubHost' ) || undefined , hubPrefix : PageConfig . getOption ( 'hubPrefix' ) || undefined , hubUser : PageConfig . getOption ( 'hubUser' ) || undefined , hubServerName : PageConfig . getOption ( 'hubServerName' ) || undefined , } , directories : { appSettings : PageConfig . getOption ( 'appSettingsDir' ) , schemas : PageConfig . getOption ( 'schemasDir' ) , static : PageConfig . getOption ( 'staticDir' ) , templates : PageConfig . getOption ( 'templatesDir' ) , themes : PageConfig . getOption ( 'themesDir' ) , userSettings : PageConfig . getOption ( 'userSettingsDir' ) , serverRoot : PageConfig . getOption ( 'serverRoot' ) , workspaces : PageConfig . getOption ( 'workspacesDir' ) , } , } ; } param mod registerPluginModule ( mod ) { let data = mod . default ; if ( ! Object . prototype . hasOwnProperty . call ( mod , '__esModule' ) ) { data = mod as any ; } if ( ! Array . isArray ( data ) ) { data = [ data ] ; } data . forEach ( ( item ) => { try { this . registerPlugin ( item ) ; } catch ( error ) { console . error ( error ) ; } } ) ; } param mods registerPluginModules ( mods ) { mods . forEach ( ( mod ) => { this . registerPluginModule ( mod ) ; } ) ; } } /**
 * A namespace for App statics.
 */ export namespace App { /**
     * The instantiation options for an App application.
     */ export type IOptions = JupyterFrontEnd . IOptions < IShell > ; /**
     * The interface for a module that exports a plugin or plugins as
     * the default value.
     */ export interface IPluginModule { /**
         * The default export.
         */ default : JupyterFrontEndPlugin < any > | JupyterFrontEndPlugin < any > [ ] ; } }