- 适用于 Serein的
JavaScript插件的TypeScript类型声明库 - 当前适用版本
2.1.0
建议使用Visual Studio Code或其他带有语法提示的代码编辑器编写插件
git clone https://github.com/SereinDev/HelperLib.git
# or
git submodule add https://github.com/SereinDev/HelperLib.git在文件开头加上如下两行
// @ts-check
/// <reference path="path/to/lib/HelperLib/src/index.d.ts"/>修改tsconfig.json
修改jsconfig.json
{
"compilerOptions": {
"target": "esnext",
"lib": [
"ES2023",
],
"skipLibCheck": true,
// 👇👇👇
"typeRoots": [
"path/to/lib//HelperLib/src/*.ts"
],
// 👆👆👆
},
}如果你输入serein后出现了和下面一样的语法提示,就说明你添加成功了
serein
┌───────────────────────────────────────────┐
│[◻] serein const serein: ScriptInstance │
└───────────────────────────────────────────┘
{ "compilerOptions": { "target": "esnext", "lib": [ "ES2023", ], "skipLibCheck": true, // 👇👇👇 "typeRoots": [ "path/to/lib//HelperLib/src/*.ts" ], // 👆👆👆 }, }