View Issue Details

IDProjectCategoryView StatusLast Update
0021381MMW 5Extensions frameworkpublic2024-11-30 04:53
Reporterdrakinite Assigned To 
PriorityhighSeverityfeatureReproducibilityN/A
Status assignedResolutionopen 
Product Version2024.1 
Target Version2024.1 
Summary0021381: Add TypeScript / type hinting support for addon developers
DescriptionThe objective is to publish MM's typescript declaration files to a NPM package that can be imported in the addon developers' projects, with assistance from pack-mmip for automating the initialization and build process.

The addition of type hinting should be really helpful for addon developers writing JS. The general idea is that the "declarations" folder that's emitted by the new typescript compile process is turned into a NPM package, which can be imported into their project. When their tsconfig.json is set up right (which I plan to be autogenerated with a `pack-mmip --init` call), VS Code (and hopefully other IDEs with TS support) will automatically understand all of the custom functions and window extensions that MM makes, and then you can create imports in your file, like import Multiview from 'mediamonkey-types/controls/multiview'. The IDE will then understand that it's importing the Multiview class. Then, when pack-mmip is called to package the addon, it runs a simple post-processing script that replaces 'mediamonkey-types' in the import string with the appropriate relative path (e.g. dialogs/dlgUndockedControls.ts's import would turn into import Multiview from '../controls/multiview'.
TagsNo tags attached.
Fixed in build

Activities

There are no notes attached to this issue.