decord/alpha/source/modules/channel_autocomplete/ChannelAutocompleteConstants.tsx

45 lines
1.5 KiB
TypeScript
Raw Normal View History

// Module ID: 5296
// Function ID: 5297
// Name: ChannelAutocompleteConstants
2026-07-23 10:11:24 +00:00
// Dependencies: [2]
2026-07-28 08:39:19 +00:00
// Exports: extractGameMentionIds, formatGameMentionRaw, formatGameMentionToken
2026-07-20 16:05:17 +00:00
// Module 5296 (ChannelAutocompleteConstants)
import size from "module_2" /* 2 */;
2026-08-24 06:08:38 +00:00
2026-07-24 07:16:23 +00:00
let closure_0 = [];
2026-07-20 16:05:17 +00:00
const tmp2 = /^<@\$(\d+)>/;
const regExp = new RegExp(tmp2.source.replace(/^\^/, ""), "g");
const result = size.fileFinishedImporting("modules/channel_autocomplete/ChannelAutocompleteConstants.tsx");
2026-07-20 16:05:17 +00:00
export const MENTION_SENTINEL = "@";
2026-07-24 07:16:23 +00:00
export const GAME_MENTION_SENTINEL = "$";
2026-07-20 16:05:17 +00:00
export const CHANNEL_SENTINEL = "#";
export const EMOJI_SENTINEL = ":";
export const REACTION_START_SENTINEL = "+:";
export const REACTION_END_SENTINEL = ":";
export const COMMAND_SENTINEL = "/";
2026-07-24 07:16:23 +00:00
export const GAME_MENTION_INPUT_PREFIX = "@game:";
2026-09-02 09:53:35 +00:00
export const TIMESTAMP_MENTION_INPUT_PREFIX = "@time:";
2026-07-20 16:05:17 +00:00
export const formatGameMentionRaw = function formatGameMentionRaw(arg0) {
return "<@$" + arg0 + ">";
};
2026-07-28 08:39:19 +00:00
export const formatGameMentionToken = function formatGameMentionToken(arg0) {
return "$" + arg0;
};
2026-07-20 16:05:17 +00:00
export const GAME_MENTION_RAW_RE = tmp2;
export const GAME_MENTION_RAW_RE_GLOBAL = regExp;
2026-07-24 07:16:23 +00:00
export const extractGameMentionIds = function extractGameMentionIds(arr) {
if (arr.includes("<@$")) {
const items = [];
HermesBuiltin.arraySpread(arr.matchAll(regExp), 0);
let mapped = items.map((item) => item[1]);
2026-07-24 07:16:23 +00:00
if (mapped.length <= 0) {
mapped = closure_0;
}
return mapped;
} else {
return closure_0;
}
};