utils.ts 864 B

123456789101112131415161718192021222324252627282930
  1. // Copyright (c) Jupyter Development Team.
  2. // Distributed under the terms of the Modified BSD License.
  3. import { editorServices } from '@jupyterlab/codemirror';
  4. import { defaultRenderMime } from '@jupyterlab/testutils';
  5. import { CodeConsole, ConsolePanel } from '../src';
  6. export const editorFactory = editorServices.factoryService.newInlineEditor.bind(
  7. editorServices.factoryService
  8. );
  9. export const mimeTypeService = editorServices.mimeTypeService;
  10. export const rendermime = defaultRenderMime();
  11. /**
  12. * Create a console content factory.
  13. */
  14. export function createConsoleFactory(): CodeConsole.IContentFactory {
  15. return new CodeConsole.ContentFactory({ editorFactory });
  16. }
  17. /**
  18. * Create a panel content factory.
  19. */
  20. export function createConsolePanelFactory(): ConsolePanel.IContentFactory {
  21. return new ConsolePanel.ContentFactory({ editorFactory });
  22. }