@jupyterlab/apputils

  • Version 3.4.2
  • Published
  • 569 kB
  • 23 dependencies
  • BSD-3-Clause license

Install

npm i @jupyterlab/apputils
yarn add @jupyterlab/apputils
pnpm add @jupyterlab/apputils

Overview

apputils

Index

Variables

Functions

Classes

Interfaces

Type Aliases

Namespaces

Variables

variable defaultSanitizer

const defaultSanitizer: ISanitizer;
  • The default instance of an ISanitizer meant for use by user code.

variable ICommandPalette

const ICommandPalette: Token<ICommandPalette>;
  • The command palette token.

variable ISanitizer

const ISanitizer: Token<ISanitizer>;
  • The sanitizer token.

variable ISessionContextDialogs

const ISessionContextDialogs: Token<ISessionContext.IDialogs>;
  • The session context dialogs token.

variable ISplashScreen

const ISplashScreen: Token<ISplashScreen>;
  • The main menu token.

variable IThemeManager

const IThemeManager: Token<IThemeManager>;
  • The theme manager token.

variable IToolbarWidgetRegistry

const IToolbarWidgetRegistry: Token<IToolbarWidgetRegistry>;
  • The toolbar registry token.

variable IWindowResolver

const IWindowResolver: Token<IWindowResolver>;
  • The default window resolver token.

variable sessionContextDialogs

const sessionContextDialogs: ISessionContext.IDialogs;
  • The default implementation of the client session dialog provider.

Functions

function addCommandToolbarButtonClass

addCommandToolbarButtonClass: (w: Widget) => Widget;

    function addToolbarButtonClass

    addToolbarButtonClass: (w: Widget) => Widget;
    • Adds the toolbar button class to the toolbar widget.

      Parameter w

      Toolbar button widget.

    function CommandToolbarButtonComponent

    CommandToolbarButtonComponent: (
    props: CommandToolbarButtonComponent.IProps
    ) => JSX.Element;
    • React component for a toolbar button that wraps a command.

      This wraps the ToolbarButtonComponent and watches the command registry for changes to the command.

    function createDefaultFactory

    createDefaultFactory: (
    commands: CommandRegistry
    ) => (
    widgetFactory: string,
    widget: Widget,
    toolbarItem: ToolbarRegistry.IWidget
    ) => Widget;
    • Create the default toolbar item widget factory

      Parameter commands

      Application commands registry

      Returns

      Default factory

    function createToolbarFactory

    createToolbarFactory: (
    toolbarRegistry: IToolbarWidgetRegistry,
    settingsRegistry: ISettingRegistry,
    factoryName: string,
    pluginId: string,
    translator: ITranslator,
    propertyId?: string
    ) => (widget: Widget) => IObservableList<ToolbarRegistry.IToolbarItem>;
    • Create the toolbar factory for a given container widget based on a data description stored in settings

      Parameter toolbarRegistry

      Toolbar widgets registry

      Parameter settingsRegistry

      Settings registry

      Parameter factoryName

      Toolbar container factory name

      Parameter pluginId

      Settings plugin id

      Parameter translator

      Translator

      Parameter propertyId

      Toolbar definition key in the settings plugin

      Returns

      List of toolbar widgets factory

    function FilenameSearcher

    FilenameSearcher: (props: IFilterBoxProps) => ReactWidget;
    • A widget which hosts a input textbox to filter on file names.

    function FilterBox

    FilterBox: (props: IFilterBoxProps) => JSX.Element;

      function setToolbar

      setToolbar: (
      widget: Toolbar.IWidgetToolbar,
      factory: (
      widget: Widget
      ) =>
      | IObservableList<ToolbarRegistry.IToolbarItem>
      | ToolbarRegistry.IToolbarItem[]
      ) => void;
      • Set the toolbar items of a widget from a factory

        Parameter widget

        Widget with the toolbar to set

        Parameter factory

        Toolbar items factory

      function showDialog

      showDialog: <T>(
      options?: Partial<Dialog.IOptions<T>>
      ) => Promise<Dialog.IResult<T>>;
      • Create and show a dialog.

        Parameter options

        The dialog setup options.

        Returns

        A promise that resolves with whether the dialog was accepted.

      function showErrorMessage

      showErrorMessage: (
      title: string,
      error: any,
      buttons?: ReadonlyArray<Dialog.IButton>
      ) => Promise<void>;
      • Show an error message dialog.

        Parameter title

        The title of the dialog box.

        Parameter error

        the error to show in the dialog body (either a string or an object with a string message property).

      function ToolbarButtonComponent

      ToolbarButtonComponent: (props: ToolbarButtonComponent.IProps) => JSX.Element;
      • React component for a toolbar button.

        Parameter props

        The props for ToolbarButtonComponent.

      function translateKernelStatuses

      translateKernelStatuses: (
      translator?: ITranslator
      ) => Record<ISessionContext.KernelDisplayStatus, string>;
      • Helper function to translate kernel statuses mapping by using input translator.

        Parameter translator

        - Language translator. The translated kernel status mapping.

      function updateFilterFunction

      updateFilterFunction: (
      value: string,
      useFuzzyFilter: boolean,
      caseSensitive?: boolean | undefined
      ) => (item: string) => boolean;

        Classes

        class Collapse

        class Collapse<T extends Widget = Widget> extends Widget {}
        • A panel that supports a collapsible header made from the widget's title. Clicking on the title expands or contracts the widget.

        constructor

        constructor(options: Collapse.IOptions<T>);

          property collapseChanged

          readonly collapseChanged: ISignal<Collapse<Widget>, void>;
          • A signal for when the widget collapse state changes.

          property collapsed

          collapsed: boolean;
          • The collapsed state of the panel.

          property widget

          widget: Widget;
          • The widget inside the collapse panel.

          method dispose

          dispose: () => void;
          • Dispose the widget.

          method handleEvent

          handleEvent: (event: Event) => void;
          • Handle the DOM events for the Collapse widget.

            Parameter event

            The DOM event sent to the panel.

            #### Notes This method implements the DOM EventListener interface and is called in response to events on the panel's DOM node. It should not be called directly by user code.

          method onAfterAttach

          protected onAfterAttach: (msg: Message) => void;

            method onBeforeDetach

            protected onBeforeDetach: (msg: Message) => void;

              method toggle

              toggle: () => void;
              • Toggle the collapse state of the panel.

              class CommandLinker

              class CommandLinker implements IDisposable {}
              • A static class that provides helper methods to generate clickable nodes that execute registered commands with pre-populated arguments.

              constructor

              constructor(options: CommandLinker.IOptions);
              • Instantiate a new command linker.

              property isDisposed

              readonly isDisposed: boolean;
              • Test whether the linker is disposed.

              method connectNode

              connectNode: (
              node: HTMLElement,
              command: string,
              args?: ReadonlyPartialJSONObject
              ) => HTMLElement;
              • Connect a command/argument pair to a given node so that when it is clicked, the command will execute.

                Parameter node

                The node being connected.

                Parameter command

                The command ID to execute upon click.

                Parameter args

                The arguments with which to invoke the command.

                Returns

                The same node that was passed in, after it has been connected.

                #### Notes Only click events will execute the command on a connected node. So, there are two considerations that are relevant: 1. If a node is connected, the default click action will be prevented. 2. The HTMLElement passed in should be clickable.

              method disconnectNode

              disconnectNode: (node: HTMLElement) => HTMLElement;
              • Disconnect a node that has been connected to execute a command on click.

                Parameter node

                The node being disconnected.

                Returns

                The same node that was passed in, after it has been disconnected.

                #### Notes This method is safe to call multiple times and is safe to call on nodes that were never connected.

                This method can be called on rendered virtual DOM nodes that were populated using the populateVNodeDataset method in order to disconnect them from executing their command/argument pair.

              method dispose

              dispose: () => void;
              • Dispose of the resources held by the linker.

              method handleEvent

              handleEvent: (event: Event) => void;
              • Handle the DOM events for the command linker helper class.

                Parameter event

                The DOM event sent to the class.

                #### Notes This method implements the DOM EventListener interface and is called in response to events on the panel's DOM node. It should not be called directly by user code.

              method populateVNodeDataset

              populateVNodeDataset: (
              command: string,
              args?: ReadonlyPartialJSONObject
              ) => ElementDataset;
              • Populate the dataset attribute within the collection of attributes used to instantiate a virtual DOM node with the values necessary for its rendered DOM node to respond to clicks by executing a command/argument pair.

                Parameter command

                The command ID to execute upon click.

                Parameter args

                The arguments with which to invoke the command.

                Returns

                A dataset collection for use within virtual node attributes.

                #### Notes The return value can be used on its own as the value for the dataset attribute of a virtual element, or it can be added to an existing dataset as in the example below.

                #### Example

                let command = 'some:command-id';
                let args = { alpha: 'beta' };
                let anchor = h.a({
                className: 'some-class',
                dataset: {
                foo: '1',
                bar: '2',
                ../...linker.populateVNodeDataset(command, args)
                }
                }, 'some text');

              class CommandToolbarButton

              class CommandToolbarButton extends ReactWidget {}
              • Phosphor Widget version of CommandToolbarButtonComponent.

              constructor

              constructor(props: CommandToolbarButtonComponent.IProps);
              • Creates a command toolbar button

                Parameter props

                props for underlying CommandToolbarButtonComponent component

              method render

              render: () => JSX.Element;

                class Dialog

                class Dialog<T> extends Widget {}
                • A modal dialog widget.

                constructor

                constructor(options?: Partial<Dialog.IOptions<T>>);
                • Create a dialog panel instance.

                  Parameter options

                  The dialog setup options.

                method dispose

                dispose: () => void;
                • Dispose of the resources used by the dialog.

                method handleEvent

                handleEvent: (event: Event) => void;
                • Handle the DOM events for the directory listing.

                  Parameter event

                  The DOM event sent to the widget.

                  #### Notes This method implements the DOM EventListener interface and is called in response to events on the panel's DOM node. It should not be called directly by user code.

                method launch

                launch: () => Promise<Dialog.IResult<T>>;
                • Launch the dialog as a modal window.

                  Returns

                  a promise that resolves with the result of the dialog.

                method onAfterAttach

                protected onAfterAttach: (msg: Message) => void;
                • A message handler invoked on an 'after-attach' message.

                method onAfterDetach

                protected onAfterDetach: (msg: Message) => void;
                • A message handler invoked on an 'after-detach' message.

                method onCloseRequest

                protected onCloseRequest: (msg: Message) => void;
                • A message handler invoked on a 'close-request' message.

                method reject

                reject: () => void;
                • Reject the current dialog with a default reject value.

                  #### Notes Will be a no-op if the dialog is not shown.

                method resolve

                resolve: (index?: number) => void;
                • Resolve the current dialog.

                  Parameter index

                  An optional index to the button to resolve.

                  #### Notes Will default to the defaultIndex. Will resolve the current show() with the button value. Will be a no-op if the dialog is not shown.

                class IFrame

                class IFrame extends Widget {}
                • A phosphor widget which wraps an IFrame.

                constructor

                constructor(options?: IFrame.IOptions);
                • Create a new IFrame widget.

                property referrerPolicy

                referrerPolicy: IFrame.ReferrerPolicy;
                • Referrer policy for the iframe.

                  #### Notes By default, no-referrer is chosen.

                  For more information, see https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/referrerPolicy

                property sandbox

                sandbox: IFrame.SandboxExceptions[];
                • Exceptions to the sandboxing.

                  #### Notes By default, all sandboxing security policies are enabled. This setting allows the user to selectively disable these policies. This should be done with care, as it can introduce security risks, and possibly allow malicious sites to execute code in a JupyterLab session.

                  For more information, see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe

                property url

                url: string;
                • The url of the IFrame.

                class MainAreaWidget

                class MainAreaWidget<T extends Widget = Widget>
                extends Widget
                implements Printing.IPrintable {}
                • A widget meant to be contained in the JupyterLab main area.

                  #### Notes Mirrors all of the title attributes of the content. This widget is closable by default. This widget is automatically disposed when closed. This widget ensures its own focus when activated.

                constructor

                constructor(options: MainAreaWidget.IOptions<T>);
                • Construct a new main area widget.

                  Parameter options

                  The options for initializing the widget.

                property content

                readonly content: Widget;
                • The content hosted by the widget.

                property contentHeader

                readonly contentHeader: BoxPanel;
                • A panel for widgets that sit between the toolbar and the content. Imagine a formatting toolbar, notification headers, etc.

                property isRevealed

                readonly isRevealed: boolean;
                • Whether the content widget or an error is revealed.

                property revealed

                readonly revealed: Promise<void>;
                • A promise that resolves when the widget is revealed.

                property toolbar

                readonly toolbar: Toolbar<Widget>;
                • The toolbar hosted by the widget.

                method [Printing.symbol]

                [Printing.symbol]: () => Printing.OptionalAsyncThunk;
                • Print method. Deferred to content.

                method onActivateRequest

                protected onActivateRequest: (msg: Message) => void;
                • Handle 'activate-request' messages.

                method onAfterAttach

                protected onAfterAttach: (msg: Message) => void;
                • Handle after-attach messages for the widget.

                method onBeforeDetach

                protected onBeforeDetach: (msg: Message) => void;
                • Handle before-detach messages for the widget.

                method onCloseRequest

                protected onCloseRequest: (msg: Message) => void;
                • Handle 'close-request' messages.

                method onUpdateRequest

                protected onUpdateRequest: (msg: Message) => void;
                • Handle 'update-request' messages by forwarding them to the content.

                class ModalCommandPalette

                class ModalCommandPalette extends Panel {}
                • Wrap the command palette in a modal to make it more usable.

                constructor

                constructor(options: ModalCommandPalette.IOptions);

                  property palette

                  palette: CommandPalette;

                    property searchIconGroup

                    readonly searchIconGroup: HTMLDivElement;
                    • Find the element with search icon group.

                    method attach

                    attach: () => void;

                      method createSearchIconGroup

                      protected createSearchIconGroup: () => HTMLDivElement;
                      • Create element with search icon group.

                      method detach

                      detach: () => void;

                        method handleEvent

                        handleEvent: (event: Event) => void;
                        • Handle incoming events.

                        method hideAndReset

                        hideAndReset: () => void;
                        • Hide the modal command palette and reset its search.

                        method onActivateRequest

                        protected onActivateRequest: (msg: Message) => void;
                        • A message handler invoked on an 'activate-request' message.

                        method onAfterAttach

                        protected onAfterAttach: (msg: Message) => void;
                        • A message handler invoked on an 'after-attach' message.

                        method onAfterDetach

                        protected onAfterDetach: (msg: Message) => void;
                        • A message handler invoked on an 'after-detach' message.

                        method onAfterShow

                        protected onAfterShow: (msg: Message) => void;

                          method onBeforeHide

                          protected onBeforeHide: (msg: Message) => void;

                            class ReactiveToolbar

                            class ReactiveToolbar extends Toolbar<Widget> {}
                            • A class which provides a toolbar widget.

                            constructor

                            constructor();
                            • Construct a new toolbar widget.

                            property popupOpener

                            protected readonly popupOpener: ToolbarPopupOpener;

                              method dispose

                              dispose: () => void;
                              • Dispose of the widget and its descendant widgets.

                              method insertAfter

                              insertAfter: (at: string, name: string, widget: Widget) => boolean;
                              • Insert an item into the toolbar at the after a target item.

                                Parameter at

                                The target item to insert after.

                                Parameter name

                                The name of the item.

                                Parameter widget

                                The widget to add.

                                Returns

                                Whether the item was added to the toolbar. Returns false if an item of the same name is already in the toolbar or if the target is the toolbar pop-up opener.

                                #### Notes The index will be clamped to the bounds of the items. The item can be removed from the toolbar by setting its parent to null.

                              method insertItem

                              insertItem: (index: number, name: string, widget: Widget) => boolean;
                              • Insert an item into the toolbar at the specified index.

                                Parameter index

                                The index at which to insert the item.

                                Parameter name

                                The name of the item.

                                Parameter widget

                                The widget to add.

                                Returns

                                Whether the item was added to the toolbar. Returns false if an item of the same name is already in the toolbar.

                                #### Notes The index will be clamped to the bounds of the items. The item can be removed from the toolbar by setting its parent to null.

                              method onBeforeHide

                              onBeforeHide: (msg: Message) => void;
                              • A message handler invoked on a 'before-hide' message.

                                It will hide the pop-up panel

                              method onResize

                              protected onResize: (msg: Widget.ResizeMessage) => void;

                                class ReactWidget

                                abstract class ReactWidget extends Widget {}
                                • An abstract class for a Phosphor widget which renders a React component.

                                property renderPromise

                                renderPromise?: Promise<void>;

                                  method create

                                  static create: (element: ReactRenderElement) => ReactWidget;
                                  • Creates a new ReactWidget that renders a constant element.

                                    Parameter element

                                    React element to render.

                                  method onAfterAttach

                                  protected onAfterAttach: (msg: Message) => void;
                                  • Called after the widget is attached to the DOM

                                  method onBeforeDetach

                                  protected onBeforeDetach: (msg: Message) => void;
                                  • Called before the widget is detached from the DOM.

                                  method onUpdateRequest

                                  protected onUpdateRequest: (msg: Message) => void;
                                  • Called to update the state of the widget.

                                    The default implementation of this method triggers VDOM based rendering by calling the renderDOM method.

                                  method render

                                  protected abstract render: () => ReactRenderElement | null;
                                  • Render the content of this widget using the virtual DOM.

                                    This method will be called anytime the widget needs to be rendered, which includes layout triggered rendering.

                                    Subclasses should define this method and return the root React nodes here.

                                  class Sanitizer

                                  class Sanitizer implements ISanitizer {}
                                  • A class to sanitize HTML strings.

                                  method sanitize

                                  sanitize: (dirty: string, options?: ISanitizer.IOptions) => string;
                                  • Sanitize an HTML string.

                                    Parameter dirty

                                    The dirty text.

                                    Parameter options

                                    The optional sanitization options.

                                    Returns

                                    The sanitized string.

                                  class SessionContext

                                  class SessionContext implements ISessionContext {}
                                  • The default implementation for a session context object.

                                  constructor

                                  constructor(options: SessionContext.IOptions);
                                  • Construct a new session context.

                                  property connectionStatusChanged

                                  readonly connectionStatusChanged: ISignal<this, Kernel.ConnectionStatus>;
                                  • A signal emitted when the kernel status changes, proxied from the kernel.

                                  property disposed

                                  readonly disposed: ISignal<this, void>;
                                  • A signal emitted when the poll is disposed.

                                  property hasNoKernel

                                  readonly hasNoKernel: boolean;
                                  • Whether the kernel is "No Kernel" or not.

                                    #### Notes As the displayed name is translated, this can be used directly.

                                  property iopubMessage

                                  readonly iopubMessage: ISignal<this, KernelMessage.IIOPubMessage>;
                                  • A signal emitted for iopub kernel messages, proxied from the kernel.

                                  property isDisposed

                                  readonly isDisposed: boolean;
                                  • Test whether the context is disposed.

                                  property isReady

                                  readonly isReady: boolean;
                                  • Whether the context is ready.

                                  property isRestarting

                                  readonly isRestarting: boolean;
                                  • Whether the context is restarting.

                                  property isTerminating

                                  readonly isTerminating: boolean;
                                  • Whether the context is terminating.

                                  property kernelChanged

                                  readonly kernelChanged: ISignal<
                                  this,
                                  Session.ISessionConnection.IKernelChangedArgs
                                  >;
                                  • A signal emitted when the kernel connection changes, proxied from the session connection.

                                  property kernelDisplayName

                                  readonly kernelDisplayName: string;
                                  • The display name of the current kernel, or a sensible alternative.

                                    #### Notes This is a convenience function to have a consistent sensible name for the kernel.

                                  property kernelDisplayStatus

                                  readonly kernelDisplayStatus: any;
                                  • A sensible status to display

                                    #### Notes This combines the status and connection status into a single status for the user.

                                  property kernelPreference

                                  kernelPreference: ISessionContext.IKernelPreference;
                                  • The kernel preference of this client session.

                                    This is used when selecting a new kernel, and should reflect the sort of kernel the activity prefers.

                                  property name

                                  readonly name: string;
                                  • The session name.

                                    #### Notes Typically .session.name should be used. This attribute is useful if there is no current session.

                                  property noKernelName

                                  readonly noKernelName: string;
                                  • Get the constant displayed name for "No Kernel"

                                  property path

                                  readonly path: string;
                                  • The session path.

                                    #### Notes Typically .session.path should be used. This attribute is useful if there is no current session.

                                  property pendingInput

                                  readonly pendingInput: boolean;
                                  • A flag indicating if the session has ending input, proxied from the kernel.

                                  property prevKernelName

                                  readonly prevKernelName: string;
                                  • The name of the previously started kernel.

                                  property propertyChanged

                                  readonly propertyChanged: ISignal<this, 'path' | 'name' | 'type'>;
                                  • A signal emitted when a session property changes, proxied from the current session.

                                  property ready

                                  readonly ready: Promise<void>;
                                  • A promise that is fulfilled when the context is ready.

                                  property session

                                  readonly session: any;
                                  • The current session connection.

                                  property sessionChanged

                                  readonly sessionChanged: ISignal<this, IChangedArgs<any, any, 'session'>>;
                                  • A signal emitted when the session connection changes.

                                  property sessionManager

                                  readonly sessionManager: Session.IManager;
                                  • The session manager used by the session.

                                  property specsManager

                                  readonly specsManager: KernelSpec.IManager;
                                  • The kernel spec manager

                                  property statusChanged

                                  readonly statusChanged: ISignal<this, Kernel.Status>;
                                  • A signal emitted when the kernel status changes, proxied from the kernel.

                                  property type

                                  readonly type: string;
                                  • The session type.

                                    #### Notes Typically .session.type should be used. This attribute is useful if there is no current session.

                                  property unhandledMessage

                                  readonly unhandledMessage: ISignal<this, KernelMessage.IMessage>;
                                  • A signal emitted for an unhandled kernel message, proxied from the kernel.

                                  method changeKernel

                                  changeKernel: (
                                  options?: Kernel.IModel
                                  ) => Promise<Kernel.IKernelConnection | null>;
                                  • Change the current kernel associated with the session.

                                  method dispose

                                  dispose: () => void;
                                  • Dispose of the resources held by the context.

                                  method initialize

                                  initialize: () => Promise<boolean>;
                                  • Initialize the session context

                                    Returns

                                    A promise that resolves with whether to ask the user to select a kernel.

                                    #### Notes If a server session exists on the current path, we will connect to it. If preferences include disabling canStart or shouldStart, no server session will be started. If a kernel id is given, we attempt to start a session with that id. If a default kernel is available, we connect to it. Otherwise we ask the user to select a kernel.

                                  method restartKernel

                                  restartKernel: () => Promise<void>;
                                  • Restart the current Kernel.

                                    Returns

                                    A promise that resolves when the kernel is restarted.

                                  method shutdown

                                  shutdown: () => Promise<void>;
                                  • Kill the kernel and shutdown the session.

                                    Returns

                                    A promise that resolves when the session is shut down.

                                  class Spinner

                                  class Spinner extends Widget {}
                                  • The spinner class.

                                  constructor

                                  constructor();
                                  • Construct a spinner widget.

                                  method onActivateRequest

                                  protected onActivateRequest: (msg: Message) => void;
                                  • Handle 'activate-request' messages.

                                  class ThemeManager

                                  class ThemeManager implements IThemeManager {}
                                  • A class that provides theme management.

                                  constructor

                                  constructor(options: ThemeManager.IOptions);
                                  • Construct a new theme manager.

                                  property theme

                                  readonly theme: string;
                                  • Get the name of the current theme.

                                  property themeChanged

                                  readonly themeChanged: ISignal<this, IChangedArgs<string, string>>;
                                  • A signal fired when the application theme changes.

                                  property themes

                                  readonly themes: readonly string[];
                                  • The names of the registered themes.

                                  property translator

                                  protected translator: ITranslator;

                                    method decrFontSize

                                    decrFontSize: (key: string) => Promise<void>;
                                    • Decrease a font size w.r.t. its current setting or its value in the current theme.

                                      Parameter key

                                      A Jupyterlab font size CSS variable, without the leading '--jp-'.

                                    method getCSS

                                    getCSS: (key: string) => string;
                                    • Get the value of a CSS variable from its key.

                                      Parameter key

                                      A Jupyterlab CSS variable, without the leading '--jp-'.

                                      value - The current value of the Jupyterlab CSS variable

                                    method getDisplayName

                                    getDisplayName: (name: string) => string;
                                    • Get the display name of the theme.

                                    method incrFontSize

                                    incrFontSize: (key: string) => Promise<void>;
                                    • Increase a font size w.r.t. its current setting or its value in the current theme.

                                      Parameter key

                                      A Jupyterlab font size CSS variable, without the leading '--jp-'.

                                    method isLight

                                    isLight: (name: string) => boolean;
                                    • Test whether a given theme is light.

                                    method isToggledThemeScrollbars

                                    isToggledThemeScrollbars: () => boolean;
                                    • Test if the user has scrollbar styling enabled.

                                    method loadCSS

                                    loadCSS: (path: string) => Promise<void>;
                                    • Load a theme CSS file by path.

                                      Parameter path

                                      The path of the file to load.

                                    method loadCSSOverrides

                                    loadCSSOverrides: () => void;
                                    • Loads all current CSS overrides from settings. If an override has been removed or is invalid, this function unloads it instead.

                                    method register

                                    register: (theme: IThemeManager.ITheme) => IDisposable;
                                    • Register a theme with the theme manager.

                                      Parameter theme

                                      The theme to register.

                                      Returns

                                      A disposable that can be used to unregister the theme.

                                    method setCSSOverride

                                    setCSSOverride: (key: string, value: string) => Promise<void>;
                                    • Add a CSS override to the settings.

                                    method setTheme

                                    setTheme: (name: string) => Promise<void>;
                                    • Set the current theme.

                                    method themeScrollbars

                                    themeScrollbars: (name: string) => boolean;
                                    • Test whether a given theme styles scrollbars, and if the user has scrollbar styling enabled.

                                    method toggleThemeScrollbars

                                    toggleThemeScrollbars: () => Promise<void>;
                                    • Toggle the theme-scrollbars setting.

                                    method validateCSS

                                    validateCSS: (key: string, val: string) => boolean;
                                    • Validate a CSS value w.r.t. a key

                                      Parameter key

                                      A Jupyterlab CSS variable, without the leading '--jp-'.

                                      Parameter val

                                      A candidate CSS value

                                    class Toolbar

                                    class Toolbar<T extends Widget = Widget> extends Widget {}
                                    • A class which provides a toolbar widget.

                                    constructor

                                    constructor(options?: Toolbar.IOptions);
                                    • Construct a new toolbar widget.

                                    method addItem

                                    addItem: (name: string, widget: T) => boolean;
                                    • Add an item to the end of the toolbar.

                                      Parameter name

                                      The name of the widget to add to the toolbar.

                                      Parameter widget

                                      The widget to add to the toolbar.

                                      Parameter index

                                      The optional name of the item to insert after.

                                      Returns

                                      Whether the item was added to toolbar. Returns false if an item of the same name is already in the toolbar.

                                      #### Notes The item can be removed from the toolbar by setting its parent to null.

                                    method handleClick

                                    protected handleClick: (event: Event) => void;
                                    • Handle a DOM click event.

                                    method handleEvent

                                    handleEvent: (event: Event) => void;
                                    • Handle the DOM events for the widget.

                                      Parameter event

                                      The DOM event sent to the widget.

                                      #### Notes This method implements the DOM EventListener interface and is called in response to events on the dock panel's node. It should not be called directly by user code.

                                    method insertAfter

                                    insertAfter: (at: string, name: string, widget: T) => boolean;
                                    • Insert an item into the toolbar at the after a target item.

                                      Parameter at

                                      The target item to insert after.

                                      Parameter name

                                      The name of the item.

                                      Parameter widget

                                      The widget to add.

                                      Returns

                                      Whether the item was added to the toolbar. Returns false if an item of the same name is already in the toolbar.

                                      #### Notes The index will be clamped to the bounds of the items. The item can be removed from the toolbar by setting its parent to null.

                                    method insertBefore

                                    insertBefore: (at: string, name: string, widget: T) => boolean;
                                    • Insert an item into the toolbar at the before a target item.

                                      Parameter at

                                      The target item to insert before.

                                      Parameter name

                                      The name of the item.

                                      Parameter widget

                                      The widget to add.

                                      Returns

                                      Whether the item was added to the toolbar. Returns false if an item of the same name is already in the toolbar.

                                      #### Notes The index will be clamped to the bounds of the items. The item can be removed from the toolbar by setting its parent to null.

                                    method insertItem

                                    insertItem: (index: number, name: string, widget: T) => boolean;
                                    • Insert an item into the toolbar at the specified index.

                                      Parameter index

                                      The index at which to insert the item.

                                      Parameter name

                                      The name of the item.

                                      Parameter widget

                                      The widget to add.

                                      Returns

                                      Whether the item was added to the toolbar. Returns false if an item of the same name is already in the toolbar.

                                      #### Notes The index will be clamped to the bounds of the items. The item can be removed from the toolbar by setting its parent to null.

                                    method names

                                    names: () => IIterator<string>;
                                    • Get an iterator over the ordered toolbar item names.

                                      Returns

                                      An iterator over the toolbar item names.

                                    method onAfterAttach

                                    protected onAfterAttach: (msg: Message) => void;
                                    • Handle after-attach messages for the widget.

                                    method onBeforeDetach

                                    protected onBeforeDetach: (msg: Message) => void;
                                    • Handle before-detach messages for the widget.

                                    class ToolbarButton

                                    class ToolbarButton extends ReactWidget {}
                                    • Phosphor Widget version of static ToolbarButtonComponent.

                                    constructor

                                    constructor(props?: ToolbarButtonComponent.IProps);
                                    • Creates a toolbar button

                                      Parameter props

                                      props for underlying ToolbarButton component

                                    property enabled

                                    enabled: boolean;
                                    • Returns true if button is enabled, false otherwise

                                    property onClick

                                    onClick: () => void;
                                    • Returns the click handler for the button

                                    property pressed

                                    pressed: boolean;
                                    • Returns true if button is pressed, false otherwise

                                    method render

                                    render: () => JSX.Element;

                                      class ToolbarWidgetRegistry

                                      class ToolbarWidgetRegistry implements IToolbarWidgetRegistry {}
                                      • Concrete implementation of IToolbarWidgetRegistry interface

                                      constructor

                                      constructor(options: ToolbarRegistry.IOptions);

                                        property defaultFactory

                                        defaultFactory: (
                                        widgetFactory: string,
                                        widget: Widget,
                                        toolbarItem: ToolbarRegistry.IWidget
                                        ) => Widget;
                                        • Default toolbar item factory

                                        method createWidget

                                        createWidget: (
                                        widgetFactory: string,
                                        widget: Widget,
                                        toolbarItem: ToolbarRegistry.IWidget
                                        ) => Widget;
                                        • Create a toolbar item widget

                                          Parameter widgetFactory

                                          The widget factory name that creates the toolbar

                                          Parameter widget

                                          The newly widget containing the toolbar

                                          Parameter toolbarItem

                                          The toolbar item definition

                                          Returns

                                          The widget to be inserted in the toolbar.

                                        method registerFactory

                                        registerFactory: <T extends Widget = Widget>(
                                        widgetFactory: string,
                                        toolbarItemName: string,
                                        factory: (main: T) => Widget
                                        ) => (main: T) => Widget;
                                        • Register a new toolbar item factory

                                          Parameter widgetFactory

                                          The widget factory name that creates the toolbar

                                          Parameter toolbarItemName

                                          The unique toolbar item

                                          Parameter factory

                                          The factory function that receives the widget containing the toolbar and returns the toolbar widget.

                                          Returns

                                          The previously defined factory

                                        class UseSignal

                                        class UseSignal<SENDER, ARGS> extends React.Component<
                                        IUseSignalProps<SENDER, ARGS>,
                                        IUseSignalState<SENDER, ARGS>
                                        > {}
                                        • UseSignal provides a way to hook up a Phosphor signal to a React element, so that the element is re-rendered every time the signal fires.

                                          It is implemented through the "render props" technique, using the children prop as a function to render, so that it can be used either as a prop or as a child of this element https://reactjs.org/docs/render-props.html

                                          Example as child:

                                          function LiveButton(isActiveSignal: ISignal<any, boolean>) {
                                          return (
                                          <UseSignal signal={isActiveSignal} initialArgs={True}>
                                          {(_, isActive) => <Button isActive={isActive}>}
                                          </UseSignal>
                                          )
                                          }

                                          Example as prop:

                                          function LiveButton(isActiveSignal: ISignal<any, boolean>) {
                                          return (
                                          <UseSignal
                                          signal={isActiveSignal}
                                          initialArgs={True}
                                          children={(_, isActive) => <Button isActive={isActive}>}
                                          />
                                          )
                                          }

                                        constructor

                                        constructor(props: IUseSignalProps<SENDER, ARGS>);

                                          method componentDidMount

                                          componentDidMount: () => void;

                                            method componentWillUnmount

                                            componentWillUnmount: () => void;

                                              method render

                                              render: () => React.ReactNode;

                                                class VDomModel

                                                class VDomModel implements VDomRenderer.IModel {}
                                                • Concrete implementation of VDomRenderer model.

                                                property isDisposed

                                                readonly isDisposed: boolean;
                                                • Test whether the model is disposed.

                                                property stateChanged

                                                readonly stateChanged: Signal<this, void>;
                                                • A signal emitted when any model state changes.

                                                method dispose

                                                dispose: () => void;
                                                • Dispose the model.

                                                class VDomRenderer

                                                abstract class VDomRenderer<
                                                T extends VDomRenderer.IModel | null = null
                                                > extends ReactWidget {}
                                                • An abstract ReactWidget with a model.

                                                constructor

                                                constructor(model: VDomRenderer.IModel);
                                                • Create a new VDomRenderer

                                                property model

                                                model: VDomRenderer.IModel;
                                                • Get the current model.

                                                property modelChanged

                                                readonly modelChanged: ISignal<this, void>;
                                                • A signal emitted when the model changes.

                                                method dispose

                                                dispose: () => void;
                                                • Dispose this widget.

                                                class WidgetTracker

                                                class WidgetTracker<T extends Widget = Widget>
                                                implements IWidgetTracker<T>, IRestorable<T> {}
                                                • A class that keeps track of widget instances on an Application shell.

                                                constructor

                                                constructor(options: WidgetTracker.IOptions);
                                                • Create a new widget tracker.

                                                  Parameter options

                                                  The instantiation options for a widget tracker.

                                                property currentChanged

                                                readonly currentChanged: ISignal<this, T>;
                                                • A signal emitted when the current widget changes.

                                                property currentWidget

                                                readonly currentWidget: Widget;
                                                • The current widget is the most recently focused or added widget.

                                                  #### Notes It is the most recently focused widget, or the most recently added widget if no widget has taken focus.

                                                property isDisposed

                                                readonly isDisposed: boolean;
                                                • Test whether the tracker is disposed.

                                                property namespace

                                                readonly namespace: string;
                                                • A namespace for all tracked widgets, (e.g., notebook).

                                                property restored

                                                readonly restored: Promise<void>;
                                                • A promise resolved when the tracker has been restored.

                                                property size

                                                readonly size: number;
                                                • The number of widgets held by the tracker.

                                                property widgetAdded

                                                readonly widgetAdded: ISignal<this, T>;
                                                • A signal emitted when a widget is added.

                                                  #### Notes This signal will only fire when a widget is added to the tracker. It will not fire if a widget is injected into the tracker.

                                                property widgetUpdated

                                                readonly widgetUpdated: ISignal<this, T>;
                                                • A signal emitted when a widget is updated.

                                                method add

                                                add: (widget: T) => Promise<void>;
                                                • Add a new widget to the tracker.

                                                  Parameter widget

                                                  The widget being added.

                                                  #### Notes The widget passed into the tracker is added synchronously; its existence in the tracker can be checked with the has() method. The promise this method returns resolves after the widget has been added and saved to an underlying restoration connector, if one is available.

                                                  The newly added widget becomes the current widget unless the focus tracker already had a focused widget.

                                                method dispose

                                                dispose: () => void;
                                                • Dispose of the resources held by the tracker.

                                                method filter

                                                filter: (fn: (widget: T) => boolean) => T[];
                                                • Filter the widgets in the tracker based on a predicate.

                                                  Parameter fn

                                                  The function by which to filter.

                                                method find

                                                find: (fn: (widget: T) => boolean) => T | undefined;
                                                • Find the first widget in the tracker that satisfies a filter function.

                                                  Parameter

                                                  - fn The filter function to call on each widget.

                                                  #### Notes If no widget is found, the value returned is undefined.

                                                method forEach

                                                forEach: (fn: (widget: T) => void) => void;
                                                • Iterate through each widget in the tracker.

                                                  Parameter fn

                                                  The function to call on each widget.

                                                method has

                                                has: (widget: Widget) => boolean;
                                                • Check if this tracker has the specified widget.

                                                  Parameter widget

                                                  The widget whose existence is being checked.

                                                method inject

                                                inject: (widget: T) => Promise<void>;
                                                • Inject a foreign widget into the widget tracker.

                                                  Parameter widget

                                                  The widget to inject into the tracker.

                                                  #### Notes Injected widgets will not have their state saved by the tracker.

                                                  The primary use case for widget injection is for a plugin that offers a sub-class of an extant plugin to have its instances share the same commands as the parent plugin (since most relevant commands will use the currentWidget of the parent plugin's widget tracker). In this situation, the sub-class plugin may well have its own widget tracker for layout and state restoration in addition to injecting its widgets into the parent plugin's widget tracker.

                                                method onCurrentChanged

                                                protected onCurrentChanged: (value: T | null) => void;
                                                • Handle the current change event.

                                                  #### Notes The default implementation is a no-op.

                                                method restore

                                                restore: (options: IRestorable.IOptions<T>) => Promise<any>;
                                                • Restore the widgets in this tracker's namespace.

                                                  Parameter options

                                                  The configuration options that describe restoration.

                                                  Returns

                                                  A promise that resolves when restoration has completed.

                                                  #### Notes This function should not typically be invoked by client code. Its primary use case is to be invoked by a restorer.

                                                method save

                                                save: (widget: T) => Promise<void>;
                                                • Save the restore data for a given widget.

                                                  Parameter widget

                                                  The widget being saved.

                                                class WindowResolver

                                                class WindowResolver implements IWindowResolver {}
                                                • A concrete implementation of a window name resolver.

                                                property name

                                                readonly name: string;
                                                • The resolved window name.

                                                  #### Notes If the resolve promise has not resolved, the behavior is undefined.

                                                method resolve

                                                resolve: (candidate: string) => Promise<void>;
                                                • Resolve a window name to use as a handle among shared resources.

                                                  Parameter candidate

                                                  The potential window name being resolved.

                                                  #### Notes Typically, the name candidate should be a JupyterLab workspace name or an empty string if there is no workspace.

                                                  If the returned promise rejects, a window name cannot be resolved without user intervention, which typically means navigation to a new URL.

                                                Interfaces

                                                interface ICommandPalette

                                                interface ICommandPalette {}
                                                • The interface for a Jupyter Lab command palette.

                                                property placeholder

                                                placeholder: string;
                                                • The placeholder text of the command palette's search input.

                                                method activate

                                                activate: () => void;
                                                • Activate the command palette for user input.

                                                method addItem

                                                addItem: (options: IPaletteItem) => IDisposable;
                                                • Add a command item to the command palette.

                                                  Parameter options

                                                  The options for creating the command item.

                                                  Returns

                                                  A disposable that will remove the item from the palette.

                                                interface IFilterBoxProps

                                                interface IFilterBoxProps {}
                                                • The class name added to the filebrowser crumbs node.

                                                property caseSensitive

                                                caseSensitive?: boolean;
                                                • Whether to use case-sensitive search

                                                property forceRefresh

                                                forceRefresh?: boolean;
                                                • Whether to force a refresh.

                                                property initialQuery

                                                initialQuery?: string;
                                                • An optional initial search value.

                                                property placeholder

                                                placeholder?: string;
                                                • Optional placeholder for the search box.

                                                property updateFilter

                                                updateFilter: (filterFn: (item: string) => boolean, query?: string) => void;
                                                • A function to callback when filter is updated.

                                                property useFuzzyFilter

                                                useFuzzyFilter: boolean;
                                                • Whether to use the fuzzy filter.

                                                interface IPaletteItem

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

                                                interface ISanitizer

                                                interface ISanitizer {}

                                                  method sanitize

                                                  sanitize: (dirty: string, options?: ISanitizer.IOptions) => string;
                                                  • Sanitize an HTML string.

                                                    Parameter dirty

                                                    The dirty text.

                                                    Parameter options

                                                    The optional sanitization options.

                                                    Returns

                                                    The sanitized string.

                                                  interface ISessionContext

                                                  interface ISessionContext extends IObservableDisposable {}
                                                  • A context object to manage a widget's kernel session connection.

                                                    #### Notes The current session connection is .session, the current session's kernel connection is .session.kernel. For convenience, we proxy several kernel connection and session connection signals up to the session context so that you do not have to manage slots as sessions and kernels change. For example, to act on whatever the current kernel's iopubMessage signal is producing, connect to the session context .iopubMessage signal.

                                                  property connectionStatusChanged

                                                  readonly connectionStatusChanged: ISignal<this, Kernel.ConnectionStatus>;
                                                  • A signal emitted when the kernel connection status changes, proxied from the session connection.

                                                  property hasNoKernel

                                                  readonly hasNoKernel: boolean;
                                                  • Whether the kernel is "No Kernel" or not.

                                                    #### Notes As the displayed name is translated, this can be used directly.

                                                  property iopubMessage

                                                  readonly iopubMessage: ISignal<this, KernelMessage.IMessage>;
                                                  • A signal emitted for a kernel messages, proxied from the session connection.

                                                  property isReady

                                                  readonly isReady: boolean;
                                                  • Whether the session context is ready.

                                                  property isRestarting

                                                  readonly isRestarting: boolean;
                                                  • Whether the session context is restarting.

                                                  property isTerminating

                                                  readonly isTerminating: boolean;
                                                  • Whether the session context is terminating.

                                                  property kernelChanged

                                                  readonly kernelChanged: ISignal<
                                                  this,
                                                  IChangedArgs<
                                                  Kernel.IKernelConnection | null,
                                                  Kernel.IKernelConnection | null,
                                                  'kernel'
                                                  >
                                                  >;
                                                  • A signal emitted when the kernel changes, proxied from the session connection.

                                                  property kernelDisplayName

                                                  readonly kernelDisplayName: string;
                                                  • The sensible display name for the kernel, or translated "No Kernel"

                                                    #### Notes This is at this level since the underlying kernel connection does not have access to the kernel spec manager.

                                                  property kernelDisplayStatus

                                                  readonly kernelDisplayStatus: ISessionContext.KernelDisplayStatus;
                                                  • A sensible status to display

                                                    #### Notes This combines the status and connection status into a single status for the user.

                                                  property kernelPreference

                                                  kernelPreference: ISessionContext.IKernelPreference;
                                                  • The kernel preference for starting new kernels.

                                                  property name

                                                  readonly name: string;
                                                  • The session name.

                                                    #### Notes Typically .session.name should be used. This attribute is useful if there is no current session.

                                                  property path

                                                  readonly path: string;
                                                  • The session path.

                                                    #### Notes Typically .session.path should be used. This attribute is useful if there is no current session.

                                                  property pendingInput

                                                  readonly pendingInput: boolean;
                                                  • A flag indicating if session is has pending input, proxied from the session connection.

                                                  property prevKernelName

                                                  readonly prevKernelName: string;
                                                  • The previous kernel name.

                                                  property propertyChanged

                                                  readonly propertyChanged: ISignal<this, 'path' | 'name' | 'type'>;
                                                  • A signal emitted when a session property changes, proxied from the session connection.

                                                  property ready

                                                  readonly ready: Promise<void>;
                                                  • A promise that is fulfilled when the session context is ready.

                                                  property session

                                                  session: Session.ISessionConnection | null;
                                                  • The current session connection.

                                                  property sessionChanged

                                                  readonly sessionChanged: ISignal<
                                                  this,
                                                  IChangedArgs<
                                                  Session.ISessionConnection | null,
                                                  Session.ISessionConnection | null,
                                                  'session'
                                                  >
                                                  >;
                                                  • A signal emitted when the session connection changes.

                                                  property sessionManager

                                                  readonly sessionManager: Session.IManager;
                                                  • The session manager used by the session.

                                                  property specsManager

                                                  readonly specsManager: KernelSpec.IManager;
                                                  • The kernel spec manager

                                                  property statusChanged

                                                  readonly statusChanged: ISignal<this, Kernel.Status>;
                                                  • A signal emitted when the kernel status changes, proxied from the session connection.

                                                  property type

                                                  readonly type: string;
                                                  • The session type.

                                                    #### Notes Typically .session.type should be used. This attribute is useful if there is no current session.

                                                  property unhandledMessage

                                                  readonly unhandledMessage: ISignal<this, KernelMessage.IMessage>;
                                                  • A signal emitted for an unhandled kernel message, proxied from the session connection.

                                                  method changeKernel

                                                  changeKernel: (
                                                  options?: Kernel.IModel
                                                  ) => Promise<Kernel.IKernelConnection | null>;
                                                  • Change the kernel associated with the session.

                                                    Parameter options

                                                    The optional kernel model parameters to use for the new kernel.

                                                    Returns

                                                    A promise that resolves with the new kernel connection.

                                                  method initialize

                                                  initialize: () => Promise<boolean>;
                                                  • Initialize the session context.

                                                    Returns

                                                    A promise that resolves with whether to ask the user to select a kernel.

                                                    #### Notes This includes starting up an initial kernel if needed.

                                                  method restartKernel

                                                  restartKernel: () => Promise<void>;
                                                  • Restart the current Kernel.

                                                    Returns

                                                    A promise that resolves when the kernel is restarted.

                                                  method shutdown

                                                  shutdown: () => Promise<void>;
                                                  • Kill the kernel and shutdown the session.

                                                    Returns

                                                    A promise that resolves when the session is shut down.

                                                  interface ISessionContextDialogs

                                                  interface ISessionContextDialogs extends ISessionContext.IDialogs {}
                                                  • An interface for the session context dialogs.

                                                  interface ISplashScreen

                                                  interface ISplashScreen {}
                                                  • The interface for an application splash screen.

                                                  method show

                                                  show: (light?: boolean) => IDisposable;
                                                  • Show the application splash screen.

                                                    Parameter light

                                                    Whether to show the light splash screen or the dark one.

                                                    Returns

                                                    A disposable used to clear the splash screen.

                                                  interface IThemeManager

                                                  interface IThemeManager {}
                                                  • An interface for a theme manager.

                                                  property theme

                                                  readonly theme: string | null;
                                                  • Get the name of the current theme.

                                                  property themeChanged

                                                  readonly themeChanged: ISignal<this, IChangedArgs<string, string | null>>;
                                                  • A signal fired when the application theme changes.

                                                  property themes

                                                  readonly themes: ReadonlyArray<string>;
                                                  • The names of the registered themes.

                                                  method getDisplayName

                                                  getDisplayName: (name: string) => string;
                                                  • Get display name for theme.

                                                  method isLight

                                                  isLight: (name: string) => boolean;
                                                  • Test whether a given theme is light.

                                                  method loadCSS

                                                  loadCSS: (path: string) => Promise<void>;
                                                  • Load a theme CSS file by path.

                                                    Parameter path

                                                    The path of the file to load.

                                                  method register

                                                  register: (theme: IThemeManager.ITheme) => IDisposable;
                                                  • Register a theme with the theme manager.

                                                    Parameter theme

                                                    The theme to register.

                                                    Returns

                                                    A disposable that can be used to unregister the theme.

                                                  method setTheme

                                                  setTheme: (name: string) => Promise<void>;
                                                  • Set the current theme.

                                                  method themeScrollbars

                                                  themeScrollbars: (name: string) => boolean;
                                                  • Test whether a given theme styles scrollbars, and if the user has scrollbar styling enabled.

                                                  interface IToolbarWidgetRegistry

                                                  interface IToolbarWidgetRegistry {}
                                                  • Toolbar widget registry interface

                                                  property defaultFactory

                                                  defaultFactory: (
                                                  widgetFactory: string,
                                                  widget: Widget,
                                                  toolbarItem: ToolbarRegistry.IWidget
                                                  ) => Widget;
                                                  • Default toolbar item factory

                                                  method createWidget

                                                  createWidget: (
                                                  widgetFactory: string,
                                                  widget: Widget,
                                                  toolbarItem: ToolbarRegistry.IWidget
                                                  ) => Widget;
                                                  • Create a toolbar item widget

                                                    Parameter widgetFactory

                                                    The widget factory name that creates the toolbar

                                                    Parameter widget

                                                    The newly widget containing the toolbar

                                                    Parameter toolbarItem

                                                    The toolbar item definition

                                                    Returns

                                                    The widget to be inserted in the toolbar.

                                                  method registerFactory

                                                  registerFactory: <T extends Widget = Widget>(
                                                  widgetFactory: string,
                                                  toolbarItemName: string,
                                                  factory: (main: T) => Widget
                                                  ) => (main: T) => Widget;
                                                  • Register a new toolbar item factory

                                                    Parameter widgetFactory

                                                    The widget factory name that creates the toolbar

                                                    Parameter toolbarItemName

                                                    The unique toolbar item

                                                    Parameter factory

                                                    The factory function that receives the widget containing the toolbar and returns the toolbar widget.

                                                    Returns

                                                    The previously defined factory

                                                  interface IUseSignalProps

                                                  interface IUseSignalProps<SENDER, ARGS> {}
                                                  • Props for the UseSignal component

                                                  property children

                                                  children: (sender?: SENDER, args?: ARGS) => React.ReactNode;
                                                  • Function mapping the last signal value or initial values to an element to render.

                                                    Note: returns React.ReactNode as per https://github.com/sw-yx/react-typescript-cheatsheet#higher-order-componentsrender-props

                                                  property initialArgs

                                                  initialArgs?: ARGS;
                                                  • Initial value to use for the args, used before the signal emits a value. If not provided, initial args will be undefined.

                                                  property initialSender

                                                  initialSender?: SENDER;
                                                  • Initial value to use for the sender, used before the signal emits a value. If not provided, initial sender will be undefined

                                                  property shouldUpdate

                                                  shouldUpdate?: (sender: SENDER, args: ARGS) => boolean;
                                                  • Given the last signal value, should return whether to update the state or not.

                                                    The default unconditionally returns true, so you only have to override if you want to skip some updates.

                                                  property signal

                                                  signal: ISignal<SENDER, ARGS>;
                                                  • Phosphor signal to connect to.

                                                  interface IUseSignalState

                                                  interface IUseSignalState<SENDER, ARGS> {}
                                                  • State for the UseSignal component

                                                  property value

                                                  value: [SENDER?, ARGS?];

                                                    interface IWidgetTracker

                                                    interface IWidgetTracker<T extends Widget = Widget> extends IDisposable {}
                                                    • A tracker that tracks widgets.

                                                    property currentChanged

                                                    readonly currentChanged: ISignal<this, T | null>;
                                                    • A signal emitted when the current instance changes.

                                                      #### Notes If the last instance being tracked is disposed, null will be emitted.

                                                    property currentWidget

                                                    readonly currentWidget: T | null;
                                                    • The current widget is the most recently focused or added widget.

                                                      #### Notes It is the most recently focused widget, or the most recently added widget if no widget has taken focus.

                                                    property restored

                                                    readonly restored: Promise<void>;
                                                    • A promise that is resolved when the widget tracker has been restored from a serialized state.

                                                      #### Notes Most client code will not need to use this, since they can wait for the whole application to restore. However, if an extension wants to perform actions during the application restoration, but after the restoration of another widget tracker, they can use this promise.

                                                    property size

                                                    readonly size: number;
                                                    • The number of instances held by the tracker.

                                                    property widgetAdded

                                                    readonly widgetAdded: ISignal<this, T>;
                                                    • A signal emitted when a widget is added.

                                                    property widgetUpdated

                                                    readonly widgetUpdated: ISignal<this, T>;
                                                    • A signal emitted when a widget is updated.

                                                    method filter

                                                    filter: (fn: (obj: T) => boolean) => T[];
                                                    • Filter the instances in the tracker based on a predicate.

                                                      Parameter fn

                                                      The function by which to filter.

                                                    method find

                                                    find: (fn: (obj: T) => boolean) => T | undefined;
                                                    • Find the first instance in the tracker that satisfies a filter function.

                                                      Parameter

                                                      - fn The filter function to call on each instance.

                                                      #### Notes If nothing is found, the value returned is undefined.

                                                    method forEach

                                                    forEach: (fn: (obj: T) => void) => void;
                                                    • Iterate through each instance in the tracker.

                                                      Parameter fn

                                                      The function to call on each instance.

                                                    method has

                                                    has: (obj: Widget) => boolean;
                                                    • Check if this tracker has the specified instance.

                                                      Parameter obj

                                                      The object whose existence is being checked.

                                                    method inject

                                                    inject: (obj: T) => void;
                                                    • Inject an instance into the widget tracker without the tracker handling its restoration lifecycle.

                                                      Parameter obj

                                                      The instance to inject into the tracker.

                                                    interface IWindowResolver

                                                    interface IWindowResolver {}
                                                    • The description of a window name resolver.

                                                    property name

                                                    readonly name: string;
                                                    • A window name to use as a handle among shared resources.

                                                    Type Aliases

                                                    type ClipboardData

                                                    type ClipboardData = string | MimeData;

                                                      Namespaces

                                                      namespace Clipboard

                                                      namespace Clipboard {}
                                                      • The clipboard interface.

                                                      function copyToSystem

                                                      copyToSystem: (clipboardData: ClipboardData) => void;
                                                      • Copy text to the system clipboard.

                                                        #### Notes This can only be called in response to a user input event.

                                                      function generateEvent

                                                      generateEvent: (node: HTMLElement, type?: 'copy' | 'cut') => void;
                                                      • Generate a clipboard event on a node.

                                                        Parameter node

                                                        The element on which to generate the event.

                                                        Parameter type

                                                        The type of event to generate. 'paste' events cannot be programmatically generated.

                                                        #### Notes This can only be called in response to a user input event.

                                                      function getInstance

                                                      getInstance: () => MimeData;
                                                      • Get the application clipboard instance.

                                                      function setInstance

                                                      setInstance: (value: MimeData) => void;
                                                      • Set the application clipboard instance.

                                                      namespace Collapse

                                                      namespace Collapse {}

                                                        interface IOptions

                                                        interface IOptions<T extends Widget = Widget> extends Widget.IOptions {}

                                                          property collapsed

                                                          collapsed?: boolean;

                                                            property widget

                                                            widget: T;

                                                              namespace CommandLinker

                                                              namespace CommandLinker {}
                                                              • A namespace for command linker statics.

                                                              interface IOptions

                                                              interface IOptions {}
                                                              • The instantiation options for a command linker.

                                                              property commands

                                                              commands: CommandRegistry;
                                                              • The command registry instance that all linked commands will use.

                                                              namespace CommandToolbarButtonComponent

                                                              namespace CommandToolbarButtonComponent {}
                                                              • Namespace for CommandToolbarButtonComponent.

                                                              interface IProps

                                                              interface IProps {}
                                                              • Interface for CommandToolbarButtonComponent props.

                                                              property args

                                                              args?: ReadonlyJSONObject;
                                                              • Command arguments

                                                              property commands

                                                              commands: CommandRegistry;
                                                              • Application commands registry

                                                              property icon

                                                              icon?: LabIcon;
                                                              • Overrides command icon

                                                              property id

                                                              id: string;
                                                              • Command unique id

                                                              property label

                                                              label?: string;
                                                              • Overrides command label

                                                              namespace Dialog

                                                              namespace Dialog {}
                                                              • The namespace for Dialog class statics.

                                                              variable defaultRenderer

                                                              const defaultRenderer: Renderer;
                                                              • The default renderer instance.

                                                              variable tracker

                                                              const tracker: WidgetTracker<Dialog<any>>;
                                                              • The dialog widget tracker.

                                                              function cancelButton

                                                              cancelButton: (options?: Partial<IButton>) => Readonly<IButton>;
                                                              • Create a reject button.

                                                              function createButton

                                                              createButton: (value: Partial<IButton>) => Readonly<IButton>;
                                                              • Create a button item.

                                                              function flush

                                                              flush: () => void;
                                                              • Disposes all dialog instances.

                                                                #### Notes This function should only be used in tests or cases where application state may be discarded.

                                                              function okButton

                                                              okButton: (options?: Partial<IButton>) => Readonly<IButton>;
                                                              • Create an accept button.

                                                              function warnButton

                                                              warnButton: (options?: Partial<IButton>) => Readonly<IButton>;
                                                              • Create a warn button.

                                                              class Renderer

                                                              class Renderer {}
                                                              • The default implementation of a dialog renderer.

                                                              method createBody

                                                              createBody: (value: Body<any>) => Widget;
                                                              • Create the body of the dialog.

                                                                Parameter value

                                                                The input value for the body.

                                                                Returns

                                                                A widget for the body.

                                                              method createButtonNode

                                                              createButtonNode: (button: IButton) => HTMLElement;
                                                              • Create a button node for the dialog.

                                                                Parameter button

                                                                The button data.

                                                                Returns

                                                                A node for the button.

                                                              method createFooter

                                                              createFooter: (buttons: ReadonlyArray<HTMLElement>) => Widget;
                                                              • Create the footer of the dialog.

                                                                Parameter buttonNodes

                                                                The buttons nodes to add to the footer.

                                                                Returns

                                                                A widget for the footer.

                                                              method createHeader

                                                              createHeader: <T>(
                                                              title: Header,
                                                              reject?: () => void,
                                                              options?: Partial<Dialog.IOptions<T>>
                                                              ) => Widget;
                                                              • Create the header of the dialog.

                                                                Parameter title

                                                                The title of the dialog.

                                                                Returns

                                                                A widget for the dialog header.

                                                              method createIconClass

                                                              createIconClass: (data: IButton) => string;
                                                              • Create the class name for the button icon.

                                                                Parameter data

                                                                The data to use for the class name.

                                                                Returns

                                                                The full class name for the item icon.

                                                              method createItemClass

                                                              createItemClass: (data: IButton) => string;
                                                              • Create the class name for the button.

                                                                Parameter data

                                                                The data to use for the class name.

                                                                Returns

                                                                The full class name for the button.

                                                              method renderIcon

                                                              renderIcon: (data: IButton) => HTMLElement;
                                                              • Render an icon element for a dialog item.

                                                                Parameter data

                                                                The data to use for rendering the icon.

                                                                Returns

                                                                An HTML element representing the icon.

                                                              method renderLabel

                                                              renderLabel: (data: IButton) => HTMLElement;
                                                              • Render the label element for a button.

                                                                Parameter data

                                                                The data to use for rendering the label.

                                                                Returns

                                                                An HTML element representing the item label.

                                                              interface IBodyWidget

                                                              interface IBodyWidget<T = string> extends Widget {}
                                                              • A widget used as a dialog body.

                                                              method getValue

                                                              getValue: () => T;
                                                              • Get the serialized value of the widget.

                                                              interface IButton

                                                              interface IButton {}
                                                              • The options used to make a button item.

                                                              property accept

                                                              accept: boolean;
                                                              • The dialog action to perform when the button is clicked.

                                                              property actions

                                                              actions: Array<string>;
                                                              • The additional dialog actions to perform when the button is clicked.

                                                              property caption

                                                              caption: string;
                                                              • The caption for the button.

                                                              property className

                                                              className: string;
                                                              • The extra class name for the button.

                                                              property displayType

                                                              displayType: 'default' | 'warn';
                                                              • The button display type.

                                                              property iconClass

                                                              iconClass: string;
                                                              • The icon class for the button.

                                                              property iconLabel

                                                              iconLabel: string;
                                                              • The icon label for the button.

                                                              property label

                                                              label: string;
                                                              • The label for the button.

                                                              interface IOptions

                                                              interface IOptions<T> {}
                                                              • The options used to create a dialog.

                                                              property body

                                                              body: Body<T>;
                                                              • The main body element for the dialog or a message to display. Defaults to an empty string.

                                                                #### Notes If a widget is given as the body, it will be disposed after the dialog is resolved. If the widget has a getValue() method, the method will be called prior to disposal and the value will be provided as part of the dialog result. A string argument will be used as raw textContent. All input and select nodes will be wrapped and styled.

                                                              property buttons

                                                              buttons: ReadonlyArray<IButton>;
                                                              • The buttons to display. Defaults to cancel and accept buttons.

                                                              property defaultButton

                                                              defaultButton: number;
                                                              • The index of the default button. Defaults to the last button.

                                                              property focusNodeSelector

                                                              focusNodeSelector: string;
                                                              • A selector for the primary element that should take focus in the dialog. Defaults to an empty string, causing the [[defaultButton]] to take focus.

                                                              property hasClose

                                                              hasClose: boolean;
                                                              • When "false", disallows user from dismissing the dialog by clicking outside it or pressing escape. Defaults to "true", which renders a close button.

                                                              property host

                                                              host: HTMLElement;
                                                              • The host element for the dialog. Defaults to document.body.

                                                              property renderer

                                                              renderer: IRenderer;
                                                              • An optional renderer for dialog items. Defaults to a shared default renderer.

                                                              property title

                                                              title: Header;
                                                              • The top level text for the dialog. Defaults to an empty string.

                                                              interface IRenderer

                                                              interface IRenderer {}
                                                              • A dialog renderer.

                                                              method createBody

                                                              createBody: (body: Body<any>) => Widget;
                                                              • Create the body of the dialog.

                                                                Parameter value

                                                                The input value for the body.

                                                                Returns

                                                                A widget for the body.

                                                              method createButtonNode

                                                              createButtonNode: (button: IButton) => HTMLElement;
                                                              • Create a button node for the dialog.

                                                                Parameter button

                                                                The button data.

                                                                Returns

                                                                A node for the button.

                                                              method createFooter

                                                              createFooter: (buttons: ReadonlyArray<HTMLElement>) => Widget;
                                                              • Create the footer of the dialog.

                                                                Parameter buttons

                                                                The button nodes to add to the footer.

                                                                Returns

                                                                A widget for the footer.

                                                              method createHeader

                                                              createHeader: <T>(
                                                              title: Header,
                                                              reject: () => void,
                                                              options: Partial<Dialog.IOptions<T>>
                                                              ) => Widget;
                                                              • Create the header of the dialog.

                                                                Parameter title

                                                                The title of the dialog.

                                                                Returns

                                                                A widget for the dialog header.

                                                              interface IResult

                                                              interface IResult<T> {}
                                                              • The result of a dialog.

                                                              property button

                                                              button: IButton;
                                                              • The button that was pressed.

                                                              property value

                                                              value: T | null;
                                                              • The value retrieved from .getValue() if given on the widget.

                                                              type Body

                                                              type Body<T> = IBodyWidget<T> | React.ReactElement<any> | string;
                                                              • The body input types.

                                                              type Header

                                                              type Header = React.ReactElement<any> | string;
                                                              • The header input types.

                                                              namespace DOMUtils

                                                              namespace DOMUtils {}
                                                              • The namespace for DOM utilities.

                                                              function createDomID

                                                              createDomID: () => string;
                                                              • Create a DOM id with prefix "id-" to solve bug for UUIDs beginning with numbers.

                                                              function findElement

                                                              findElement: (parent: HTMLElement, className: string) => HTMLElement;
                                                              • Find the first element matching a class name.

                                                              function findElements

                                                              findElements: (
                                                              parent: HTMLElement,
                                                              className: string
                                                              ) => HTMLCollectionOf<HTMLElement>;
                                                              • Find the first element matching a class name.

                                                              function hitTestNodes

                                                              hitTestNodes: (
                                                              nodes: HTMLElement[] | HTMLCollection,
                                                              x: number,
                                                              y: number
                                                              ) => number;
                                                              • Get the index of the node at a client position, or -1.

                                                              namespace HoverBox

                                                              namespace HoverBox {}
                                                              • A namespace for HoverBox members.

                                                              function setGeometry

                                                              setGeometry: (options: IOptions) => void;
                                                              • Set the visible dimensions of a hovering box anchored to an editor cursor.

                                                                Parameter options

                                                                The hover box geometry calculation options.

                                                              interface IOptions

                                                              interface IOptions {}
                                                              • Options for setting the geometry of a hovering node and its anchor node.

                                                              property anchor

                                                              anchor: ClientRect;
                                                              • The referent anchor rectangle to which the hover box is bound.

                                                                #### Notes In an editor context, this value will typically be the cursor's coordinate position, which can be retrieved via calling the getCoordinateForPosition method.

                                                              property host

                                                              host: HTMLElement;
                                                              • The node that hosts the anchor.

                                                                #### Notes The visibility of the anchor rectangle within this host node is the heuristic that determines whether the hover box ought to be visible.

                                                              property maxHeight

                                                              maxHeight: number;
                                                              • The maximum height of a hover box.

                                                                #### Notes This value is only used if a CSS max-height attribute is not set for the hover box. It is a fallback value.

                                                              property minHeight

                                                              minHeight: number;
                                                              • The minimum height of a hover box.

                                                              property node

                                                              node: HTMLElement;
                                                              • The hover box node.

                                                              property offset

                                                              offset?: {
                                                              horizontal?: number;
                                                              vertical?: {
                                                              above?: number;
                                                              below?: number;
                                                              };
                                                              };
                                                              • Optional pixel offset values added to where the hover box should render.

                                                                #### Notes This option is useful for passing in values that may pertain to CSS borders or padding in cases where the text inside the hover box may need to align with the text of the referent editor.

                                                                Because the hover box calculation may render a box either above or below the cursor, the vertical offset accepts above and below values for the different render modes.

                                                              property privilege

                                                              privilege?: 'above' | 'below' | 'forceAbove' | 'forceBelow';
                                                              • If space is available both above and below the anchor, denote which location is privileged. Use forceBelow and forceAbove to mandate where hover box should render relative to anchor.

                                                                #### Notes The default value is 'below'.

                                                              property style

                                                              style?: CSSStyleDeclaration;
                                                              • If the style of the node has already been computed, it can be passed into the hover box for geometry calculation.

                                                              namespace IFrame

                                                              namespace IFrame {}
                                                              • A namespace for IFrame widget statics.

                                                              interface IOptions

                                                              interface IOptions {}
                                                              • Options for creating a new IFrame widget.

                                                              property referrerPolicy

                                                              referrerPolicy?: ReferrerPolicy;
                                                              • Referrer policy for the iframe.

                                                              property sandbox

                                                              sandbox?: SandboxExceptions[];
                                                              • Exceptions for the iframe sandbox.

                                                              type ReferrerPolicy

                                                              type ReferrerPolicy =
                                                              | 'no-referrer'
                                                              | 'no-referrer-when-downgrade'
                                                              | 'origin'
                                                              | 'origin-when-cross-origin'
                                                              | 'same-origin'
                                                              | 'strict-origin'
                                                              | 'strict-origin-when-cross-origin'
                                                              | 'unsafe-url';
                                                              • Referrer policy for the iframe.

                                                                User documentation for the policies can be found here: https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/referrerPolicy

                                                              type SandboxExceptions

                                                              type SandboxExceptions =
                                                              | 'allow-downloads'
                                                              | 'allow-forms'
                                                              | 'allow-modals'
                                                              | 'allow-orientation-lock'
                                                              | 'allow-pointer-lock'
                                                              | 'allow-popups'
                                                              | 'popups-to-escape-sandbox'
                                                              | 'allow-presentation'
                                                              | 'allow-same-origin'
                                                              | 'allow-scripts'
                                                              | 'allow-storage-access-by-user-activation'
                                                              | 'allow-top-navigation'
                                                              | 'allow-top-navigation-by-user-activation';
                                                              • Exceptions to the iframe sandboxing policies. These are specified here: https://www.w3.org/TR/2011/WD-html5-20110525/the-iframe-element.html#attr-iframe-sandbox

                                                                More user-friendly documentation can be found here: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#sandbox

                                                              namespace InputDialog

                                                              namespace InputDialog {}
                                                              • Namespace for input dialogs

                                                              function getBoolean

                                                              getBoolean: (options: IBooleanOptions) => Promise<Dialog.IResult<boolean>>;
                                                              • Create and show a input dialog for a boolean.

                                                                Parameter options

                                                                The dialog setup options.

                                                                Returns

                                                                A promise that resolves with whether the dialog was accepted

                                                              function getItem

                                                              getItem: (options: IItemOptions) => Promise<Dialog.IResult<string>>;
                                                              • Create and show a input dialog for a choice.

                                                                Parameter options

                                                                The dialog setup options.

                                                                Returns

                                                                A promise that resolves with whether the dialog was accepted

                                                              function getNumber

                                                              getNumber: (options: INumberOptions) => Promise<Dialog.IResult<number>>;
                                                              • Create and show a input dialog for a number.

                                                                Parameter options

                                                                The dialog setup options.

                                                                Returns

                                                                A promise that resolves with whether the dialog was accepted

                                                              function getPassword

                                                              getPassword: (options: ITextOptions) => Promise<Dialog.IResult<string>>;
                                                              • Create and show a input dialog for a password.

                                                                Parameter options

                                                                The dialog setup options.

                                                                Returns

                                                                A promise that resolves with whether the dialog was accepted

                                                              function getText

                                                              getText: (options: ITextOptions) => Promise<Dialog.IResult<string>>;
                                                              • Create and show a input dialog for a text.

                                                                Parameter options

                                                                The dialog setup options.

                                                                Returns

                                                                A promise that resolves with whether the dialog was accepted

                                                              interface IBooleanOptions

                                                              interface IBooleanOptions extends IOptions {}
                                                              • Constructor options for boolean input dialogs

                                                              property value

                                                              value?: boolean;
                                                              • Default value

                                                              interface IItemOptions

                                                              interface IItemOptions extends IOptions {}
                                                              • Constructor options for item selection input dialogs

                                                              property current

                                                              current?: number | string;
                                                              • Default choice

                                                                If the list is editable a string with a default value can be provided otherwise the index of the default choice should be given.

                                                              property editable

                                                              editable?: boolean;
                                                              • Is the item editable?

                                                              property items

                                                              items: Array<string>;
                                                              • List of choices

                                                              property placeholder

                                                              placeholder?: string;
                                                              • Placeholder text for editable input

                                                              interface INumberOptions

                                                              interface INumberOptions extends IOptions {}
                                                              • Constructor options for number input dialogs

                                                              property value

                                                              value?: number;
                                                              • Default value

                                                              interface IOptions

                                                              interface IOptions {}
                                                              • Common constructor options for input dialogs

                                                              property cancelLabel

                                                              cancelLabel?: string;
                                                              • Label for cancel button.

                                                              property host

                                                              host?: HTMLElement;
                                                              • The host element for the dialog. Defaults to document.body.

                                                              property label

                                                              label?: string;
                                                              • Label of the requested input

                                                              property okLabel

                                                              okLabel?: string;
                                                              • Label for ok button.

                                                              property renderer

                                                              renderer?: Dialog.IRenderer;
                                                              • An optional renderer for dialog items. Defaults to a shared default renderer.

                                                              property title

                                                              title: Dialog.Header;
                                                              • The top level text for the dialog. Defaults to an empty string.

                                                              interface ITextOptions

                                                              interface ITextOptions extends IOptions {}
                                                              • Constructor options for text input dialogs

                                                              property placeholder

                                                              placeholder?: string;
                                                              • Placeholder text

                                                              property text

                                                              text?: string;
                                                              • Default input text

                                                              namespace ISanitizer

                                                              namespace ISanitizer {}
                                                              • The namespace for ISanitizer related interfaces.

                                                              interface IOptions

                                                              interface IOptions {}
                                                              • The options used to sanitize.

                                                              property allowedAttributes

                                                              allowedAttributes?: {
                                                              [key: string]: string[];
                                                              };
                                                              • The allowed attributes for a given tag.

                                                              property allowedStyles

                                                              allowedStyles?: {
                                                              [key: string]: {
                                                              [key: string]: RegExp[];
                                                              };
                                                              };
                                                              • The allowed style values for a given tag.

                                                              property allowedTags

                                                              allowedTags?: string[];
                                                              • The allowed tags.

                                                              namespace ISessionContext

                                                              namespace ISessionContext {}
                                                              • The namespace for session context related interfaces.

                                                              interface IDialogs

                                                              interface IDialogs {}
                                                              • An interface for a session context dialog provider.

                                                              method restart

                                                              restart: (
                                                              session: ISessionContext,
                                                              translator?: ITranslator
                                                              ) => Promise<boolean>;
                                                              • Restart the session context.

                                                                Returns

                                                                A promise that resolves with whether the kernel has restarted.

                                                                #### Notes If there is a running kernel, present a dialog. If there is no kernel, we start a kernel with the last run kernel name and resolves with true. If no kernel has been started, this is a no-op, and resolves with false.

                                                              method selectKernel

                                                              selectKernel: (
                                                              session: ISessionContext,
                                                              translator?: ITranslator
                                                              ) => Promise<void>;
                                                              • Select a kernel for the session.

                                                              interface IKernelPreference

                                                              interface IKernelPreference {}
                                                              • A kernel preference.

                                                                #### Notes Preferences for a kernel are considered in the order id, name, language. If no matching kernels can be found and autoStartDefault is true, then the default kernel for the server is preferred.

                                                              property autoStartDefault

                                                              readonly autoStartDefault?: boolean;
                                                              • Automatically start the default kernel if no other matching kernel is found (default true).

                                                              property canStart

                                                              readonly canStart?: boolean;
                                                              • A kernel can be started (default true).

                                                              property id

                                                              readonly id?: string;
                                                              • The id of an existing kernel.

                                                              property language

                                                              readonly language?: string;
                                                              • The preferred kernel language.

                                                              property name

                                                              readonly name?: string;
                                                              • The name of the kernel.

                                                              property shouldStart

                                                              readonly shouldStart?: boolean;
                                                              • A kernel should be started automatically (default true).

                                                              property shutdownOnDispose

                                                              readonly shutdownOnDispose?: boolean;
                                                              • Shut down the session when session context is disposed (default false).

                                                              type KernelDisplayStatus

                                                              type KernelDisplayStatus =
                                                              | Kernel.Status
                                                              | Kernel.ConnectionStatus
                                                              | 'initializing'
                                                              | '';

                                                                namespace IThemeManager

                                                                namespace IThemeManager {}
                                                                • A namespace for the IThemeManager sub-types.

                                                                interface ITheme

                                                                interface ITheme {}
                                                                • An interface for a theme.

                                                                property displayName

                                                                displayName?: string;
                                                                • The display name of the theme.

                                                                property isLight

                                                                isLight: boolean;
                                                                • Whether the theme is light or dark. Downstream authors of extensions can use this information to customize their UI depending upon the current theme.

                                                                property name

                                                                name: string;
                                                                • The unique identifier name of the theme.

                                                                property themeScrollbars

                                                                themeScrollbars?: boolean;
                                                                • Whether the theme includes styling for the scrollbar. If set to false, this theme will leave the native scrollbar untouched.

                                                                method load

                                                                load: () => Promise<void>;
                                                                • Load the theme.

                                                                  Returns

                                                                  A promise that resolves when the theme has loaded.

                                                                method unload

                                                                unload: () => Promise<void>;
                                                                • Unload the theme.

                                                                  Returns

                                                                  A promise that resolves when the theme has unloaded.

                                                                namespace MainAreaWidget

                                                                namespace MainAreaWidget {}
                                                                • The namespace for the MainAreaWidget class statics.

                                                                interface IOptions

                                                                interface IOptions<T extends Widget = Widget> extends Widget.IOptions {}
                                                                • An options object for creating a main area widget.

                                                                property content

                                                                content: T;
                                                                • The child widget to wrap.

                                                                property contentHeader

                                                                contentHeader?: BoxPanel;
                                                                • The layout to sit underneath the toolbar and above the content, and that extensions can populate. Defaults to an empty BoxPanel.

                                                                property reveal

                                                                reveal?: Promise<any>;
                                                                • An optional promise for when the content is ready to be revealed.

                                                                property toolbar

                                                                toolbar?: Toolbar;
                                                                • The toolbar to use for the widget. Defaults to an empty toolbar.

                                                                property translator

                                                                translator?: ITranslator;
                                                                • The application language translator.

                                                                interface IOptionsOptionalContent

                                                                interface IOptionsOptionalContent<T extends Widget = Widget>
                                                                extends Widget.IOptions {}
                                                                • An options object for main area widget subclasses providing their own default content.

                                                                  #### Notes This makes it easier to have a subclass that provides its own default content. This can go away once we upgrade to TypeScript 2.8 and have an easy way to make a single property optional, ala https://stackoverflow.com/a/46941824

                                                                property content

                                                                content?: T;
                                                                • The child widget to wrap.

                                                                property reveal

                                                                reveal?: Promise<any>;
                                                                • An optional promise for when the content is ready to be revealed.

                                                                property toolbar

                                                                toolbar?: Toolbar;
                                                                • The toolbar to use for the widget. Defaults to an empty toolbar.

                                                                namespace MenuFactory {}
                                                                • Helper functions to build a menu from the settings

                                                                addContextItem: (
                                                                item: ISettingRegistry.IContextMenuItem,
                                                                menu: ContextMenu,
                                                                menuFactory: (options: IMenuOptions) => Menu
                                                                ) => void;
                                                                • Convert an item description in a context menu item object

                                                                  Parameter item

                                                                  Context menu item

                                                                  Parameter menu

                                                                  Context menu to populate

                                                                  Parameter menuFactory

                                                                  Empty menu factory

                                                                createMenus: (
                                                                data: ISettingRegistry.IMenu[],
                                                                menuFactory: (options: IMenuOptions) => Menu
                                                                ) => Menu[];
                                                                • Create menus from their description

                                                                  Parameter data

                                                                  Menubar description

                                                                  Parameter menuFactory

                                                                  Factory for empty menu

                                                                updateMenus: (
                                                                menus: Menu[],
                                                                data: ISettingRegistry.IMenu[],
                                                                menuFactory: (options: IMenuOptions) => Menu
                                                                ) => Menu[];
                                                                • Update an existing list of menu and returns the new elements.

                                                                  #### Note New elements are added to the current menu list.

                                                                  Parameter menus

                                                                  Current menus

                                                                  Parameter data

                                                                  New description to take into account

                                                                  Parameter menuFactory

                                                                  Empty menu factory

                                                                  Returns

                                                                  Newly created menus

                                                                interface IMenuOptions {}
                                                                • Menu constructor options

                                                                id: string;
                                                                • The unique menu identifier.

                                                                label?: string;
                                                                • The menu label.

                                                                rank?: number;
                                                                • The menu rank.

                                                                namespace ModalCommandPalette

                                                                namespace ModalCommandPalette {}

                                                                  interface IOptions

                                                                  interface IOptions {}

                                                                    property commandPalette

                                                                    commandPalette: CommandPalette;

                                                                      namespace Printing

                                                                      namespace Printing {}
                                                                      • Any object is "printable" if it implements the IPrintable interface.

                                                                        To do this it, it must have a method called Printing.symbol which returns either a function to print the object or null if it cannot be printed.

                                                                        One way of printing is to use the printWidget function, which creates a hidden iframe and copies the DOM nodes from your widget to that iframe and printing just that iframe.

                                                                        Another way to print is to use the printURL function, which takes a URL and prints that page.

                                                                      variable symbol

                                                                      const symbol: Symbol;
                                                                      • Symbol to use for a method that returns a function to print an object.

                                                                      function getPrintFunction

                                                                      getPrintFunction: (val: unknown) => OptionalAsyncThunk;
                                                                      • Returns the print function for an object, or null if it does not provide a handler.

                                                                      function isPrintable

                                                                      isPrintable: (a: unknown) => a is IPrintable;
                                                                      • Returns whether an object implements a print method.

                                                                      function printURL

                                                                      printURL: (url: string) => Promise<void>;
                                                                      • Prints a URL by loading it into an iframe.

                                                                        Parameter url

                                                                        URL to load into an iframe.

                                                                      function printWidget

                                                                      printWidget: (widget: Widget) => Promise<void>;
                                                                      • Prints a widget by copying it's DOM node to a hidden iframe and printing that iframe.

                                                                      interface IPrintable

                                                                      interface IPrintable {}
                                                                      • Objects who provide a custom way of printing themselves should implement this interface.

                                                                      property [symbol]

                                                                      [symbol]: () => OptionalAsyncThunk;
                                                                      • Returns a function to print this object or null if it cannot be printed.

                                                                      type OptionalAsyncThunk

                                                                      type OptionalAsyncThunk = (() => Promise<void>) | null;
                                                                      • Function that takes no arguments and when invoked prints out some object or null if printing is not defined.

                                                                      namespace SessionContext

                                                                      namespace SessionContext {}
                                                                      • A namespace for SessionContext statics.

                                                                      function getDefaultKernel

                                                                      getDefaultKernel: (options: IKernelSearch) => string | null;
                                                                      • Get the default kernel name given select options.

                                                                      interface IKernelSearch

                                                                      interface IKernelSearch {}
                                                                      • An interface for populating a kernel selector.

                                                                      property preference

                                                                      preference: ISessionContext.IKernelPreference;
                                                                      • The kernel preference.

                                                                      property sessions

                                                                      sessions?: IterableOrArrayLike<Session.IModel>;
                                                                      • The current running sessions.

                                                                      property specs

                                                                      specs: KernelSpec.ISpecModels | null;
                                                                      • The Kernel specs.

                                                                      interface IOptions

                                                                      interface IOptions {}
                                                                      • The options used to initialize a context.

                                                                      property kernelPreference

                                                                      kernelPreference?: ISessionContext.IKernelPreference;
                                                                      • A kernel preference.

                                                                      property name

                                                                      name?: string;
                                                                      • The name of the session.

                                                                      property path

                                                                      path?: string;
                                                                      • The initial path of the file.

                                                                      property sessionManager

                                                                      sessionManager: Session.IManager;
                                                                      • A session manager instance.

                                                                      property setBusy

                                                                      setBusy?: () => IDisposable;
                                                                      • A function to call when the session becomes busy.

                                                                      property specsManager

                                                                      specsManager: KernelSpec.IManager;
                                                                      • A kernel spec manager instance.

                                                                      property translator

                                                                      translator?: ITranslator;
                                                                      • The application language translator.

                                                                      property type

                                                                      type?: string;
                                                                      • The type of the session.

                                                                      namespace Styling

                                                                      namespace Styling {}
                                                                      • A namespace for node styling.

                                                                      function styleNode

                                                                      styleNode: (node: HTMLElement, className?: string) => void;
                                                                      • Style a node and its child elements with the default tag names.

                                                                        Parameter node

                                                                        The base node.

                                                                        Parameter className

                                                                        The optional CSS class to add to styled nodes.

                                                                      function styleNodeByTag

                                                                      styleNodeByTag: (node: HTMLElement, tagName: string, className?: string) => void;
                                                                      • Style a node and its elements that have a given tag name.

                                                                        Parameter node

                                                                        The base node.

                                                                        Parameter tagName

                                                                        The html tag name to style.

                                                                        Parameter className

                                                                        The optional CSS class to add to styled nodes.

                                                                      function wrapSelect

                                                                      wrapSelect: (node: HTMLSelectElement) => HTMLElement;
                                                                      • Wrap a select node.

                                                                      namespace ThemeManager

                                                                      namespace ThemeManager {}

                                                                        interface IOptions

                                                                        interface IOptions {}
                                                                        • The options used to create a theme manager.

                                                                        property host

                                                                        host: Widget;
                                                                        • The host widget for the theme manager.

                                                                        property key

                                                                        key: string;
                                                                        • The setting registry key that holds theme setting data.

                                                                        property settings

                                                                        settings: ISettingRegistry;
                                                                        • The settings registry.

                                                                        property splash

                                                                        splash?: ISplashScreen;
                                                                        • The splash screen to show when loading themes.

                                                                        property translator

                                                                        translator?: ITranslator;
                                                                        • The application language translator.

                                                                        property url

                                                                        url: string;
                                                                        • The url for local theme loading.

                                                                        namespace Toolbar

                                                                        namespace Toolbar {}
                                                                        • The namespace for Toolbar class statics.

                                                                        function createInterruptButton

                                                                        createInterruptButton: (
                                                                        sessionContext: ISessionContext,
                                                                        translator?: ITranslator
                                                                        ) => Widget;
                                                                        • Create an interrupt toolbar item.

                                                                          Deprecated

                                                                          since version v3.2 This is dead code now.

                                                                        function createKernelNameItem

                                                                        createKernelNameItem: (
                                                                        sessionContext: ISessionContext,
                                                                        dialogs?: ISessionContext.IDialogs,
                                                                        translator?: ITranslator
                                                                        ) => Widget;
                                                                        • Create a kernel name indicator item.

                                                                          #### Notes It will display the 'display_name' of the session context. It can handle a change in context or kernel.

                                                                        function createKernelStatusItem

                                                                        createKernelStatusItem: (
                                                                        sessionContext: ISessionContext,
                                                                        translator?: ITranslator
                                                                        ) => Widget;
                                                                        • Create a kernel status indicator item.

                                                                          #### Notes It will show a busy status if the kernel status is busy. It will show the current status in the node title. It can handle a change to the context or the kernel.

                                                                        function createRestartButton

                                                                        createRestartButton: (
                                                                        sessionContext: ISessionContext,
                                                                        dialogs?: ISessionContext.IDialogs,
                                                                        translator?: ITranslator
                                                                        ) => Widget;
                                                                        • Create a restart toolbar item.

                                                                          Deprecated

                                                                          since v3.2 This is dead code now.

                                                                        function createSpacerItem

                                                                        createSpacerItem: () => Widget;
                                                                        • Create a toolbar spacer item.

                                                                          #### Notes It is a flex spacer that separates the left toolbar items from the right toolbar items.

                                                                        interface IOptions

                                                                        interface IOptions {}
                                                                        • The options used to create a toolbar.

                                                                        property layout

                                                                        layout?: Layout;
                                                                        • Toolbar widget layout.

                                                                        interface IWidgetToolbar

                                                                        interface IWidgetToolbar extends Widget {}
                                                                        • Widget with associated toolbar

                                                                        property toolbar

                                                                        toolbar?: Toolbar;
                                                                        • Toolbar of actions on the widget

                                                                        namespace ToolbarButtonComponent

                                                                        namespace ToolbarButtonComponent {}
                                                                        • Namespace for ToolbarButtonComponent.

                                                                        interface IProps

                                                                        interface IProps {}
                                                                        • Interface for ToolbarButtonComponent props.

                                                                        property actualOnClick

                                                                        actualOnClick?: boolean;
                                                                        • Trigger the button on the actual onClick event rather than onMouseDown.

                                                                          See note in ToolbarButtonComponent below as to why the default is to trigger on onMouseDown.

                                                                        property className

                                                                        className?: string;

                                                                          property dataset

                                                                          dataset?: DOMStringMap;
                                                                          • Data set of the button

                                                                          property disabledTooltip

                                                                          disabledTooltip?: string;

                                                                            property enabled

                                                                            enabled?: boolean;

                                                                              property icon

                                                                              icon?: LabIcon.IMaybeResolvable;

                                                                                property iconClass

                                                                                iconClass?: string;

                                                                                  property iconLabel

                                                                                  iconLabel?: string;

                                                                                    property label

                                                                                    label?: string;

                                                                                      property onClick

                                                                                      onClick?: () => void;

                                                                                        property pressed

                                                                                        pressed?: boolean;

                                                                                          property pressedIcon

                                                                                          pressedIcon?: LabIcon.IMaybeResolvable;

                                                                                            property pressedTooltip

                                                                                            pressedTooltip?: string;

                                                                                              property tooltip

                                                                                              tooltip?: string;

                                                                                                property translator

                                                                                                translator?: ITranslator;
                                                                                                • The application language translator.

                                                                                                namespace ToolbarRegistry

                                                                                                namespace ToolbarRegistry {}
                                                                                                • The namespace for IToolbarWidgetRegistry related interfaces

                                                                                                interface IOptions

                                                                                                interface IOptions {}
                                                                                                • Options to set up the toolbar widget registry

                                                                                                property defaultFactory

                                                                                                defaultFactory: (
                                                                                                widgetFactory: string,
                                                                                                widget: Widget,
                                                                                                toolbarItem: IWidget
                                                                                                ) => Widget;
                                                                                                • Default toolbar widget factory

                                                                                                  The factory is receiving 3 arguments:

                                                                                                  Parameter widgetFactory

                                                                                                  The widget factory name that creates the toolbar

                                                                                                  Parameter widget

                                                                                                  The newly widget containing the toolbar

                                                                                                  Parameter toolbarItem

                                                                                                  The toolbar item definition

                                                                                                  Returns

                                                                                                  The widget to be inserted in the toolbar.

                                                                                                interface IToolbarItem

                                                                                                interface IToolbarItem {}
                                                                                                • Interface of item to be inserted in a toolbar

                                                                                                property name

                                                                                                name: string;
                                                                                                • Unique item name

                                                                                                property widget

                                                                                                widget: Widget;
                                                                                                • Toolbar widget

                                                                                                interface IWidget

                                                                                                interface IWidget extends ISettingRegistry.IToolbarItem {}
                                                                                                • Interface describing a toolbar item widget

                                                                                                namespace VDomRenderer

                                                                                                namespace VDomRenderer {}
                                                                                                • The namespace for VDomRenderer statics.

                                                                                                interface IModel

                                                                                                interface IModel extends IDisposable {}
                                                                                                • An interface for a model to be used with vdom rendering.

                                                                                                property stateChanged

                                                                                                readonly stateChanged: ISignal<this, void>;
                                                                                                • A signal emitted when any model state changes.

                                                                                                namespace WidgetTracker

                                                                                                namespace WidgetTracker {}
                                                                                                • A namespace for WidgetTracker statics.

                                                                                                interface IOptions

                                                                                                interface IOptions {}
                                                                                                • The instantiation options for a widget tracker.

                                                                                                property namespace

                                                                                                namespace: string;
                                                                                                • A namespace for all tracked widgets, (e.g., notebook).

                                                                                                Package Files (28)

                                                                                                Dependencies (23)

                                                                                                Dev Dependencies (9)

                                                                                                Peer Dependencies (0)

                                                                                                No peer dependencies.

                                                                                                Badge

                                                                                                To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                                                You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@jupyterlab/apputils.

                                                                                                • Markdown
                                                                                                  [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@jupyterlab/apputils)
                                                                                                • HTML
                                                                                                  <a href="https://www.jsdocs.io/package/@jupyterlab/apputils"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>