From c7ad3e014131632448d4beef403ffbc436d2c9fd Mon Sep 17 00:00:00 2001 From: lingyan <1029891106@qq.com> Date: Thu, 7 Apr 2022 14:02:03 +0800 Subject: [PATCH] doc: add jsconfig guide --- README-en.md | 4 ++++ README.md | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/README-en.md b/README-en.md index 9b20e86..6a6d9e7 100644 --- a/README-en.md +++ b/README-en.md @@ -33,6 +33,10 @@ Or specify types in typescript config: - Specify `types: ["miniprogram-api-typings"]` in `tsconfig.json` +Or specify types in js config: + +- Specify `typeRoots: ["miniprogram-api-typings"]` in `jsconfig.json` + Or reference by [Triple-Slash Directives](https://www.typescriptlang.org/docs/handbook/triple-slash-directives.html): - `/// ` diff --git a/README.md b/README.md index f27d10c..a31e914 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,10 @@ npm install miniprogram-api-typings - 在 `tsconfig.json` 中指定 `types: ["miniprogram-api-typings"]` +或者在 js 配置中指定: + +- 在 `jsconfig.json` 中指定 `typeRoots: ["miniprogram-api-typings"]` + 或者通过 [三斜杠指令](https://www.tslang.cn/docs/handbook/triple-slash-directives.html) 引用: - `/// `