@scml/addon-modded-clothes
Modded clothes addon 的 TypeScript 类型定义,用于添加并修补 modded 服装数据。
安装
快速开始
添加类型引用
在项目中添加三斜杠指令以引入全局类型:
使用全局实例
addonModdedClothesAddon 已挂载到 window 上,可直接调用其方法:
按需导入类型
若只需导入部分类型,可使用子路径:
全局类型 global
主入口通过 /// <reference types="..." /> 扩展 Window 接口。 global 以下属性挂载在 window 上:
子路径导出
API 参考
./ModdedClothesAddon
ModdedClothesAddon 类
实现 LifeTimeCircleHook 和 AddonPluginHookPointEx 的 Addon 插件类,管理 clothesAddInfo。
构造函数
属性
方法
ClothesAddInfo 接口
ClothesInfo 接口
searchClothesByName() 方法
- 签名:
searchClothesByName(name: string): { c: ClothesItem; t: string }[] - 参数:
name- 服装名称 - 返回值: 匹配的服装条目及对应 key
checkForOutfitWarmth() 方法
- 签名:
checkForOutfitWarmth(logger: LogWrapper): void - 说明: 为
window.getTrueWarmth()执行服装保暖检查
./ModdedClothesAddonParams
ModdedClothesAddonParams 接口
mod 配置参数,用于 mod.json 或类似配置。
AddClothesItem 接口
ClothesPatchInfo 接口
ClothesPatchUpdateType 类型
ClothesItem 的局部更新类型,键为 ClothesItem 属性,值为新值或 null。
checkParams() / checkAddClothesItem() / checkClothesPatchInfo() 类型守卫
checkParams(a: any): a is ModdedClothesAddonParamscheckAddClothesItem(a: any): a is AddClothesItemcheckClothesPatchInfo(a: any): a is ClothesPatchInfo
类型定义来源
INFO
- 上游: https://github.com/Lyoko-Jeremie/DoL_ModdedClothesAddon
- 默认分支: master
- 构建:
pnpm run download && pnpm run build
