export type Chunk = { highlight: boolean; start: number; end: number; }; /** * Creates an array of chunk objects representing both highlightable and non-highlightable pieces of text that match each search word. * @return Array of "chunks" (where a Chunk is { start:number, end:number, highlight:boolean }) */ export declare function findAll({ autoEscape, caseSensitive, findChunks, sanitize, searchWords, textToHighlight, }: { autoEscape?: boolean; caseSensitive?: boolean; findChunks?: typeof defaultFindChunks; sanitize?: typeof defaultSanitize; searchWords: (string | RegExp)[]; textToHighlight: string; }): Chunk[]; /** * Takes an array of {start:number, end:number} objects and combines chunks that overlap into single chunks. * @return {start:number, end:number}[] */ export declare function combineChunks({ chunks }: { chunks: Chunk[]; }): Chunk[]; /** * Examine text for any matches. * If we find matches, add them to the returned array as a "chunk" object ({start:number, end:number}). * @return {start:number, end:number}[] */ declare function defaultFindChunks({ autoEscape, caseSensitive, sanitize, searchWords, textToHighlight, }: { autoEscape?: boolean; caseSensitive?: boolean; sanitize?: typeof defaultSanitize; searchWords: (string | RegExp)[]; textToHighlight: string; }): Chunk[]; export { defaultFindChunks as findChunks }; /** * Given a set of chunks to highlight, create an additional set of chunks * to represent the bits of text between the highlighted text. * @param chunksToHighlight {start:number, end:number}[] * @param totalLength number * @return {start:number, end:number, highlight:boolean}[] */ export declare function fillInChunks({ chunksToHighlight, totalLength, }: { chunksToHighlight: Chunk[]; totalLength: number; }): Chunk[]; declare function defaultSanitize(string: string): string;