@zeppos/zeus-cli 1.0.6 → 1.0.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/bin/cli.js +4 -1
- package/config/device.js +10 -2
- package/config/project.js +23 -1
- package/modules/build.js +52 -26
- package/modules/config.js +55 -11
- package/modules/create/index.js +57 -18
- package/modules/create/local-app.js +28 -4
- package/modules/help.js +1 -0
- package/modules/login.js +62 -18
- package/modules/run.js +43 -29
- package/modules/simulator.js +4 -3
- package/package.json +3 -2
- package/public/template/empty/app-side/index.js +1 -1
- package/public/template/empty/app.js +1 -1
- package/public/template/empty/app.json +1 -8
- package/public/template/empty/pages/index.js +2 -2
- package/public/template/empty/setting/index.js +1 -1
- package/public/template/empty/watchface/index.js +13 -0
- package/public/template/hello-world/app.js +1 -1
- package/public/template/hello-world/page/i18n/en-US.po +3 -0
- package/public/template/timer/app.js +10 -0
- package/public/template/timer/app.json +50 -0
- package/public/template/timer/assets/gtr-3-pro/images/bg/bg.png +0 -0
- package/public/template/timer/assets/gtr-3-pro/images/bigNum/0.png +0 -0
- package/public/template/timer/assets/gtr-3-pro/images/bigNum/1.png +0 -0
- package/public/template/timer/assets/gtr-3-pro/images/bigNum/2.png +0 -0
- package/public/template/timer/assets/gtr-3-pro/images/bigNum/3.png +0 -0
- package/public/template/timer/assets/gtr-3-pro/images/bigNum/4.png +0 -0
- package/public/template/timer/assets/gtr-3-pro/images/bigNum/5.png +0 -0
- package/public/template/timer/assets/gtr-3-pro/images/bigNum/6.png +0 -0
- package/public/template/timer/assets/gtr-3-pro/images/bigNum/7.png +0 -0
- package/public/template/timer/assets/gtr-3-pro/images/bigNum/8.png +0 -0
- package/public/template/timer/assets/gtr-3-pro/images/bigNum/9.png +0 -0
- package/public/template/timer/assets/gtr-3-pro/images/bigNum/sp.png +0 -0
- package/public/template/timer/assets/gtr-3-pro/images/btn/back.png +0 -0
- package/public/template/timer/assets/gtr-3-pro/images/btn/lv.png +0 -0
- package/public/template/timer/assets/gtr-3-pro/images/btn/red.png +0 -0
- package/public/template/timer/assets/gtr-3-pro/images/point/bg.png +0 -0
- package/public/template/timer/assets/gtr-3-pro/images/point/bottom.png +0 -0
- package/public/template/timer/assets/gtr-3-pro/images/point/center.png +0 -0
- package/public/template/timer/assets/gtr-3-pro/images/point/h.png +0 -0
- package/public/template/timer/assets/gtr-3-pro/images/point/left.png +0 -0
- package/public/template/timer/assets/gtr-3-pro/images/point/m.png +0 -0
- package/public/template/timer/assets/gtr-3-pro/images/point/right.png +0 -0
- package/public/template/timer/assets/gtr-3-pro/images/point/s.png +0 -0
- package/public/template/timer/assets/gtr-3-pro/images/preview.png +0 -0
- package/public/template/timer/assets/gtr-3-pro/images/second/second.png +0 -0
- package/public/template/timer/assets/gtr-3-pro/images/smallNum/0.png +0 -0
- package/public/template/timer/assets/gtr-3-pro/images/smallNum/1.png +0 -0
- package/public/template/timer/assets/gtr-3-pro/images/smallNum/2.png +0 -0
- package/public/template/timer/assets/gtr-3-pro/images/smallNum/3.png +0 -0
- package/public/template/timer/assets/gtr-3-pro/images/smallNum/4.png +0 -0
- package/public/template/timer/assets/gtr-3-pro/images/smallNum/5.png +0 -0
- package/public/template/timer/assets/gtr-3-pro/images/smallNum/6.png +0 -0
- package/public/template/timer/assets/gtr-3-pro/images/smallNum/7.png +0 -0
- package/public/template/timer/assets/gtr-3-pro/images/smallNum/8.png +0 -0
- package/public/template/timer/assets/gtr-3-pro/images/smallNum/9.png +0 -0
- package/public/template/timer/assets/gtr-3-pro/images/smallNum/d.png +0 -0
- package/public/template/timer/assets/gtr-3-pro/images/smallNum/n.png +0 -0
- package/public/template/timer/assets/gtr-3-pro/images/week_ch/1.png +0 -0
- package/public/template/timer/assets/gtr-3-pro/images/week_ch/2.png +0 -0
- package/public/template/timer/assets/gtr-3-pro/images/week_ch/3.png +0 -0
- package/public/template/timer/assets/gtr-3-pro/images/week_ch/4.png +0 -0
- package/public/template/timer/assets/gtr-3-pro/images/week_ch/5.png +0 -0
- package/public/template/timer/assets/gtr-3-pro/images/week_ch/6.png +0 -0
- package/public/template/timer/assets/gtr-3-pro/images/week_ch/7.png +0 -0
- package/public/template/timer/assets/gtr-3-pro/images/week_en/1.png +0 -0
- package/public/template/timer/assets/gtr-3-pro/images/week_en/2.png +0 -0
- package/public/template/timer/assets/gtr-3-pro/images/week_en/3.png +0 -0
- package/public/template/timer/assets/gtr-3-pro/images/week_en/4.png +0 -0
- package/public/template/timer/assets/gtr-3-pro/images/week_en/5.png +0 -0
- package/public/template/timer/assets/gtr-3-pro/images/week_en/6.png +0 -0
- package/public/template/timer/assets/gtr-3-pro/images/week_en/7.png +0 -0
- package/public/template/timer/shared/buffer.js +11 -0
- package/public/template/timer/shared/device-polyfill.js +3 -0
- package/public/template/timer/shared/global.js +17 -0
- package/public/template/timer/shared/js-module.js +27 -0
- package/public/template/timer/shared/logger.js +21 -0
- package/public/template/timer/shared/setTimeout.js +59 -0
- package/public/template/timer/watchface/gtr-3-pro/index.js +1 -0
- package/public/template/timer/watchface/round/index.js +438 -0
- package/public/template/hello-world/i18n/en-US.po +0 -2
package/modules/run.js
CHANGED
|
@@ -63,16 +63,22 @@ var fs_1 = __importDefault(require("fs"));
|
|
|
63
63
|
var lodash_1 = __importDefault(require("lodash"));
|
|
64
64
|
var chalk_1 = __importDefault(require("chalk"));
|
|
65
65
|
var path = __importStar(require("path"));
|
|
66
|
-
var fs_extra_1 = __importDefault(require("fs-extra"));
|
|
67
66
|
var inquirer_1 = __importDefault(require("inquirer"));
|
|
68
67
|
var chokidar_1 = __importDefault(require("chokidar"));
|
|
69
|
-
var compressing = __importStar(require("compressing"));
|
|
70
68
|
var logger = __importStar(require("../utils/logger"));
|
|
71
69
|
var build_1 = require("./build");
|
|
72
70
|
var storage_1 = require("./storage");
|
|
73
71
|
var simulator_1 = require("./simulator");
|
|
72
|
+
var device_1 = require("../config/device");
|
|
74
73
|
var DEFAULT_HOST = '127.0.0.1';
|
|
75
74
|
var DEFAULT_PORT = '7650';
|
|
75
|
+
var getDeviceInternalCodename = function (curTarget) {
|
|
76
|
+
var _a;
|
|
77
|
+
var appJsonFilePath = path.resolve('./app.json');
|
|
78
|
+
var appJsonContent = JSON.parse(fs_1["default"].readFileSync(appJsonFilePath, 'utf-8'));
|
|
79
|
+
var _b = ((_a = appJsonContent === null || appJsonContent === void 0 ? void 0 : appJsonContent.targets[curTarget]) === null || _a === void 0 ? void 0 : _a.platforms[0]).deviceSource, deviceSource = _b === void 0 ? 229 : _b;
|
|
80
|
+
return device_1.deviceInternalCodename[deviceSource];
|
|
81
|
+
};
|
|
76
82
|
var run = function (args) { return __awaiter(void 0, void 0, void 0, function () {
|
|
77
83
|
var storage, simulatorHost, simulatorPort, answer, hasStarted, packages, simulator, refreshSimulator;
|
|
78
84
|
return __generator(this, function (_a) {
|
|
@@ -108,43 +114,51 @@ var run = function (args) { return __awaiter(void 0, void 0, void 0, function ()
|
|
|
108
114
|
packages = _a.sent();
|
|
109
115
|
simulator = new simulator_1.Simulator("http://" + simulatorHost + ":" + simulatorPort);
|
|
110
116
|
refreshSimulator = lodash_1["default"].debounce(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
111
|
-
var
|
|
117
|
+
var zpkBuffer, targetDeviceInternalName, projectName;
|
|
112
118
|
return __generator(this, function (_a) {
|
|
113
119
|
switch (_a.label) {
|
|
114
120
|
case 0:
|
|
115
121
|
logger.info('rebuilding...');
|
|
116
122
|
return [4 /*yield*/, (0, build_1.buildDev)(packages)];
|
|
117
123
|
case 1:
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
logger.info('rebuild done');
|
|
122
|
-
uzipZabPath = path.resolve(zabPath, '../zab');
|
|
123
|
-
logger.info('getting device package...');
|
|
124
|
-
return [4 /*yield*/, compressing.zip.uncompress(zabPath, uzipZabPath)];
|
|
125
|
-
case 2:
|
|
126
|
-
_a.sent();
|
|
127
|
-
zabFileList = fs_1["default"].readdirSync(uzipZabPath);
|
|
128
|
-
zabBuffer = Buffer.alloc(0);
|
|
129
|
-
if (packages.length === 1) {
|
|
130
|
-
zpkFileName = lodash_1["default"].find(zabFileList, function (fileName) {
|
|
131
|
-
return lodash_1["default"].startsWith(fileName, packages[0] + ".");
|
|
132
|
-
});
|
|
133
|
-
if (zpkFileName) {
|
|
134
|
-
zabBuffer = Buffer.from(fs_1["default"].readFileSync(path.resolve(uzipZabPath, "./" + zpkFileName)));
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
projectName = process.cwd().split('/').slice(-1)[0];
|
|
138
|
-
if (zabBuffer.length) {
|
|
124
|
+
zpkBuffer = _a.sent();
|
|
125
|
+
if (zpkBuffer) {
|
|
126
|
+
logger.info('rebuild done');
|
|
139
127
|
logger.info('refrshing simulator...');
|
|
140
|
-
|
|
128
|
+
targetDeviceInternalName = getDeviceInternalCodename(packages[0]);
|
|
129
|
+
projectName = process.cwd().split('/').slice(-1)[0];
|
|
130
|
+
simulator.upload(zpkBuffer, projectName, targetDeviceInternalName);
|
|
141
131
|
}
|
|
142
132
|
else {
|
|
143
|
-
logger.error('
|
|
133
|
+
logger.error('build error');
|
|
144
134
|
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
135
|
+
// const zabPath = path.resolve(`./dist/${zabName}`)
|
|
136
|
+
// if (fs.existsSync(zabPath)) {
|
|
137
|
+
// logger.info('rebuild done')
|
|
138
|
+
// const uzipZabPath = path.resolve(zabPath, '../zab')
|
|
139
|
+
// logger.info('getting device package...')
|
|
140
|
+
// await compressing.zip.uncompress(zabPath, uzipZabPath)
|
|
141
|
+
// const zabFileList = fs.readdirSync(uzipZabPath)
|
|
142
|
+
// let zabBuffer: Buffer = Buffer.alloc(0)
|
|
143
|
+
// if (packages.length === 1) {
|
|
144
|
+
// const zpkFileName = _.find(zabFileList, (fileName) => {
|
|
145
|
+
// return _.startsWith(fileName, `${packages[0]}.`)
|
|
146
|
+
// })
|
|
147
|
+
// if (zpkFileName) {
|
|
148
|
+
// const zpkPath = path.resolve(uzipZabPath, `./${zpkFileName}`)
|
|
149
|
+
// zabBuffer = Buffer.from(fs.readFileSync(zpkPath))
|
|
150
|
+
// }
|
|
151
|
+
// }
|
|
152
|
+
// const projectName = process.cwd().split('/').slice(-1)[0]
|
|
153
|
+
// if (zabBuffer.length) {
|
|
154
|
+
// logger.info('refrshing simulator...')
|
|
155
|
+
// const targetDeviceInternalName = getDeviceInternalCodename(packages[0])
|
|
156
|
+
// simulator.upload(zabBuffer, projectName, targetDeviceInternalName)
|
|
157
|
+
// } else {
|
|
158
|
+
// logger.error('can\'t find device package, pleace check the build result')
|
|
159
|
+
// }
|
|
160
|
+
// fsExtra.removeSync(uzipZabPath)
|
|
161
|
+
// }
|
|
148
162
|
if (!hasStarted) {
|
|
149
163
|
hasStarted = true;
|
|
150
164
|
logger.log(chalk_1["default"].green("[" + args['$0'] + "] watching the changes in this project..."));
|
package/modules/simulator.js
CHANGED
|
@@ -41,12 +41,13 @@ var Simulator = /** @class */ (function () {
|
|
|
41
41
|
Simulator.prototype.emit = function (space, jsonData) {
|
|
42
42
|
this.socket.emit(space, jsonData);
|
|
43
43
|
};
|
|
44
|
-
Simulator.prototype.upload = function (data, projectName) {
|
|
44
|
+
Simulator.prototype.upload = function (data, projectName, target) {
|
|
45
45
|
var dataArr = this.uint8ToArray(new Uint8Array(data));
|
|
46
46
|
var message = this.encodeMessage({
|
|
47
|
+
target: target,
|
|
48
|
+
projectName: projectName,
|
|
47
49
|
size: data.byteLength,
|
|
48
|
-
data: dataArr
|
|
49
|
-
projectName: projectName
|
|
50
|
+
data: dataArr
|
|
50
51
|
});
|
|
51
52
|
this.sendMessage(message);
|
|
52
53
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeppos/zeus-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.16",
|
|
4
4
|
"description": "zeus mini-program tools",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "zepp",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"webpack": "^5.52.0"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@zeppos/zpm": "^2.1.
|
|
40
|
+
"@zeppos/zpm": "^2.1.48",
|
|
41
41
|
"axios": "^0.23.0",
|
|
42
42
|
"chalk": "^4.1.2",
|
|
43
43
|
"chokidar": "^3.5.2",
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
"inquirer": "^8.1.2",
|
|
50
50
|
"lodash": "^4.17.21",
|
|
51
51
|
"npm-keyword": "^6.1.0",
|
|
52
|
+
"open": "^8.4.0",
|
|
52
53
|
"qrcode-terminal": "^0.12.0",
|
|
53
54
|
"qs": "^6.10.1",
|
|
54
55
|
"rd": "^2.0.1",
|
|
@@ -26,14 +26,7 @@
|
|
|
26
26
|
"page": {
|
|
27
27
|
"pages": [
|
|
28
28
|
"pages/index"
|
|
29
|
-
]
|
|
30
|
-
"window": {
|
|
31
|
-
"navigationBarBackgroundColor": "#ffffff",
|
|
32
|
-
"navigationBarTextStyle": "black",
|
|
33
|
-
"navigationBarTitleText": "empty",
|
|
34
|
-
"backgroundColor": "#eeeeee",
|
|
35
|
-
"backgroundTextStyle": "light"
|
|
36
|
-
}
|
|
29
|
+
]
|
|
37
30
|
},
|
|
38
31
|
"app-side": {
|
|
39
32
|
"path": "app-side/index"
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"configVersion": "v2",
|
|
3
|
+
"app": {
|
|
4
|
+
"appId": 10013,
|
|
5
|
+
"appName": "计时器",
|
|
6
|
+
"appType": "watchface",
|
|
7
|
+
"version": {
|
|
8
|
+
"code": 1,
|
|
9
|
+
"name": "1.0"
|
|
10
|
+
},
|
|
11
|
+
"vender": "zepp",
|
|
12
|
+
"description": "默认表盘",
|
|
13
|
+
"icon": "images/preview.png"
|
|
14
|
+
},
|
|
15
|
+
"permissions": ["gps"],
|
|
16
|
+
"runtime": {
|
|
17
|
+
"apiVersion": {
|
|
18
|
+
"compatible": "1.0.0",
|
|
19
|
+
"target": "1.0.1",
|
|
20
|
+
"minVersion": "1.0.0"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"targets": {
|
|
24
|
+
"gtr-3-pro": {
|
|
25
|
+
"module": {
|
|
26
|
+
"watchface": {
|
|
27
|
+
"path": "watchface/gtr-3-pro/index",
|
|
28
|
+
"main": 1,
|
|
29
|
+
"editable": 1,
|
|
30
|
+
"lockscreen": 1
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"platforms": [{
|
|
34
|
+
"name": "madrid",
|
|
35
|
+
"deviceSource": 229
|
|
36
|
+
}, {
|
|
37
|
+
"name": "madridw",
|
|
38
|
+
"deviceSource": 230
|
|
39
|
+
}],
|
|
40
|
+
"designWidth": 480
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"i18n": {
|
|
44
|
+
"en-US": {
|
|
45
|
+
"name": "timer"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"defaultLanguage": "en-US",
|
|
49
|
+
"debug": false
|
|
50
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
|
|
2
|
+
export function getGlobal () {
|
|
3
|
+
if (typeof self !== 'undefined') {
|
|
4
|
+
return self
|
|
5
|
+
}
|
|
6
|
+
if (typeof window !== 'undefined') {
|
|
7
|
+
return window
|
|
8
|
+
}
|
|
9
|
+
if (typeof global !== 'undefined') {
|
|
10
|
+
return global
|
|
11
|
+
}
|
|
12
|
+
if (typeof globalThis !== 'undefined') {
|
|
13
|
+
return globalThis
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
throw new Error('unable to locate global object')
|
|
17
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export function isHmUIDefined() {
|
|
2
|
+
return typeof hmUI !== 'undefined'
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
export function isHmBleDefined() {
|
|
6
|
+
return typeof hmBle !== 'undefined'
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function isHmTimerDefined() {
|
|
10
|
+
return typeof timer !== 'undefined'
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function isHmFsDefined() {
|
|
14
|
+
return typeof hmFS !== 'undefined'
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function isHmAppDefined() {
|
|
18
|
+
return typeof hmApp !== 'undefined'
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function isHmSensorDefined() {
|
|
22
|
+
return typeof hmSensor !== 'undefined'
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function isHmSettingDefined() {
|
|
26
|
+
return typeof hmSetting !== 'undefined'
|
|
27
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { getGlobal } from './global'
|
|
2
|
+
|
|
3
|
+
let globalNS = getGlobal()
|
|
4
|
+
|
|
5
|
+
if (!globalNS.Logger) {
|
|
6
|
+
if (typeof DeviceRuntimeCore !== 'undefined') {
|
|
7
|
+
globalNS.Logger = DeviceRuntimeCore.HmLogger
|
|
8
|
+
} else {
|
|
9
|
+
if (typeof Logger !== 'undefined') {
|
|
10
|
+
|
|
11
|
+
}
|
|
12
|
+
// console.connect = () => {
|
|
13
|
+
// // pass
|
|
14
|
+
// }
|
|
15
|
+
// globalNS.Logger = {
|
|
16
|
+
// getLogger() {
|
|
17
|
+
// return console
|
|
18
|
+
// },
|
|
19
|
+
// }
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { isHmTimerDefined } from './js-module'
|
|
2
|
+
import { getGlobal } from './global'
|
|
3
|
+
|
|
4
|
+
let globalNS = getGlobal()
|
|
5
|
+
|
|
6
|
+
if (typeof setTimeout === 'undefined' && isHmTimerDefined()) {
|
|
7
|
+
globalNS.clearTimeout = function clearTimeout(timerRef) {
|
|
8
|
+
timerRef && timer.stopTimer(timerRef)
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
globalNS.setTimeout = function setTimeout(func, ns) {
|
|
12
|
+
const timer1 = timer.createTimer(
|
|
13
|
+
ns || 1,
|
|
14
|
+
Number.MAX_SAFE_INTEGER,
|
|
15
|
+
function () {
|
|
16
|
+
globalNS.clearTimeout(timer1)
|
|
17
|
+
func && func()
|
|
18
|
+
},
|
|
19
|
+
{},
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
return timer1
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
globalNS.clearImmediate = function clearImmediate(timerRef) {
|
|
26
|
+
timerRef && timer.stopTimer(timerRef)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
globalNS.setImmediate = function setImmediate(func) {
|
|
30
|
+
const timer1 = timer.createTimer(
|
|
31
|
+
1,
|
|
32
|
+
Number.MAX_SAFE_INTEGER,
|
|
33
|
+
function () {
|
|
34
|
+
globalNS.clearImmediate(timer1)
|
|
35
|
+
func && func()
|
|
36
|
+
},
|
|
37
|
+
{},
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
return timer1
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
globalNS.clearInterval = function clearInterval(timerRef) {
|
|
44
|
+
timerRef && timer.stopTimer(timerRef)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
globalNS.setInterval = function setInterval(func, ms) {
|
|
48
|
+
const timer1 = timer.createTimer(
|
|
49
|
+
1,
|
|
50
|
+
ms,
|
|
51
|
+
function () {
|
|
52
|
+
func && func()
|
|
53
|
+
},
|
|
54
|
+
{},
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
return timer1
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '../round/index'
|