@heybox/hb-sdk 0.7.5-alpha.0 → 0.8.0-alpha

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.
Files changed (54) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/README.md +14 -14
  3. package/dist/cli-chunks/{build-V1YBdpzY.cjs → build-DJWFSM1B.cjs} +6 -5
  4. package/dist/cli-chunks/{context-Ba1Je-wT.cjs → context-DV2UK1Nz.cjs} +2 -2
  5. package/dist/cli-chunks/{create-CKGjqo9E.cjs → create-2HfoB48V.cjs} +1 -1
  6. package/dist/cli-chunks/{dev-XopYKLYZ.cjs → dev-Dgt2zS9k.cjs} +8 -8
  7. package/dist/cli-chunks/{doctor-BHbrYQqT.cjs → doctor-C95gIao_.cjs} +1 -1
  8. package/dist/cli-chunks/{index-DKWfX6Ut.cjs → index-BjoSXl8C.cjs} +2 -2
  9. package/dist/cli-chunks/{index-C9mpajVG.cjs → index-D62ANeBv.cjs} +14 -14
  10. package/dist/cli-chunks/{index.esm-SXAQ3WVR.cjs → index.esm-CigcxJ2B.cjs} +6 -6
  11. package/dist/cli-chunks/{login-BVWicWqe.cjs → login-Cumknwdx.cjs} +2 -2
  12. package/dist/cli-chunks/{project-vite-CBb38HJ3.cjs → project-vite-CcE-HMmd.cjs} +1 -1
  13. package/dist/cli-chunks/{remote-BG1u0NKT.cjs → remote-DDdP3xcE.cjs} +10 -8
  14. package/dist/cli-chunks/{runtime-gate-CtV7rWyX.cjs → runtime-gate-DFjw66kF.cjs} +20 -1
  15. package/dist/cli-chunks/{runtime-permission-env-D-8_jPG3.cjs → runtime-permission-env-CjsCe5bp.cjs} +13 -13
  16. package/dist/cli-chunks/{session-CJS_SEp9.cjs → session-BDi_AZSv.cjs} +1 -1
  17. package/dist/cli.cjs +1 -1
  18. package/dist/devtools/browser-dev-host/main.js +173 -68
  19. package/dist/index.cjs.js +113 -63
  20. package/dist/index.esm.js +113 -63
  21. package/dist/miniapp-publish.cjs.js +13 -13
  22. package/dist/miniapp-publish.esm.js +13 -13
  23. package/dist/templates/vue3-vite-ts/README.md.ejs +2 -0
  24. package/dist/templates/vue3-vite-ts/vite.config.ts +1 -1
  25. package/dist/vite.cjs.js +31 -4
  26. package/dist/vite.esm.js +31 -5
  27. package/package.json +10 -7
  28. package/skill/references/api-protocol.md +14 -2
  29. package/skill/references/api-root.md +42 -21
  30. package/skill/references/examples.md +1 -1
  31. package/skill/references/safety-boundaries.md +1 -1
  32. package/skill/scripts/sync-references.mjs +3 -1
  33. package/skill/skill.json +4 -4
  34. package/types/core/errors.d.ts +5 -5
  35. package/types/core/sdk.d.ts +5 -5
  36. package/types/core/singleton.d.ts +56 -6
  37. package/types/miniapp-manifest/schema.d.ts +5 -0
  38. package/types/miniapp-publish/index.d.ts +8 -8
  39. package/types/modules/auth/index.d.ts +15 -1
  40. package/types/modules/cloud/index.d.ts +75 -5
  41. package/types/modules/device/index.d.ts +31 -3
  42. package/types/modules/navigation/index.d.ts +46 -4
  43. package/types/modules/network/index.d.ts +22 -11
  44. package/types/modules/share/copy-link.d.ts +3 -3
  45. package/types/modules/share/index.d.ts +61 -5
  46. package/types/modules/share/screenshot.d.ts +3 -3
  47. package/types/modules/share/show-share-menu.d.ts +3 -3
  48. package/types/modules/storage/index.d.ts +38 -10
  49. package/types/modules/ui/index.d.ts +46 -4
  50. package/types/modules/user/get-info.d.ts +1 -1
  51. package/types/modules/user/index.d.ts +46 -4
  52. package/types/modules/user/steam-game-list.d.ts +2 -2
  53. package/types/modules/viewport/index.d.ts +36 -8
  54. package/types/vite/index.d.ts +15 -7
@@ -81,15 +81,85 @@ export interface GetLeaderboardInfoResult {
81
81
  }
82
82
  /** 外部小程序可调用的云端排行榜模块。 */
83
83
  export interface MiniProgramCloudLeaderboardModule {
84
- /** 提交当前用户分数。 */
84
+ /**
85
+ * 提交当前用户分数。
86
+ *
87
+ * @since 0.5.11
88
+ * @hbPlatform android
89
+ * @hbPlatform ios
90
+ * @hbPlatform ohos
91
+ * @hbPlatform windows
92
+ * @hbPlatform macos
93
+ * @hbClient android none
94
+ * @hbClient ios none
95
+ * @hbClient ohos none
96
+ * @hbClient windows none
97
+ * @hbClient macos none
98
+ */
85
99
  submit(options: SubmitLeaderboardEntryPayload): Promise<SubmitLeaderboardEntryResult>;
86
- /** 读取排行榜列表。 */
100
+ /**
101
+ * 读取排行榜列表。
102
+ *
103
+ * @since 0.5.11
104
+ * @hbPlatform android
105
+ * @hbPlatform ios
106
+ * @hbPlatform ohos
107
+ * @hbPlatform windows
108
+ * @hbPlatform macos
109
+ * @hbClient android none
110
+ * @hbClient ios none
111
+ * @hbClient ohos none
112
+ * @hbClient windows none
113
+ * @hbClient macos none
114
+ */
87
115
  getList(options?: GetLeaderboardListPayload): Promise<GetLeaderboardListResult>;
88
- /** 读取当前用户记录。 */
116
+ /**
117
+ * 读取当前用户记录。
118
+ *
119
+ * @since 0.5.11
120
+ * @hbPlatform android
121
+ * @hbPlatform ios
122
+ * @hbPlatform ohos
123
+ * @hbPlatform windows
124
+ * @hbPlatform macos
125
+ * @hbClient android none
126
+ * @hbClient ios none
127
+ * @hbClient ohos none
128
+ * @hbClient windows none
129
+ * @hbClient macos none
130
+ */
89
131
  getCurrentUserEntry(options?: GetCurrentUserLeaderboardEntryPayload): Promise<GetCurrentUserLeaderboardEntryResult>;
90
- /** 删除当前用户记录。 */
132
+ /**
133
+ * 删除当前用户记录。
134
+ *
135
+ * @since 0.5.11
136
+ * @hbPlatform android
137
+ * @hbPlatform ios
138
+ * @hbPlatform ohos
139
+ * @hbPlatform windows
140
+ * @hbPlatform macos
141
+ * @hbClient android none
142
+ * @hbClient ios none
143
+ * @hbClient ohos none
144
+ * @hbClient windows none
145
+ * @hbClient macos none
146
+ */
91
147
  deleteCurrentUserEntry(options?: DeleteCurrentUserLeaderboardEntryPayload): Promise<DeleteCurrentUserLeaderboardEntryResult>;
92
- /** 读取排行榜基础信息。 */
148
+ /**
149
+ * 读取排行榜基础信息。
150
+ *
151
+ * @since 0.5.11
152
+ * @hbPlatform android
153
+ * @hbPlatform ios
154
+ * @hbPlatform ohos
155
+ * @hbPlatform windows
156
+ * @hbPlatform macos
157
+ * @hbClient android none
158
+ * @hbClient ios none
159
+ * @hbClient ohos none
160
+ * @hbClient windows none
161
+ * @hbClient macos none
162
+ */
93
163
  getInfo(options?: GetLeaderboardInfoPayload): Promise<GetLeaderboardInfoResult>;
94
164
  }
95
165
  /** 外部小程序可调用的云端能力模块。 */
@@ -1,5 +1,5 @@
1
1
  import type { MiniProgramRequester } from '../../core/client';
2
- export { DEVICE_SET_CLIPBOARD_METHOD, DEVICE_VIBRATE_METHOD, } from '../../protocol/capabilities';
2
+ export { DEVICE_SET_CLIPBOARD_METHOD, DEVICE_VIBRATE_METHOD } from '../../protocol/capabilities';
3
3
  /** 震动强度。 */
4
4
  export type MiniProgramVibrateIntensity = 'light' | 'medium' | 'heavy';
5
5
  /** `device.vibrate` 入参。 */
@@ -21,9 +21,37 @@ export type SetClipboardResult = void;
21
21
  export type { MiniProgramDeviceMethod } from '../../protocol/capabilities';
22
22
  /** 外部小程序可调用的 device 模块。 */
23
23
  export interface MiniProgramDeviceModule {
24
- /** 触发宿主震动反馈。 */
24
+ /**
25
+ * 触发宿主震动反馈。
26
+ *
27
+ * @since 0.4.4
28
+ * @hbPlatform android
29
+ * @hbPlatform ios
30
+ * @hbPlatform ohos
31
+ * @hbPlatform windows
32
+ * @hbPlatform macos
33
+ * @hbClient android none
34
+ * @hbClient ios none
35
+ * @hbClient ohos none
36
+ * @hbClient windows none
37
+ * @hbClient macos none
38
+ */
25
39
  vibrate(options?: VibratePayload): Promise<void>;
26
- /** 写入系统文本剪贴板。 */
40
+ /**
41
+ * 写入系统文本剪贴板。
42
+ *
43
+ * @since 0.4.4
44
+ * @hbPlatform android
45
+ * @hbPlatform ios
46
+ * @hbPlatform ohos
47
+ * @hbPlatform windows
48
+ * @hbPlatform macos
49
+ * @hbClient android none
50
+ * @hbClient ios none
51
+ * @hbClient ohos none
52
+ * @hbClient windows none
53
+ * @hbClient macos none
54
+ */
27
55
  setClipboard(options: SetClipboardPayload): Promise<void>;
28
56
  }
29
57
  /** 触发宿主震动反馈。 */
@@ -1,6 +1,6 @@
1
1
  import type { MiniProgramRequester } from '../../core/client';
2
2
  import { type OpenAppPageOptions } from './app-pages';
3
- export { NAVIGATION_CLOSE_METHOD, NAVIGATION_OPEN_APP_PAGE_METHOD, NAVIGATION_RELOAD_METHOD, } from '../../protocol/capabilities';
3
+ export { NAVIGATION_CLOSE_METHOD, NAVIGATION_OPEN_APP_PAGE_METHOD, NAVIGATION_RELOAD_METHOD } from '../../protocol/capabilities';
4
4
  export type { MiniProgramAppPageTarget, MiniProgramGameDetailGameType, MiniProgramGameDetailPage, OpenAppPageOptions, OpenAppPagePayload, OpenAppPageResult, OpenGameDetailAppPagePayload, OpenGameDetailAppPageOptions, OpenPostDetailAppPagePayload, OpenPostDetailAppPageOptions, OpenUserDetailAppPagePayload, OpenUserDetailAppPageOptions, } from './app-pages';
5
5
  /** `navigation.close` 不需要入参。 */
6
6
  export type ClosePayload = void;
@@ -13,11 +13,53 @@ export type ReloadResult = void;
13
13
  export type { MiniProgramNavigationMethod } from '../../protocol/capabilities';
14
14
  /** 外部小程序可调用的 navigation 模块。 */
15
15
  export interface MiniProgramNavigationModule {
16
- /** 请求宿主关闭当前小程序容器。 */
16
+ /**
17
+ * 请求宿主关闭当前小程序容器。
18
+ *
19
+ * @since 0.4.4
20
+ * @hbPlatform android
21
+ * @hbPlatform ios
22
+ * @hbPlatform ohos
23
+ * @hbPlatform windows
24
+ * @hbPlatform macos
25
+ * @hbClient android none
26
+ * @hbClient ios none
27
+ * @hbClient ohos none
28
+ * @hbClient windows none
29
+ * @hbClient macos none
30
+ */
17
31
  close(): Promise<void>;
18
- /** 请求宿主重载当前小程序容器。 */
32
+ /**
33
+ * 请求宿主重载当前小程序容器。
34
+ *
35
+ * @since 0.4.4
36
+ * @hbPlatform android
37
+ * @hbPlatform ios
38
+ * @hbPlatform ohos
39
+ * @hbPlatform windows
40
+ * @hbPlatform macos
41
+ * @hbClient android none
42
+ * @hbClient ios none
43
+ * @hbClient ohos none
44
+ * @hbClient windows none
45
+ * @hbClient macos none
46
+ */
19
47
  reload(): Promise<void>;
20
- /** 请求宿主打开受 SDK 白名单约束的黑盒 App 页面。 */
48
+ /**
49
+ * 请求宿主打开受 SDK 白名单约束的黑盒 App 页面。
50
+ *
51
+ * @since 0.5.2
52
+ * @hbPlatform android
53
+ * @hbPlatform ios
54
+ * @hbPlatform ohos
55
+ * @hbPlatform windows
56
+ * @hbPlatform macos
57
+ * @hbClient android none
58
+ * @hbClient ios none
59
+ * @hbClient ohos none
60
+ * @hbClient windows none
61
+ * @hbClient macos none
62
+ */
21
63
  openAppPage(options: OpenAppPageOptions): Promise<void>;
22
64
  }
23
65
  /** 请求宿主关闭当前小程序容器。 */
@@ -11,7 +11,7 @@ export type MiniProgramNetworkRequestMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' |
11
11
  /**
12
12
  * SDK 侧可配置的状态校验函数。
13
13
  *
14
- * @param status 标准化后的 HTTP 状态码。
14
+ * @param status - 标准化后的 HTTP 状态码。
15
15
  * @returns 返回 `true` 时表示本次响应应视为成功。
16
16
  *
17
17
  * @remarks
@@ -60,7 +60,7 @@ export interface NetworkRequestPayload {
60
60
  /**
61
61
  * bridge / runtime 返回的标准化 HTTP 响应。
62
62
  *
63
- * @typeParam T 标准化响应数据的类型。
63
+ * @typeParam T - 标准化响应数据的类型。
64
64
  */
65
65
  export interface NetworkResponsePayload<T = unknown> {
66
66
  data: T;
@@ -71,7 +71,7 @@ export interface NetworkResponsePayload<T = unknown> {
71
71
  /**
72
72
  * SDK 对外暴露的网络响应。
73
73
  *
74
- * @typeParam T 标准化响应数据的类型。
74
+ * @typeParam T - 标准化响应数据的类型。
75
75
  */
76
76
  export interface MiniProgramNetworkResponse<T = unknown> extends NetworkResponsePayload<T> {
77
77
  /** 发起请求时的 SDK 公共配置快照。 */
@@ -83,21 +83,32 @@ export interface MiniProgramNetworkModule {
83
83
  /**
84
84
  * 发起网络请求。
85
85
  *
86
- * @param config 面向业务层的网络请求配置。
86
+ * @param config - 面向业务层的网络请求配置。
87
87
  * @returns 标准化网络响应;HTTP 2xx 默认返回 resolve。
88
- * @throws {HbMiniProgramNetworkError} 当请求已完成但 HTTP 状态不满足 `validateStatus` 时抛出。
89
- * @throws {HbMiniProgramSDKError} 当 bridge、运行时或宿主能力调用失败时抛出。
88
+ * @throws 当请求已完成但 HTTP 状态不满足 `validateStatus` 时抛出 `HbMiniProgramNetworkError`。
89
+ * @throws 当 bridge、运行时或宿主能力调用失败时抛出 `HbMiniProgramSDKError`。
90
+ * @since 0.2.0-alpha.0
91
+ * @hbPlatform android
92
+ * @hbPlatform ios
93
+ * @hbPlatform ohos
94
+ * @hbPlatform windows
95
+ * @hbPlatform macos
96
+ * @hbClient android none
97
+ * @hbClient ios none
98
+ * @hbClient ohos none
99
+ * @hbClient windows none
100
+ * @hbClient macos none
90
101
  */
91
102
  request<T = unknown>(config: MiniProgramNetworkRequestConfig): Promise<MiniProgramNetworkResponse<T>>;
92
103
  }
93
104
  /**
94
105
  * 发起网络请求并返回标准化响应。
95
106
  *
96
- * @param requester 底层 bridge 请求能力。
97
- * @param config 面向业务层的网络请求配置。
107
+ * @param requester - 底层 bridge 请求能力。
108
+ * @param config - 面向业务层的网络请求配置。
98
109
  * @returns 标准化网络响应。HTTP 2xx 默认返回 resolve。
99
- * @throws {HbMiniProgramNetworkError} 当请求已完成但 HTTP 状态不满足 `validateStatus` 时抛出。
100
- * @throws {HbMiniProgramSDKError} 当 bridge、运行时或宿主能力调用失败时抛出。
110
+ * @throws {@link HbMiniProgramNetworkError} 当请求已完成但 HTTP 状态不满足 `validateStatus` 时抛出。
111
+ * @throws {@link HbMiniProgramSDKError} 当 bridge、运行时或宿主能力调用失败时抛出。
101
112
  *
102
113
  * @remarks
103
114
  * `validateStatus` 仅在 SDK 侧执行,不会跨 bridge 传输函数值。
@@ -115,7 +126,7 @@ export declare function request<T = unknown>(requester: MiniProgramRequester, co
115
126
  /**
116
127
  * 创建 network 模块。
117
128
  *
118
- * @param requester 底层 bridge 请求能力。
129
+ * @param requester - 底层 bridge 请求能力。
119
130
  * @returns 面向业务层的网络模块对象。
120
131
  */
121
132
  export declare function createNetworkModule(requester: MiniProgramRequester): MiniProgramNetworkModule;
@@ -8,9 +8,9 @@ export type CopyLinkResult = string;
8
8
  /**
9
9
  * 复制当前小程序的通用分享链接。
10
10
  *
11
- * @param requester 底层 bridge 请求能力。
12
- * @param options 分享扩展数据;不传时复制默认首页链接。
11
+ * @param requester - 底层 bridge 请求能力。
12
+ * @param options - 分享扩展数据;不传时复制默认首页链接。
13
13
  * @returns 已写入系统剪贴板的完整分享链接。
14
- * @throws {HbMiniProgramSDKError} 当参数、bridge、父容器或剪贴板能力调用失败时抛出。
14
+ * @throws {@link HbMiniProgramSDKError} 当参数、bridge、父容器或剪贴板能力调用失败时抛出。
15
15
  */
16
16
  export declare function copyLink(requester: MiniProgramRequester, options?: MiniProgramCopyLinkOptions): Promise<CopyLinkResult>;
@@ -10,19 +10,75 @@ export * from './types';
10
10
  export type { MiniProgramShareMethod } from '../../protocol/capabilities';
11
11
  /** 外部小程序可调用的分享模块。 */
12
12
  export interface MiniProgramShareModule {
13
- /** 复制当前小程序的通用分享链接,并返回该链接。 */
13
+ /**
14
+ * 复制当前小程序的通用分享链接,并返回该链接。
15
+ *
16
+ * @since 0.7.4-alpha.5
17
+ * @hbPlatform android
18
+ * @hbPlatform ios
19
+ * @hbPlatform ohos
20
+ * @hbPlatform windows
21
+ * @hbPlatform macos
22
+ * @hbClient android none
23
+ * @hbClient ios none
24
+ * @hbClient ohos none
25
+ * @hbClient windows none
26
+ * @hbClient macos none
27
+ */
14
28
  copyLink(options?: MiniProgramCopyLinkOptions): Promise<CopyLinkResult>;
15
- /** 同步获取小程序启动时携带的分享扩展数据;没有有效数据时返回 `undefined`。 */
29
+ /**
30
+ * 同步获取小程序启动时携带的分享扩展数据;没有有效数据时返回 `undefined`。
31
+ *
32
+ * @since 0.7.4-alpha.5
33
+ * @hbPlatform android
34
+ * @hbPlatform ios
35
+ * @hbPlatform ohos
36
+ * @hbPlatform windows
37
+ * @hbPlatform macos
38
+ * @hbClient android none
39
+ * @hbClient ios none
40
+ * @hbClient ohos none
41
+ * @hbClient windows none
42
+ * @hbClient macos none
43
+ */
16
44
  getExtra(): MiniProgramShareExtraValue | undefined;
17
- /** 展示基础分享面板。 */
45
+ /**
46
+ * 展示基础分享面板。
47
+ *
48
+ * @since 0.2.0-alpha.0
49
+ * @hbPlatform android
50
+ * @hbPlatform ios
51
+ * @hbPlatform ohos
52
+ * @hbPlatform windows
53
+ * @hbPlatform macos
54
+ * @hbClient android none
55
+ * @hbClient ios none
56
+ * @hbClient ohos none
57
+ * @hbClient windows none
58
+ * @hbClient macos none
59
+ */
18
60
  showShareMenu(options: ShowShareMenuPayload): Promise<ShowShareMenuResult>;
19
- /** 截图并唤起分享。 */
61
+ /**
62
+ * 截图并唤起分享。
63
+ *
64
+ * @since 0.2.0-alpha.0
65
+ * @hbPlatform android
66
+ * @hbPlatform ios
67
+ * @hbPlatform ohos
68
+ * @hbPlatform windows
69
+ * @hbPlatform macos
70
+ * @hbClient android none
71
+ * @hbClient ios none
72
+ * @hbClient ohos none
73
+ * @hbClient windows none
74
+ * @hbClient macos none
75
+ */
20
76
  screenshot(options?: MiniProgramScreenshotOptions): Promise<ScreenshotResult>;
21
77
  }
22
78
  /**
23
79
  * 创建分享模块。
24
80
  *
25
- * @param requester 底层 bridge 请求能力。
81
+ * @param requester - 底层 bridge 请求能力。
26
82
  * @returns 面向业务层的分享模块对象。
27
83
  */
28
84
  export declare function createShareModule(requester: MiniProgramRequester, launchHref?: string): MiniProgramShareModule;
@@ -8,9 +8,9 @@ export type ScreenshotResult = unknown;
8
8
  /**
9
9
  * 截图并唤起分享。
10
10
  *
11
- * @param requester 底层 bridge 请求能力。
12
- * @param options 截图区域、延迟与保存相册等配置。
11
+ * @param requester - 底层 bridge 请求能力。
12
+ * @param options - 截图区域、延迟与保存相册等配置。
13
13
  * @returns 由宿主客户端协议决定的结果。
14
- * @throws {HbMiniProgramSDKError} 当 bridge、父容器或宿主能力调用失败时抛出。
14
+ * @throws {@link HbMiniProgramSDKError} 当 bridge、父容器或宿主能力调用失败时抛出。
15
15
  */
16
16
  export declare function screenshot(requester: MiniProgramRequester, options?: MiniProgramScreenshotOptions): Promise<ScreenshotResult>;
@@ -8,9 +8,9 @@ export type ShowShareMenuResult = unknown;
8
8
  /**
9
9
  * 展示基础分享面板。
10
10
  *
11
- * @param requester 底层 bridge 请求能力。
12
- * @param options 基础分享参数。
11
+ * @param requester - 底层 bridge 请求能力。
12
+ * @param options - 基础分享参数。
13
13
  * @returns 由宿主客户端协议决定的结果。
14
- * @throws {HbMiniProgramSDKError} 当 bridge、父容器或宿主能力调用失败时抛出。
14
+ * @throws {@link HbMiniProgramSDKError} 当 bridge、父容器或宿主能力调用失败时抛出。
15
15
  */
16
16
  export declare function showShareMenu(requester: MiniProgramRequester, options: ShowShareMenuPayload): Promise<ShowShareMenuResult>;
@@ -8,7 +8,7 @@ export interface GetStoragePayload {
8
8
  /**
9
9
  * `storage.getStorage` 返回值。
10
10
  *
11
- * @typeParam T 反序列化后的业务数据类型。
11
+ * @typeParam T - 反序列化后的业务数据类型。
12
12
  */
13
13
  export interface GetStorageResult<T = unknown> {
14
14
  /** key 对应的数据;不存在时为 undefined。 */
@@ -24,33 +24,61 @@ export interface SetStoragePayload {
24
24
  export type { MiniProgramStorageMethod } from '../../protocol/capabilities';
25
25
  /** 外部小程序可调用的 storage 模块。 */
26
26
  export interface MiniProgramStorageModule {
27
- /** 获取小程序隔离 storage。 */
27
+ /**
28
+ * 获取小程序隔离 storage。
29
+ *
30
+ * @since 0.2.0-alpha.0
31
+ * @hbPlatform android
32
+ * @hbPlatform ios
33
+ * @hbPlatform ohos
34
+ * @hbPlatform windows
35
+ * @hbPlatform macos
36
+ * @hbClient android none
37
+ * @hbClient ios none
38
+ * @hbClient ohos none
39
+ * @hbClient windows none
40
+ * @hbClient macos none
41
+ */
28
42
  getStorage<T = unknown>(options: GetStoragePayload): Promise<GetStorageResult<T>>;
29
- /** 写入小程序隔离 storage。 */
43
+ /**
44
+ * 写入小程序隔离 storage。
45
+ *
46
+ * @since 0.2.0-alpha.0
47
+ * @hbPlatform android
48
+ * @hbPlatform ios
49
+ * @hbPlatform ohos
50
+ * @hbPlatform windows
51
+ * @hbPlatform macos
52
+ * @hbClient android none
53
+ * @hbClient ios none
54
+ * @hbClient ohos none
55
+ * @hbClient windows none
56
+ * @hbClient macos none
57
+ */
30
58
  setStorage(options: SetStoragePayload): Promise<void>;
31
59
  }
32
60
  /**
33
61
  * 获取小程序隔离 storage。
34
62
  *
35
- * @param requester 底层 bridge 请求能力。
36
- * @param options 读取的 storage key。
63
+ * @param requester - 底层 bridge 请求能力。
64
+ * @param options - 读取的 storage key。
37
65
  * @returns 对应 key 的标准化读取结果。
38
- * @throws {HbMiniProgramSDKError} 当 bridge、父容器或宿主能力调用失败时抛出。
66
+ * @throws {@link HbMiniProgramSDKError} 当 bridge、父容器或宿主能力调用失败时抛出。
39
67
  */
40
68
  export declare function getStorage<T = unknown>(requester: MiniProgramRequester, options: GetStoragePayload): Promise<GetStorageResult<T>>;
41
69
  /**
42
70
  * 写入小程序隔离 storage。
43
71
  *
44
- * @param requester 底层 bridge 请求能力。
45
- * @param options 要写入的 storage key 与数据。
72
+ * @param requester - 底层 bridge 请求能力。
73
+ * @param options - 要写入的 storage key 与数据。
46
74
  * @returns 当写入完成后 resolve。
47
- * @throws {HbMiniProgramSDKError} 当 bridge、父容器或宿主能力调用失败时抛出。
75
+ * @throws {@link HbMiniProgramSDKError} 当 bridge、父容器或宿主能力调用失败时抛出。
48
76
  */
49
77
  export declare function setStorage(requester: MiniProgramRequester, options: SetStoragePayload): Promise<void>;
50
78
  /**
51
79
  * 创建 storage 模块。
52
80
  *
53
- * @param requester 底层 bridge 请求能力。
81
+ * @param requester - 底层 bridge 请求能力。
54
82
  * @returns 面向业务层的 storage 模块对象。
55
83
  */
56
84
  export declare function createStorageModule(requester: MiniProgramRequester): MiniProgramStorageModule;
@@ -1,5 +1,5 @@
1
1
  import type { MiniProgramRequester } from '../../core/client';
2
- export { UI_HIDE_LOADING_METHOD, UI_SHOW_LOADING_METHOD, UI_SHOW_TOAST_METHOD, } from '../../protocol/capabilities';
2
+ export { UI_HIDE_LOADING_METHOD, UI_SHOW_LOADING_METHOD, UI_SHOW_TOAST_METHOD } from '../../protocol/capabilities';
3
3
  /** Toast 展示状态。 */
4
4
  export type MiniProgramToastStatus = 'success' | 'error';
5
5
  /** `ui.showToast` 入参。 */
@@ -25,11 +25,53 @@ export type HideLoadingResult = void;
25
25
  export type { MiniProgramUiMethod } from '../../protocol/capabilities';
26
26
  /** 外部小程序可调用的 UI 模块。 */
27
27
  export interface MiniProgramUiModule {
28
- /** 展示 toast。 */
28
+ /**
29
+ * 展示 toast。
30
+ *
31
+ * @since 0.4.4
32
+ * @hbPlatform android
33
+ * @hbPlatform ios
34
+ * @hbPlatform ohos
35
+ * @hbPlatform windows
36
+ * @hbPlatform macos
37
+ * @hbClient android none
38
+ * @hbClient ios none
39
+ * @hbClient ohos none
40
+ * @hbClient windows none
41
+ * @hbClient macos none
42
+ */
29
43
  showToast(options: ShowToastPayload): Promise<void>;
30
- /** 展示全局 loading。 */
44
+ /**
45
+ * 展示全局 loading。
46
+ *
47
+ * @since 0.4.4
48
+ * @hbPlatform android
49
+ * @hbPlatform ios
50
+ * @hbPlatform ohos
51
+ * @hbPlatform windows
52
+ * @hbPlatform macos
53
+ * @hbClient android none
54
+ * @hbClient ios none
55
+ * @hbClient ohos none
56
+ * @hbClient windows none
57
+ * @hbClient macos none
58
+ */
31
59
  showLoading(options?: ShowLoadingPayload): Promise<void>;
32
- /** 隐藏全局 loading。 */
60
+ /**
61
+ * 隐藏全局 loading。
62
+ *
63
+ * @since 0.4.4
64
+ * @hbPlatform android
65
+ * @hbPlatform ios
66
+ * @hbPlatform ohos
67
+ * @hbPlatform windows
68
+ * @hbPlatform macos
69
+ * @hbClient android none
70
+ * @hbClient ios none
71
+ * @hbClient ohos none
72
+ * @hbClient windows none
73
+ * @hbClient macos none
74
+ */
33
75
  hideLoading(): Promise<void>;
34
76
  }
35
77
  /** 展示 toast。 */
@@ -18,6 +18,6 @@ export type GetUserInfoResult = MiniProgramUserInfoResult;
18
18
  * `app_user_id`,并隐式授予 `identity` 与 `profile` 后返回昵称与头像,不展示授权 UI。未登录时返回
19
19
  * `{ isHeyboxAppLoggedIn: false, authorization: null, userInfo: null }`。
20
20
  *
21
- * @throws {HbMiniProgramSDKError} 当 SDK 调用失败时抛出。
21
+ * @throws {@link HbMiniProgramSDKError} 当 SDK 调用失败时抛出。
22
22
  */
23
23
  export declare function getInfo(requester: MiniProgramRequester): Promise<GetUserInfoResult>;
@@ -8,12 +8,54 @@ export * from './steam-game-list';
8
8
  export * from './types';
9
9
  /** 外部小程序可调用的用户模块。 */
10
10
  export interface MiniProgramUserModule {
11
- /** 获取当前黑盒 APP 登录态、授权状态和已获准披露的资料。 */
11
+ /**
12
+ * 获取当前黑盒 APP 登录态、授权状态和已获准披露的资料。
13
+ *
14
+ * @since 0.2.0-alpha.0
15
+ * @hbPlatform android
16
+ * @hbPlatform ios
17
+ * @hbPlatform ohos
18
+ * @hbPlatform windows
19
+ * @hbPlatform macos
20
+ * @hbClient android none
21
+ * @hbClient ios none
22
+ * @hbClient ohos none
23
+ * @hbClient windows none
24
+ * @hbClient macos none
25
+ */
12
26
  getInfo(): Promise<GetUserInfoResult>;
13
- /** 撤销当前用户授予本小程序的授权;必须由可信用户操作触发。 */
27
+ /**
28
+ * 撤销当前用户授予本小程序的授权;必须由可信用户操作触发。
29
+ *
30
+ * @since 0.7.0-alpha.1
31
+ * @hbPlatform android
32
+ * @hbPlatform ios
33
+ * @hbPlatform ohos
34
+ * @hbPlatform windows
35
+ * @hbPlatform macos
36
+ * @hbClient android none
37
+ * @hbClient ios none
38
+ * @hbClient ohos none
39
+ * @hbClient windows none
40
+ * @hbClient macos none
41
+ */
14
42
  revokeAuthorization(): Promise<RevokeAuthorizationResult>;
15
- /** 获取当前用户的 Steam 游戏库。 */
43
+ /**
44
+ * 获取当前用户的 Steam 游戏库。
45
+ *
46
+ * @since 0.5.0
47
+ * @hbPlatform android
48
+ * @hbPlatform ios
49
+ * @hbPlatform ohos
50
+ * @hbPlatform windows
51
+ * @hbPlatform macos
52
+ * @hbClient android none
53
+ * @hbClient ios none
54
+ * @hbClient ohos none
55
+ * @hbClient windows none
56
+ * @hbClient macos none
57
+ */
16
58
  getSteamGameList(options?: GetSteamGameListOptions): Promise<GetSteamGameListResult>;
17
59
  }
18
60
  export declare function createUserModule(requester: MiniProgramRequester): MiniProgramUserModule;
19
- export { USER_GET_INFO_METHOD, USER_GET_STEAM_GAME_LIST_METHOD, USER_REVOKE_AUTHORIZATION_METHOD, };
61
+ export { USER_GET_INFO_METHOD, USER_GET_STEAM_GAME_LIST_METHOD, USER_REVOKE_AUTHORIZATION_METHOD };
@@ -64,8 +64,8 @@ export type GetSteamGameListResult = {
64
64
  /**
65
65
  * 获取当前用户 Steam 游戏库。
66
66
  *
67
- * @param requester 底层 bridge 请求能力。
68
- * @param options 查询与分页参数。
67
+ * @param requester - 底层 bridge 请求能力。
68
+ * @param options - 查询与分页参数。
69
69
  * @returns 当前用户 Steam 游戏库;未登录或未绑定 Steam 时返回状态对象。
70
70
  */
71
71
  export declare function getSteamGameList(requester: MiniProgramRequester, options?: GetSteamGameListOptions): Promise<GetSteamGameListResult>;