Skip to content

chore: TypeScript type improvements #1

@edobry

Description

@edobry

TypeScript Type Improvements

Follow-up from the string deduplication and HF write support work. These are internal code quality improvements that don't change behavior.

Tasks

  • Stricter CardInfo.type: Change from string to CardTypeName (the union type from constants.ts). This will give type-checking on switch statements and prevent invalid card types at compile time.
  • Rename FobTag in interfaces and store functions: Internal code still uses "fob" naming (Fob interface, saveFob(), loadFobs(), getFob(), fobs.json). Align with the "tag" terminology used in all user-facing strings. This is a larger rename that touches store, commands, and tests.
  • Type-safe PM3 command arguments: Consider whether cloneCommand() return type could encode the expected arguments at the type level (e.g., discriminated union per card type).

Context

The CardType constant object and CardTypeName type already exist in src/lib/constants.ts. The Fob→Tag rename was deferred during the terminology normalization pass to keep that PR focused on user-facing strings.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions