@scml/addon-modded-hair

TypeScript type definitions for Modded hair addon, for adding and merging modded hair data.

Installation

npm
yarn
pnpm
bun
deno
npm install -D @scml/addon-modded-hair

Quick Start

Add type reference

/// <reference types="@scml/addon-modded-hair" />

Use global instance

addonModdedHairAddon is mounted on window.

Import types on demand

import type { ModdedHairAddon, mergeHairObject } from '@scml/addon-modded-hair/ModdedHairAddon';
import type { ModdedClothesHairParams } from '@scml/addon-modded-hair/ModdedHairAddonParams';

Global Types global

PropertyTypeDescription
addonModdedHairAddonModdedHairAddonAddon instance, manages hair data
Main entry
Subpath import
/// <reference types="@scml/addon-modded-hair" />

Subpath Exports

SubpathDescription
.Main entry, augments Window/global
./ModdedHairAddonMain class and utility functions
./ModdedHairAddonParamsConfig params and type guards

API Reference

./ModdedHairAddon

ModdedHairAddon class

PropertyTypeDescription
hairDataMap<string, HairObject>Hair data by key
registerMod()(addonName, mod, modZip) => Promise<void>Register mod
exportDataZip()(zip: JSZip) => Promise<JSZip>Export data
init()() => voidInitialize

mergeHairObject() / appendHairObject() method

  • mergeHairObject(b, o, modName, logger): Merge two HairObject; errors on same key
  • appendHairObject(b, o, logger): Append o to b

./ModdedHairAddonParams

ModdedClothesHairParams interface

PropertyTypeDescription
hairstring[]Hair file path list

checkParams() / checkHairItem() type guard

Type Definition Source

INFO