Table of content model factory interface

interface IFactory<
    W extends Widget = Widget,
    H extends TableOfContents.IHeading = TableOfContents.IHeading,
> {
    createNew: (
        widget: W,
        configuration?: TableOfContents.IConfig,
    ) => TableOfContents.IModel<H>;
    isApplicable: (widget: W) => boolean;
}

Type Parameters

Implemented by

Properties

createNew: (
    widget: W,
    configuration?: TableOfContents.IConfig,
) => TableOfContents.IModel<H>

Create a new table of contents model for the widget

Type declaration

isApplicable: (widget: W) => boolean

Whether the factory can handle the widget or not.

Type declaration

    • (widget: W): boolean
    • Parameters

      • widget: W

        widget

      Returns boolean

      boolean indicating a ToC can be generated