UNPKG

captide

Version:

Get millions of financial documents into your AI app 🚀

40 lines (39 loc) • 1.26 kB
/** * PDF Highlighting Utility * * Provides functionality to find and highlight text in PDF documents using PDF.js */ export interface HighlightResult { page: number; textItems: Array<{ index: number; item: any; start: number; end: number; }>; textContent: any; } export interface CurrentHighlight { element: HTMLElement; page: number; text: string; } /** * Find text in PDF and return matching text items with coordinates */ export declare const findTextInPDF: (searchText: string, pdfViewerInstance: any, targetPage?: number) => Promise<HighlightResult | null>; /** * Create a rectangle highlight overlay on a PDF page */ export declare const createRectangleHighlight: ({ searchText, pdfViewerInstance, targetPage, currentHighlight, forceRecreate, shouldNavigateOnMatch }: { searchText: string; pdfViewerInstance: any; targetPage?: number | undefined; currentHighlight?: CurrentHighlight | null | undefined; forceRecreate?: boolean | undefined; shouldNavigateOnMatch?: boolean | undefined; }) => Promise<CurrentHighlight | null>; /** * Remove a highlight element from the DOM */ export declare const removeHighlight: (highlight: CurrentHighlight | null) => void;