mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-06 05:23:56 -07:00
remove type aliases
This commit is contained in:
parent
141f0e59f5
commit
cea9ae62d8
58 changed files with 412 additions and 455 deletions
|
|
@ -1,7 +1,8 @@
|
|||
import type { ServerInfo_Room } from 'generated/proto/serverinfo_room_pb';
|
||||
import type { ServerInfo_Game } from 'generated/proto/serverinfo_game_pb';
|
||||
import type { ServerInfo_GameType } from 'generated/proto/serverinfo_gametype_pb';
|
||||
import { Game, GametypeMap, LogItem, LogGroups, Message, Room } from 'types';
|
||||
import type { ServerInfo_ChatMessage } from 'generated/proto/serverinfo_chat_message_pb';
|
||||
import { Game, GametypeMap, LogGroups, Message, Room } from 'types';
|
||||
|
||||
/** Flatten a gametype list into a lookup map of { gameTypeId → description }. */
|
||||
export function normalizeGametypeMap(gametypeList: ServerInfo_GameType[]): GametypeMap {
|
||||
|
|
@ -40,7 +41,7 @@ export function normalizeGameObject(game: ServerInfo_Game, gametypeMap: Gametype
|
|||
}
|
||||
|
||||
/** Group a flat LogItem[] into { room, game, chat } buckets for the server store. */
|
||||
export function normalizeLogs(logs: LogItem[]): LogGroups {
|
||||
export function normalizeLogs(logs: ServerInfo_ChatMessage[]): LogGroups {
|
||||
return logs.reduce((obj, log) => {
|
||||
const type = log.targetType as keyof LogGroups;
|
||||
obj[type] = obj[type] || [];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue