deeke-script-app 1.5.4 → 1.5.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.
@@ -124,14 +124,14 @@ declare global {
124
124
  public focusable(bool: boolean): UiSelector;
125
125
 
126
126
  /**
127
- * 是否聚焦
127
+ * @param bool 是否已聚焦
128
128
  */
129
- public focused():boolean;
129
+ public focused(bool: boolean):UiSelector;
130
130
 
131
131
  /**
132
- * 是否可以编辑
132
+ * @param bool 是否可编辑
133
133
  */
134
- public editable():boolean;
134
+ public editable(bool: boolean):UiSelector;
135
135
 
136
136
  /**
137
137
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deeke-script-app",
3
- "version": "1.5.4",
3
+ "version": "1.5.6",
4
4
  "description": "DeekeScript应用",
5
5
  "main": "src/index.ts",
6
6
  "scripts": {
@@ -0,0 +1,72 @@
1
+
2
+ function test() {
3
+ let script = "let a = 12;console.log(a);System.sleep(3000);console.log(a);System.sleep(3000);console.log(a);";
4
+ Engines.executeScriptStr(script);
5
+ }
6
+
7
+ // test();
8
+
9
+ // console.log(1);
10
+ // for(let i = 0;i<1000;i++){
11
+ // //
12
+ // }
13
+ // System.sleep(5000);
14
+ // console.log(2);
15
+
16
+ function test1() {
17
+ console.log("任务开始");
18
+ setTimeout(() => {
19
+ console.log("延时3秒执行完成");
20
+ }, 3000);
21
+
22
+ // @ts-ignore
23
+ let i = 0;
24
+ // @ts-ignore
25
+ let timer = setInterval(() => {
26
+ if (i >= 3) {
27
+ clearInterval(timer);
28
+ return;
29
+ }
30
+ console.log("每3秒执行一次:" + i++);
31
+ }, 3000);
32
+
33
+ console.log('任务结束');
34
+ }
35
+
36
+ // test1();
37
+
38
+ function test2() {
39
+ let script = "let a = 12;console.log(a);System.sleep(3000);setTimeout(()=>console.log(22), 3000);console.log(a);";
40
+ Engines.executeScriptStr(script);
41
+ setTimeout(() => {
42
+ console.log("延时3秒执行完成");
43
+ }, 3000);
44
+ }
45
+ // test2();
46
+
47
+ let timerIndex;
48
+ function test3() {
49
+ let obj = {
50
+ run: function () {
51
+ console.log('线程');
52
+ timerIndex = setInterval(() => {
53
+ for (let i = 0; i <= 5; i++) {
54
+ console.log('延时3秒执行完成');
55
+ }
56
+ }, 3000);
57
+ }
58
+ }
59
+
60
+ let thread = new java.lang.Thread(new java.lang.Runnable(obj));
61
+
62
+ thread.start();
63
+ thread.join();
64
+ console.log('主线程');
65
+
66
+ // setTimeout(() => {
67
+ // console.log("main-延时3秒执行完成", timerIndex);
68
+ // clearInterval(timerIndex);
69
+ // }, 12000);
70
+ }
71
+
72
+ test3();