aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend/app/types
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/app/types')
-rw-r--r--frontend/app/types/ExecResult.ts18
-rw-r--r--frontend/app/types/PlayerInfo.ts7
-rw-r--r--frontend/app/types/PlayerProfile.ts4
-rw-r--r--frontend/app/types/PlayerState.ts7
-rw-r--r--frontend/app/types/SubmitResult.ts16
5 files changed, 52 insertions, 0 deletions
diff --git a/frontend/app/types/ExecResult.ts b/frontend/app/types/ExecResult.ts
new file mode 100644
index 0000000..e0b6bb4
--- /dev/null
+++ b/frontend/app/types/ExecResult.ts
@@ -0,0 +1,18 @@
+export type ExecResultStatus =
+ | "waiting_submission"
+ | "running"
+ | "success"
+ | "wrong_answer"
+ | "timeout"
+ | "compile_error"
+ | "runtime_error"
+ | "internal_error"
+ | "canceled";
+
+export type ExecResult = {
+ testcase_id: number | null;
+ status: ExecResultStatus;
+ label: string;
+ stdout: string;
+ stderr: string;
+};
diff --git a/frontend/app/types/PlayerInfo.ts b/frontend/app/types/PlayerInfo.ts
new file mode 100644
index 0000000..e282ba9
--- /dev/null
+++ b/frontend/app/types/PlayerInfo.ts
@@ -0,0 +1,7 @@
+import type { PlayerProfile } from "./PlayerProfile";
+import type { PlayerState } from "./PlayerState";
+
+export type PlayerInfo = {
+ profile: PlayerProfile;
+ state: PlayerState;
+};
diff --git a/frontend/app/types/PlayerProfile.ts b/frontend/app/types/PlayerProfile.ts
new file mode 100644
index 0000000..42bdcb8
--- /dev/null
+++ b/frontend/app/types/PlayerProfile.ts
@@ -0,0 +1,4 @@
+export type PlayerProfile = {
+ displayName: string;
+ iconPath: string | null;
+};
diff --git a/frontend/app/types/PlayerState.ts b/frontend/app/types/PlayerState.ts
new file mode 100644
index 0000000..e2a2da9
--- /dev/null
+++ b/frontend/app/types/PlayerState.ts
@@ -0,0 +1,7 @@
+import type { SubmitResult } from "./SubmitResult";
+
+export type PlayerState = {
+ score: number | null;
+ code: string;
+ submitResult: SubmitResult;
+};
diff --git a/frontend/app/types/SubmitResult.ts b/frontend/app/types/SubmitResult.ts
new file mode 100644
index 0000000..6df00b6
--- /dev/null
+++ b/frontend/app/types/SubmitResult.ts
@@ -0,0 +1,16 @@
+import type { ExecResult } from "./ExecResult";
+
+export type SubmitResultStatus =
+ | "waiting_submission"
+ | "running"
+ | "success"
+ | "wrong_answer"
+ | "timeout"
+ | "compile_error"
+ | "runtime_error"
+ | "internal_error";
+
+export type SubmitResult = {
+ status: SubmitResultStatus;
+ execResults: ExecResult[];
+};