index.ts 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. // Copyright (c) Jupyter Development Team.
  2. // Distributed under the terms of the Modified BSD License.
  3. import {
  4. IClientSession
  5. } from '@jupyterlab/apputils';
  6. import {
  7. CodeEditor
  8. } from '@jupyterlab/codeeditor';
  9. import {
  10. Token
  11. } from '@phosphor/coreutils';
  12. import {
  13. Widget
  14. } from '@phosphor/widgets';
  15. import '../style/index.css';
  16. export * from './handler';
  17. export * from './model';
  18. export * from './widget';
  19. /* tslint:disable */
  20. /**
  21. * The completion manager token.
  22. */
  23. export
  24. const ICompletionManager = new Token<ICompletionManager>('jupyter.services.completer');
  25. /* tslint:enable */
  26. /**
  27. * A manager to register completers with parent widgets.
  28. */
  29. export
  30. interface ICompletionManager {
  31. /**
  32. * Register a completable object with the completion manager.
  33. *
  34. * @returns A completable object whose attributes can be updated as necessary.
  35. */
  36. register(completable: ICompletionManager.ICompletable): ICompletionManager.ICompletableAttributes;
  37. }
  38. /**
  39. * A namespace for `ICompletionManager` interface specifications.
  40. */
  41. export
  42. namespace ICompletionManager {
  43. /**
  44. * The attributes of a completable object that can change and sync at runtime.
  45. */
  46. export
  47. interface ICompletableAttributes {
  48. /**
  49. * The host editor for the completer.
  50. */
  51. editor: CodeEditor.IEditor | null;
  52. /**
  53. * The session used by the completer to make API requests.
  54. */
  55. session: IClientSession;
  56. }
  57. /**
  58. * An interface for completer-compatible objects.
  59. */
  60. export
  61. interface ICompletable extends ICompletableAttributes {
  62. /**
  63. * The parent of the completer; the completer resources dispose with parent.
  64. */
  65. readonly parent: Widget;
  66. }
  67. }