All files / src TextResult.ts

92.85% Statements 13/14
83.33% Branches 5/6
100% Functions 3/3
92.85% Lines 13/14

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24              1x 25x 25x 25x   25x 18x 75x 75x   18x   25x 25x 25x 25x  
export type HyperlinkPosition = { rect: { left: number; top: number; right: number; bottom: number }; url: string; text: string; used: boolean };
 
export interface PageTextResult {
	num: number;
	text: string;
}
 
export class TextResult {
	pages: Array<PageTextResult> = [];
	text: string = '';
	total: number = 0;
 
	public getPageText(num: number): string {
		for (const pageData of this.pages) {
			if (pageData.num === num) return pageData.text;
		}
		return '';
	}
 
	constructor(total: number) {
		this.total = total;
	}
}