|
1 | 1 | // Copyright (c) {{ cookiecutter.author_name }} |
2 | 2 | // Distributed under the terms of the Modified BSD License. |
3 | 3 |
|
4 | | -import { |
5 | | - Application, IPlugin |
6 | | -} from '@phosphor/application'; |
| 4 | +import { Application, IPlugin } from '@phosphor/application'; |
7 | 5 |
|
8 | | -import { |
9 | | - Widget |
10 | | -} from '@phosphor/widgets'; |
| 6 | +import { Widget } from '@phosphor/widgets'; |
11 | 7 |
|
12 | | -import { |
13 | | - IJupyterWidgetRegistry |
14 | | - } from '@jupyter-widgets/base'; |
| 8 | +import { IJupyterWidgetRegistry } from '@jupyter-widgets/base'; |
15 | 9 |
|
16 | 10 | import * as widgetExports from './widget'; |
17 | 11 |
|
18 | | -import { |
19 | | - MODULE_NAME, MODULE_VERSION |
20 | | -} from './version'; |
| 12 | +import { MODULE_NAME, MODULE_VERSION } from './version'; |
21 | 13 |
|
22 | 14 | const EXTENSION_ID = '{{ cookiecutter.npm_package_name }}:plugin'; |
23 | 15 |
|
24 | 16 | /** |
25 | 17 | * The example plugin. |
26 | 18 | */ |
27 | | -const examplePlugin: IPlugin<Application<Widget>, void> = { |
| 19 | +const examplePlugin: IPlugin<Application<Widget>, void> = ({ |
28 | 20 | id: EXTENSION_ID, |
29 | 21 | requires: [IJupyterWidgetRegistry], |
30 | 22 | activate: activateWidgetExtension, |
31 | | - autoStart: true |
32 | | -} as unknown as IPlugin<Application<Widget>, void>; |
| 23 | + autoStart: true, |
| 24 | +} as unknown) as IPlugin<Application<Widget>, void>; |
33 | 25 | // the "as unknown as ..." typecast above is solely to support JupyterLab 1 |
34 | 26 | // and 2 in the same codebase and should be removed when we migrate to Lumino. |
35 | 27 |
|
36 | 28 | export default examplePlugin; |
37 | 29 |
|
38 | | - |
39 | 30 | /** |
40 | 31 | * Activate the widget extension. |
41 | 32 | */ |
42 | | -function activateWidgetExtension(app: Application<Widget>, registry: IJupyterWidgetRegistry): void { |
| 33 | +function activateWidgetExtension( |
| 34 | + app: Application<Widget>, |
| 35 | + registry: IJupyterWidgetRegistry |
| 36 | +): void { |
43 | 37 | registry.registerWidget({ |
44 | 38 | name: MODULE_NAME, |
45 | 39 | version: MODULE_VERSION, |
|
0 commit comments