Skip to main content

TocItem

Creates an item for the table of content. You should create a table of content (Toc) first to link the items.

constructor(text: IText)

new TocItem(
new Txt('Page 1').end
).end;

tocStyle(style: IStyleDefinition): TocItem

Defines styles for the item.

new TocItem(
new Txt('Page 1').end
).tocStyle({
color: 'blue',
bold: true
}).end;

tocMargin(margin: number | [number, number] | [number, number, number, number]): TocItem

Defines margins for the item.

new TocItem(
new Txt('Page 1').end
).tocMargin([20, 10]).end;

Types

ITocItem

TocItem properties (extends from IStyleDefinition).

  • readonly tocItem: boolean;
  • readonly tocStyle?: IStyleDefinition;
  • readonly tocMargin?: number | [number, number] | [number, number, number, number];