How to use the @lumino/coreutils.Token function in @lumino/coreutils

To help you get started, we’ve selected a few @lumino/coreutils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jupyterlab / jupyterlab / packages / inspector / src / tokens.ts View on Github external
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

import { Token } from '@lumino/coreutils';

import { ISignal } from '@lumino/signaling';

import { Widget } from '@lumino/widgets';

/* tslint:disable */
/**
 * The inspector panel token.
 */
export const IInspector = new Token(
  '@jupyterlab/inspector:IInspector'
);
/* tslint:enable */

/**
 * An interface for an inspector.
 */
export interface IInspector {
  /**
   * The source of events the inspector listens for.
   */
  source: IInspector.IInspectable | null;
}

/**
 * A namespace for inspector interfaces.
github jupyterlab / jupyterlab / packages / notebook / src / tokens.ts View on Github external
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

import { IWidgetTracker } from '@jupyterlab/apputils';
import { Cell } from '@jupyterlab/cells';
import { Token } from '@lumino/coreutils';
import { ISignal } from '@lumino/signaling';
import { Widget } from '@lumino/widgets';
import { NotebookPanel } from './panel';
import { NotebookTools } from './notebooktools';

/* tslint:disable */
/**
 * The notebook tools token.
 */
export const INotebookTools = new Token(
  '@jupyterlab/notebook:INotebookTools'
);
/* tslint:enable */

/**
 * The interface for notebook metadata tools.
 */
export interface INotebookTools extends Widget {
  activeNotebookPanel: NotebookPanel | null;
  activeCell: Cell | null;
  selectedCells: Cell[];
  addItem(options: NotebookTools.IAddOptions): void;
}

/**
 * The namespace for NotebookTools class statics.
github jupyterlab / jupyterlab / packages / coreutils / src / tokens.ts View on Github external
Token
} from '@lumino/coreutils';

import { IDisposable } from '@lumino/disposable';

import { ISignal } from '@lumino/signaling';

import { ISchemaValidator } from './settingregistry';

import { IDataConnector } from './interfaces';

/* tslint:disable */
/**
 * The setting registry token.
 */
export const ISettingRegistry = new Token(
  '@jupyterlab/coreutils:ISettingRegistry'
);
/* tslint:enable */

/**
 * The settings registry interface.
 */
export interface ISettingRegistry {
  /**
   * The data connector used by the setting registry.
   */
  readonly connector: IDataConnector;

  /**
   * The schema of the setting registry.
   */
github jupyterlab / jupyterlab / packages / application / src / mimerenderers.ts View on Github external
import { AttachedProperty } from '@lumino/properties';

import { JupyterFrontEnd, JupyterFrontEndPlugin } from './index';

import { ILayoutRestorer } from './layoutrestorer';

/**
 * A class that tracks mime documents.
 */
export interface IMimeDocumentTracker extends IWidgetTracker {}

/* tslint:disable */
/**
 * The mime document tracker token.
 */
export const IMimeDocumentTracker = new Token(
  '@jupyterlab/application:IMimeDocumentTracker'
);
/* tslint:enable */

/**
 * Create rendermime plugins for rendermime extension modules.
 */
export function createRendermimePlugins(
  extensions: IRenderMime.IExtensionModule[]
): JupyterFrontEndPlugin[] {
  const plugins: JupyterFrontEndPlugin[] = [];

  const namespace = 'application-mimedocuments';
  const tracker = new WidgetTracker({ namespace });

  extensions.forEach(mod => {
github jupyterlab / jupyterlab / packages / settingeditor / src / tokens.ts View on Github external
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

import { IWidgetTracker, MainAreaWidget } from '@jupyterlab/apputils';

import { Token } from '@lumino/coreutils';

import { SettingEditor } from './settingeditor';

/* tslint:disable */
/**
 * The setting editor tracker token.
 */
export const ISettingEditorTracker = new Token(
  '@jupyterlab/settingeditor:ISettingEditorTracker'
);
/* tslint:enable */

/**
 * A class that tracks the setting editor.
 */
export interface ISettingEditorTracker
  extends IWidgetTracker> {}
github jupyterlab / jupyterlab / packages / mainmenu / src / tokens.ts View on Github external
import { IKernelMenu } from './kernel';

import { IRunMenu } from './run';

import { ISettingsMenu } from './settings';

import { IViewMenu } from './view';

import { ITabsMenu } from './tabs';

/* tslint:disable */
/**
 * The main menu token.
 */
export const IMainMenu = new Token('@jupyterlab/mainmenu:IMainMenu');
/* tslint:enable */

/**
 * The main menu interface.
 */
export interface IMainMenu {
  /**
   * Add a new menu to the main menu bar.
   */
  addMenu(menu: Menu, options?: IMainMenu.IAddOptions): void;

  /**
   * The application "File" menu.
   */
  readonly fileMenu: IFileMenu;
github jupyterlab / jupyterlab / packages / filebrowser / src / tokens.ts View on Github external
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.

import { WidgetTracker } from '@jupyterlab/apputils';

import { IStateDB } from '@jupyterlab/coreutils';

import { Token } from '@lumino/coreutils';

import { FileBrowser } from './browser';

/* tslint:disable */
/**
 * The path tracker token.
 */
export const IFileBrowserFactory = new Token(
  '@jupyterlab/filebrowser:IFileBrowserFactory'
);
/* tslint:enable */

/**
 * The file browser factory interface.
 */
export interface IFileBrowserFactory {
  /**
   * Create a new file browser instance.
   *
   * @param id - The widget/DOM id of the file browser.
   *
   * @param options - The optional file browser configuration object.
   *
   * #### Notes
github jupyterlab / jupyterlab / packages / apputils / src / commandpalette.ts View on Github external
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/

import { Token } from '@lumino/coreutils';

import { IDisposable } from '@lumino/disposable';

import { CommandPalette } from '@lumino/widgets';

/* tslint:disable */
/**
 * The command palette token.
 */
export const ICommandPalette = new Token(
  '@jupyterlab/apputils:ICommandPalette'
);
/* tslint:enable */

/**
 * The options for creating a command palette item.
 */
export interface IPaletteItem extends CommandPalette.IItemOptions {}

/**
 * The interface for a Jupyter Lab command palette.
 */
export interface ICommandPalette {
  /**
   * The placeholder text of the command palette's search input.
   */
github jupyterlab / jupyterlab / packages / ui-components / src / icon / interfaces.ts View on Github external
icon(
    props: Icon.INodeOptions & { container: HTMLElement }
  ): HTMLElement | null;

  /**
   * Get the icon as a ReactElement of tag <svg><svg></svg>
   */
  iconReact(
    props: Icon.INodeOptions &amp; { tag?: 'div' | 'span' }
  ): React.ReactElement;
}

/**
 * The IIconRegistry token.
 */
export const IIconRegistry = new Token(
  '@jupyterlab/ui-components:IIconRegistry'
);

export namespace Icon {
  /**
   * A representation of the resources underlying an inline svg icon
   */
  export interface IModel {
    /**
     * The icon name. For a 'foo-bar.svg' file, the icon name is 'foo-bar'.
     */
    name: string;

    /**
     * Manually set the className corresponding to the icon name. By default,
     * the className is generated from the name: 'foo-bar' -&gt; 'jp-FooBarIcon'</svg>
github jupyterlab / jupyterlab / packages / htmlviewer / src / index.tsx View on Github external
import { Token } from '@lumino/coreutils';

import { ISignal, Signal } from '@lumino/signaling';

import * as React from 'react';

/**
 * A class that tracks HTML viewer widgets.
 */
export interface IHTMLViewerTracker extends IWidgetTracker {}

/**
 * The HTML viewer tracker token.
 */
export const IHTMLViewerTracker = new Token(
  '@jupyterlab/htmlviewer:IHTMLViewerTracker'
);
/**
 * The timeout to wait for change activity to have ceased before rendering.
 */
const RENDER_TIMEOUT = 1000;

/**
 * The CSS class to add to the HTMLViewer Widget.
 */
const CSS_CLASS = 'jp-HTMLViewer';

/**
 * A viewer widget for HTML documents.
 *
 * #### Notes