Who imports who · hover a nodeNo overview comment at the top of the file.
- Imports
- no other modules
- Used by
- 1 module3 other
Types
export type Tracker = ReturnType<typeof createTracker>;
Functions & values
export const tracker = createTracker(() => ({
document,
window,
lastActiveTab: {
read: () => PersistedState.read(lastActiveTabPersisted),
write: (tabId) => PersistedState.write(lastActiveTabPersisted, tabId),
},
now: () => Date.now(),
}));Unit tests not about one export (6)
Not shown, only used by tests: createTracker
No overview comment at the top of the file.
- Imports
- no other modules
- Used by
- 1 component
Functions & values
constMENTION_COOLDOWN_MS
no JSDoc:4 export const MENTION_COOLDOWN_MS = 5_000;
constSTICKER_COOLDOWN_MS
no JSDoc:5 export const STICKER_COOLDOWN_MS = 15_000;
constSTICKER_COOLDOWN_KEY
no JSDoc:6 export const STICKER_COOLDOWN_KEY = "sticker";
functionmentionKey
no JSDoc:8 export function mentionKey(userId: number)
export function start(keys: string[], durationMs: number, now = Date.now())
export function until(key: string, now = Date.now())
Unit tests (6)
No overview comment at the top of the file.
- Imports
- Replies
- Used by
- 2 components
Functions & values
functioncontinuesBatch
no JSDoc:6 export function continuesBatch(
previous: ClientChatMessage | undefined,
message: ClientChatMessage,
)
Unit tests (1)
functionfirstUnreadMessageId
no JSDoc:22 export function firstUnreadMessageId({
messages,
divider,
ownUserId,
}: {
messages: ClientChatMessage[];
divider: UnreadDivider | undefined;
ownUserId: number;
}): number | nullUnit tests (1)
No overview comment at the top of the file.
- Imports
- no other modules
- Used by
- 1 other
Functions & values
export function create({
attention,
playSound,
resolveMentions,
}: {
attention: Pick<
Attention.Tracker,
"isAttending" | "isLastActiveTab" | "subscribe"
>;
playSound: () => void;
resolveMentions: (roomId: number) => void;
})Unit tests (4)
No overview comment at the top of the file.
- Imports
- no other modules
- Used by
- 2 components3 other
Types
interfacePickedMention
no JSDoc:12 export interface PickedMention {
userId: number;
username: string;
start: number;
}Functions & values
export function split(contents: string): MessagePart[]
Unit tests (2)
functionmentionedUserIds
no JSDoc:44 export function mentionedUserIds(contents: string)
functionmentionsUser
no JSDoc:52 export function mentionsUser(contents: string, userId: number)
Unit tests (1)
functionvisibleLength
no JSDoc:56 export function visibleLength(contents: string)
Unit tests (1)
functionencode
no JSDoc:60 export function encode(
text: string,
users: Array<{ id: number; username: string }>,
pickedMentions: PickedMention[] = [],
)Unit tests (2)
functionshiftPicked
no JSDoc:92 export function shiftPicked(
pickedMentions: PickedMention[],
previousText: string,
nextText: string,
): PickedMention[]
Unit tests (1)
functionactiveQuery
no JSDoc:124 export function activeQuery(text: string, caret: number)
Unit tests (1)
functionsuggestions
no JSDoc:131 export function suggestions<T extends { username: string }>(
users: T[],
query: string,
)Unit tests (2)
Not shown, only used by tests: token
No overview comment at the top of the file.
- Imports
- no other modules
- Used by
- 1 component
Functions & values
functionfindRoomLinks
no JSDoc:20 export function findRoomLinks(
text: string,
): Array<{ url: string; index: number }>Unit tests (5)
Unit tests not about one export (2)
Not shown, only used by tests: isSplatnetRoomUrl
No overview comment at the top of the file.
- Imports
- no other modules
- Used by
- 1 module2 components1 other
Functions & values
export function token(messageId: number)
export function split(contents: string)
Unit tests (1)
functionhasValid
no JSDoc:16 export function hasValid(contents: string)
Unit tests (1)
No overview comment at the top of the file.
- Imports
- no other modules
- Used by
- 1 component3 other
Functions & values
export function play(soundCode: string)
Unit tests (4)
functionplayIgnoringSetting
:17 Plays regardless of the user's setting (e.g. volume preview); cuts off any sound already playing.
export function playIgnoringSetting(soundCode: string)
No overview comment at the top of the file.
- Imports
- no other modules
- Used by
- 3 components1 other
Types
typeChatSticker
no JSDoc:25 export type ChatSticker = (typeof CHAT_STICKERS)[number];
Functions & values
export function token(stickerId: string)
export function split(contents: string)
Unit tests (1)
functionhasValid
no JSDoc:41 export function hasValid(contents: string)
Unit tests (1)
functionactiveQuery
no JSDoc:46 export function activeQuery(text: string, caret: number)
Unit tests (1)
functionsuggestions
no JSDoc:53 export function suggestions(query: string)
Unit tests (1)
Not shown, only used by tests: CHAT_STICKERS