@jupyterlab/notebook
Version:
JupyterLab - Notebook
79 lines (78 loc) • 2.2 kB
TypeScript
import type { ITranslator } from '@jupyterlab/translation';
import { VDomModel, VDomRenderer } from '@jupyterlab/ui-components';
import type { Notebook } from '.';
/**
* A widget implementing a notebook cell counter status item.
*/
export declare class CellCounterStatus extends VDomRenderer<CellCounterStatus.Model> {
/**
* Construct a new CellCounterStatus status item.
*/
constructor(options?: CellCounterStatus.IOptions);
/**
* Render the status item.
*/
render(): JSX.Element | null;
/**
* A click handler for the widget.
*/
private _handleClick;
/**
* Handle submission for the widget.
*/
private _handleSubmit;
private _translator;
private _popup;
}
/**
* A namespace for CellCounterStatus statics.
*/
export declare namespace CellCounterStatus {
/**
* Options for creating a CellCounterStatus item.
*/
interface IOptions {
/**
* The application language translator.
*/
translator?: ITranslator;
}
/**
* A VDom model for a status item tracking active and total notebook cells.
*/
class Model extends VDomModel {
/**
* The notebook tracked by this model.
*/
get notebook(): Notebook | null;
set notebook(notebook: Notebook | null);
/**
* The current active cell index shown to users (1-based).
*/
get activeCell(): number;
/**
* The first selected cell index shown to users (1-based).
*/
get selectionStart(): number;
/**
* The last selected cell index shown to users (1-based).
*/
get selectionEnd(): number;
/**
* The total number of cells.
*/
get totalCells(): number;
/**
* React to notebook changes by refreshing the tracked state.
*/
private _onChanged;
private _updateStateFromNotebook;
private _getAllState;
private _triggerChange;
private _activeCell;
private _selectionStart;
private _selectionEnd;
private _totalCells;
private _notebook;
}
}