UNPKG

@twurple/common

Version:

Common functions used by the `@twurple` library family.

32 lines 1.57 kB
import { type BasicMessageCheermote } from './BaseCheermoteList'; import { type BasicParsedMessagePart, type ParsedMessageEmotePart } from './ParsedMessagePart'; /** * Transforms the parts of the given text that are marked as emotes. * * @param text The message text. * @param emoteOffsets The emote offsets. An emote name maps to a list of text ranges. */ export declare function parseEmotePositions(text: string, emoteOffsets: Map<string, string[]>): ParsedMessageEmotePart[]; /** * Finds the positions of all cheermotes in the given message. * * @param text The message text. * @param names The names of the cheermotes to find. */ export declare function findCheermotePositions(text: string, names: string[]): BasicMessageCheermote[]; /** * Add text parts to the given list of message parts for all the text that's unaccounted for. * * @param text The message text. * @param otherPositions The parsed non-text parts of the message. */ export declare function fillTextPositions(text: string, otherPositions: BasicParsedMessagePart[]): BasicParsedMessagePart[]; /** * Parse a chat message with emotes and optionally cheermotes. * * @param text The message text. * @param emoteOffsets The emote offsets. An emote name maps to a list of text ranges. * @param cheermoteNames The names of the cheermotes to find. Will not do cheermote parsing if not given. */ export declare function parseChatMessage(text: string, emoteOffsets: Map<string, string[]>, cheermoteNames?: string[]): BasicParsedMessagePart[]; //# sourceMappingURL=messagePartParser.d.ts.map