mirror of
https://github.com/jzillmann/pdf-to-markdown.git
synced 2025-08-07 13:08:37 +02:00
- merge `ItemType`/`BlockType` to `TextType` - fix bug with duplicate and flattened types
22 lines
435 B
TypeScript
22 lines
435 B
TypeScript
import Item from './Item';
|
|
import { HeadlineType } from './text-types';
|
|
|
|
/**
|
|
* Table of contents usually parsed by `DetectToc.ts`.
|
|
*/
|
|
export default class TOC {
|
|
constructor(
|
|
public tocHeadlineItems: Item[],
|
|
public pages: number[],
|
|
public detectedHeadlineLevels: Set<HeadlineType>,
|
|
) {}
|
|
|
|
startPage(): number {
|
|
return Math.min(...this.pages);
|
|
}
|
|
|
|
endPage(): number {
|
|
return Math.max(...this.pages);
|
|
}
|
|
}
|