fix: Phase 3 - fix adapter type issues (43 -> 42 errors)

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 <noreply@anthropic.com>
This commit is contained in:
Justin Edmund 2025-11-28 19:25:23 -08:00
parent 5d98bba30c
commit 45b51d8880
3 changed files with 4 additions and 1 deletions

View file

@ -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

View file

@ -320,7 +320,7 @@ export interface ResourceOptions<T> {
onSuccess?: (data: T) => void
/** Callback when fetch fails */
onError?: (error: Error) => void
onError?: (error: AdapterError) => void
/** Dependencies that trigger refetch when changed */
dependencies?: any[]

View file

@ -93,6 +93,7 @@ export interface Party {
turnCount?: number
chainCount?: number
visibility?: number
element?: number
favorited?: boolean
extra?: boolean
remix?: boolean