@yagolive/event-kit 1.0.5 → 1.0.6

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/CHANGELOG.md CHANGED
@@ -1,5 +1,43 @@
1
1
  # Changelog
2
2
 
3
+ ## @1.0.6 (2026-06-09)
4
+
5
+ ### 新增
6
+
7
+ - **Close Action(addon 附加类型)**: 新增关闭 WebView 窗口动作类型
8
+ - `ActionType.CLOSE` = `'close'`
9
+ - `Close` 数据类:仅含 `text` 可选字段(继承自 `Base`)
10
+ - `ActionCreator.buildClose()`、`createCloseAction()`、`createCloseActionWithData()`
11
+ - `ActionBridge.close()`、`buildClose()`、`createCloseAction()`、`createCloseActionWithData()`
12
+ - 来源:`packages/@yagolive/event_kit/addon.ts` 中的 `AddonAction`,由宿主容器扩展
13
+
14
+ - **Config Action(addon 附加类型)**: 新增配置 WebView 主题/品牌色动作类型
15
+ - `ActionType.CONFIG` = `'config'`
16
+ - `Config` 数据类:可选字段 `theme`(`'dark' | 'light'`)、`brandColor`(string)、`tintColor`(string)、`title`(string,页面标题)、`text`
17
+ - `Config.Theme` 枚举:`DARK = 'dark'`、`LIGHT = 'light'`
18
+ - `ActionCreator.buildConfig()`、`createConfigAction()`、`createConfigActionWithData()`
19
+ - `ActionBridge.config(options?)`、`buildConfig()`、`createConfigAction()`、`createConfigActionWithData()`
20
+ - `bridge.config()` 便捷方法接受 `{ theme?, brandColor?, tintColor?, title? }` 配置对象
21
+ - 来源:`packages/@yagolive/event_kit/addon.ts` 中的 `AddonAction`,由宿主容器扩展
22
+
23
+ ### Action 类型完整列表
24
+
25
+ | 类型 | 字段 | 说明 |
26
+ |------|------|------|
27
+ | jump | path: string, text?: string | 页面跳转 |
28
+ | navigate | screen: string, params?: Record, text?: string | 导航到指定屏幕 |
29
+ | replace | screen: string, params?: Record, text?: string | 替换当前页面 |
30
+ | goback | text?: string | 返回上一页 |
31
+ | enter_room | id?: number, match?: string, callbacks?: Record, useReplace?: boolean, text?: string | 进入房间 |
32
+ | live_detect | text?: string | 活体检测 |
33
+ | onelink | url: string, share?: boolean, text?: string | 分享链接 |
34
+ | agency_invite | id: number, type: string, title?: string, message?: string, agencyInfo?: AgencyInfo, accepted?: boolean, text?: string | 工会邀请 |
35
+ | recharge | text?: string | 充值操作 |
36
+ | close | text?: string | 关闭 WebView 窗口(addon 附加) |
37
+ | config | theme?: 'dark' \| 'light', brandColor?: string, tintColor?: string, title?: string, text?: string | 配置 WebView 主题(addon 附加) |
38
+
39
+ ---
40
+
3
41
  ## @1.0.5 (2026-06-08)
4
42
 
5
43
  ### 新增
package/README.md CHANGED
@@ -169,8 +169,8 @@ import { ActionCreator } from '@yagolive/event-kit';
169
169
 
170
170
  | 属性 | 类型 | 说明 |
171
171
  |------|------|------|
172
- | `ActionData` | Object | 包含所有数据类型类:Jump, Navigate, Replace, Goback, EnterRoom, LiveDetect, Onelink, AgencyInvite, Recharge |
173
- | `ActionType` | Object | Action 类型枚举:JUMP, NAVIGATE, REPLACE, GOBACK, ENTER_ROOM, LIVE_DETECT, ONELINK, AGENCY_INVITE, RECHARGE |
172
+ | `ActionData` | Object | 包含所有数据类型类:Jump, Navigate, Replace, Goback, EnterRoom, LiveDetect, Onelink, AgencyInvite, Recharge, Close, Config |
173
+ | `ActionType` | Object | Action 类型枚举:JUMP, NAVIGATE, REPLACE, GOBACK, ENTER_ROOM, LIVE_DETECT, ONELINK, AGENCY_INVITE, RECHARGE, CLOSE, CONFIG |
174
174
 
175
175
  #### 工厂方法
176
176
 
@@ -205,6 +205,12 @@ import { ActionCreator } from '@yagolive/event-kit';
205
205
  | `buildRecharge()` | - | Recharge | 构建 Recharge 对象(链式配置) |
206
206
  | `createRechargeAction()` | - | Action | 创建充值 Action |
207
207
  | `createRechargeActionWithData(recharge)` | recharge: Recharge | Action | 从 Recharge 对象创建 Action |
208
+ | `buildClose()` | - | Close | 构建 Close 对象(链式配置,addon) |
209
+ | `createCloseAction()` | - | Action | 创建关闭 Action(addon) |
210
+ | `createCloseActionWithData(close)` | close: Close | Action | 从 Close 对象创建 Action(addon) |
211
+ | `buildConfig()` | - | Config | 构建 Config 对象(链式配置,addon) |
212
+ | `createConfigAction()` | - | Action | 创建配置 Action(addon) |
213
+ | `createConfigActionWithData(config)` | config: Config | Action | 从 Config 对象创建 Action(addon) |
208
214
 
209
215
  #### 使用示例
210
216
 
@@ -247,6 +253,8 @@ ActionType.LIVE_DETECT // 'live_detect'
247
253
  ActionType.ONELINK // 'onelink'
248
254
  ActionType.AGENCY_INVITE // 'agency_invite'
249
255
  ActionType.RECHARGE // 'recharge'
256
+ ActionType.CLOSE // 'close' (addon)
257
+ ActionType.CONFIG // 'config' (addon)
250
258
  ```
251
259
 
252
260
  ### ActionBridge
@@ -320,6 +328,12 @@ new ActionBridge(adapter, options?)
320
328
  | `recharge()` | - | Promise | 充值操作 |
321
329
  | `buildRecharge()` | - | Recharge | 构建 Recharge 对象(链式配置) |
322
330
  | `createRechargeActionWithData(recharge)` | recharge: Recharge | Action | 从 Recharge 对象创建 Action(不自动发送) |
331
+ | `close()` | - | Promise | 关闭 WebView 窗口(addon) |
332
+ | `buildClose()` | - | Close | 构建 Close 对象(链式配置,addon) |
333
+ | `createCloseActionWithData(close)` | close: Close | Action | 从 Close 对象创建 Action(addon) |
334
+ | `config(options?)` | options?: { theme?: 'dark' \| 'light', brandColor?: string, tintColor?: string, title?: string } | Promise | 配置 WebView 主题色(addon) |
335
+ | `buildConfig()` | - | Config | 构建 Config 对象(链式配置,addon) |
336
+ | `createConfigActionWithData(config)` | config: Config | Action | 从 Config 对象创建 Action(addon) |
323
337
 
324
338
  #### 静态方法
325
339
 
@@ -688,6 +702,33 @@ Onelink Action 数据。
688
702
  | `constructor()` | - | 创建充值数据 |
689
703
  | `setText(text)` | text: string | 设置显示文本,返回 this |
690
704
 
705
+ ### Close(addon 附加)
706
+
707
+ 关闭 WebView 窗口 Action 数据。来源于 `addon.ts` 的 `AddonAction`,由宿主容器扩展。
708
+
709
+ | 方法 | 参数 | 说明 |
710
+ |------|------|------|
711
+ | `constructor()` | - | 创建 Close 数据 |
712
+ | `setText(text)` | text: string | 设置显示文本,返回 this |
713
+
714
+ ### Config(addon 附加)
715
+
716
+ 配置 WebView 主题色等参数 Action 数据。来源于 `addon.ts` 的 `AddonAction`,由宿主容器扩展。
717
+
718
+ | 方法 | 参数 | 说明 |
719
+ |------|------|------|
720
+ | `constructor()` | - | 创建 Config 数据 |
721
+ | `setText(text)` | text: string | 设置显示文本,返回 this |
722
+ | `setTheme(theme)` | theme: 'dark' \| 'light' | 设置主题,返回 this |
723
+ | `setBrandColor(brandColor)` | brandColor: string | 设置品牌色,返回 this |
724
+ | `setTintColor(tintColor)` | tintColor: string | 设置主题色,返回 this |
725
+ | `setTitle(title)` | title: string | 设置页面标题,返回 this |
726
+
727
+ **静态属性**:
728
+
729
+ - `Config.Theme.DARK` = `'dark'`
730
+ - `Config.Theme.LIGHT` = `'light'`
731
+
691
732
  ### Action
692
733
 
693
734
  Action 对象,封装类型和数据。
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * YAGO Event Kit - Action Bridge (Full)
3
- * @version 1.0.5
3
+ * @version 1.0.6
4
4
  *
5
5
  * Generated by build script - do not edit manually.
6
6
  * Supports: Browser script tag, CommonJS, AMD
@@ -513,6 +513,86 @@ var Recharge = class {
513
513
  };
514
514
  var Recharge_default = Recharge;
515
515
 
516
+ // src/core/types/Close.js
517
+ var Close = class {
518
+ constructor() {
519
+ this.text = null;
520
+ }
521
+ getText() {
522
+ return this.text;
523
+ }
524
+ setText(text) {
525
+ this.text = text;
526
+ return this;
527
+ }
528
+ toMap() {
529
+ const map = {};
530
+ if (this.text != null) map.text = this.text;
531
+ return map;
532
+ }
533
+ };
534
+ var Close_default = Close;
535
+
536
+ // src/core/types/Config.js
537
+ var Config = class {
538
+ constructor() {
539
+ this.text = null;
540
+ this.theme = null;
541
+ this.brandColor = null;
542
+ this.tintColor = null;
543
+ this.title = null;
544
+ }
545
+ getText() {
546
+ return this.text;
547
+ }
548
+ setText(text) {
549
+ this.text = text;
550
+ return this;
551
+ }
552
+ getTheme() {
553
+ return this.theme;
554
+ }
555
+ setTheme(theme) {
556
+ this.theme = theme;
557
+ return this;
558
+ }
559
+ getBrandColor() {
560
+ return this.brandColor;
561
+ }
562
+ setBrandColor(brandColor) {
563
+ this.brandColor = brandColor;
564
+ return this;
565
+ }
566
+ getTintColor() {
567
+ return this.tintColor;
568
+ }
569
+ setTintColor(tintColor) {
570
+ this.tintColor = tintColor;
571
+ return this;
572
+ }
573
+ getTitle() {
574
+ return this.title;
575
+ }
576
+ setTitle(title) {
577
+ this.title = title;
578
+ return this;
579
+ }
580
+ toMap() {
581
+ const map = {};
582
+ if (this.text != null) map.text = this.text;
583
+ if (this.theme != null) map.theme = this.theme;
584
+ if (this.brandColor != null) map.brandColor = this.brandColor;
585
+ if (this.tintColor != null) map.tintColor = this.tintColor;
586
+ if (this.title != null) map.title = this.title;
587
+ return map;
588
+ }
589
+ };
590
+ Config.Theme = {
591
+ DARK: "dark",
592
+ LIGHT: "light"
593
+ };
594
+ var Config_default = Config;
595
+
516
596
  // src/core/types/Action.js
517
597
  var Action = class {
518
598
  constructor(type, data) {
@@ -559,7 +639,9 @@ var ActionType = {
559
639
  LIVE_DETECT: "live_detect",
560
640
  ONELINK: "onelink",
561
641
  AGENCY_INVITE: "agency_invite",
562
- RECHARGE: "recharge"
642
+ RECHARGE: "recharge",
643
+ CLOSE: "close",
644
+ CONFIG: "config"
563
645
  };
564
646
  var ActionData = {
565
647
  Jump: Jump_default,
@@ -570,7 +652,9 @@ var ActionData = {
570
652
  LiveDetect: LiveDetect_default,
571
653
  Onelink: Onelink_default,
572
654
  AgencyInvite: AgencyInvite_default,
573
- Recharge: Recharge_default
655
+ Recharge: Recharge_default,
656
+ Close: Close_default,
657
+ Config: Config_default
574
658
  };
575
659
  var ActionCreator = {
576
660
  ActionData,
@@ -672,6 +756,26 @@ var ActionCreator = {
672
756
  },
673
757
  createRechargeActionWithData(recharge) {
674
758
  return new Action_default(ActionType.RECHARGE, recharge);
759
+ },
760
+ // Close
761
+ buildClose() {
762
+ return new Close_default();
763
+ },
764
+ createCloseAction() {
765
+ return new Action_default(ActionType.CLOSE, new Close_default());
766
+ },
767
+ createCloseActionWithData(close) {
768
+ return new Action_default(ActionType.CLOSE, close);
769
+ },
770
+ // Config
771
+ buildConfig() {
772
+ return new Config_default();
773
+ },
774
+ createConfigAction() {
775
+ return new Action_default(ActionType.CONFIG, new Config_default());
776
+ },
777
+ createConfigActionWithData(config) {
778
+ return new Action_default(ActionType.CONFIG, config);
675
779
  }
676
780
  };
677
781
 
@@ -959,6 +1063,37 @@ var ActionBridge = class _ActionBridge {
959
1063
  createRechargeActionWithData(recharge) {
960
1064
  return ActionCreator.createRechargeActionWithData(recharge);
961
1065
  }
1066
+ close() {
1067
+ return this._adapter.sendAction(ActionCreator.createCloseAction());
1068
+ }
1069
+ buildClose() {
1070
+ return ActionCreator.buildClose();
1071
+ }
1072
+ createCloseAction() {
1073
+ return ActionCreator.createCloseAction();
1074
+ }
1075
+ createCloseActionWithData(close) {
1076
+ return ActionCreator.createCloseActionWithData(close);
1077
+ }
1078
+ config(options) {
1079
+ var data = ActionCreator.buildConfig();
1080
+ if (options) {
1081
+ if (options.theme != null) data.setTheme(options.theme);
1082
+ if (options.brandColor != null) data.setBrandColor(options.brandColor);
1083
+ if (options.tintColor != null) data.setTintColor(options.tintColor);
1084
+ if (options.title != null) data.setTitle(options.title);
1085
+ }
1086
+ return this._adapter.sendAction(ActionCreator.createConfigActionWithData(data));
1087
+ }
1088
+ buildConfig() {
1089
+ return ActionCreator.buildConfig();
1090
+ }
1091
+ createConfigAction() {
1092
+ return ActionCreator.createConfigAction();
1093
+ }
1094
+ createConfigActionWithData(config) {
1095
+ return ActionCreator.createConfigActionWithData(config);
1096
+ }
962
1097
  destroy() {
963
1098
  if (typeof this._adapter.destroy === "function") {
964
1099
  this._adapter.destroy();
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * YAGO Event Kit - Action Creator (Core Only)
3
- * @version 1.0.5
3
+ * @version 1.0.6
4
4
  *
5
5
  * Generated by build script - do not edit manually.
6
6
  * Supports: Browser script tag, CommonJS, AMD
@@ -513,6 +513,86 @@ var Recharge = class {
513
513
  };
514
514
  var Recharge_default = Recharge;
515
515
 
516
+ // src/core/types/Close.js
517
+ var Close = class {
518
+ constructor() {
519
+ this.text = null;
520
+ }
521
+ getText() {
522
+ return this.text;
523
+ }
524
+ setText(text) {
525
+ this.text = text;
526
+ return this;
527
+ }
528
+ toMap() {
529
+ const map = {};
530
+ if (this.text != null) map.text = this.text;
531
+ return map;
532
+ }
533
+ };
534
+ var Close_default = Close;
535
+
536
+ // src/core/types/Config.js
537
+ var Config = class {
538
+ constructor() {
539
+ this.text = null;
540
+ this.theme = null;
541
+ this.brandColor = null;
542
+ this.tintColor = null;
543
+ this.title = null;
544
+ }
545
+ getText() {
546
+ return this.text;
547
+ }
548
+ setText(text) {
549
+ this.text = text;
550
+ return this;
551
+ }
552
+ getTheme() {
553
+ return this.theme;
554
+ }
555
+ setTheme(theme) {
556
+ this.theme = theme;
557
+ return this;
558
+ }
559
+ getBrandColor() {
560
+ return this.brandColor;
561
+ }
562
+ setBrandColor(brandColor) {
563
+ this.brandColor = brandColor;
564
+ return this;
565
+ }
566
+ getTintColor() {
567
+ return this.tintColor;
568
+ }
569
+ setTintColor(tintColor) {
570
+ this.tintColor = tintColor;
571
+ return this;
572
+ }
573
+ getTitle() {
574
+ return this.title;
575
+ }
576
+ setTitle(title) {
577
+ this.title = title;
578
+ return this;
579
+ }
580
+ toMap() {
581
+ const map = {};
582
+ if (this.text != null) map.text = this.text;
583
+ if (this.theme != null) map.theme = this.theme;
584
+ if (this.brandColor != null) map.brandColor = this.brandColor;
585
+ if (this.tintColor != null) map.tintColor = this.tintColor;
586
+ if (this.title != null) map.title = this.title;
587
+ return map;
588
+ }
589
+ };
590
+ Config.Theme = {
591
+ DARK: "dark",
592
+ LIGHT: "light"
593
+ };
594
+ var Config_default = Config;
595
+
516
596
  // src/core/types/Action.js
517
597
  var Action = class {
518
598
  constructor(type, data) {
@@ -559,7 +639,9 @@ var ActionType = {
559
639
  LIVE_DETECT: "live_detect",
560
640
  ONELINK: "onelink",
561
641
  AGENCY_INVITE: "agency_invite",
562
- RECHARGE: "recharge"
642
+ RECHARGE: "recharge",
643
+ CLOSE: "close",
644
+ CONFIG: "config"
563
645
  };
564
646
  var ActionData = {
565
647
  Jump: Jump_default,
@@ -570,7 +652,9 @@ var ActionData = {
570
652
  LiveDetect: LiveDetect_default,
571
653
  Onelink: Onelink_default,
572
654
  AgencyInvite: AgencyInvite_default,
573
- Recharge: Recharge_default
655
+ Recharge: Recharge_default,
656
+ Close: Close_default,
657
+ Config: Config_default
574
658
  };
575
659
  var ActionCreator = {
576
660
  ActionData,
@@ -672,6 +756,26 @@ var ActionCreator = {
672
756
  },
673
757
  createRechargeActionWithData(recharge) {
674
758
  return new Action_default(ActionType.RECHARGE, recharge);
759
+ },
760
+ // Close
761
+ buildClose() {
762
+ return new Close_default();
763
+ },
764
+ createCloseAction() {
765
+ return new Action_default(ActionType.CLOSE, new Close_default());
766
+ },
767
+ createCloseActionWithData(close) {
768
+ return new Action_default(ActionType.CLOSE, close);
769
+ },
770
+ // Config
771
+ buildConfig() {
772
+ return new Config_default();
773
+ },
774
+ createConfigAction() {
775
+ return new Action_default(ActionType.CONFIG, new Config_default());
776
+ },
777
+ createConfigActionWithData(config) {
778
+ return new Action_default(ActionType.CONFIG, config);
675
779
  }
676
780
  };
677
781
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yagolive/event-kit",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "YAGO Event Kit - 跨环境 Action 创建与通信工具库,支持浏览器、React、Vue",
5
5
  "main": "src/index.js",
6
6
  "browser": "dist/js/action_bridge.umd.js",
@@ -181,6 +181,41 @@ export default class ActionBridge {
181
181
  return ActionCreator.createRechargeActionWithData(recharge);
182
182
  }
183
183
 
184
+ close() {
185
+ return this._adapter.sendAction(ActionCreator.createCloseAction());
186
+ }
187
+
188
+ buildClose() {
189
+ return ActionCreator.buildClose();
190
+ }
191
+ createCloseAction() {
192
+ return ActionCreator.createCloseAction();
193
+ }
194
+ createCloseActionWithData(close) {
195
+ return ActionCreator.createCloseActionWithData(close);
196
+ }
197
+
198
+ config(options) {
199
+ var data = ActionCreator.buildConfig();
200
+ if (options) {
201
+ if (options.theme != null) data.setTheme(options.theme);
202
+ if (options.brandColor != null) data.setBrandColor(options.brandColor);
203
+ if (options.tintColor != null) data.setTintColor(options.tintColor);
204
+ if (options.title != null) data.setTitle(options.title);
205
+ }
206
+ return this._adapter.sendAction(ActionCreator.createConfigActionWithData(data));
207
+ }
208
+
209
+ buildConfig() {
210
+ return ActionCreator.buildConfig();
211
+ }
212
+ createConfigAction() {
213
+ return ActionCreator.createConfigAction();
214
+ }
215
+ createConfigActionWithData(config) {
216
+ return ActionCreator.createConfigActionWithData(config);
217
+ }
218
+
184
219
  destroy() {
185
220
  if (typeof this._adapter.destroy === 'function') {
186
221
  this._adapter.destroy();
@@ -1,5 +1,5 @@
1
1
  import {
2
- Action, Jump, Navigate, Replace, Goback, EnterRoom, LiveDetect, Onelink, AgencyInvite, Recharge,
2
+ Action, Jump, Navigate, Replace, Goback, EnterRoom, LiveDetect, Onelink, AgencyInvite, Recharge, Close, Config,
3
3
  ActionType, ActionData, ActionCreator,
4
4
  } from '../core/index.js';
5
5
  import { IActionAdapter, RNWebViewAdapter, MockAdapter, AdapterOptions } from '../adapters/index.js';
@@ -61,6 +61,16 @@ export declare class ActionBridge {
61
61
  createRechargeAction(): Action;
62
62
  createRechargeActionWithData(recharge: Recharge): Action;
63
63
 
64
+ close(): Promise<any>;
65
+ buildClose(): Close;
66
+ createCloseAction(): Action;
67
+ createCloseActionWithData(close: Close): Action;
68
+
69
+ config(options?: { theme?: 'dark' | 'light'; brandColor?: string; tintColor?: string; title?: string }): Promise<any>;
70
+ buildConfig(): Config;
71
+ createConfigAction(): Action;
72
+ createConfigActionWithData(config: Config): Action;
73
+
64
74
  destroy(): void;
65
75
 
66
76
  static ActionCreator: typeof ActionCreator;
@@ -7,6 +7,8 @@ import LiveDetect from './types/LiveDetect.js';
7
7
  import Onelink from './types/Onelink.js';
8
8
  import AgencyInvite from './types/AgencyInvite.js';
9
9
  import Recharge from './types/Recharge.js';
10
+ import Close from './types/Close.js';
11
+ import Config from './types/Config.js';
10
12
  import Action from './types/Action.js';
11
13
 
12
14
  const ActionType = {
@@ -19,6 +21,8 @@ const ActionType = {
19
21
  ONELINK: 'onelink',
20
22
  AGENCY_INVITE: 'agency_invite',
21
23
  RECHARGE: 'recharge',
24
+ CLOSE: 'close',
25
+ CONFIG: 'config',
22
26
  };
23
27
 
24
28
  const ActionData = {
@@ -31,6 +35,8 @@ const ActionData = {
31
35
  Onelink,
32
36
  AgencyInvite,
33
37
  Recharge,
38
+ Close,
39
+ Config,
34
40
  };
35
41
 
36
42
  const ActionCreator = {
@@ -163,6 +169,32 @@ const ActionCreator = {
163
169
  createRechargeActionWithData(recharge) {
164
170
  return new Action(ActionType.RECHARGE, recharge);
165
171
  },
172
+
173
+ // Close
174
+ buildClose() {
175
+ return new Close();
176
+ },
177
+
178
+ createCloseAction() {
179
+ return new Action(ActionType.CLOSE, new Close());
180
+ },
181
+
182
+ createCloseActionWithData(close) {
183
+ return new Action(ActionType.CLOSE, close);
184
+ },
185
+
186
+ // Config
187
+ buildConfig() {
188
+ return new Config();
189
+ },
190
+
191
+ createConfigAction() {
192
+ return new Action(ActionType.CONFIG, new Config());
193
+ },
194
+
195
+ createConfigActionWithData(config) {
196
+ return new Action(ActionType.CONFIG, config);
197
+ },
166
198
  };
167
199
 
168
200
  export { ActionCreator, ActionData, ActionType };
@@ -191,6 +191,40 @@ export class Recharge {
191
191
  toMap(): Record<string, any>;
192
192
  }
193
193
 
194
+ export class Close {
195
+ constructor();
196
+ text: string | null;
197
+ getText(): string | null;
198
+ setText(text: string): this;
199
+ toMap(): Record<string, any>;
200
+ }
201
+
202
+ export const ConfigTheme: {
203
+ DARK: 'dark';
204
+ LIGHT: 'light';
205
+ };
206
+
207
+ export class Config {
208
+ constructor();
209
+ text: string | null;
210
+ theme: 'dark' | 'light' | null;
211
+ brandColor: string | null;
212
+ tintColor: string | null;
213
+ title: string | null;
214
+ static Theme: typeof ConfigTheme;
215
+ getText(): string | null;
216
+ setText(text: string): this;
217
+ getTheme(): 'dark' | 'light' | null;
218
+ setTheme(theme: 'dark' | 'light'): this;
219
+ getBrandColor(): string | null;
220
+ setBrandColor(brandColor: string): this;
221
+ getTintColor(): string | null;
222
+ setTintColor(tintColor: string): this;
223
+ getTitle(): string | null;
224
+ setTitle(title: string): this;
225
+ toMap(): Record<string, any>;
226
+ }
227
+
194
228
  export class Action {
195
229
  constructor(type: ActionTypeValue, data: any);
196
230
  type: ActionTypeValue;
@@ -204,7 +238,7 @@ export class Action {
204
238
  toJson(): string;
205
239
  }
206
240
 
207
- export type ActionTypeValue = 'jump' | 'navigate' | 'replace' | 'goback' | 'enter_room' | 'live_detect' | 'onelink' | 'agency_invite' | 'recharge';
241
+ export type ActionTypeValue = 'jump' | 'navigate' | 'replace' | 'goback' | 'enter_room' | 'live_detect' | 'onelink' | 'agency_invite' | 'recharge' | 'close' | 'config';
208
242
 
209
243
  export const ActionType: {
210
244
  JUMP: 'jump';
@@ -216,6 +250,8 @@ export const ActionType: {
216
250
  ONELINK: 'onelink';
217
251
  AGENCY_INVITE: 'agency_invite';
218
252
  RECHARGE: 'recharge';
253
+ CLOSE: 'close';
254
+ CONFIG: 'config';
219
255
  };
220
256
 
221
257
  export const ActionData: {
@@ -228,6 +264,8 @@ export const ActionData: {
228
264
  Onelink: typeof Onelink;
229
265
  AgencyInvite: typeof AgencyInvite;
230
266
  Recharge: typeof Recharge;
267
+ Close: typeof Close;
268
+ Config: typeof Config;
231
269
  };
232
270
 
233
271
  export const ActionCreator: {
@@ -262,4 +300,10 @@ export const ActionCreator: {
262
300
  buildRecharge(): Recharge;
263
301
  createRechargeAction(): Action;
264
302
  createRechargeActionWithData(recharge: Recharge): Action;
303
+ buildClose(): Close;
304
+ createCloseAction(): Action;
305
+ createCloseActionWithData(close: Close): Action;
306
+ buildConfig(): Config;
307
+ createConfigAction(): Action;
308
+ createConfigActionWithData(config: Config): Action;
265
309
  };
package/src/core/index.js CHANGED
@@ -8,4 +8,6 @@ export { default as LiveDetect } from './types/LiveDetect.js';
8
8
  export { default as Onelink } from './types/Onelink.js';
9
9
  export { default as AgencyInvite } from './types/AgencyInvite.js';
10
10
  export { default as Recharge } from './types/Recharge.js';
11
+ export { default as Close } from './types/Close.js';
12
+ export { default as Config } from './types/Config.js';
11
13
  export { default as Action } from './types/Action.js';
@@ -0,0 +1,16 @@
1
+ class Close {
2
+ constructor() {
3
+ this.text = null;
4
+ }
5
+
6
+ getText() { return this.text; }
7
+ setText(text) { this.text = text; return this; }
8
+
9
+ toMap() {
10
+ const map = {};
11
+ if (this.text != null) map.text = this.text;
12
+ return map;
13
+ }
14
+ }
15
+
16
+ export default Close;
@@ -0,0 +1,37 @@
1
+ class Config {
2
+ constructor() {
3
+ this.text = null;
4
+ this.theme = null;
5
+ this.brandColor = null;
6
+ this.tintColor = null;
7
+ this.title = null;
8
+ }
9
+
10
+ getText() { return this.text; }
11
+ setText(text) { this.text = text; return this; }
12
+ getTheme() { return this.theme; }
13
+ setTheme(theme) { this.theme = theme; return this; }
14
+ getBrandColor() { return this.brandColor; }
15
+ setBrandColor(brandColor) { this.brandColor = brandColor; return this; }
16
+ getTintColor() { return this.tintColor; }
17
+ setTintColor(tintColor) { this.tintColor = tintColor; return this; }
18
+ getTitle() { return this.title; }
19
+ setTitle(title) { this.title = title; return this; }
20
+
21
+ toMap() {
22
+ const map = {};
23
+ if (this.text != null) map.text = this.text;
24
+ if (this.theme != null) map.theme = this.theme;
25
+ if (this.brandColor != null) map.brandColor = this.brandColor;
26
+ if (this.tintColor != null) map.tintColor = this.tintColor;
27
+ if (this.title != null) map.title = this.title;
28
+ return map;
29
+ }
30
+ }
31
+
32
+ Config.Theme = {
33
+ DARK: 'dark',
34
+ LIGHT: 'light',
35
+ };
36
+
37
+ export default Config;
package/src/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export { ActionBridge } from './bridge/index.js';
2
- export { ActionCreator, ActionData, ActionType, Jump, Navigate, Replace, Goback, EnterRoom, LiveDetect, Onelink, AgencyInvite, Recharge, Action } from './core/index.js';
2
+ export { ActionCreator, ActionData, ActionType, Jump, Navigate, Replace, Goback, EnterRoom, LiveDetect, Onelink, AgencyInvite, Recharge, Close, Config, Action } from './core/index.js';
3
3
  export { RNWebViewAdapter, MockAdapter, IActionAdapter, MockCall } from './adapters/index.js';
4
4
  export { ActionBridgeProvider, useActionBridge } from './integrations/react/index.js';
package/src/index.js CHANGED
@@ -10,4 +10,6 @@ export { LiveDetect } from './core/index.js';
10
10
  export { Onelink } from './core/index.js';
11
11
  export { AgencyInvite } from './core/index.js';
12
12
  export { Recharge } from './core/index.js';
13
+ export { Close } from './core/index.js';
14
+ export { Config } from './core/index.js';
13
15
  export { Action } from './core/index.js';