grimmdude / MidiWriterJS

♬ A JavaScript library which provides an API for programmatically generating and creating expressive multi-track MIDI files and JSON.
MIT License
547 stars 58 forks source link

Automatically generate type definition files during npm run build #125

Closed tri-star closed 9 months ago

tri-star commented 9 months ago

Description

Thank you for the wonderful library!

While using midi-writer-js in TypeScript, I noticed that some methods were not being auto-completed, so I created this PR.

image

By adjusting tsconfig.json, it is possible to automatically output d.ts files under build/types when running npm run build, so I have changed it to automatically output at build time.

With this PR method, type definition files will be output to build/types and browser/types when running npm run build. I believe this may result in a change in the project's policy, so please consider it.

Screenshots

As far as I have reflected the changes in node_modules/midi-writer-js of my project, I have confirmed that Track.controllerChange is also auto-completed by this method.

image

grimmdude commented 9 months ago

Thanks, @tri-star! Admittedly I'm still a bit new to TypeScript so this is very much appreciated.