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:
parent
5d98bba30c
commit
45b51d8880
3 changed files with 4 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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[]
|
||||
|
|
|
|||
|
|
@ -93,6 +93,7 @@ export interface Party {
|
|||
turnCount?: number
|
||||
chainCount?: number
|
||||
visibility?: number
|
||||
element?: number
|
||||
favorited?: boolean
|
||||
extra?: boolean
|
||||
remix?: boolean
|
||||
|
|
|
|||
Loading…
Reference in a new issue