@jupyterlab/toc
Version:
JupyterLab - Table of Contents widget
37 lines (36 loc) • 1.27 kB
TypeScript
import type { ToolbarRegistry } from '@jupyterlab/apputils';
import type { IDisposable } from '@lumino/disposable';
import type { Widget } from '@lumino/widgets';
import type { ITableOfContentsRegistry, TableOfContents } from './tokens';
/**
* Class for registering table of contents generators.
*/
export declare class TableOfContentsRegistry implements ITableOfContentsRegistry {
/**
* Finds a table of contents model for a widget.
*
* ## Notes
*
* - If unable to find a table of contents model, the method return `undefined`.
*
* @param widget - widget
* @param configuration - Default model configuration
* @returns Table of contents model
*/
getModel(widget: Widget, configuration?: TableOfContents.IConfig): TableOfContents.Model | undefined;
/**
* Get the toolbar items for a widget.
*
* @param widget - widget
* @returns List of toolbar items
*/
getToolbarItems(widget: Widget): ToolbarRegistry.IToolbarItem[] | undefined;
/**
* Adds a table of contents generator to the registry.
*
* @param generator - table of contents generator
*/
add(generator: TableOfContents.IFactory): IDisposable;
private _generators;
private _idCounter;
}