From 171786895c2d1af0fd4196c3180c21dab4abb9d4 Mon Sep 17 00:00:00 2001 From: psnbaotg Date: Fri, 6 Dec 2024 22:57:01 +0800 Subject: [PATCH] Add TS declaration for npm --- README.EN.MD | 2 +- README.MD | 4 ++-- package.json | 4 ++-- tsconfig.json | 5 +++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/README.EN.MD b/README.EN.MD index f78cb59..a85435a 100644 --- a/README.EN.MD +++ b/README.EN.MD @@ -26,4 +26,4 @@ mw.loader.load( 'https://another.wiki/w/index.php?title=MediaWiki:Gadget-HanAssi // mw.libs.HanAssist.convByVar( ... ); ``` -Since this gadget is mainly for Chinese users, most of its documentation is written in Chinese. For building instructions, see [CONTRIBUTING.MD](./CONTRIBUTING.MD). For TypeScript definitions, see [typings.d.ts](./typings.d.ts). +Since this gadget is mainly for Chinese users, most of its documentation is written in Chinese. For building instructions, see [CONTRIBUTING.MD](./CONTRIBUTING.MD). There is a TypeScript type definition at [typings.d.ts](./typings.d.ts) specially for MediaWiki frontend development. diff --git a/README.MD b/README.MD index 5fbcdf8..7b796ff 100644 --- a/README.MD +++ b/README.MD @@ -1,4 +1,4 @@ -# HanAssist ![Lint](https://github.com/diskdance/HanAssist/actions/workflows/lint.yml/badge.svg) ![Test status](https://github.com/diskdance/HanAssist/actions/workflows/test.yml/badge.svg) +# HanAssist ![Lint](https://github.com/wikimedia-gadgets/HanAssist/actions/workflows/lint.yml/badge.svg) ![Test status](https://github.com/wikimedia-gadgets/HanAssist/actions/workflows/test.yml/badge.svg) [English](./README.EN.MD) HanAssist 是帮助中文维基百科及其他 MediaWiki 网站上的用户脚本和小工具更优雅地处理中文变体消息的实用程序。 @@ -142,7 +142,7 @@ mw.msg( 'SearchHint', 'Apple' ); // => 界面语言为简中:“搜索包含Ap ``` ### 使用类型定义文件 -本小工具[提供了类型定义文件](./typings.d.ts),将其中的内容复制到您的项目中即可使用。 +本小工具[提供了类型定义文件](./typings.d.ts),将其中的内容复制到您的 MediaWiki 项目中即可使用。 ## 局限 在软件领域,[没有银弹](https://zh.wikipedia.org/wiki/%E6%B2%A1%E6%9C%89%E9%93%B6%E5%BC%B9),因此 HanAssist 也并非完美。在一些使用场景下,您应该使用其他更合适的工具而非 HanAssist。 diff --git a/package.json b/package.json index cf76493..e3c225a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hanassist", - "version": "4.2.2", + "version": "4.2.3", "description": "A MediaWiki gadget to ease Chinese variant handling in user scripts and gadgets.", "repository": "github:diskdance/HanAssist", "author": "diskdance", @@ -40,4 +40,4 @@ "jsdom": "^20.0.0", "tslib": "^2.6.2" } -} \ No newline at end of file +} diff --git a/tsconfig.json b/tsconfig.json index d040d0a..933aea9 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,10 +12,11 @@ "composite": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true, - "moduleResolution": "node" + "moduleResolution": "node", + "declaration": true }, "include": [ "lib/**/*.ts" ], "exclude": [] -} \ No newline at end of file +}