alemonjs 2.1.0-alpha.37 → 2.1.0-alpha.38
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/lib/app/event-processor-cycle.d.ts +19 -0
- package/lib/app/event-processor-event.d.ts +11 -0
- package/lib/app/event-processor-middleware.d.ts +11 -0
- package/lib/app/event-processor-subscribe.d.ts +41 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.js +4 -0
- package/lib/main.js +5 -4
- package/package.json +1 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { EventKeys, Events } from '../typing/event/map.js';
|
|
2
|
+
import '../global.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @fileoverview 消息处理快
|
|
6
|
+
* 登录模块向核心模块发送数据
|
|
7
|
+
* 核心模块调用模块索引
|
|
8
|
+
* @module processor
|
|
9
|
+
* @author ningmengchongshui
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* 消息体处理机制
|
|
14
|
+
* @param event
|
|
15
|
+
* @param key
|
|
16
|
+
*/
|
|
17
|
+
declare const expendCycle: <T extends EventKeys>(valueEvent: Events[T], select: T) => Promise<void>;
|
|
18
|
+
|
|
19
|
+
export { expendCycle };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { EventKeys, Events } from '../typing/event/map.js';
|
|
2
|
+
import '../global.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 消息体处理机制
|
|
6
|
+
* @param event
|
|
7
|
+
* @param key
|
|
8
|
+
*/
|
|
9
|
+
declare const expendEvent: <T extends EventKeys>(valueEvent: Events[T], select: T, next: Function) => Promise<void>;
|
|
10
|
+
|
|
11
|
+
export { expendEvent };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { EventKeys, Events } from '../typing/event/map.js';
|
|
2
|
+
import '../global.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 处理中间件
|
|
6
|
+
* @param event
|
|
7
|
+
* @param select
|
|
8
|
+
*/
|
|
9
|
+
declare const expendMiddleware: <T extends EventKeys>(valueEvent: Events[T], select: T, next: Function) => Promise<void>;
|
|
10
|
+
|
|
11
|
+
export { expendMiddleware };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { EventCycleEnum } from '../typing/cycle/index.js';
|
|
2
|
+
import '../global.js';
|
|
3
|
+
import { EventKeys, Events } from '../typing/event/map.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @fileoverview 观察者
|
|
7
|
+
* @module processor
|
|
8
|
+
* @author ningmengchongshui
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* 处理订阅
|
|
13
|
+
* @param valueEvent
|
|
14
|
+
* @param select
|
|
15
|
+
* @param next
|
|
16
|
+
* @param chioce
|
|
17
|
+
*/
|
|
18
|
+
declare const expendSubscribe: <T extends EventKeys>(valueEvent: Events[T], select: T, next: Function, chioce: EventCycleEnum) => Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @param valueEvent
|
|
22
|
+
* @param select
|
|
23
|
+
* @param next
|
|
24
|
+
*/
|
|
25
|
+
declare const expendSubscribeCreate: <T extends EventKeys>(valueEvent: Events[T], select: T, next: Function) => Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
*
|
|
28
|
+
* @param valueEvent
|
|
29
|
+
* @param select
|
|
30
|
+
* @param next
|
|
31
|
+
*/
|
|
32
|
+
declare const expendSubscribeMount: <T extends EventKeys>(valueEvent: Events[T], select: T, next: Function) => Promise<void>;
|
|
33
|
+
/**
|
|
34
|
+
*
|
|
35
|
+
* @param valueEvent
|
|
36
|
+
* @param select
|
|
37
|
+
* @param next
|
|
38
|
+
*/
|
|
39
|
+
declare const expendSubscribeUnmount: <T extends EventKeys>(valueEvent: Events[T], select: T, next: Function) => Promise<void>;
|
|
40
|
+
|
|
41
|
+
export { expendSubscribe, expendSubscribeCreate, expendSubscribeMount, expendSubscribeUnmount };
|
package/lib/index.d.ts
CHANGED
|
@@ -24,6 +24,10 @@ export { defineChildren } from './app/define-chidren.js';
|
|
|
24
24
|
export { onGroup } from './app/event-group.js';
|
|
25
25
|
export { OnMiddleware, onMiddleware } from './app/event-middleware.js';
|
|
26
26
|
export { OnProcessor, onProcessor } from './app/event-processor.js';
|
|
27
|
+
export { expendCycle } from './app/event-processor-cycle.js';
|
|
28
|
+
export { expendEvent } from './app/event-processor-event.js';
|
|
29
|
+
export { expendMiddleware } from './app/event-processor-middleware.js';
|
|
30
|
+
export { expendSubscribe, expendSubscribeCreate, expendSubscribeMount, expendSubscribeUnmount } from './app/event-processor-subscribe.js';
|
|
27
31
|
export { OnResponse, onResponse } from './app/event-response.js';
|
|
28
32
|
export { createSelects, onSelects, unChildren, useChannel, useClient, useMenber, useMention, useMessage, useSend, useSends } from './app/hook-use-api.js';
|
|
29
33
|
export { onState, unState, useState } from './app/hook-use-state.js';
|
package/lib/index.js
CHANGED
|
@@ -5,6 +5,10 @@ export { defineChildren } from './app/define-chidren.js';
|
|
|
5
5
|
export { onGroup } from './app/event-group.js';
|
|
6
6
|
export { OnMiddleware, onMiddleware } from './app/event-middleware.js';
|
|
7
7
|
export { OnProcessor, onProcessor } from './app/event-processor.js';
|
|
8
|
+
export { expendCycle } from './app/event-processor-cycle.js';
|
|
9
|
+
export { expendEvent } from './app/event-processor-event.js';
|
|
10
|
+
export { expendMiddleware } from './app/event-processor-middleware.js';
|
|
11
|
+
export { expendSubscribe, expendSubscribeCreate, expendSubscribeMount, expendSubscribeUnmount } from './app/event-processor-subscribe.js';
|
|
8
12
|
export { OnResponse, onResponse } from './app/event-response.js';
|
|
9
13
|
export { createSelects, onSelects, unChildren, useChannel, useClient, useMenber, useMention, useMessage, useSend, useSends } from './app/hook-use-api.js';
|
|
10
14
|
export { onState, unState, useState } from './app/hook-use-state.js';
|
package/lib/main.js
CHANGED
|
@@ -5,12 +5,14 @@ import './app/define-chidren.js';
|
|
|
5
5
|
import './app/event-group.js';
|
|
6
6
|
import './app/event-middleware.js';
|
|
7
7
|
import './app/event-processor.js';
|
|
8
|
-
import './app/event-response.js';
|
|
9
|
-
import './app/hook-use-api.js';
|
|
10
|
-
import { useState } from './app/hook-use-state.js';
|
|
11
8
|
import { ResultCode } from './core/code.js';
|
|
9
|
+
import 'util/types';
|
|
10
|
+
import { useState } from './app/hook-use-state.js';
|
|
12
11
|
import 'node:fs';
|
|
13
12
|
import 'log4js';
|
|
13
|
+
import './app/hook-use-api.js';
|
|
14
|
+
import { default_port, file_prefix_common, default_platform_common_prefix } from './core/variable.js';
|
|
15
|
+
import './app/event-response.js';
|
|
14
16
|
import './app/message-api.js';
|
|
15
17
|
import './app/message-format.js';
|
|
16
18
|
import { cbpClient } from './cbp/client.js';
|
|
@@ -20,7 +22,6 @@ import './cbp/config.js';
|
|
|
20
22
|
import 'flatted';
|
|
21
23
|
import { join } from 'path';
|
|
22
24
|
import { existsSync } from 'fs';
|
|
23
|
-
import { default_port, file_prefix_common, default_platform_common_prefix } from './core/variable.js';
|
|
24
25
|
|
|
25
26
|
const loadState = () => {
|
|
26
27
|
const value = getConfigValue() ?? {};
|