import { ConversationItem, MessageType, SessionType } from "@droppii-org/wasm-client-sdk"; import { TFunction } from "i18next"; import { UrlMetadataInfo } from "../types/chat"; import { PeerType } from "../types/conversation"; export interface LatestMessageConversation { peerType?: PeerType | string; conversationType?: SessionType; showName?: string; } export declare const formatMemberLabel: (displayName: string, username?: string) => string; export declare const parseMessageContent: (content?: string) => Partial; export declare const parseUrlMetadata: (ex?: string) => UrlMetadataInfo | undefined; export declare function formatDuration(seconds: number): string; export declare function renderFileSize(bytes: number): string; interface ShortenFileNameOptions { maxLength?: number; keepStart?: number; keepEnd?: number; } export declare const shortenFileName: (name?: string, options?: ShortenFileNameOptions) => string; export declare const generateContentBasedOnMessageType: (contentType: MessageType, plainText?: string, t?: TFunction, mediaMeta?: { duration?: number; fileName?: string; }, customElem?: { extension?: string; description?: string; }) => string; export declare const isInternalLatestMessage: (latestMsg?: string) => boolean; export declare const ignoreInternalLatestMessage: (conversations: ConversationItem[], isCrm: boolean) => ConversationItem[]; export declare const parseLatestMessage: (latestMsg: string, currentUserId?: string, t?: TFunction, conversation?: LatestMessageConversation, options?: { includeSenderPrefix?: boolean; /** Automatic bot-thread messages; CRM never shows them. */ showEventMessages?: boolean; }) => string; export interface HighlightParts { before: string; match: string; after: string; } /** A window of about `maxLength` chars around the first match, "…" marking cut text. */ export declare const splitHighlight: (text: string, keyword: string, maxLength?: number) => HighlightParts | null; export declare const highlightSearch: (text: string, keyword: string, maxLength?: number) => string; interface FormatOptions { hasTime?: boolean; dateMonthFormat?: string; } export declare function formatTimestamp(timestamp: number, options?: FormatOptions): string; export declare function formatDividerTimestamp(timestamp: number): string; export declare const urlRegex: RegExp; export declare function wrapLinksInHtml(htmlContent: string): string; export declare const getHostFromUrl: (url: string) => string | null; export declare const htmlHasFormatting: (html: string) => boolean; export declare const stripHtml: (html: string) => string; /** * Sanitizes HTML content to prevent XSS attacks * Uses DOMPurify to remove all potentially malicious code * * @param html - Raw HTML content that may contain malicious scripts * @returns Sanitized HTML safe for rendering * * @example * const userInput = ''; * const safe = sanitizeHtml(userInput); * // Returns: '' (onerror removed) */ export declare function sanitizeHtml(html: string): string; export {}; //# sourceMappingURL=common.d.ts.map