1- import {
2- JupyterFrontEnd ,
3- JupyterFrontEndPlugin
4- } from '@jupyterlab/application' ;
5-
6- import { PageConfig } from '@jupyterlab/coreutils' ;
1+ import { Application , IPlugin } from '@lumino/application' ;
72
83import { IGatorShell , GatorShell } from './shell' ;
94
5+ /**
6+ * The type for all JupyterFrontEnd application plugins.
7+ *
8+ * @typeparam T - The type that the plugin `provides` upon being activated.
9+ */
10+ export type GatorFrontEndPlugin < T > = IPlugin < Gator , T > ;
11+
1012/**
1113 * Gator is the main application class. It is instantiated once and shared.
1214 */
13- export class Gator extends JupyterFrontEnd < IGatorShell > {
15+ export class Gator extends Application < IGatorShell > {
1416 /**
1517 * Construct a new App object.
1618 *
1719 * @param options The instantiation options for an Gator application.
1820 */
19- constructor ( options : Gator . IOptions = { shell : new GatorShell ( ) } ) {
21+ constructor (
22+ options : Application . IOptions < IGatorShell > = { shell : new GatorShell ( ) }
23+ ) {
2024 super ( {
2125 shell : options . shell
2226 } ) ;
@@ -37,38 +41,6 @@ export class Gator extends JupyterFrontEnd<IGatorShell> {
3741 */
3842 readonly version = 'unknown' ;
3943
40- /**
41- * The JupyterLab application paths dictionary.
42- */
43- get paths ( ) : JupyterFrontEnd . IPaths {
44- return {
45- urls : {
46- base : PageConfig . getOption ( 'baseUrl' ) ,
47- notFound : PageConfig . getOption ( 'notFoundUrl' ) ,
48- app : PageConfig . getOption ( 'appUrl' ) ,
49- static : PageConfig . getOption ( 'staticUrl' ) ,
50- settings : PageConfig . getOption ( 'settingsUrl' ) ,
51- themes : PageConfig . getOption ( 'themesUrl' ) ,
52- tree : PageConfig . getOption ( 'treeUrl' ) ,
53- workspaces : PageConfig . getOption ( 'workspacesUrl' ) ,
54- hubHost : PageConfig . getOption ( 'hubHost' ) || undefined ,
55- hubPrefix : PageConfig . getOption ( 'hubPrefix' ) || undefined ,
56- hubUser : PageConfig . getOption ( 'hubUser' ) || undefined ,
57- hubServerName : PageConfig . getOption ( 'hubServerName' ) || undefined
58- } ,
59- directories : {
60- appSettings : PageConfig . getOption ( 'appSettingsDir' ) ,
61- schemas : PageConfig . getOption ( 'schemasDir' ) ,
62- static : PageConfig . getOption ( 'staticDir' ) ,
63- templates : PageConfig . getOption ( 'templatesDir' ) ,
64- themes : PageConfig . getOption ( 'themesDir' ) ,
65- userSettings : PageConfig . getOption ( 'userSettingsDir' ) ,
66- serverRoot : PageConfig . getOption ( 'serverRoot' ) ,
67- workspaces : PageConfig . getOption ( 'workspacesDir' )
68- }
69- } ;
70- }
71-
7244 /**
7345 * Register plugins from a plugin module.
7446 *
@@ -108,11 +80,6 @@ export class Gator extends JupyterFrontEnd<IGatorShell> {
10880 * A namespace for Gator statics.
10981 */
11082export namespace Gator {
111- /**
112- * The instantiation options for an Gator application.
113- */
114- export type IOptions = JupyterFrontEnd . IOptions < IGatorShell > ;
115-
11683 /**
11784 * The interface for a module that exports a plugin or plugins as
11885 * the default value.
@@ -121,6 +88,6 @@ export namespace Gator {
12188 /**
12289 * The default export.
12390 */
124- default : JupyterFrontEndPlugin < any > | JupyterFrontEndPlugin < any > [ ] ;
91+ default : IPlugin < Gator , any > | IPlugin < Gator , any > [ ] ;
12592 }
12693}
0 commit comments