fix: remove type hacks
Build and Deploy / build-and-deploy (push) Successful in 1m5s

This commit is contained in:
2026-07-07 16:58:28 +07:00 Unverified
parent a18af70b2a
commit cd3c386250
3 changed files with 16 additions and 7 deletions
+12
View File
@@ -0,0 +1,12 @@
import "enka.ts";
declare module "enka.ts" {
namespace ApiResponse {
interface ShowAvatarInfo {
energyType?: number;
talentLevel?: number;
}
}
}
export {};
+2 -5
View File
@@ -222,11 +222,8 @@ export function getAvatar(
avatarId.split("-")[0] === `${id}` &&
avatar.Element ===
ElementList[
(
playerInfo.showAvatarInfoList.find(
(e) => e.avatar.avatarId === id,
) as { energyType: number } | undefined
)?.energyType ?? 0
playerInfo.showAvatarInfoList.find((e) => e.avatar.avatarId === id)
?.energyType ?? 0
],
)?.[1] || store[id]
);
+2 -2
View File
@@ -244,7 +244,7 @@ export async function ListPage(
avatarInfoList?.find(
(e) => e.avatar.avatarId === a.avatar.avatarId,
)!.talentIdList?.length ??
(a as unknown as { talentLevel?: number }).talentLevel,
a.talentLevel,
}))
.map(({ a, c, cons }) => (
<div tw="relative flex flex-col rounded-[.3em] overflow-hidden shadow-[0_.08em_.35em_rgba(0,0,0,.18)]">
@@ -262,7 +262,7 @@ export async function ListPage(
/>
<img
tw="absolute top-[.2em] left-[.2em] w-[1.7em] h-[1.7em]"
src={`/e/${ElementList[(a as unknown as { energyType: number }).energyType]?.toLowerCase()}`}
src={`/e/${ElementList[a.energyType ?? 0]?.toLowerCase()}`}
/>
<div
tw={`flex text-[#404B57] bg-[#E9E6DB] items-center justify-center grow text-[1.1em] ${a.level > 90 && "text-[#966E6C]"}`}