alemonjs 2.0.7 → 2.0.8
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/hook-use-api.d.ts +4 -3
- package/lib/app/message-api.d.ts +4 -14
- package/lib/index.d.ts +1 -1
- package/lib/jsx.d.ts +4 -13
- package/lib/typing/client/index.d.ts +10 -14
- package/package.json +1 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { Result } from './utils.js';
|
|
2
1
|
import { EventKeys, Events } from '../typing/event/map.js';
|
|
3
|
-
import '../
|
|
2
|
+
import { ClientAPIMessageResult } from '../typing/client/index.js';
|
|
4
3
|
import { DataEnums } from '../typing/message/index.js';
|
|
4
|
+
import '../global.js';
|
|
5
|
+
import { Result } from './utils.js';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* 使用提及。
|
|
@@ -29,7 +30,7 @@ declare const useMention: <T extends EventKeys>(event: Events[T]) => {
|
|
|
29
30
|
* @param {Object} event - 事件对象,包含触发发送的相关信息。
|
|
30
31
|
* @throws {Error} - 如果 event 无效,抛出错误。
|
|
31
32
|
*/
|
|
32
|
-
declare const useSend: <T extends EventKeys>(event: Events[T]) => (...val: DataEnums[]) => Promise<Result>;
|
|
33
|
+
declare const useSend: <T extends EventKeys>(event: Events[T]) => (...val: DataEnums[]) => Promise<Result | ClientAPIMessageResult[]>;
|
|
33
34
|
/**
|
|
34
35
|
* 卸载模块
|
|
35
36
|
* @param name
|
package/lib/app/message-api.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import '../global.js';
|
|
1
|
+
import { ClientAPIMessageResult } from '../typing/client/index.js';
|
|
3
2
|
import { DataEnums } from '../typing/message/index.js';
|
|
3
|
+
import '../global.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* 创建数据格式。
|
|
@@ -15,23 +15,13 @@ declare const createSendDataFormat: (...data: DataEnums[]) => DataEnums[];
|
|
|
15
15
|
* @param {DataEnums[]} data - 要发送的数据。
|
|
16
16
|
* @throws {Error} - 如果 channel_id 无效或发送失败,抛出错误。
|
|
17
17
|
*/
|
|
18
|
-
declare const sendToChannel: (channel_id: string, data: DataEnums[]) => Promise<
|
|
19
|
-
data: {
|
|
20
|
-
[key: string]: any;
|
|
21
|
-
id: string;
|
|
22
|
-
};
|
|
23
|
-
})[]>;
|
|
18
|
+
declare const sendToChannel: (channel_id: string, data: DataEnums[]) => Promise<ClientAPIMessageResult[]>;
|
|
24
19
|
/**
|
|
25
20
|
* 向指定用户发送消息。
|
|
26
21
|
* @param {string} user_id - 目标用户的 ID。
|
|
27
22
|
* @param {DataEnums[]} data - 要发送的数据。
|
|
28
23
|
* @throws {Error} - 如果 user_id 无效或发送失败,抛出错误。
|
|
29
24
|
*/
|
|
30
|
-
declare const sendToUser: (user_id: string, data: DataEnums[]) => Promise<
|
|
31
|
-
data: {
|
|
32
|
-
[key: string]: any;
|
|
33
|
-
id: string;
|
|
34
|
-
};
|
|
35
|
-
}>;
|
|
25
|
+
declare const sendToUser: (user_id: string, data: DataEnums[]) => Promise<ClientAPIMessageResult[]>;
|
|
36
26
|
|
|
37
27
|
export { createSendDataFormat, sendToChannel, sendToUser };
|
package/lib/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export { ActionsEventEnum } from './typing/event/actions.js';
|
|
|
13
13
|
export { Current, CurrentResult, DefineBot, DefineBotCallback, DefineBotValue, DefineChildrenCallback, DefineChildrenFunc, DefineChildrenValue, DefinePlatformCallback, DefinePlatformFunc, DefinePlatformValue, OnMiddlewareFunc, OnMiddlewareReversalFunc, OnMiddlewareValue, OnResponseFunc, OnResponseReversalFunc, OnResponseValue } from './typing/event/index.js';
|
|
14
14
|
export { EventKeys, Events, EventsEnum, EventsKeyEnum, EventsMessageCreate, EventsMessageCreateEnum, EventsMessageCreateKeys } from './typing/event/map.js';
|
|
15
15
|
export { LoggerUtils } from './typing/logger/index.js';
|
|
16
|
-
export { ClientAPI } from './typing/client/index.js';
|
|
16
|
+
export { ClientAPI, ClientAPIMessageResult } from './typing/client/index.js';
|
|
17
17
|
export { DataEnums, MessageDataFormat } from './typing/message/index.js';
|
|
18
18
|
export { StoreChildrenApp, StoreMiddleware, StoreMiddlewareItem, StoreResponse, StoreResponseItem } from './typing/store/res.js';
|
|
19
19
|
export { StateSubscribeMap, SubscribeKeysMap, SubscribeMap, SubscribeValue } from './typing/subscribe/index.js';
|
package/lib/jsx.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { EventKeys, Events } from './typing/event/map.js';
|
|
2
|
+
import { ClientAPIMessageResult } from './typing/client/index.js';
|
|
2
3
|
import { DataEnums } from './typing/message/index.js';
|
|
3
4
|
import { Result } from './app/utils.js';
|
|
4
5
|
import React from 'react';
|
|
@@ -102,30 +103,20 @@ declare function JSX(...arg: React.JSX.Element[]): DataEnums[];
|
|
|
102
103
|
* @param e
|
|
103
104
|
* @returns
|
|
104
105
|
*/
|
|
105
|
-
declare const useSend: <T extends EventKeys>(e: Events[T]) => (...arg: React.JSX.Element[]) => Promise<Result>;
|
|
106
|
+
declare const useSend: <T extends EventKeys>(e: Events[T]) => (...arg: React.JSX.Element[]) => Promise<Result | ClientAPIMessageResult[]>;
|
|
106
107
|
/**
|
|
107
108
|
*
|
|
108
109
|
* @param channel_id
|
|
109
110
|
* @param data
|
|
110
111
|
* @returns
|
|
111
112
|
*/
|
|
112
|
-
declare const sendToChannel: (channel_id: string, data: React.JSX.Element[]) => Promise<
|
|
113
|
-
data: {
|
|
114
|
-
[key: string]: any;
|
|
115
|
-
id: string;
|
|
116
|
-
};
|
|
117
|
-
})[]>;
|
|
113
|
+
declare const sendToChannel: (channel_id: string, data: React.JSX.Element[]) => Promise<ClientAPIMessageResult[]>;
|
|
118
114
|
/**
|
|
119
115
|
*
|
|
120
116
|
* @param user_id
|
|
121
117
|
* @param data
|
|
122
118
|
* @returns
|
|
123
119
|
*/
|
|
124
|
-
declare const sendToUser: (user_id: string, data: React.JSX.Element[]) => Promise<
|
|
125
|
-
data: {
|
|
126
|
-
[key: string]: any;
|
|
127
|
-
id: string;
|
|
128
|
-
};
|
|
129
|
-
}>;
|
|
120
|
+
declare const sendToUser: (user_id: string, data: React.JSX.Element[]) => Promise<ClientAPIMessageResult[]>;
|
|
130
121
|
|
|
131
122
|
export { BT, Image, ImageFile, ImageURL, JSX, Mention, Text, sendToChannel, sendToUser, useSend };
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { EventKeys, Events } from '../event/map.js';
|
|
2
2
|
import { User } from '../event/base/user.js';
|
|
3
3
|
import { DataEnums } from '../message/index.js';
|
|
4
|
-
import { Result } from '../../app/utils.js';
|
|
5
4
|
import '../../global.js';
|
|
5
|
+
import { Result } from '../../app/utils.js';
|
|
6
6
|
|
|
7
|
-
type
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
type ClientAPIMessageResult = Result & {
|
|
8
|
+
data: {
|
|
9
|
+
id: string;
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
};
|
|
10
12
|
};
|
|
11
13
|
type ClientAPI = {
|
|
12
14
|
/**
|
|
@@ -23,9 +25,7 @@ type ClientAPI = {
|
|
|
23
25
|
* @param val
|
|
24
26
|
* @returns
|
|
25
27
|
*/
|
|
26
|
-
send: <T extends EventKeys>(event: Events[T], val: DataEnums[]) => Promise<
|
|
27
|
-
data: SendMessageRes;
|
|
28
|
-
})>;
|
|
28
|
+
send: <T extends EventKeys>(event: Events[T], val: DataEnums[]) => Promise<ClientAPIMessageResult[]>;
|
|
29
29
|
/**
|
|
30
30
|
* 获取提及信息
|
|
31
31
|
* @param event
|
|
@@ -47,18 +47,14 @@ type ClientAPI = {
|
|
|
47
47
|
* @param data
|
|
48
48
|
* @returns
|
|
49
49
|
*/
|
|
50
|
-
channel: (channel_id: string, data: DataEnums[]) => Promise<
|
|
51
|
-
data: SendMessageRes;
|
|
52
|
-
})[]>;
|
|
50
|
+
channel: (channel_id: string, data: DataEnums[]) => Promise<ClientAPIMessageResult[]>;
|
|
53
51
|
/**
|
|
54
52
|
* 向指定用户发送消息
|
|
55
53
|
* @param user_id
|
|
56
54
|
* @param data
|
|
57
55
|
* @returns
|
|
58
56
|
*/
|
|
59
|
-
user: (user_id: string, data: DataEnums[]) => Promise<
|
|
60
|
-
data: SendMessageRes;
|
|
61
|
-
})>;
|
|
57
|
+
user: (user_id: string, data: DataEnums[]) => Promise<ClientAPIMessageResult[]>;
|
|
62
58
|
};
|
|
63
59
|
};
|
|
64
60
|
};
|
|
@@ -68,4 +64,4 @@ type ClientAPI = {
|
|
|
68
64
|
platform: string;
|
|
69
65
|
};
|
|
70
66
|
|
|
71
|
-
export type { ClientAPI };
|
|
67
|
+
export type { ClientAPI, ClientAPIMessageResult };
|