Skip to content

Commit 47ef260

Browse files
committed
use for type declaration
1 parent 0bcacb4 commit 47ef260

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

app/lib/hai/shanten.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ import { type Hai, haiToIndex } from "./types";
22

33
type TehaiIndex = number[];
44

5-
interface ShantenResult {
5+
type ShantenResult = {
66
shanten: number;
77
isTenpai: boolean;
88
isAgari: boolean;
9-
}
9+
};
1010

1111
/**
1212
* Calculate shanten number for a hand (13 or 14 tiles)

app/routes/gameover.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { getDB } from "@/lib/db";
66
import { kyoku } from "@/lib/db/schema";
77
import type { Route } from "./+types/gameover";
88

9-
export interface GameOverData {
9+
export type GameOverData = {
1010
finalScore: number;
1111
rank: number;
1212
totalPlayers: number;
@@ -15,7 +15,7 @@ export interface GameOverData {
1515
agariCount: number;
1616
ryukyokuCount: number;
1717
tenpaiCount: number;
18-
}
18+
};
1919

2020
export async function loader({
2121
context,

app/routes/score.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { getDB } from "@/lib/db";
55
import { kyoku } from "@/lib/db/schema";
66
import type { Route } from "./+types/score";
77

8-
export interface KyokuRecord {
8+
export type KyokuRecord = {
99
id: string;
1010
haiyamaId: string;
1111
didAgari: boolean;
@@ -15,16 +15,16 @@ export interface KyokuRecord {
1515
createdAt: Date;
1616
playedCount: number;
1717
agariCount: number;
18-
}
18+
};
1919

20-
export interface GameSession {
20+
export type GameSession = {
2121
records: KyokuRecord[];
22-
}
22+
};
2323

24-
export interface ScoreData {
24+
export type ScoreData = {
2525
sessions: GameSession[];
2626
totalScore: number;
27-
}
27+
};
2828

2929
export async function loader({
3030
context,

0 commit comments

Comments
 (0)