mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
refactor typescript wiring
This commit is contained in:
parent
cea9ae62d8
commit
c62c336a11
286 changed files with 2999 additions and 3053 deletions
|
|
@ -1,105 +1,57 @@
|
|||
import {
|
||||
Game, SortBy, UserSortField
|
||||
} from 'types';
|
||||
import type { ServerInfo_User } from 'generated/proto/serverinfo_user_pb';
|
||||
import type { ServerInfo_Ban } from 'generated/proto/serverinfo_ban_pb';
|
||||
import type { ServerInfo_Warning } from 'generated/proto/serverinfo_warning_pb';
|
||||
import type { Response_WarnList } from 'generated/proto/response_warn_list_pb';
|
||||
import type { ServerInfo_ReplayMatch } from 'generated/proto/serverinfo_replay_match_pb';
|
||||
import type { Response_DeckList } from 'generated/proto/response_deck_list_pb';
|
||||
import type { ServerInfo_ChatMessage } from 'generated/proto/serverinfo_chat_message_pb';
|
||||
import { NotifyUserData, ServerShutdownData, UserMessageData } from 'websocket/events/session/interfaces';
|
||||
|
||||
export interface ServerConnectParams {
|
||||
host: string;
|
||||
port: string;
|
||||
userName: string;
|
||||
password: string;
|
||||
}
|
||||
|
||||
export interface ServerRegisterParams {
|
||||
host: string;
|
||||
port: string;
|
||||
userName: string;
|
||||
password: string;
|
||||
email: string;
|
||||
country: string;
|
||||
realName: string;
|
||||
}
|
||||
|
||||
export interface RequestPasswordSaltParams {
|
||||
userName: string;
|
||||
}
|
||||
|
||||
export interface ForgotPasswordParams {
|
||||
userName: string;
|
||||
}
|
||||
|
||||
export interface ForgotPasswordChallengeParams extends ForgotPasswordParams {
|
||||
email: string;
|
||||
}
|
||||
|
||||
export interface ForgotPasswordResetParams extends ForgotPasswordParams {
|
||||
token: string;
|
||||
newPassword: string;
|
||||
}
|
||||
|
||||
export interface AccountActivationParams extends ServerRegisterParams {
|
||||
token: string;
|
||||
}
|
||||
import { App, Data, Enriched } from '@app/types';
|
||||
|
||||
export interface ServerState {
|
||||
initialized: boolean;
|
||||
buddyList: ServerInfo_User[];
|
||||
ignoreList: ServerInfo_User[];
|
||||
buddyList: Data.ServerInfo_User[];
|
||||
ignoreList: Data.ServerInfo_User[];
|
||||
info: ServerStateInfo;
|
||||
status: ServerStateStatus;
|
||||
logs: ServerStateLogs;
|
||||
user: ServerInfo_User;
|
||||
users: ServerInfo_User[];
|
||||
user: Data.ServerInfo_User | null;
|
||||
users: Data.ServerInfo_User[];
|
||||
sortUsersBy: ServerStateSortUsersBy;
|
||||
messages: {
|
||||
[userName: string]: UserMessageData[];
|
||||
[userName: string]: Data.Event_UserMessage[];
|
||||
}
|
||||
userInfo: {
|
||||
[userName: string]: ServerInfo_User;
|
||||
[userName: string]: Data.ServerInfo_User;
|
||||
}
|
||||
notifications: NotifyUserData[];
|
||||
serverShutdown: ServerShutdownData;
|
||||
notifications: Data.Event_NotifyUser[];
|
||||
serverShutdown: Data.Event_ServerShutdown | null;
|
||||
banUser: string;
|
||||
banHistory: {
|
||||
[userName: string]: ServerInfo_Ban[];
|
||||
[userName: string]: Data.ServerInfo_Ban[];
|
||||
};
|
||||
warnHistory: {
|
||||
[userName: string]: ServerInfo_Warning[];
|
||||
[userName: string]: Data.ServerInfo_Warning[];
|
||||
};
|
||||
warnListOptions: Response_WarnList[];
|
||||
warnListOptions: Data.Response_WarnList[];
|
||||
warnUser: string;
|
||||
adminNotes: { [userName: string]: string };
|
||||
replays: ServerInfo_ReplayMatch[];
|
||||
backendDecks: Response_DeckList | null;
|
||||
gamesOfUser: { [userName: string]: Game[] };
|
||||
replays: Data.ServerInfo_ReplayMatch[];
|
||||
backendDecks: Data.Response_DeckList | null;
|
||||
gamesOfUser: { [userName: string]: Enriched.Game[] };
|
||||
registrationError: string | null;
|
||||
}
|
||||
|
||||
export interface ServerStateStatus {
|
||||
connectionAttemptMade: boolean;
|
||||
description: string;
|
||||
state: number;
|
||||
description: string | null;
|
||||
state: App.StatusEnum;
|
||||
}
|
||||
|
||||
export interface ServerStateInfo {
|
||||
message: string;
|
||||
name: string;
|
||||
version: string;
|
||||
message: string | null;
|
||||
name: string | null;
|
||||
version: string | null;
|
||||
}
|
||||
|
||||
export interface ServerStateLogs {
|
||||
room: ServerInfo_ChatMessage[];
|
||||
game: ServerInfo_ChatMessage[];
|
||||
chat: ServerInfo_ChatMessage[];
|
||||
room: Data.ServerInfo_ChatMessage[];
|
||||
game: Data.ServerInfo_ChatMessage[];
|
||||
chat: Data.ServerInfo_ChatMessage[];
|
||||
}
|
||||
|
||||
export interface ServerStateSortUsersBy extends SortBy {
|
||||
field: UserSortField
|
||||
export interface ServerStateSortUsersBy extends App.SortBy {
|
||||
field: App.UserSortField
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue