Skip to content

Commit dc2d5b3

Browse files
authored
Merge pull request #95 from wechat-miniprogram/feat-use-api-typing
feat: using miniprogram-api-typing instead of @types/wechat-miniprogram
2 parents f5a8faa + 6b5f1ae commit dc2d5b3

File tree

7 files changed

+15
-25
lines changed

7 files changed

+15
-25
lines changed

dist/index.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

+7-19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
"@swc/core": "^1.2.80",
3535
"@types/jest": "^27.0.1",
3636
"@types/rfdc": "^1.1.0",
37-
"@types/wechat-miniprogram": "^3.0.0",
3837
"@typescript-eslint/eslint-plugin": "^2.23.0",
3938
"@typescript-eslint/parser": "^2.23.0",
4039
"codecov": "^3.7.0",
@@ -55,6 +54,7 @@
5554
"gulp-watch": "^5.0.1",
5655
"husky": "^7.0.2",
5756
"jest": "^27.0.6",
57+
"miniprogram-api-typings": "^3.12.0",
5858
"miniprogram-exparser": "^2.11.2",
5959
"miniprogram-simulate": "^1.2.9",
6060
"prettier": "^2.0.1",

src/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import 'miniprogram-api-typings'
2+
13
import { behavior } from './behavior'
24

35
export { behavior } from './behavior'

test/utils.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/// <reference types="node" />
2+
13
import path from 'path'
24
import simulate from 'miniprogram-simulate'
35
import exparser from 'miniprogram-exparser'

tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"declaration": true,
1414
"declarationDir": "./types",
1515
"emitDeclarationOnly": true,
16-
"skipLibCheck": true
16+
"types": ["jest", "rfdc"]
1717
},
1818
"include": ["./src/**/*.ts"]
1919
}

types/index.d.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
/// <reference types="wechat-miniprogram" />
2-
/// <reference types="wechat-miniprogram" />
3-
/// <reference types="wechat-miniprogram" />
1+
import 'miniprogram-api-typings';
42
export { behavior } from './behavior';
53
declare type ComputedInstance<D extends WechatMiniprogram.Component.DataOption, P extends WechatMiniprogram.Component.PropertyOption, M extends WechatMiniprogram.Component.MethodOption, C extends Record<string, (data: D & {
64
[K in keyof P]: any;

0 commit comments

Comments
 (0)