Files
pdf-to-markdown/src/TOC.ts
Johannes Zillmann b5f3075bdf Clean up types
- merge `ItemType`/`BlockType` to `TextType`
- fix bug with duplicate and flattened types
2024-04-02 11:18:55 -06:00

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);
}
}