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

Twee prefix/postfix addon 的 TypeScript 类型定义,用于在 passage 或 widget 文本前后添加前缀/后缀。

安装

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

快速开始

添加类型引用

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

使用全局实例

addonTweePrefixPostfixAddon 已挂载到 window 上。

按需导入类型

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

全局类型 global

属性类型说明
addonTweePrefixPostfixAddonTweePrefixPostfixAddonAddon 实例
主入口
子路径导入
/// <reference types="@scml/addon-mod-twee-prefix-postfix" />

子路径导出

子路径描述
.主入口,增强 Window/全局
./TweePrefixPostfixAddon主类与参数
./TweePrefixPostfixAddonJsCallbackJS 回调类型

API 参考

./TweePrefixPostfixAddon

TweePrefixPostfixAddon

方法说明
addCallback(key, callback)添加回调
registerMod()注册 mod
init()初始化
beforePassage() / afterPassage()Wikify 钩子
beforeWikify() / afterWikify()Wikify 钩子
beforeWidget() / afterWidget()Widget 钩子

TweePrefixPostfixAddonParams 接口

属性类型说明
passageNamestringpassage 名
widgetNamestringwidget 名
prefixstring前缀
postfixstring后缀

类型定义来源

INFO
  • 上游: 随 scml-types 发布
  • 构建: pnpm run download && pnpm run build