UNPKG

1.75 kBTypeScriptView Raw
1import { ITranslator } from '@jupyterlab/translation';
2import { VDomModel, VDomRenderer } from '@jupyterlab/ui-components';
3import { IDisposable } from '@lumino/disposable';
4import * as React from 'react';
5import { ILauncher } from './tokens';
6/**
7 * LauncherModel keeps track of the path to working directory and has a list of
8 * LauncherItems, which the Launcher will render.
9 */
10export declare class LauncherModel extends VDomModel implements ILauncher.IModel {
11 /**
12 * Add a command item to the launcher, and trigger re-render event for parent
13 * widget.
14 *
15 * @param options - The specification options for a launcher item.
16 *
17 * @returns A disposable that will remove the item from Launcher, and trigger
18 * re-render event for parent widget.
19 *
20 */
21 add(options: ILauncher.IItemOptions): IDisposable;
22 /**
23 * Return an iterator of launcher items.
24 */
25 items(): IterableIterator<ILauncher.IItemOptions>;
26 protected itemsList: ILauncher.IItemOptions[];
27}
28/**
29 * A virtual-DOM-based widget for the Launcher.
30 */
31export declare class Launcher extends VDomRenderer<ILauncher.IModel> {
32 /**
33 * Construct a new launcher widget.
34 */
35 constructor(options: ILauncher.IOptions);
36 /**
37 * The cwd of the launcher.
38 */
39 get cwd(): string;
40 set cwd(value: string);
41 /**
42 * Whether there is a pending item being launched.
43 */
44 get pending(): boolean;
45 set pending(value: boolean);
46 /**
47 * Render the launcher to virtual DOM nodes.
48 */
49 protected render(): React.ReactElement<any> | null;
50 protected translator: ITranslator;
51 private _trans;
52 private _commands;
53 private _callback;
54 private _pending;
55 private _cwd;
56}