tokens.ts 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. // Copyright (c) Jupyter Development Team.
  2. // Distributed under the terms of the Modified BSD License.
  3. import { Token } from '@phosphor/coreutils';
  4. import { ISignal } from '@phosphor/signaling';
  5. import { Widget } from '@phosphor/widgets';
  6. /* tslint:disable */
  7. /**
  8. * The inspector panel token.
  9. */
  10. export const IInspector = new Token<IInspector>(
  11. '@jupyterlab/inspector:IInspector'
  12. );
  13. /* tslint:enable */
  14. /**
  15. * An interface for an inspector.
  16. */
  17. export interface IInspector {
  18. /**
  19. * The source of events the inspector listens for.
  20. */
  21. source: IInspector.IInspectable | null;
  22. }
  23. /**
  24. * A namespace for inspector interfaces.
  25. */
  26. export namespace IInspector {
  27. /**
  28. * The definition of an inspectable source.
  29. */
  30. export interface IInspectable {
  31. /**
  32. * A signal emitted when the inspector should clear all items.
  33. */
  34. cleared: ISignal<any, void>;
  35. /**
  36. * A signal emitted when the inspectable is disposed.
  37. */
  38. disposed: ISignal<any, void>;
  39. /**
  40. * A signal emitted when an inspector value is generated.
  41. */
  42. inspected: ISignal<any, IInspectorUpdate>;
  43. /**
  44. * Test whether the inspectable has been disposed.
  45. */
  46. isDisposed: boolean;
  47. /**
  48. * Indicates whether the inspectable source emits signals.
  49. *
  50. * #### Notes
  51. * The use case for this attribute is to limit the API traffic when no
  52. * inspector is visible. It can be modified by the consumer of the source.
  53. */
  54. standby: boolean;
  55. }
  56. /**
  57. * An update value for code inspectors.
  58. */
  59. export interface IInspectorUpdate {
  60. /**
  61. * The content being sent to the inspector for display.
  62. */
  63. content: Widget | null;
  64. }
  65. }