@scml/addon-twee-replacer-linker

TypeScript type definitions for Twee replacer linker addon, for connecting TweeReplacer clients and coordinating replace callbacks across mods.

Installation

npm
yarn
pnpm
bun
deno
npm install -D @scml/addon-twee-replacer-linker

Quick Start

Add type reference

/// <reference types="@scml/addon-twee-replacer-linker" />

Use global instance

addonTweeReplacerLinker is mounted on window.

Import types on demand

import type { TweeReplacerLinker } from '@scml/addon-twee-replacer-linker/TweeReplacerLinker';
import type { TweeReplacerLinkerInterface, TweeReplacerLinkerClientInterface } from '@scml/addon-twee-replacer-linker/TweeReplacerLinkerInterface';

Global Types global

PropertyTypeDescription
addonTweeReplacerLinkerTweeReplacerLinkerAddon instance, coordinates TweeReplacer clients
Main entry
Subpath import
/// <reference types="@scml/addon-twee-replacer-linker" />

Subpath Exports

SubpathDescription
.Main entry, augments Window/global
./TweeReplacerLinkerMain class
./TweeReplacerLinkerInterfaceInterfaces and types

API Reference

./TweeReplacerLinker

TweeReplacerLinker class

Property/MethodTypeDescription
canRegisterbooleanWhether registrable
userCallbackTweeReplacerLinkerCallbackData[]User callback list
registerClient()(client) => Promise<boolean>Register client
addUserMod()(clientName, userModName, callback) => Promise<boolean>Add user mod callback
registerMod()(addonName, mod, modZip) => Promise<void>Register mod
afterPatchModToGame()() => Promise<void>After-patch hook
init()() => voidInitialize

./TweeReplacerLinkerInterface

TweeReplacerLinkerInterface interface

MethodDescription
registerClient(client)Register client
addUserMod(clientName, userModName, callback)Add user mod callback

TweeReplacerLinkerClientInterface interface

MethodDescription
enableLinkerMode()Enable linker mode

TweeReplacerLinkerClientCallbackType type

(sc: SC2DataInfo) => Promise<any> - User mod callback type

Type Definition Source

INFO