@scml/mod-twee-replacer

TypeScript type definitions for Twee replacer, for find/replace on Twee passage content.

Installation

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

Quick Start

Add type reference

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

Use global instance

addonTweeReplacer is mounted on window.

Import types on demand

import type { TweeReplacer, ReplaceParams, ReplaceInfo } from '@scml/mod-twee-replacer/TweeReplacer';

Global Types global

PropertyTypeDescription
addonTweeReplacerTweeReplacerAddon instance, performs Twee replace
Main entry
Subpath import
/// <reference types="@scml/mod-twee-replacer" />

Subpath Exports

SubpathDescription
.Main entry, augments Window/global
./TweeReplacerMain class, ReplaceParams, ReplaceInfo, etc.

API Reference

./TweeReplacer

TweeReplacer class

Property/MethodDescription
infoMap<string, ReplaceInfo>
registerMod()Register mod
enableLinkerMode()Enable linker mode
afterEarlyLoad()After EarlyLoad hook
afterPatchModToGame()After patch hook
do_patch()Execute replace
init()Initialize

ReplaceParams interface

PropertyTypeDescription
passagestringPassage name
findStringstringFind string
findRegexstringFind regex
regexFlagstringRegex flags
replacestringReplace string
replaceFilestringReplace file path
debugbooleanDebug
allbooleanReplace all

Type Definition Source

INFO