import { ChatCitation } from '../../../__generated__/graphql'; export declare const citationsRegex: RegExp; /** * Replaces markdown citation links with a display format and URL. * * @param {string} inputString - The input markdown string containing citation links in the format [^{int}^] or [^{int}]. * @param {CitationNumberToDisplayOrderMap} citationNumberToDisplayOrderMap - A mapping from citation numbers to their display order. * @param {CitationNumberToChatCitationMap} citationNumberToChatCitationMap - A mapping from citation numbers to citation objects. * @returns {string} - The updated markdown string with replaced citation links int he format of [\({int}\)]({url}). */ export declare function replaceMdCitationsToMdLinks(inputString: string, citationNumberToDisplayOrderMap: CitationNumberToDisplayOrderMap, citationNumberToChatCitationMap: CitationNumberToChatCitationMap): string; export declare function replaceMdCitationsForSupHTML(inputString: string): string; /** * Deduplicates citation groups in a given string. * * A citation group is a sequence of adjacent citations (with no content other than whitespace in between). * A citation group is considered duplicated if it is the same as the immediately preceding citation group. * * @param {string} inputString - The string to deduplicate citations in. * @return {string} - The input string with duplicate citation groups removed. * * @example * * let input = "Hi there [^1] [^2]. How are you [^1][^2] this fine evening [^1][^2]. I'm doing well [^1]. That's great to hear [^2]. I'm doing well as well [^2]. What a great day. [^1][^2] "; * let output = deduplicateCitations(input); * console.log(output); * // Hi there [^1] [^2]. How are you this fine evening. I'm doing well [^1]. That's great to hear [^2]. I'm doing well as well. What a great day. [^1][^2] * */ export declare function deduplicateCitations(inputString: string): string; /** * createUrlToChatCitationMap creates a dictionary (object) that maps URLs to ChatCitation objects. * @param citations - An array of ChatCitation objects * @returns URLToChatCitationMap - An object with URLs as keys and ChatCitation objects as values */ export type URLToChatCitationMap = Record; export declare const createUrlToChatCitationMap: (citations: ChatCitation[]) => URLToChatCitationMap; /** * createCitationNumberToChatCitationMap creates a dictionary (object) that maps citation numbers to ChatCitation objects. * @param citations - An array of ChatCitation objects * @returns CitationNumberToChatCitationMap - An object with citation numbers as keys and ChatCitation objects as values */ export type CitationNumberToChatCitationMap = Record; export declare const createCitationNumberToChatCitationMap: (citations: ChatCitation[]) => CitationNumberToChatCitationMap; export type CitationNumberToDisplayOrderMap = Record;