@scml/sc2-modloader
TypeScript type definitions for SugarCube 2 Mod Loader, providing type support for mod and game data management.
Installation
Quick Start
Add type reference
Add triple-slash directive in your project to bring in global types:
Use global objects
Mod Loader mounts core objects on window; access directly:
Import types on demand
Global Types global
Main entry extends Window via /// <reference types="..." />. global The following properties are on window:
Subpath Exports
API Reference
./AddonPlugin
AddonPluginHookPointEx interface
Interface for addon plugins; must implement registerMod(), optional lifecycle hooks.
AddonPluginManager class
registerAddonPlugin(), getAddonPlugin().
./SC2DataManager
SC2DataManager class
Mod and game data manager. Methods: getModUtils(), getModLoadController(), getSC2DataInfoCache(), getSC2DataInfoAfterPatch(), etc.
./ModLoader
ModInfo interface
./Utils
ModUtils class
Methods: getModListName(), getMod(), getModZip(), getPassageData(), getAllPassageData(), createNewSC2DataInfoFromNow(), updatePassageData(), updatePassageDataMany(), etc.
Other subpaths
./ModZipReader, ./SC2DataInfoCache, ./SugarCube2, ./ReplacePatcher, ./ModOrderContainer, ./ModPack/*, ./SemVer/InfiniteSemVer.
Type Definition Source
- Upstream: https://github.com/Lyoko-Jeremie/sugarcube-2-ModLoader
- Default branch: master
- Build:
pnpm run download && pnpm run build
