index.ts 1.9 KB

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