export interface Chunk { start: number; end: number; highlight: boolean; } /** * Creates an array of chunk objects representing both higlightable 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 const findAll: ({ autoEscape, caseSensitive, findChunks, sanitize, searchWords, textToHighlight, }: { autoEscape?: boolean | undefined; caseSensitive?: boolean | undefined; findChunks?: (({ autoEscape, caseSensitive, sanitize, searchWords, textToHighlight, }: { autoEscape?: boolean | undefined; caseSensitive?: boolean | undefined; sanitize?: typeof defaultSanitize | undefined; searchWords: string[]; textToHighlight: string; }) => Chunk[]) | undefined; sanitize?: typeof defaultSanitize | undefined; searchWords: string[]; 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 const 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}[] */ export declare const defaultFindChunks: ({ autoEscape, caseSensitive, sanitize, searchWords, textToHighlight, }: { autoEscape?: boolean | undefined; caseSensitive?: boolean | undefined; sanitize?: typeof defaultSanitize | undefined; searchWords: string[]; 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 const fillInChunks: ({ chunksToHighlight, totalLength, }: { chunksToHighlight: Chunk[]; totalLength: number; }) => Chunk[]; export declare function defaultSanitize(string: string): string;