Skip to content

Makings mods in TypeScript

PolyModLoader is written in TypeScript, allowing people who feel like it to have types and autocompletion when making a PML mod.

The PolyTrackMods codeberg organization has a template repository which you can fork to have type autocompletion from the get go.

The main thing in tsconfig.json is this snippet:

json
"paths": {
    "https://cdn.polymodloader.com/cb/polytrackmods/PolyModLoader/0.6.0/PolyTypes.js": [
        "./types/PolyTypes.d.ts"
    ]
}

So that TypeScript adds the types from ./types/PolyTypes.d.ts when you are importing from the url. Note that this URL will change soon(tm) with upcoming placeholders URLs.

After forking the repository, you can run tsc -w to compile in watch mode, making your mod update everytime you save a file.