feat: 타입 정의 개선 및 any 사용 제거

This commit is contained in:
2026-01-05 17:19:32 +00:00
parent 7e58f7bac4
commit cb7e9c832f
17 changed files with 176 additions and 86 deletions
+12 -3
View File
@@ -1,15 +1,24 @@
<script setup lang="ts">
import { ref, onMounted } from 'vue';
import { useRouter } from 'vue-router';
import type { inferRouterOutputs } from '@trpc/server';
import type { AppRouter } from '@sammo-ts/gateway-api';
import DefaultLayout from '../layouts/DefaultLayout.vue';
import { trpc } from '../utils/trpc';
import { createGameTrpc } from '../utils/gameTrpc';
import type { GameRouter } from '../utils/gameTrpc';
type GatewayRouterOutput = inferRouterOutputs<AppRouter>;
type GameRouterOutput = inferRouterOutputs<GameRouter>;
type MeOutput = GatewayRouterOutput['me'];
type LobbyProfile = GatewayRouterOutput['lobby']['profiles'][number];
type LobbyInfo = GameRouterOutput['lobby']['info'];
const router = useRouter();
const me = ref<any>(null);
const me = ref<MeOutput>(null);
const notice = ref('');
const profiles = ref<any[]>([]);
const profileDetails = ref<Record<string, any>>({});
const profiles = ref<LobbyProfile[]>([]);
const profileDetails = ref<Record<string, LobbyInfo | undefined>>({});
onMounted(async () => {
try {