index.ts 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. // Copyright (c) Jupyter Development Team.
  2. // Distributed under the terms of the Modified BSD License.
  3. import { Kernel } from '@jupyterlab/services';
  4. import { Token } from '@phosphor/coreutils';
  5. import { Widget } from '@phosphor/widgets';
  6. import { CodeEditor } from '@jupyterlab/codeeditor';
  7. import { RenderMimeRegistry } from '@jupyterlab/rendermime';
  8. import '../style/index.css';
  9. export * from './widget';
  10. /* tslint:disable */
  11. /**
  12. * The tooltip manager token.
  13. */
  14. export const ITooltipManager = new Token<ITooltipManager>(
  15. '@jupyterlab/tooltip:ITooltipManager'
  16. );
  17. /* tslint:enable */
  18. /**
  19. * A manager to register tooltips with parent widgets.
  20. */
  21. export interface ITooltipManager {
  22. /**
  23. * Invoke a tooltip.
  24. */
  25. invoke(options: ITooltipManager.IOptions): void;
  26. }
  27. /**
  28. * A namespace for `ICompletionManager` interface specifications.
  29. */
  30. export namespace ITooltipManager {
  31. /**
  32. * An interface for tooltip-compatible objects.
  33. */
  34. export interface IOptions {
  35. /**
  36. * The referent anchor the tooltip follows.
  37. */
  38. readonly anchor: Widget;
  39. /**
  40. * The referent editor for the tooltip.
  41. */
  42. readonly editor: CodeEditor.IEditor;
  43. /**
  44. * The kernel the tooltip communicates with to populate itself.
  45. */
  46. readonly kernel: Kernel.IKernelConnection;
  47. /**
  48. * The renderer the tooltip uses to render API responses.
  49. */
  50. readonly rendermime: RenderMimeRegistry;
  51. }
  52. }