Skip to content

TypeScript migration: add reporter and game API boundary types #35

Description

@KagamiChan

Context

The mechanical TypeScript source move and tsdown build are already in place. The next migration slice is to introduce shared boundary types without changing reporter behavior.

Reference: docs/typescript-migration-plan.md PR 4.

Scope

  • Add shared reporter/game API/window-state type modules, such as:
    • src/types/reporter.ts
    • src/types/game-api.ts
    • src/types/window-state.ts
  • Define GameResponseEventDetail for game.response payloads: method, path, body, postBody, and time.
  • Define a shared Reporter interface and make reporter classes conform to it.
  • Type BaseReporter.report and BaseReporter.getJson.
  • Add narrow boundary helpers such as asRecord, parseInt10, getWindowShip, and getWindowSlotItem.
  • Keep Kancolle response bodies as unknown or coarse local interfaces at unsafe boundaries until each reporter is typed.

Acceptance criteria

  • Entry/runtime and base reporter boundaries are typed.
  • Reporter classes conform to a shared interface.
  • No reporter payload field names or endpoint behavior changes.
  • No broad catch/silent fallback behavior is introduced.

Validation

  • pnpm run typecheck
  • pnpm run build

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions