@wevu/api 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +269 -0
- package/dist/index.cjs +2312 -36
- package/dist/index.d.cts +2464 -6
- package/dist/index.d.mts +2464 -6
- package/dist/index.mjs +2311 -34
- package/package.json +18 -3
- package/types/index.d.ts +36 -2
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wevu/api",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.2.0",
|
|
5
5
|
"description": "tsdown bundler template",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -36,7 +36,9 @@
|
|
|
36
36
|
"types"
|
|
37
37
|
],
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"
|
|
39
|
+
"@douyin-microapp/typings": "^1.3.1",
|
|
40
|
+
"@mini-types/alipay": "^3.0.14",
|
|
41
|
+
"miniprogram-api-typings": "^5.1.1"
|
|
40
42
|
},
|
|
41
43
|
"publishConfig": {
|
|
42
44
|
"access": "public"
|
|
@@ -46,9 +48,22 @@
|
|
|
46
48
|
"build": "tsdown",
|
|
47
49
|
"test": "vitest run",
|
|
48
50
|
"test:dev": "vitest",
|
|
51
|
+
"pretest:types": "pnpm build",
|
|
49
52
|
"test:types": "tsd",
|
|
50
53
|
"release": "pnpm publish",
|
|
51
54
|
"lint": "eslint .",
|
|
52
|
-
"lint:fix": "eslint . --fix"
|
|
55
|
+
"lint:fix": "eslint . --fix",
|
|
56
|
+
"catalog:sync": "node ./scripts/sync-api-catalog.mjs",
|
|
57
|
+
"catalog:check": "node ./scripts/sync-api-catalog.mjs --check",
|
|
58
|
+
"strict-alias:check": "node --import tsx ./scripts/check-strict-alias-guard.mjs",
|
|
59
|
+
"coverage:check": "node --import tsx ./scripts/check-coverage-guard.mjs",
|
|
60
|
+
"structure:check": "node ./scripts/check-structure-guard.mjs",
|
|
61
|
+
"strict-alias:scan": "node --import tsx ./scripts/scan-strict-alias-candidates.mjs",
|
|
62
|
+
"docs:sync": "node --import tsx ./scripts/sync-support-matrix.ts",
|
|
63
|
+
"docs:check": "node --import tsx ./scripts/sync-support-matrix.ts --check",
|
|
64
|
+
"report:api": "node --import tsx ./scripts/generate-api-report.mjs",
|
|
65
|
+
"prebuild": "pnpm run structure:check && pnpm run typecheck && pnpm run typecheck:test && pnpm run catalog:check && pnpm run docs:check && pnpm run strict-alias:check && pnpm run coverage:check",
|
|
66
|
+
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
67
|
+
"typecheck:test": "tsc --noEmit -p tsconfig.test.json"
|
|
53
68
|
}
|
|
54
69
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -1,11 +1,22 @@
|
|
|
1
1
|
/// <reference types="miniprogram-api-typings" />
|
|
2
|
+
/// <reference types="@mini-types/alipay" />
|
|
3
|
+
/// <reference types="@douyin-microapp/typings" />
|
|
2
4
|
|
|
3
5
|
// eslint-disable-next-line antfu/no-import-dist
|
|
4
6
|
import type {
|
|
5
7
|
CreateWeapiOptions,
|
|
6
8
|
WeapiAdapter,
|
|
9
|
+
WeapiAlipayAdapter,
|
|
10
|
+
WeapiAlipayRawAdapter,
|
|
11
|
+
WeapiCrossPlatformAdapter,
|
|
12
|
+
WeapiCrossPlatformRawAdapter,
|
|
13
|
+
WeapiDouyinAdapter,
|
|
14
|
+
WeapiDouyinRawAdapter,
|
|
7
15
|
WeapiInstance,
|
|
16
|
+
WeapiMethodSupportQueryOptions,
|
|
8
17
|
WeapiPromisify,
|
|
18
|
+
WeapiResolvedTarget,
|
|
19
|
+
WeapiSupportLevel,
|
|
9
20
|
WeapiWxAdapter,
|
|
10
21
|
WeapiWxRawAdapter,
|
|
11
22
|
} from '../dist/index.d.mts'
|
|
@@ -13,14 +24,37 @@ import type {
|
|
|
13
24
|
export type {
|
|
14
25
|
CreateWeapiOptions,
|
|
15
26
|
WeapiAdapter,
|
|
27
|
+
WeapiAlipayAdapter,
|
|
28
|
+
WeapiAlipayRawAdapter,
|
|
29
|
+
WeapiCrossPlatformAdapter,
|
|
30
|
+
WeapiCrossPlatformRawAdapter,
|
|
31
|
+
WeapiDouyinAdapter,
|
|
32
|
+
WeapiDouyinRawAdapter,
|
|
16
33
|
WeapiInstance,
|
|
34
|
+
WeapiMethodSupportQueryOptions,
|
|
17
35
|
WeapiPromisify,
|
|
36
|
+
WeapiResolvedTarget,
|
|
37
|
+
WeapiSupportLevel,
|
|
18
38
|
WeapiWxAdapter,
|
|
19
39
|
WeapiWxRawAdapter,
|
|
20
40
|
}
|
|
21
41
|
|
|
22
|
-
export function createWeapi<TAdapter extends WeapiAdapter =
|
|
42
|
+
export function createWeapi<TAdapter extends WeapiAdapter = WeapiCrossPlatformRawAdapter>(
|
|
23
43
|
options?: CreateWeapiOptions<TAdapter>,
|
|
24
44
|
): WeapiInstance<TAdapter>
|
|
25
45
|
|
|
26
|
-
export
|
|
46
|
+
export type WeapiDefaultInstance = WeapiInstance<WeapiCrossPlatformRawAdapter>
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* 默认跨平台 API 实例。
|
|
50
|
+
*
|
|
51
|
+
* @generated weapi-platform-matrix:start
|
|
52
|
+
* | 平台 | 全局对象 | 类型来源 | 对齐状态 |
|
|
53
|
+
* | --- | --- | --- | --- |
|
|
54
|
+
* | 微信小程序 | `wx` | `miniprogram-api-typings` | ✅ 全量 |
|
|
55
|
+
* | 支付宝小程序 | `my` | `@mini-types/alipay` | ✅ 全量 |
|
|
56
|
+
* | 抖音小程序 | `tt` | `@douyin-microapp/typings` | ✅ 全量 |
|
|
57
|
+
* | 其他平台(swan/jd/xhs 等) | 运行时宿主对象 | 运行时透传 | ⚠️ 按宿主能力支持 |
|
|
58
|
+
* @generated weapi-platform-matrix:end
|
|
59
|
+
*/
|
|
60
|
+
export const wpi: WeapiDefaultInstance
|