mm_machine 2.7.2 → 2.7.3
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/drive.js +0 -26
- package/index.js +0 -18
- package/mod.js +26 -0
- package/package.json +1 -1
package/drive.js
CHANGED
|
@@ -686,32 +686,6 @@ Drive.prototype.save = function () {
|
|
|
686
686
|
}
|
|
687
687
|
};
|
|
688
688
|
|
|
689
|
-
/**
|
|
690
|
-
* 触发事件
|
|
691
|
-
* @param {string} event 事件名
|
|
692
|
-
* @param {...any} args 事件参数
|
|
693
|
-
*/
|
|
694
|
-
Drive.prototype.emitEvent = function (event, ...args) {
|
|
695
|
-
this.getEventer()?.emit(event, ...args);
|
|
696
|
-
};
|
|
697
|
-
|
|
698
|
-
/**
|
|
699
|
-
* 注册事件监听
|
|
700
|
-
* @param {string} event 事件名
|
|
701
|
-
* @param {Function} callback 事件回调函数
|
|
702
|
-
*/
|
|
703
|
-
Drive.prototype.onEvent = function (event, callback) {
|
|
704
|
-
this.getEventer()?.on(event, callback);
|
|
705
|
-
};
|
|
706
|
-
|
|
707
|
-
/**
|
|
708
|
-
* 移除事件监听
|
|
709
|
-
* @param {string} event 事件名
|
|
710
|
-
*/
|
|
711
|
-
Drive.prototype.offEvent = function (event) {
|
|
712
|
-
this.getEventer()?.off(event);
|
|
713
|
-
};
|
|
714
|
-
|
|
715
689
|
/**
|
|
716
690
|
* 删除项目
|
|
717
691
|
*/
|
package/index.js
CHANGED
|
@@ -923,24 +923,6 @@ Manager.prototype.runSubMod = async function (name, method, ...params) {
|
|
|
923
923
|
return await mod.do(method, ...params);
|
|
924
924
|
};
|
|
925
925
|
|
|
926
|
-
/**
|
|
927
|
-
* 触发事件
|
|
928
|
-
* @param {string} event 事件名
|
|
929
|
-
* @param {...any} args 事件参数
|
|
930
|
-
*/
|
|
931
|
-
Manager.prototype.emitEvent = function (event, ...args) {
|
|
932
|
-
this.getEventer()?.emit(event, ...args);
|
|
933
|
-
};
|
|
934
|
-
|
|
935
|
-
/**
|
|
936
|
-
* 注册事件监听
|
|
937
|
-
* @param {string} event 事件名
|
|
938
|
-
* @param {Function} callback 事件回调函数
|
|
939
|
-
*/
|
|
940
|
-
Manager.prototype.onEvent = function (event, callback) {
|
|
941
|
-
this.getEventer()?.on(event, callback);
|
|
942
|
-
};
|
|
943
|
-
|
|
944
926
|
/**
|
|
945
927
|
* 移除事件监听
|
|
946
928
|
* @param {string} event 事件名
|
package/mod.js
CHANGED
|
@@ -419,6 +419,32 @@ Mod.prototype.emitEvent = function (event, ...args) {
|
|
|
419
419
|
this.getEventer()?.emit(event, ...args);
|
|
420
420
|
};
|
|
421
421
|
|
|
422
|
+
/**
|
|
423
|
+
* 触发事件 - 随机触发
|
|
424
|
+
* @param {string} event 事件名
|
|
425
|
+
* @param {...any} args 事件参数
|
|
426
|
+
*/
|
|
427
|
+
Mod.prototype.emitEventRace = function (event, ...args) {
|
|
428
|
+
this.getEventer()?.emitRace(event, ...args);
|
|
429
|
+
};
|
|
430
|
+
|
|
431
|
+
/**
|
|
432
|
+
* 注册事件监听
|
|
433
|
+
* @param {string} event 事件名
|
|
434
|
+
* @param {Function} callback 事件回调函数
|
|
435
|
+
*/
|
|
436
|
+
Mod.prototype.onEvent = function (event, callback) {
|
|
437
|
+
this.getEventer()?.on(event, callback);
|
|
438
|
+
};
|
|
439
|
+
|
|
440
|
+
/**
|
|
441
|
+
* 移除事件监听
|
|
442
|
+
* @param {string} event 事件名
|
|
443
|
+
*/
|
|
444
|
+
Mod.prototype.offEvent = function (event) {
|
|
445
|
+
this.getEventer()?.off(event);
|
|
446
|
+
};
|
|
447
|
+
|
|
422
448
|
/**
|
|
423
449
|
* 主方法名
|
|
424
450
|
* @param {...any} args 方法参数
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mm_machine",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.3",
|
|
4
4
|
"description": "A flexible Node.js plugin mechanism system for dynamic loading, management and execution of modules. Supports hot reload, lifecycle management, and modern JavaScript features.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|