feat: NCS-69 Challenge request (#3)
- create challange window - challanges view page - decline and accept - notif tab (wip) - active game window (wip) --------- Co-authored-by: shahdlala66 <shahd.lala66@gmail.com> Co-authored-by: Lala, Shahd <Shahd.Lala@sybit.de> Reviewed-on: #3
This commit was merged in pull request #3.
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
export type ChallengeStatus = 'created' | 'pending' | 'accepted' | 'declined' | 'cancelled' | 'expired';
|
||||
|
||||
export type PlayerColor = 'white' | 'black' | 'random';
|
||||
|
||||
export interface Player {
|
||||
id: string;
|
||||
name: string;
|
||||
rating: number;
|
||||
}
|
||||
|
||||
export interface TimeControl {
|
||||
type: string | null;
|
||||
limit: number | null;
|
||||
increment: number | null;
|
||||
}
|
||||
|
||||
export interface Challenge {
|
||||
id: string;
|
||||
challenger: Player;
|
||||
destUser: Player;
|
||||
variant: string;
|
||||
color: PlayerColor;
|
||||
timeControl: TimeControl;
|
||||
status: ChallengeStatus;
|
||||
declineReason: string | null;
|
||||
gameId: string | null;
|
||||
expiresAt: string;
|
||||
createdAt: string;
|
||||
}
|
||||
|
||||
export interface SendChallengeRequest {
|
||||
timeControl: {
|
||||
limitSeconds: number;
|
||||
incrementSeconds: number;
|
||||
};
|
||||
color?: PlayerColor;
|
||||
ttlSeconds?: number;
|
||||
}
|
||||
|
||||
export interface ListChallengesResponse {
|
||||
'in'?: Challenge[];
|
||||
'out'?: Challenge[];
|
||||
incoming?: Challenge[];
|
||||
outgoing?: Challenge[];
|
||||
}
|
||||
|
||||
export interface DeclineChallengeRequest {
|
||||
reason?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user