Skip to content

dx: replace 'any' types in cost-extractor.ts with proper interfaces #68

@George-iam

Description

@George-iam

The cost extractor utility (src/utils/cost-extractor.ts) uses any types in two places: extractCostFromResult(msg: any) and when iterating over msg.modelUsage as Record<string, any>. Since the function processes Claude SDK response messages, the input shape is known and can be typed with a proper interface. Replacing the any types improves type safety and IDE autocompletion.

Relevant files:

  • src/utils/cost-extractor.ts — define an interface for the expected message shape and replace any usages

Acceptance criteria:

  • No any types remain in the file
  • A new interface (e.g., ClaudeResultMessage) defines the expected input shape with optional fields
  • npm run lint passes (tsc --noEmit with strict mode)
  • No runtime behavior change

Metadata

Metadata

Assignees

No one assigned

    Labels

    dxDeveloper experience improvementsgood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions