@docoi/mys-sdk 1.1.0 → 1.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 CHANGED
@@ -156,7 +156,7 @@ await mys.startRecordAudio({
156
156
  | 页面跳转 | `switchTab` `navigateTo` `openWebview` `openInExternalBrowser` `closeWebView` `openScheme` |
157
157
  | 账号与用户 | `login` `getToken` `getCurrentCircleInfo` |
158
158
  | 内容与分享 | `shareWebCard` `shareImage` `openAddCustomEmoji` `openCommentPanel` `showLongVipDesDialog` `voteAction` `openFriendsList` |
159
- | 业务场景 | `toBindGameRole` `bindGameRoleSuccess` `showAd` `onAdFinished` / `offAdFinished` `updateData` `openGiftBag` `onMemberActivate` / `offMemberActivate` |
159
+ | 业务场景 | `toBindGameRole` `bindGameRoleSuccess` `showAd` `updateData` `openGiftBag` `onMemberActivate` / `offMemberActivate` |
160
160
  | 工具 | `setDebug` `registerNativeHandler` |
161
161
 
162
162
  `getAppBaseInfo` / `isInApp` / `compareVersions` 用来读 App 环境信息,`ToastDuration` / `ShareType` 是枚举值。`onRoute` / `invokeDebug` 仅供仓库内的 Demo 调试,不承诺兼容,业务侧不要依赖。
package/dist/api/biz.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Callbacks, NativeResponse, EventListenOptions, ShareWebCardParams, ShareImageParams, ShareImageResult, ShowAdParams, BindGameRoleParams, OpenCommentPanelParams, VoteActionParams, OpenGiftBagParams, OpenFriendsListParams, OpenFriendsListResult, UpdateDataParams, LoginResult, GetTokenResult, GetCircleInfoResult, VoteData, AdFinishedCallback, MemberActivateHandler } from '../types';
1
+ import { Callbacks, NativeResponse, ShareWebCardParams, ShareImageParams, ShareImageResult, ShowAdParams, BindGameRoleParams, OpenCommentPanelParams, VoteActionParams, OpenGiftBagParams, OpenFriendsListParams, OpenFriendsListResult, UpdateDataParams, LoginResult, GetTokenResult, GetCircleInfoResult, VoteData, MemberActivateHandler } from '../types';
2
2
  /**
3
3
  * 登录授权。
4
4
  *
@@ -147,32 +147,20 @@ export declare function bindGameRoleSuccess(params?: Callbacks): Promise<NativeR
147
147
  /**
148
148
  * 展示原生广告视频。
149
149
  *
150
- * @note 广告播放完成后 Native 通过 onAdFinished 事件通知。
150
+ * @note 广告播放完成后通过 onFinished 回调通知,不需要单独监听事件;只有 Native 回传的 module 与 params.module 一致时才触发。
151
+ * @note onFinished 不需要手动取消,触发一次后自动取消;同一个 module 只保留最近一次调用的 onFinished,不同 module 互不影响,调用失败也不会取消。
151
152
  *
152
153
  * @app 3.9.0
153
154
  * @example
154
- * await mys.showAd({ type: 1, params: { circle_id: '123', module: 1 } })
155
- */
156
- export declare function showAd(params: ShowAdParams): Promise<NativeResponse<void>>;
157
- /**
158
- * 监听广告播放完成。
159
- *
160
- * @app 3.7.0
161
- * @example
162
- * mys.onAdFinished((res) => {
163
- * console.log(res.module)
155
+ * await mys.showAd({
156
+ * type: 1,
157
+ * params: { circle_id: '123', module: 1 },
158
+ * onFinished: (res) => {
159
+ * console.log('广告播放完成', res.module)
160
+ * },
164
161
  * })
165
162
  */
166
- export declare function onAdFinished(callback: AdFinishedCallback, options?: EventListenOptions): void;
167
- /**
168
- * 取消监听广告播放完成。
169
- *
170
- * @param callback 要取消的监听函数,不传则取消全部广告播放完成监听
171
- * @app 3.7.0
172
- * @example
173
- * mys.offAdFinished()
174
- */
175
- export declare function offAdFinished(callback?: AdFinishedCallback): void;
163
+ export declare function showAd(params: ShowAdParams): Promise<NativeResponse<void>>;
176
164
  /**
177
165
  * 通知 Native 更新数据。
178
166
  *
@@ -185,9 +173,19 @@ export declare function updateData(params: UpdateDataParams): Promise<NativeResp
185
173
  /**
186
174
  * 打开客户端背包。
187
175
  *
176
+ * @note 送礼成功后通过 onSent 回调通知,不需要单独监听事件。
177
+ * @note onSent 不需要手动取消,调用失败或下一次调用 openGiftBag 时自动取消;每次送礼成功都会触发。
178
+ *
188
179
  * @app 3.2.0
189
180
  * @example
190
- * await mys.openGiftBag({ user_id: 'u1', server_id: 's123', openBag: true })
181
+ * await mys.openGiftBag({
182
+ * user_id: 'u1',
183
+ * server_id: 's123',
184
+ * openBag: true,
185
+ * onSent: (res) => {
186
+ * console.log('送礼成功', res.gift_id, res.gift_name)
187
+ * },
188
+ * })
191
189
  */
192
190
  export declare function openGiftBag(params: OpenGiftBagParams): Promise<NativeResponse<void>>;
193
191
  /**
@@ -16,7 +16,7 @@ export declare function switchTab(params: SwitchTabParams): Promise<NativeRespon
16
16
  *
17
17
  * @note 不在 App 内时唤起 App,唤起失败(超时仍停留在当前页)时触发 onLaunchFail,由业务侧引导下载。
18
18
  * @note 唤起 App 和 App 4.4.0 以下的跳转都是发出即成功,不代表页面已打开。
19
- * @note App 4.4.0 以下能否跳转取决于目标页面自己的起始版本,不支持的返回 ENV_UNSUPPORTED(5002);绑定游戏角色、添加自定义表情页面在低版本仍可用。
19
+ * @note App 4.4.0 以下能否跳转取决于目标页面自己的起始版本,不支持的返回 ENV_UNSUPPORTED(5002);动态发布、资料编辑、点赞列表、广告页、绑定游戏角色、添加自定义表情页面在低版本仍可用。
20
20
  *
21
21
  * @app 4.4.0
22
22
  * @paramsMap NavigatePageParamsMap
@@ -68,6 +68,9 @@ export declare const PAGE_ROUTES: {
68
68
  publish: string;
69
69
  };
70
70
  };
71
+ publishType: {
72
+ key: string;
73
+ };
71
74
  relationType: {
72
75
  key: string;
73
76
  enum: {
@@ -333,6 +336,23 @@ export declare const PAGE_ROUTES: {
333
336
  since: string;
334
337
  fields: {};
335
338
  };
339
+ dynamicPublishPage: {
340
+ type: number;
341
+ name: string;
342
+ since: string;
343
+ fields: {
344
+ serverId: {
345
+ key: string;
346
+ required: true;
347
+ };
348
+ channelId: {
349
+ key: string;
350
+ };
351
+ publishType: {
352
+ key: string;
353
+ };
354
+ };
355
+ };
336
356
  };
337
357
  /** navigateTo 页面 + switchTab / openWebview 的路由,key 为语义名 */
338
358
  export declare const ROUTES: {
@@ -442,6 +462,9 @@ export declare const ROUTES: {
442
462
  publish: string;
443
463
  };
444
464
  };
465
+ publishType: {
466
+ key: string;
467
+ };
445
468
  relationType: {
446
469
  key: string;
447
470
  enum: {
@@ -707,6 +730,23 @@ export declare const ROUTES: {
707
730
  since: string;
708
731
  fields: {};
709
732
  };
733
+ dynamicPublishPage: {
734
+ type: number;
735
+ name: string;
736
+ since: string;
737
+ fields: {
738
+ serverId: {
739
+ key: string;
740
+ required: true;
741
+ };
742
+ channelId: {
743
+ key: string;
744
+ };
745
+ publishType: {
746
+ key: string;
747
+ };
748
+ };
749
+ };
710
750
  };
711
751
  export type RouteKey = keyof typeof ROUTES;
712
752
  /** daoke type → 路由,未登记的 type 返回 undefined */