From 45b51d8880e6d6952b3b99aeb91361a1639377d6 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Fri, 28 Nov 2025 19:25:23 -0800 Subject: [PATCH] fix: Phase 3 - fix adapter type issues (43 -> 42 errors) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed three key type definition issues in the adapter layer: 1. Added missing element property to Party interface - Added `element?: number` to Party type - Used throughout codebase but was missing from interface 2. Aligned onError callback types for consistency - Changed ResourceOptions.onError from Error to AdapterError - Now matches AdapterOptions.onError type signature 3. Exported Grid types from grid.adapter.ts - Re-exported GridWeapon, GridCharacter, GridSummon - Makes types available for test files Files modified: - src/lib/types/api/party.ts: Added element property - src/lib/api/adapters/types.ts: Fixed onError callback type - src/lib/api/adapters/grid.adapter.ts: Added type re-exports Result: 43 → 42 errors (-1) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/lib/api/adapters/grid.adapter.ts | 2 ++ src/lib/api/adapters/types.ts | 2 +- src/lib/types/api/party.ts | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/api/adapters/grid.adapter.ts b/src/lib/api/adapters/grid.adapter.ts index 041ebd2f..af3f8370 100644 --- a/src/lib/api/adapters/grid.adapter.ts +++ b/src/lib/api/adapters/grid.adapter.ts @@ -13,6 +13,8 @@ import type { GridWeapon, GridCharacter, GridSummon } from '$lib/types/api/party import { DEFAULT_ADAPTER_CONFIG } from './config' // GridWeapon, GridCharacter, and GridSummon types are imported from types/api/party +// Re-export for test files and consumers +export type { GridWeapon, GridCharacter, GridSummon } /** * Parameters for creating grid items diff --git a/src/lib/api/adapters/types.ts b/src/lib/api/adapters/types.ts index e5d76eae..262156f2 100644 --- a/src/lib/api/adapters/types.ts +++ b/src/lib/api/adapters/types.ts @@ -320,7 +320,7 @@ export interface ResourceOptions { onSuccess?: (data: T) => void /** Callback when fetch fails */ - onError?: (error: Error) => void + onError?: (error: AdapterError) => void /** Dependencies that trigger refetch when changed */ dependencies?: any[] diff --git a/src/lib/types/api/party.ts b/src/lib/types/api/party.ts index 0867f383..72ebbd38 100644 --- a/src/lib/types/api/party.ts +++ b/src/lib/types/api/party.ts @@ -93,6 +93,7 @@ export interface Party { turnCount?: number chainCount?: number visibility?: number + element?: number favorited?: boolean extra?: boolean remix?: boolean