12345678910111213141516171819202122232425262728293031323334353637383940 |
- // Copyright (c) Jupyter Development Team.
- // Distributed under the terms of the Modified BSD License.
- 'use strict';
- import {
- FileBrowserWidget, FileHandler
- } from 'jupyter-js-filebrowser';
- import {
- Container, Token
- } from 'phosphor-di';
- import {
- Widget
- } from 'phosphor-widget';
- import {
- IServicesProvider, IFileOpener, IFileHandler
- } from '../index';
- /**
- * Register the plugin contributions.
- *
- * @param container - The di container for type registration.
- *
- * #### Notes
- * This is called automatically when the plugin is loaded.
- */
- export
- function resolve(container: Container): Promise<IFileHandler> {
- return container.resolve({
- requires: [IServicesProvider, IFileOpener],
- create: (services: IServicesProvider, opener: IFileOpener) => {
- let handler = new FileHandler(services.contentsManager);
- opener.registerDefault(handler);
- return handler;
- }
- });
- }
|