@jupyterlab/application

  • Version 4.1.2
  • Published
  • 431 kB
  • 20 dependencies
  • BSD-3-Clause license

Install

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

Overview

application

Index

Variables

Functions

Classes

Interfaces

Type Aliases

Namespaces

Variables

variable ConnectionLost

const ConnectionLost: IConnectionLost;
  • A default connection lost handler, which brings up an error dialog.

variable IConnectionLost

const IConnectionLost: Token<IConnectionLost>;
  • A token for which a plugin can provide to respond to connection failures to the application server.

variable ILabShell

const ILabShell: Token<ILabShell>;
  • The JupyterLab application shell token.

variable ILabStatus

const ILabStatus: Token<ILabStatus>;
  • The application status token.

variable ILayoutRestorer

const ILayoutRestorer: Token<ILayoutRestorer>;
  • The layout restorer token.

variable IMimeDocumentTracker

const IMimeDocumentTracker: Token<IMimeDocumentTracker>;
  • The mime document tracker token.

variable IRouter

const IRouter: Token<IRouter>;
  • The URL Router token.

variable ITreePathUpdater

const ITreePathUpdater: Token<ITreePathUpdater>;
  • The tree path updater token.

Functions

function createRendermimePlugin

createRendermimePlugin: (
tracker: WidgetTracker<MimeDocument>,
item: IRenderMime.IExtension
) => IPlugin<JupyterFrontEnd<U, V>, T>;
  • Create rendermime plugins for rendermime extension modules.

function createRendermimePlugins

createRendermimePlugins: (
extensions: IRenderMime.IExtensionModule[]
) => JupyterFrontEndPlugin<void | IMimeDocumentTracker, any, any>[];
  • Create rendermime plugins for rendermime extension modules.

function createSemanticCommand

createSemanticCommand: (
app: JupyterFrontEnd,
semanticCommands: SemanticCommand | SemanticCommand[],
defaultValues: ISemanticCommandDefault,
trans: TranslationBundle
) => CommandRegistry.ICommandOptions;
  • Create the command options from the given semantic commands list and the given default values.

    Parameter app

    Jupyter Application

    Parameter semanticCommands

    Single semantic command or a list of commands

    Parameter defaultValues

    Default values

    Parameter trans

    Translation bundle

    Returns

    Command options

Classes

class JupyterFrontEnd

abstract class JupyterFrontEnd<
T extends JupyterFrontEnd.IShell = JupyterFrontEnd.IShell,
U extends string = 'desktop' | 'mobile'
> extends Application<T> {}
  • The base Jupyter front-end application class.

constructor

constructor(options: JupyterFrontEnd.IOptions<T, any>);
  • Construct a new JupyterFrontEnd object.

property commandLinker

readonly commandLinker: CommandLinker;
  • The command linker used by the application.

property contextMenu

readonly contextMenu: ContextMenuSvg;
  • The application context menu.

property docRegistry

readonly docRegistry: DocumentRegistry;
  • The document registry instance used by the application.

property format

format: string;
  • The application form factor, e.g., desktop or mobile.

property formatChanged

readonly formatChanged: ISignal<this, U>;
  • A signal that emits when the application form factor changes.

property name

abstract readonly name: string;
  • The name of this Jupyter front-end application.

property namespace

abstract readonly namespace: string;
  • A namespace/prefix plugins may use to denote their provenance.

property restored

readonly restored: Promise<void>;
  • Promise that resolves when state is first restored.

property serviceManager

readonly serviceManager: ServiceManager.IManager;
  • The service manager used by the application.

property version

abstract readonly version: string;
  • The version of this Jupyter front-end application.

method contextMenuHitTest

contextMenuHitTest: (
fn: (node: HTMLElement) => boolean
) => HTMLElement | undefined;
  • Walks up the DOM hierarchy of the target of the active contextmenu event, testing each HTMLElement ancestor for a user-supplied function. This can be used to find an HTMLElement on which to operate, given a context menu click.

    Parameter fn

    a function that takes an HTMLElement and returns a boolean for whether it is the element the requester is seeking.

    Returns

    an HTMLElement or undefined, if none is found.

method evtContextMenu

protected evtContextMenu: (event: MouseEvent) => void;
  • A method invoked on a document 'contextmenu' event.

class JupyterLab

class JupyterLab extends JupyterFrontEnd<ILabShell> {}
  • JupyterLab is the main application class. It is instantiated once and shared.

constructor

constructor(options?: JupyterLab.IOptions);
  • Construct a new JupyterLab object.

property allPluginsActivated

readonly allPluginsActivated: Promise<void>;
  • Promise that resolves when all the plugins are activated, including the deferred.

property info

readonly info: JupyterLab.IInfo;
  • The JupyterLab application information dictionary.

property name

readonly name: string;
  • The name of the JupyterLab application.

property namespace

readonly namespace: string;
  • A namespace/prefix plugins may use to denote their provenance.

property paths

readonly paths: JupyterFrontEnd.IPaths;
  • The JupyterLab application paths dictionary.

property registerPluginErrors

readonly registerPluginErrors: Error[];
  • A list of all errors encountered when registering plugins.

property restored

readonly restored: Promise<void>;
  • Promise that resolves when state is first restored, returning layout description.

property status

readonly status: LabStatus;
  • The application busy and dirty status signals and flags.

property version

readonly version: string;
  • The version of the JupyterLab application.

method registerPluginModule

registerPluginModule: (mod: JupyterLab.IPluginModule) => void;
  • Register plugins from a plugin module.

    Parameter mod

    The plugin module to register.

method registerPluginModules

registerPluginModules: (mods: JupyterLab.IPluginModule[]) => void;
  • Register the plugins from multiple plugin modules.

    Parameter mods

    The plugin modules to register.

class LabShell

class LabShell extends Widget implements JupyterFrontEnd.IShell {}
  • The application shell for JupyterLab.

constructor

constructor(options?: ILabShell.IOptions);
  • Construct a new application shell.

property activeChanged

readonly activeChanged: ISignal<this, FocusTracker.IChangedArgs<Widget>>;
  • A signal emitted when main area's active focus changes.

property activeWidget

readonly activeWidget: any;
  • The active widget in the shell's main area.

property addButtonEnabled

addButtonEnabled: boolean;
  • Whether the add buttons for each main area tab bar are enabled.

property addRequested

readonly addRequested: ISignal<DockPanel, TabBar<Widget>>;
  • A signal emitted when the add button on a main area tab bar is clicked.

property currentChanged

readonly currentChanged: ISignal<this, FocusTracker.IChangedArgs<Widget>>;
  • A signal emitted when main area's current focus changes.

property currentPath

readonly currentPath: string;
  • Current document path.

property currentPathChanged

readonly currentPathChanged: ISignal<this, ILabShell.ICurrentPathChangedArgs>;
  • A signal emitted when the path of the current document changes.

    This also fires when the current document itself changes.

property currentWidget

readonly currentWidget: any;
  • The current widget in the shell's main area.

property layoutModified

readonly layoutModified: ISignal<this, void>;
  • A signal emitted when the main area's layout is modified.

property leftCollapsed

readonly leftCollapsed: boolean;
  • Whether the left area is collapsed.

property mode

mode: DockPanel.Mode;
  • The main dock area's user interface mode.

property modeChanged

readonly modeChanged: ISignal<this, DockPanel.Mode>;
  • A signal emitted when the shell/dock panel change modes (single/multiple document).

property presentationMode

presentationMode: boolean;
  • Whether JupyterLab is in presentation mode with the jp-mod-presentationMode CSS class.

property restored

readonly restored: Promise<ILabShell.ILayout>;
  • Promise that resolves when state is first restored, returning layout description.

property rightCollapsed

readonly rightCollapsed: boolean;
  • Whether the left area is collapsed.

property translator

translator: ITranslator;

    property userLayout

    readonly userLayout: {
    'single-document': ILabShell.IUserLayout;
    'multiple-document': ILabShell.IUserLayout;
    };
    • User customized shell layout.

    method activateArea

    activateArea: (area?: ILabShell.Area) => void;
    • Activate widget in specified area.

      ### Notes The alpha version of this method only supports activating the "main" area.

      Parameter area

      Name of area to activate

      Modifiers

      • @alpha

    method activateById

    activateById: (id: string) => void;
    • Activate a widget in its area.

    method activateNextTab

    activateNextTab: () => void;
    • Activate the next Tab in the active TabBar.

    method activateNextTabBar

    activateNextTabBar: () => void;
    • Activate the next TabBar.

    method activatePreviousTab

    activatePreviousTab: () => void;
    • Activate the previous Tab in the active TabBar.

    method activatePreviousTabBar

    activatePreviousTabBar: () => void;
    • Activate the next TabBar.

    method add

    add: (
    widget: Widget,
    area?: ILabShell.Area,
    options?: DocumentRegistry.IOpenOptions
    ) => void;
    • Add a widget to the JupyterLab shell

      Parameter widget

      Widget

      Parameter area

      Area

      Parameter options

      Options

    method closeAll

    closeAll: () => void;
    • Close all widgets in the main and down area.

    method collapseLeft

    collapseLeft: () => void;
    • Collapse the left area.

    method collapseRight

    collapseRight: () => void;
    • Collapse the right area.

    method dispose

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

    method expandLeft

    expandLeft: () => void;
    • Expand the left area.

      #### Notes This will open the most recently used tab, or the first tab if there is no most recently used.

    method expandRight

    expandRight: () => void;
    • Expand the right area.

      #### Notes This will open the most recently used tab, or the first tab if there is no most recently used.

    method isEmpty

    isEmpty: (area: ILabShell.Area) => boolean;
    • True if the given area is empty.

    method isSideTabBarVisible

    isSideTabBarVisible: (side: 'left' | 'right') => boolean;
    • Whether an side tab bar is visible or not.

      Parameter side

      Sidebar of interest

      Returns

      Side tab bar visibility

    method isTopInSimpleModeVisible

    isTopInSimpleModeVisible: () => boolean;
    • Whether the top bar in simple mode is visible or not.

      Returns

      Top bar visibility

    method move

    move: (
    widget: Widget,
    area: ILabShell.Area,
    mode?: DockPanel.Mode
    ) => {
    'single-document': ILabShell.IUserLayout;
    'multiple-document': ILabShell.IUserLayout;
    };
    • Move a widget type to a new area.

      The type is determined from the widget.id and fallback to widget.id.

      #### Notes If mode is undefined, both mode are updated. The new layout is now persisted.

      Parameter widget

      Widget to move

      Parameter area

      New area

      Parameter mode

      Mode to change

      Returns

      The new user layout

    method onAfterAttach

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

    method restoreLayout

    restoreLayout: (
    mode: DockPanel.Mode,
    layoutRestorer: LayoutRestorer,
    configuration?: { [m: string]: ILabShell.IUserLayout }
    ) => Promise<void>;
    • Restore the layout state and configuration for the application shell.

      #### Notes This should only be called once.

    method saveLayout

    saveLayout: () => ILabShell.ILayout;
    • Save the dehydrated state of the application shell.

    method toggleSideTabBarVisibility

    toggleSideTabBarVisibility: (side: 'right' | 'left') => void;
    • Toggle side tab bar visibility

      Parameter side

      Sidebar of interest

    method toggleTopInSimpleModeVisibility

    toggleTopInSimpleModeVisibility: () => void;
    • Toggle top header visibility in simple mode

      Note: Does nothing in multi-document mode

    method updateConfig

    updateConfig: (config: Partial<ILabShell.IConfig>) => void;
    • Update the shell configuration.

      Parameter config

      Shell configuration

    method widgets

    widgets: (area?: ILabShell.Area) => IterableIterator<Widget>;
    • Returns the widgets for an application area.

    class LayoutRestorer

    class LayoutRestorer implements ILayoutRestorer {}
    • The default implementation of a layout restorer.

      #### Notes The lifecycle for state restoration is subtle. The sequence of events is:

      1. The layout restorer plugin is instantiated and makes a fetch call to the data connector that stores the layout restoration data. The fetch call returns a promise that resolves in step 6, below.

      2. Other plugins that care about state restoration require the layout restorer as a dependency.

      3. As each load-time plugin initializes (which happens before the front-end application has started), it instructs the layout restorer whether the restorer ought to restore its widgets by passing in its widget tracker. Alternatively, a plugin that does not require its own widget tracker (because perhaps it only creates a single widget, like a command palette), can simply add its widget along with a persistent unique name to the layout restorer so that its layout state can be restored when the lab application restores.

      4. After all the load-time plugins have finished initializing, the front-end application started promise will resolve. This is the first promise that the layout restorer waits for. By this point, all of the plugins that care about restoration will have instructed the layout restorer to restore their widget trackers.

      5. The layout restorer will then instruct each plugin's widget tracker to restore its state and reinstantiate whichever widgets it wants. The tracker returns a promise to the layout restorer that resolves when it has completed restoring the tracked widgets it cares about.

      6. As each widget tracker finishes restoring the widget instances it cares about, it resolves the promise that was returned to the layout restorer (in step 5). After all of the promises that the restorer is awaiting have settled, the restorer then resolves the outstanding fetch promise (from step 1) and hands off a layout state object to the application shell's restoreLayout method for restoration.

      7. Once the application shell has finished restoring the layout, the JupyterLab application's restored promise is resolved.

      Of particular note are steps 5 and 6: since data restoration of plugins is accomplished by executing commands, the command that is used to restore the data of each plugin must return a promise that only resolves when the widget has been created and added to the plugin's widget tracker.

    constructor

    constructor(options: LayoutRestorer.IOptions);
    • Create a layout restorer.

    property isDeferred

    readonly isDeferred: boolean;
    • Whether full layout restoration is deferred and is currently incomplete.

      #### Notes This flag is useful for tracking when the application has started in 'single-document' mode and the main area has not yet been restored.

    property restored

    readonly restored: Promise<void>;
    • A promise resolved when the layout restorer is ready to receive signals.

    method add

    add: (widget: Widget, name: string) => void;
    • Add a widget to be tracked by the layout restorer.

    method fetch

    fetch: () => Promise<ILabShell.ILayout>;
    • Fetch the layout state for the application.

      #### Notes Fetching the layout relies on all widget restoration to be complete, so calls to fetch are guaranteed to return after restoration is complete.

    method restore

    restore: (
    tracker: WidgetTracker,
    options: IRestorer.IOptions<Widget>
    ) => Promise<any>;
    • Restore the widgets of a particular widget tracker.

      Parameter tracker

      The widget tracker whose widgets will be restored.

      Parameter options

      The restoration options.

    method restoreDeferred

    restoreDeferred: () => Promise<ILabShell.IMainArea | null>;
    • Restore the application layout if its restoration has been deferred.

      Returns

      - the rehydrated main area.

    method save

    save: (layout: ILabShell.ILayout) => Promise<void>;
    • Save the layout state for the application.

    class Router

    class Router implements IRouter {}
    • A static class that routes URLs within the application.

    constructor

    constructor(options: Router.IOptions);
    • Create a URL router.

    property base

    readonly base: string;
    • The base URL for the router.

    property commands

    readonly commands: CommandRegistry;
    • The command registry used by the router.

    property current

    readonly current: IRouter.ILocation;
    • Returns the parsed current URL of the application.

    property routed

    readonly routed: ISignal<this, IRouter.ILocation>;
    • A signal emitted when the router routes a route.

    property stop

    readonly stop: Token<void>;
    • If a matching rule's command resolves with the stop token during routing, no further matches will execute.

    method navigate

    navigate: (path: string, options?: IRouter.INavOptions) => void;
    • Navigate to a new path within the application.

      Parameter path

      The new path or empty string if redirecting to root.

      Parameter options

      The navigation options.

    method register

    register: (options: IRouter.IRegisterOptions) => IDisposable;
    • Register to route a path pattern to a command.

      Parameter options

      The route registration options.

      Returns

      A disposable that removes the registered rule from the router.

    method reload

    reload: () => void;
    • Cause a hard reload of the document.

    method route

    route: () => Promise<void>;
    • Route a specific path to an action.

      #### Notes If a pattern is matched, its command will be invoked with arguments that match the IRouter.ILocation interface.

    Interfaces

    interface ILabShell

    interface ILabShell extends LabShell {}
    • The JupyterLab application shell interface.

    interface ILabStatus

    interface ILabStatus {}
    • An interface for JupyterLab-like application status functionality.

    property busySignal

    readonly busySignal: ISignal<JupyterFrontEnd<any, any>, boolean>;
    • A signal for when application changes its busy status.

    property dirtySignal

    readonly dirtySignal: ISignal<JupyterFrontEnd<any, any>, boolean>;
    • A signal for when application changes its dirty status.

    property isBusy

    readonly isBusy: boolean;
    • Whether the application is busy.

    property isDirty

    readonly isDirty: boolean;
    • Whether the application is dirty.

    method setBusy

    setBusy: () => IDisposable;
    • Set the application state to busy.

      Returns

      A disposable used to clear the busy state for the caller.

    method setDirty

    setDirty: () => IDisposable;
    • Set the application state to dirty.

      Returns

      A disposable used to clear the dirty state for the caller.

    interface ILayoutRestorer

    interface ILayoutRestorer extends IRestorer {}
    • A static class that restores the widgets of the application when it reloads.

    property restored

    restored: Promise<void>;
    • A promise resolved when the layout restorer is ready to receive signals.

    method add

    add: (widget: Widget, name: string) => void;
    • Add a widget to be tracked by the layout restorer.

    method restore

    restore: <T extends Widget>(
    tracker: WidgetTracker<T>,
    options: IRestorer.IOptions<T>
    ) => Promise<any>;
    • Restore the widgets of a particular widget tracker.

      Parameter tracker

      The widget tracker whose widgets will be restored.

      Parameter options

      The restoration options.

    interface IMimeDocumentTracker

    interface IMimeDocumentTracker extends IWidgetTracker<MimeDocument> {}
    • A class that tracks mime documents.

    interface IRouter

    interface IRouter {}
    • A static class that routes URLs within the application.

    property base

    readonly base: string;
    • The base URL for the router.

    property commands

    readonly commands: CommandRegistry;
    • The command registry used by the router.

    property current

    readonly current: IRouter.ILocation;
    • The parsed current URL of the application.

    property routed

    readonly routed: ISignal<IRouter, IRouter.ILocation>;
    • A signal emitted when the router routes a route.

    property stop

    readonly stop: Token<void>;
    • If a matching rule's command resolves with the stop token during routing, no further matches will execute.

    method navigate

    navigate: (path: string, options?: IRouter.INavOptions) => void;
    • Navigate to a new path within the application.

      Parameter path

      The new path or empty string if redirecting to root.

      Parameter options

      The navigation options.

    method register

    register: (options: IRouter.IRegisterOptions) => IDisposable;
    • Register a rule that maps a path pattern to a command.

      Parameter options

      The route registration options.

      Returns

      A disposable that removes the registered rule from the router.

    method reload

    reload: () => void;
    • Cause a hard reload of the document.

    method route

    route: (url: string) => void;
    • Route a specific path to an action.

      Parameter url

      The URL string that will be routed.

      #### Notes If a pattern is matched, its command will be invoked with arguments that match the IRouter.ILocation interface.

    interface ISemanticCommandDefault

    interface ISemanticCommandDefault {}

      property caption

      caption?: string;
      • Default command caption

      property execute

      execute?: string;
      • Default command to execute if no command is enabled

      property isEnabled

      isEnabled?: boolean;
      • Whether the default command is enabled.

      property isToggled

      isToggled?: boolean;
      • Whether the default command is toggled.

      property isVisible

      isVisible?: boolean;
      • Whether the default command is visible.

      property label

      label?: string;
      • Default command label

      interface ITreePathUpdater

      interface ITreePathUpdater {}
      • A function to call to update the tree path.

      call signature

      (treePath: string): void;

        Type Aliases

        type IConnectionLost

        type IConnectionLost = (
        manager: ServiceManager.IManager,
        err: ServerConnection.NetworkError,
        translator?: ITranslator
        ) => Promise<void>;
        • A function that handles a connection to the server being lost.

          #### Notes The default implementation shows a simple dialog upon connection failures, but it may be overridden by extensions to perform other actions.

        type JupyterFrontEndPlugin

        type JupyterFrontEndPlugin<
        T,
        U extends JupyterFrontEnd.IShell = JupyterFrontEnd.IShell,
        V extends string = 'desktop' | 'mobile'
        > = IPlugin<JupyterFrontEnd<U, V>, T>;
        • The type for all JupyterFrontEnd application plugins.

        Namespaces

        namespace ILabShell

        namespace ILabShell {}
        • The namespace for ILabShell type information.

        interface IConfig

        interface IConfig {}

          property hiddenMode

          hiddenMode: 'display' | 'scale' | 'contentVisibility';
          • The method for hiding widgets in the dock panel.

            The default is display.

            Using scale will often increase performance as most browsers will not trigger style computation for the transform action.

            contentVisibility is only available in Chromium-based browsers.

          interface ICurrentPathChangedArgs

          interface ICurrentPathChangedArgs {}
          • The args for the current path change signal.

          property newValue

          newValue: string;
          • The old value of the tree path, not including '/tree'.

          property oldValue

          oldValue: string;
          • The new value of the tree path, not including '/tree'.

          interface IDelayedWidget

          interface IDelayedWidget extends IWidgetPosition {}
          • To-be-added widget and associated position

          property widget

          widget: Widget;

            interface IDownArea

            interface IDownArea {}

              property currentWidget

              readonly currentWidget: Widget | null;
              • The current widget that has down area focus.

              property size

              readonly size: number | null;
              • Vertical relative size of the down area

                The main area will take the rest of the height

              property widgets

              readonly widgets: Array<Widget> | null;
              • The collection of widgets held by the panel.

              interface ILayout

              interface ILayout {}
              • A description of the application's user interface layout.

              property downArea

              readonly downArea: IDownArea | null;
              • The down area of the user interface.

              property fresh

              readonly fresh?: boolean;
              • Indicates whether fetched session restore data was actually retrieved from the state database or whether it is a fresh blank slate.

                #### Notes This attribute is only relevant when the layout data is retrieved via a fetch call. If it is set when being passed into save, it will be ignored.

              property leftArea

              readonly leftArea: ISideArea | null;
              • The left area of the user interface.

              property mainArea

              readonly mainArea: IMainArea | null;
              • The main area of the user interface.

              property relativeSizes

              readonly relativeSizes: number[] | null;
              • The relatives sizes of the areas of the user interface.

              property rightArea

              readonly rightArea: ISideArea | null;
              • The right area of the user interface.

              property topArea

              readonly topArea: ITopArea | null;
              • The top area of the user interface.

              interface IMainArea

              interface IMainArea {}
              • The restorable description of the main application area.

              property currentWidget

              readonly currentWidget: Widget | null;
              • The current widget that has application focus.

              property dock

              readonly dock: DockLayout.ILayoutConfig | null;
              • The contents of the main application dock panel.

              interface ISideArea

              interface ISideArea {}
              • The restorable description of a sidebar in the user interface.

              property collapsed

              readonly collapsed: boolean;
              • A flag denoting whether the sidebar has been collapsed.

              property currentWidget

              readonly currentWidget: Widget | null;
              • The current widget that has side area focus.

              property visible

              readonly visible: boolean;
              • A flag denoting whether the side tab bar is visible.

              property widgets

              readonly widgets: Array<Widget> | null;
              • The collection of widgets held by the sidebar.

              property widgetStates

              readonly widgetStates: {
              [id: string]: {
              /**
              * Vertical sizes of the widgets.
              */
              readonly sizes: Array<number> | null;
              /**
              * Expansion states of the widgets.
              */
              readonly expansionStates: Array<boolean> | null;
              };
              };
              • The collection of widgets states held by the sidebar.

              interface IUserLayout

              interface IUserLayout {}
              • Mapping of widget type identifier and their user customized position

              index signature

              [k: string]: IWidgetPosition;
              • Widget customized position

              interface IWidgetPosition

              interface IWidgetPosition {}
              • Widget position

              property area

              area?: Area;
              • Widget area

              property options

              options?: DocumentRegistry.IOpenOptions;
              • Widget opening options

              type Area

              type Area =
              | 'main'
              | 'header'
              | 'top'
              | 'menu'
              | 'left'
              | 'right'
              | 'bottom'
              | 'down';
              • The areas of the application shell where widgets can reside.

              type AreaConfig

              type AreaConfig = DockLayout.AreaConfig;
              • The restorable description of an area within the main dock panel.

              type IChangedArgs

              type IChangedArgs = FocusTracker.IChangedArgs<Widget>;
              • An arguments object for the changed signals.

              type IOptions

              type IOptions = {
              /**
              * Whether the layout should wait to be restored before adding widgets or not.
              *
              * #### Notes
              * It defaults to true
              */
              waitForRestore?: boolean;
              };
              • An options object for creating a lab shell object.

              namespace IRouter

              namespace IRouter {}
              • A namespace for the IRouter specification.

              interface ILocation

              interface ILocation extends ReadonlyPartialJSONObject {}
              • The parsed location currently being routed.

              property hash

              hash: string;
              • The location hash.

              property path

              path: string;
              • The path that matched a routing pattern.

              property request

              request: string;
              • The request being routed with the router base omitted.

                #### Notes This field includes the query string and hash, if they exist.

              property search

              search?: string;
              • The search element, including leading question mark ('?'), if any, of the path.

              interface INavOptions

              interface INavOptions {}
              • The options passed into a navigation request.

              property hard

              hard?: boolean;
              • Whether the navigation should be hard URL change instead of an HTML history API change.

              property skipRouting

              skipRouting?: boolean;
              • Should the routing stage be skipped when navigating? This will simply rewrite the URL and push the new state to the history API, no routing commands will be triggered.

              interface IRegisterOptions

              interface IRegisterOptions {}
              • The specification for registering a route with the router.

              property command

              command: string;
              • The command string that will be invoked upon matching.

              property pattern

              pattern: RegExp;
              • The regular expression that will be matched against URLs.

              property rank

              rank?: number;
              • The rank order of the registered rule. A lower rank denotes a higher priority. The default rank is 100.

              namespace JupyterFrontEnd

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

              variable IPaths

              const IPaths: Token<IPaths>;
              • The application paths dictionary token.

              variable ITreeResolver

              const ITreeResolver: Token<ITreeResolver>;
              • The application tree resolver token.

                #### Notes Not all Jupyter front-end applications will have a tree resolver implemented on the client-side. This token should not be required as a dependency if it is possible to make it an optional dependency.

              function inDocMode

              inDocMode: (path: string, paths: IPaths) => boolean;
              • Is JupyterLab in document mode?

                Parameter path

                Full URL of JupyterLab

                Parameter paths

                The current IPaths object hydrated from PageConfig.

              interface IOptions

              interface IOptions<T extends IShell = IShell, U = any>
              extends Application.IOptions<T> {}
              • The options used to initialize a JupyterFrontEnd.

              property commandLinker

              commandLinker?: CommandLinker;
              • The command linker used by the application.

              property docRegistry

              docRegistry?: DocumentRegistry;
              • The document registry instance used by the application.

              property restored

              restored?: Promise<U>;
              • Promise that resolves when state is first restored, returning layout description.

              property serviceManager

              serviceManager?: ServiceManager.IManager;
              • The service manager used by the application.

              interface IPaths

              interface IPaths {}
              • An interface for URL and directory paths used by a Jupyter front-end.

              property directories

              readonly directories: {
              readonly appSettings: string;
              readonly schemas: string;
              readonly static: string;
              readonly templates: string;
              readonly themes: string;
              readonly userSettings: string;
              readonly serverRoot: string;
              readonly workspaces: string;
              };
              • The server directories used by the application, for user information only.

                #### Notes These are for user information and user interface hints only and should not be relied on in code. A server may set these to empty strings if it does not want to expose this information.

                Examples of appropriate use include displaying a help dialog for a user listing the paths, or a tooltip in a filebrowser displaying the server root. Examples of inappropriate use include using one of these paths in a terminal command, generating code using these paths, or using one of these paths in a request to the server (it would be better to write a server extension to handle these cases).

              property urls

              readonly urls: {
              readonly base: string;
              readonly notFound?: string;
              readonly app: string;
              readonly doc: string;
              readonly static: string;
              readonly settings: string;
              readonly themes: string;
              readonly translations: string;
              readonly hubPrefix?: string;
              readonly hubHost?: string;
              readonly hubUser?: string;
              readonly hubServerName?: string;
              };
              • The urls used by the application.

              interface IShell

              interface IShell extends Widget {}
              • A minimal shell type for Jupyter front-end applications.

              property currentWidget

              readonly currentWidget: Widget | null;
              • The focused widget in the application shell.

                #### Notes Different shell implementations have latitude to decide what "current" or "focused" mean, depending on their user interface characteristics.

              method activateById

              activateById: (id: string) => void;
              • Activates a widget inside the application shell.

                Parameter id

                The ID of the widget being activated.

              method add

              add: (
              widget: Widget,
              area?: string,
              options?: DocumentRegistry.IOpenOptions
              ) => void;
              • Add a widget to the application shell.

                Parameter widget

                The widget being added.

                Parameter area

                Optional region in the shell into which the widget should be added.

                Parameter options

                Optional flags the shell might use when opening the widget, as defined in the DocumentRegistry.

              method widgets

              widgets: (area?: string) => IterableIterator<Widget>;
              • Returns an iterator for the widgets inside the application shell.

                Parameter area

                Optional regions in the shell whose widgets are iterated.

              interface ITreeResolver

              interface ITreeResolver {}
              • An interface for a front-end tree route resolver.

              property paths

              readonly paths: Promise<ITreeResolver.Paths>;
              • A promise that resolves to the routed tree paths or null.

              namespace JupyterFrontEnd.ITreeResolver

              namespace JupyterFrontEnd.ITreeResolver {}
              • A namespace for tree resolver types.

              type Paths

              type Paths = {
              browser: string;
              file: string;
              } | null;
              • The browser and file paths if the tree resolver encountered and handled a tree URL or null if not. Empty string paths should be ignored.

              namespace JupyterFrontEndContextMenu

              namespace JupyterFrontEndContextMenu {}
              • A namespace for the context menu override.

              variable contextMenu

              const contextMenu: string;
              • An id for a private context-menu-info ersatz command.

              namespace JupyterLab

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

              variable defaultInfo

              const defaultInfo: IInfo;
              • The default JupyterLab application info.

              variable defaultPaths

              const defaultPaths: JupyterFrontEnd.IPaths;
              • The default JupyterLab application paths.

              variable IInfo

              const IInfo: Token<IInfo>;
              • The layout restorer token.

              interface IInfo

              interface IInfo {}
              • The information about a JupyterLab application.

              property availablePlugins

              readonly availablePlugins: IPluginInfo[];
              • The information about available plugins.

              property deferred

              readonly deferred: {
              patterns: string[];
              matches: string[];
              };
              • The collection of deferred extension patterns and matched extensions.

              property devMode

              readonly devMode: boolean;
              • Whether the application is in dev mode.

              property disabled

              readonly disabled: {
              patterns: string[];
              matches: string[];
              };
              • The collection of disabled extension patterns and matched extensions.

              property filesCached

              readonly filesCached: boolean;
              • Whether files are cached on the server.

              property isConnected

              isConnected: boolean;
              • Every periodic network polling should be paused while this is set to false. Extensions should use this value to decide whether to proceed with the polling. The extensions may also set this value to false if there is no need to fetch anything from the server backend basing on some conditions (e.g. when an error message dialog is displayed). At the same time, the extensions are responsible for setting this value back to true.

              property mimeExtensions

              readonly mimeExtensions: IRenderMime.IExtensionModule[];
              • The mime renderer extensions.

              interface IOptions

              interface IOptions
              extends Partial<JupyterFrontEnd.IOptions<ILabShell>>,
              Partial<IInfo> {}
              • The options used to initialize a JupyterLab object.

              property paths

              paths?: Partial<JupyterFrontEnd.IPaths>;

                interface IPluginInfo

                interface IPluginInfo extends ILuminoPluginData {}
                • A subset of plugin bundle enriched with JupyterLab extension metadata.

                property enabled

                enabled: boolean;
                • Whether the plugin is enabled.

                property extension

                extension: string;
                • The name of the extension which provides the plugin.

                interface IPluginModule

                interface IPluginModule {}
                • The interface for a module that exports a plugin or plugins as the default value.

                property default

                default:
                | JupyterFrontEndPlugin<any, any, any>
                | JupyterFrontEndPlugin<any, any, any>[];
                • The default export.

                namespace LayoutRestorer

                namespace LayoutRestorer {}
                • A namespace for LayoutRestorer statics.

                interface IOptions

                interface IOptions {}
                • The configuration options for layout restorer instantiation.

                property connector

                connector: IDataConnector<ReadonlyPartialJSONValue>;
                • The data connector used for layout saving and fetching.

                property first

                first: Promise<any>;
                • The initial promise that has to be resolved before restoration.

                  #### Notes This promise should equal the JupyterLab application started notifier.

                property mode

                mode?: DockPanel.Mode;
                • The DockPanel mode.

                property registry

                registry: CommandRegistry;
                • The application command registry.

                namespace Router

                namespace Router {}
                • A namespace for Router class statics.

                interface IOptions

                interface IOptions {}
                • The options for instantiating a JupyterLab URL router.

                property base

                base: string;
                • The fully qualified base URL for the router.

                property commands

                commands: CommandRegistry;
                • The command registry used by the router.

                Package Files (11)

                Dependencies (20)

                Dev Dependencies (6)

                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/application.

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