ms-types 0.9.15 → 0.9.16

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ms-types",
3
- "version": "0.9.15",
3
+ "version": "0.9.16",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
package/types/cloud.d.ts CHANGED
@@ -8,7 +8,7 @@ declare namespace cloud {
8
8
  * @param url 完整 ws:// 或 wss:// 云控地址。
9
9
  * @param deviceNo 可选设备编号,不传时沿用当前保存的设备编号。
10
10
  * @returns URL 校验通过且连接请求已提交时返回 true。
11
- * @description 只能在主脚本上下文调用;只影响当前运行期云控连接,不会写入设置页的持久化云控配置。
11
+ * @description 只能在主脚本上下文调用;只影响当前运行期云控连接,不会写入设置页的持久化云控配置;授权卡密模式不可用。
12
12
  * @example
13
13
  * const accepted = cloud.connect("wss://example.com/control", "device-001");
14
14
  */
package/types/media.d.ts CHANGED
@@ -87,9 +87,9 @@ declare namespace media {
87
87
  function stopMp3(): boolean;
88
88
 
89
89
  /**
90
- * 同步播放MP3音乐(播放一次并等待结束)
90
+ * 同步播放MP3音乐(播放一次并等待结束;系统音频中断、停止或被新播放替换时立即返回 false)
91
91
  * @param path 文件路径
92
- * @returns 是否播放成功
92
+ * @returns 是否正常播放到结尾
93
93
  * @example
94
94
  * const played = media.playMp3WaitEnd("music.mp3")
95
95
  * if (played) {
@@ -25,8 +25,19 @@ declare namespace netCard {
25
25
  expireTime: string;
26
26
  }
27
27
 
28
+ /**
29
+ * 判断当前是否为授权卡密模式
30
+ * @returns 当前 App 处于授权卡密模式返回 true,否则返回 false
31
+ * @example
32
+ * if (netCard.isAuthCardMode()) {
33
+ * logi("当前为授权卡密模式,不需要重复调用 verify")
34
+ * }
35
+ */
36
+ function isAuthCardMode(): boolean;
37
+
28
38
  /**
29
39
  * 验证卡密
40
+ * 授权卡密模式下,App 打开加密 UI 或运行脚本前会完成授权和卡密验证,脚本侧调用直接返回 true
30
41
  * @param cardNo 卡密
31
42
  * @returns 是否验证成功
32
43
  * @example
package/types/ui.d.ts CHANGED
@@ -75,6 +75,12 @@ declare namespace ms {
75
75
  */
76
76
  function getServerDeviceId(): Promise<string>;
77
77
 
78
+ /**
79
+ * 获取当前软件包缓存的授权卡密
80
+ * @returns 有缓存的授权卡密时返回卡密字符串,没有缓存时返回空字符串
81
+ */
82
+ function getAuthCardNo(): Promise<string>;
83
+
78
84
  /**
79
85
  * 获取Agent状态
80
86
  * @returns 如果Agent正在运行返回true,否则返回false
package/types/utils.d.ts CHANGED
@@ -7,7 +7,7 @@ declare namespace utils {
7
7
  * @param format 格式化字符串
8
8
  * @returns 格式化后的时间字符串
9
9
  * @example
10
- * utils.timeFormat("yyyy-MM-dd hh:mm:ss")
10
+ * utils.timeFormat("yyyy-MM-dd HH:mm:ss")
11
11
  */
12
12
  function timeFormat(format: string): string;
13
13
  /**
@@ -6,7 +6,7 @@ declare namespace $云控 {
6
6
  * @param 地址 完整 ws:// 或 wss:// 云控地址。
7
7
  * @param 设备编号 可选设备编号,不传时沿用当前保存的设备编号。
8
8
  * @returns URL 校验通过且连接请求已提交时返回 true。
9
- * @description 只能在主脚本上下文调用;只影响当前运行期云控连接,不会写入设置页的持久化云控配置。
9
+ * @description 只能在主脚本上下文调用;只影响当前运行期云控连接,不会写入设置页的持久化云控配置;授权卡密模式不可用。
10
10
  * @example
11
11
  * const 已提交 = $云控.连接("wss://example.com/control", "device-001");
12
12
  */
@@ -30,8 +30,19 @@ declare namespace $卡密 {
30
30
  expireTime: string;
31
31
  }
32
32
 
33
+ /**
34
+ * 判断当前是否为授权卡密模式
35
+ * @returns 当前 App 处于授权卡密模式返回 true,否则返回 false
36
+ * @example
37
+ * if ($卡密.是否授权卡密模式()) {
38
+ * $打印信息日志("当前为授权卡密模式,不需要重复调用验证")
39
+ * }
40
+ */
41
+ function 是否授权卡密模式(): 布尔值;
42
+
33
43
  /**
34
44
  * 验证卡密
45
+ * 授权卡密模式下,App 打开加密 UI 或运行脚本前会完成授权和卡密验证,脚本侧调用直接返回 true
35
46
  * @param 卡密
36
47
  * @returns 是否验证成功
37
48
  * @example
@@ -88,9 +88,9 @@ declare namespace $媒体 {
88
88
  function 停止播放MP3音乐(): 布尔值;
89
89
 
90
90
  /**
91
- * 同步播放MP3音乐(播放一次并等待结束)
91
+ * 同步播放MP3音乐(播放一次并等待结束;系统音频中断、停止或被新播放替换时立即返回 false)
92
92
  * @param 文件路径
93
- * @returns 是否播放成功
93
+ * @returns 是否正常播放到结尾
94
94
  * @example
95
95
  * const 是否播放成功 = $媒体.同步播放MP3音乐("music.mp3")
96
96
  * if (是否播放成功) {
@@ -9,7 +9,7 @@ declare namespace $工具 {
9
9
  * @param format 格式化字符串
10
10
  * @returns 格式化后的时间字符串
11
11
  * @example
12
- * $工具.获取当前时间字符串("yyyy-MM-dd hh:mm:ss")
12
+ * $工具.获取当前时间字符串("yyyy-MM-dd HH:mm:ss")
13
13
  */
14
14
  function 获取当前时间字符串(格式化字符串: 字符串): 字符串;
15
15
  /**