Typed Modules
The Generic JSON API can patch anything, but it makes you spell out the asset's JSON by hand. The typed modules sit on top of it and add helpers that understand a specific kind of content. PM.Parts knows what a module is. PM.Planets knows how to add a body to the galaxy. PM.Science knows how to unlock a part in a tech node.
You still register patches the same way (a Patch call, then the chain from Core Concepts). The difference is what you get inside the Do callback: a value with typed helpers instead of a bare JSON table.
The shared pattern
Most typed helpers follow the same five methods, so once you learn them for one module they read the same everywhere:
Add<Thing>(name, callback)creates a new child and errors if it already exists.Patch<Thing>(name, callback)edits an existing child and does nothing if it is missing.Ensure<Thing>(name, callback)adds it if missing or patches it if present. This is the one you usually want.Remove<Thing>(name)deletes it.Has<Thing>(name)tests for it.
For example, on a part: part:EnsureModule("Module_Engine", function(module) ... end). The callback receives the thing you just added or found, and you fill it in there.
Lists you address by name (modules, variants, science regions, and so on) are exposed as indexed collections: you can read data.cubes["DEPLOYED"], iterate them with pairs, and call :Append or :RemoveWhere on them. See Working with JSON.
The modules
Parts is the largest. Parts hold modules, modules hold data, and there are dedicated helpers for engine modes and resource containers.
Planets patches celestial bodies, creates and copies galaxies, adds new bodies to them, and overrides atmosphere and cloud visuals.
Resources defines fuels and recipes.
Science covers experiments, science regions, discoverables, and the tech tree.
Missions patches missions, including the condition and action builders.
Campaign packs creates the packs that players select for a campaign. It also sets the galaxy of each pack and the features that a new campaign starts with.
VSwift adds part variants (the in-editor variant switcher).
Audio attaches stock audio presets to a part.
When a typed helper does not exist
The typed modules do not cover every field of every asset. When you need something they do not expose, you can always fall through to the raw JSON on the same value (assign a field directly, or use the JSON methods). The typed helpers and raw access work on the same underlying data, so mixing them is fine.
If you find yourself wishing a typed helper existed for something you patch often, say so. Contact the Redux developers, or the author of the mod whose content you are patching, and ask for it. :3