Skip to content

Add shared File type in interfaces.ts#119

Merged
Geomitron merged 1 commit intoGeomitron:masterfrom
elicwhite:add-file-type
Apr 21, 2026
Merged

Add shared File type in interfaces.ts#119
Geomitron merged 1 commit intoGeomitron:masterfrom
elicwhite:add-file-type

Conversation

@elicwhite
Copy link
Copy Markdown
Contributor

Summary

Extract the { fileName: string; data: Uint8Array } shape that's inlined in every scan-chart folder-taking API into a named File type in interfaces.ts. No runtime change; purely a rename.

Callsites updated:

  • scanChart, scanChartFolder, getChartMD5 (src/index.ts)
  • parseChartAndIni, findChartData (src/chart/parse-chart-and-ini.ts)
  • scanIni, findIniData (src/ini/ini-scanner.ts)
  • scanAudio, findAudioData (src/audio/audio-scanner.ts)
  • scanImage, findAlbumData (src/image/image-scanner.ts)
  • scanVideo, findVideoData (src/video/video-scanner.ts)
  • Test helpers in ini-scanner.test.ts and derived-flags.test.ts

Context

This lives at the bottom of the writer stack so that the downstream ChartDocument PR can replace its bespoke ChartAsset type with a reference to File. Addresses review feedback on #109 asking for a shared type before landing that PR.

Test plan

  • npx vitest run — 586/586 pass (no semantic change)
  • Public API surface unchanged except for the new File export

The `{ fileName: string; data: Uint8Array }` shape was inlined in every
scan-chart API that takes a chart folder — scanChart, parseChartAndIni,
scanIni, scanAudio, scanImage, scanVideo, and the test helpers. Extract
it as a named type `File` (exported from `interfaces.ts`) so consumers
and downstream writer APIs reference a single canonical shape. No
runtime change; purely a type rename.
@Geomitron Geomitron merged commit 759ad0b into Geomitron:master Apr 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants