@choiceform/os-client-core 3.4.7 → 3.4.8

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/index.d.ts CHANGED
@@ -740,6 +740,12 @@ interface CFSetupOptions {
740
740
  * @param message 错误内容
741
741
  */
742
742
  error(message: string): void;
743
+ /**
744
+ * 上传日志的方法,核心包运行时会生成一些有利于追踪已知错误的日志,希望能通过这个方法上传。
745
+ * 如果不设置则不会上传错误。而是在控制台打印出来
746
+ * @param message
747
+ */
748
+ uploadLog?(message: string, level?: 'log' | 'error'):void;
743
749
  /**
744
750
  * 如果在单页模式中有很多题目,进行作答后点击下一题,其中某道题目的答案不满足要求,
745
751
  * 这时候可能这道题目不再滚动条所在的可见范围内,
@@ -800,9 +806,9 @@ interface CFSetupOptions {
800
806
  * 自定义中断回调方法
801
807
  * 当核心包中运行发生异常,或者需要去往外部程序时,会中断答题流程,同时触发调用这个方法
802
808
  * 客户端中可以配置该方法来在此时机做一些自定义的事情。
803
- * 默认行为:什么也不做
809
+ * 默认行为:总是会在方法被调用的一秒内压制系统消息
804
810
  */
805
- customAbort?(relax?: boolean): void;
811
+ customAbort?(): void;
806
812
  /**
807
813
  * 自定义的去往开始页面方法,只有使用web核心包是需要关注这个方法
808
814
  *
@@ -1054,19 +1060,19 @@ interface CFCore extends CFSetupOptions {
1054
1060
  * 多次调用,只有第一次会发送请求
1055
1061
  * 请求的数据会放到缓存中,后面几次获得的都是返回的缓存数据
1056
1062
  */
1057
- fetchStartState(): Promise<CFStartState>;
1063
+ fetchStartState(): Promise<CFStartState | null>;
1058
1064
  /**
1059
1065
  * 获取答题也数据的方法
1060
1066
  * 多次调用,只有第一次会发送请求
1061
1067
  * 请求的数据会放到缓存中,后面几次获得的都是返回的缓存数据
1062
1068
  */
1063
- fetchSurveyState(): Promise<CFSurveyState>;
1069
+ fetchSurveyState(): Promise<CFSurveyState | null>;
1064
1070
  /**
1065
1071
  * 获取奖励页面数据的方法
1066
1072
  * 多次调用,只有第一次会发送请求
1067
1073
  * 请求的数据会放到缓存中,后面几次获得的都是返回的缓存数据
1068
1074
  */
1069
- fetchRewardState(): Promise<CFRewardState>;
1075
+ fetchRewardState(): Promise<CFRewardState | null>;
1070
1076
  /**
1071
1077
  * 获取主题
1072
1078
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@choiceform/os-client-core",
3
- "version": "3.4.7",
3
+ "version": "3.4.8",
4
4
  "description": "choiceform survey client core",
5
5
  "main": "./dist/core.js",
6
6
  "repository": "https://github.com/choice-form/os-client-core",