@vue-pdf-viewer/viewer
Version:
A vue-pdf-viewer component for Vue and Nuxt. Suitable for vue-pdf document.
17 lines (16 loc) • 1.09 kB
TypeScript
import type { TextContent } from 'pdfjs-dist/types/src/display/text_layer';
import type { HighlightOptions, Match } from './types';
interface MatchWithLines extends Match {
lines?: any[];
}
declare function isMatchEntireWord(content: string, startIdx: number, length: number): boolean;
declare function highlightMatches(matches: Match[], textContent: TextContent, textDivs: HTMLElement[]): void;
/**
* Appends highlights without removing existing ones.
* Works with the current DOM structure to preserve overlapping highlights.
*/
declare function appendHighlightMatches(matches: Match[], textDivs: HTMLElement[]): void;
declare function resetDivs(textContent: TextContent, textDivs: HTMLElement[]): void;
declare function findMatches(queries: (string | RegExp)[], textContent: TextContent, pageIndex: number, options: HighlightOptions): MatchWithLines[];
declare function getHighlightOptionsWithDefaults(options?: HighlightOptions): HighlightOptions;
export { appendHighlightMatches, findMatches, highlightMatches, resetDivs, getHighlightOptionsWithDefaults, isMatchEntireWord };