refactor: remove api-types.ts compatibility layer

- Migrated all 29 files from api-types.ts to use reflector-api.d.ts directly
- Removed $SourceKind manual enum in favor of OpenAPI-generated types
- Fixed unrelated Spinner component TypeScript error in AuthWrapper.tsx
- All imports now use: import type { components } from "path/to/reflector-api"
- Deleted api-types.ts file completely
This commit is contained in:
2025-08-29 16:35:33 -06:00
parent 8c525e09e8
commit 7ddae5ddd5
35 changed files with 96 additions and 77 deletions

View File

@@ -20,12 +20,11 @@ import {
} from "nuqs";
import { LuX } from "react-icons/lu";
import useSessionUser from "../../lib/useSessionUser";
import {
Room,
SourceKind,
SearchResult,
$SourceKind,
} from "../../lib/api-types";
import type { components } from "../../reflector-api";
type Room = components["schemas"]["Room"];
type SourceKind = components["schemas"]["SourceKind"];
type SearchResult = components["schemas"]["SearchResult"];
import {
useRoomsList,
useTranscriptsSearch,
@@ -204,7 +203,7 @@ export default function TranscriptBrowser() {
const [urlSourceKind, setUrlSourceKind] = useQueryState(
"source",
parseAsStringLiteral($SourceKind.values).withOptions({
parseAsStringLiteral(["room", "live", "file"] as const).withOptions({
shallow: false,
}),
);