@scml/addon-mod-twee-prefix-postfix

TypeScript type definitions for Twee prefix/postfix addon, for adding prefix/postfix to passage or widget text.

Installation

npm
yarn
pnpm
bun
deno
npm install -D @scml/addon-mod-twee-prefix-postfix

Quick Start

Add type reference

/// <reference types="@scml/addon-mod-twee-prefix-postfix" />

Use global instance

addonTweePrefixPostfixAddon is mounted on window.

Import types on demand

import type { TweePrefixPostfixAddon, TweePrefixPostfixAddonParams } from '@scml/addon-mod-twee-prefix-postfix/TweePrefixPostfixAddon';
import type { TweePrefixPostfixAddonCallback } from '@scml/addon-mod-twee-prefix-postfix/TweePrefixPostfixAddonJsCallback';

Global Types global

PropertyTypeDescription
addonTweePrefixPostfixAddonTweePrefixPostfixAddonAddon instance
Main entry
Subpath import
/// <reference types="@scml/addon-mod-twee-prefix-postfix" />

Subpath Exports

SubpathDescription
.Main entry, augments Window/global
./TweePrefixPostfixAddonMain class and params
./TweePrefixPostfixAddonJsCallbackJS callback types

API Reference

./TweePrefixPostfixAddon

TweePrefixPostfixAddon class

MethodDescription
addCallback(key, callback)Add callback
registerMod()Register mod
init()Initialize
beforePassage() / afterPassage()Wikify hooks
beforeWikify() / afterWikify()Wikify hooks
beforeWidget() / afterWidget()Widget hooks

TweePrefixPostfixAddonParams interface

PropertyTypeDescription
passageNamestringPassage name
widgetNamestringWidget name
prefixstringPrefix
postfixstringPostfix

Type Definition Source

INFO
  • Upstream: Bundled with scml-types
  • Build: pnpm run download && pnpm run build