alemonjs 2.1.53 → 2.1.55

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.
Files changed (98) hide show
  1. package/lib/app/define-router.d.ts +1 -0
  2. package/lib/app/define-router.js +6 -1
  3. package/lib/app/event-format.js +1 -1
  4. package/lib/app/event-processor-cycleFiles.js +2 -6
  5. package/lib/app/expose.d.ts +16 -0
  6. package/lib/app/expose.js +190 -0
  7. package/lib/app/index.d.ts +1 -0
  8. package/lib/app/index.js +2 -1
  9. package/lib/app/load_modules/loadChild.js +4 -0
  10. package/lib/app/store.d.ts +9 -9
  11. package/lib/app/store.js +2 -0
  12. package/lib/index.js +2 -1
  13. package/lib/types/event/index.d.ts +2 -0
  14. package/lib/types/expose/index.d.ts +41 -0
  15. package/lib/types/expose/index.js +1 -0
  16. package/lib/types/index.d.ts +1 -0
  17. package/package.json +1 -1
  18. package/lib/app/define/define-children.d.ts +0 -8
  19. package/lib/app/define/define-children.js +0 -25
  20. package/lib/app/define/define-middleware.d.ts +0 -2
  21. package/lib/app/define/define-middleware.js +0 -8
  22. package/lib/app/define/define-platform.d.ts +0 -13
  23. package/lib/app/define/define-platform.js +0 -40
  24. package/lib/app/define/define-response.d.ts +0 -2
  25. package/lib/app/define/define-response.js +0 -8
  26. package/lib/app/define/define-router.d.ts +0 -17
  27. package/lib/app/define/define-router.js +0 -34
  28. package/lib/app/event/event-group.d.ts +0 -9
  29. package/lib/app/event/event-group.js +0 -29
  30. package/lib/app/event/event-middleware.d.ts +0 -23
  31. package/lib/app/event/event-middleware.js +0 -44
  32. package/lib/app/event/event-response.d.ts +0 -16
  33. package/lib/app/event/event-response.js +0 -23
  34. package/lib/app/event/event-selects.d.ts +0 -13
  35. package/lib/app/event/event-selects.js +0 -15
  36. package/lib/app/event-processor/event-processor-callHandler.d.ts +0 -1
  37. package/lib/app/event-processor/event-processor-callHandler.js +0 -43
  38. package/lib/app/event-processor/event-processor-cycle.d.ts +0 -14
  39. package/lib/app/event-processor/event-processor-cycle.js +0 -97
  40. package/lib/app/event-processor/event-processor-cycleFiles.d.ts +0 -11
  41. package/lib/app/event-processor/event-processor-cycleFiles.js +0 -147
  42. package/lib/app/event-processor/event-processor-cycleRoute.d.ts +0 -10
  43. package/lib/app/event-processor/event-processor-cycleRoute.js +0 -133
  44. package/lib/app/event-processor/event-processor-event.d.ts +0 -24
  45. package/lib/app/event-processor/event-processor-event.js +0 -41
  46. package/lib/app/event-processor/event-processor-middleware.d.ts +0 -14
  47. package/lib/app/event-processor/event-processor-middleware.js +0 -31
  48. package/lib/app/event-processor/event-processor-subscribe.d.ts +0 -35
  49. package/lib/app/event-processor/event-processor-subscribe.js +0 -115
  50. package/lib/app/event-processor/event-processor.d.ts +0 -17
  51. package/lib/app/event-processor/event-processor.js +0 -207
  52. package/lib/app/hook-use/hook-use-api.d.ts +0 -6
  53. package/lib/app/hook-use/hook-use-api.js +0 -22
  54. package/lib/app/hook-use/hook-use-channel.d.ts +0 -8
  55. package/lib/app/hook-use/hook-use-channel.js +0 -33
  56. package/lib/app/hook-use/hook-use-client.d.ts +0 -7
  57. package/lib/app/hook-use/hook-use-client.js +0 -27
  58. package/lib/app/hook-use/hook-use-me.d.ts +0 -8
  59. package/lib/app/hook-use/hook-use-me.js +0 -45
  60. package/lib/app/hook-use/hook-use-menber.d.ts +0 -8
  61. package/lib/app/hook-use/hook-use-menber.js +0 -59
  62. package/lib/app/hook-use/hook-use-mention.d.ts +0 -23
  63. package/lib/app/hook-use/hook-use-mention.js +0 -105
  64. package/lib/app/hook-use/hook-use-message.d.ts +0 -29
  65. package/lib/app/hook-use/hook-use-message.js +0 -88
  66. package/lib/app/hook-use/hook-use-state.d.ts +0 -30
  67. package/lib/app/hook-use/hook-use-state.js +0 -101
  68. package/lib/app/hook-use/hook-use-subscribe.d.ts +0 -46
  69. package/lib/app/hook-use/hook-use-subscribe.js +0 -143
  70. package/lib/app/hook-use-api.d.ts +0 -268
  71. package/lib/app/hook-use-api.js +0 -1213
  72. package/lib/app/hook-use-state.d.ts +0 -3
  73. package/lib/app/hook-use-state.js +0 -68
  74. package/lib/app/hook-use-subscribe.d.ts +0 -73
  75. package/lib/app/hook-use-subscribe.js +0 -112
  76. package/lib/app/message/message-api.d.ts +0 -69
  77. package/lib/app/message/message-api.js +0 -105
  78. package/lib/app/message/message-format-old.d.ts +0 -143
  79. package/lib/app/message/message-format-old.js +0 -359
  80. package/lib/app/message/message-format.d.ts +0 -215
  81. package/lib/app/message/message-format.js +0 -382
  82. package/lib/app/message-controller.d.ts +0 -25
  83. package/lib/app/message-controller.js +0 -66
  84. package/lib/app/message-format.old.d.ts +0 -50
  85. package/lib/app/message-format.old.js +0 -217
  86. package/lib/cbp/processor/handle.d.ts +0 -3
  87. package/lib/cbp/processor/handle.js +0 -32
  88. package/lib/jsx/index.d.ts +0 -105
  89. package/lib/jsx/index.js +0 -211
  90. package/lib/jsx/jsx-dev-runtime.d.ts +0 -2
  91. package/lib/jsx/jsx-dev-runtime.js +0 -1
  92. package/lib/jsx/jsx-runtime.d.ts +0 -18
  93. package/lib/jsx/jsx-runtime.js +0 -24
  94. package/lib/process/client.js +0 -109
  95. package/lib/store/SinglyLinkedList.d.ts +0 -22
  96. package/lib/store/SinglyLinkedList.js +0 -97
  97. package/lib/store/store.d.ts +0 -127
  98. package/lib/store/store.js +0 -443
@@ -1,359 +0,0 @@
1
- /**
2
- * 文本消息
3
- * @param val
4
- * @param options
5
- * @returns
6
- */
7
- const Text = (val, options) => {
8
- return {
9
- type: 'Text',
10
- value: val,
11
- options
12
- };
13
- };
14
- /**
15
- * 链接消息
16
- * @deprecated 废弃,这个应该是md语法里的
17
- * @param val 要显示的文本
18
- * @param options 内容选项
19
- * @returns
20
- */
21
- const Link = (val, options) => {
22
- return {
23
- type: 'Text',
24
- value: val,
25
- options
26
- };
27
- };
28
- /**
29
- * 图片链接,http 或 https 开头
30
- * @deprecated 废弃,推荐使用 Image
31
- * @param val
32
- * @returns
33
- */
34
- const ImageURL = (val) => {
35
- return {
36
- type: 'ImageURL',
37
- value: val
38
- };
39
- };
40
- /**
41
- * 本地图片文件
42
- * @deprecated 废弃,推荐使用 Image
43
- * @param val
44
- * @returns
45
- */
46
- const ImageFile = (val) => {
47
- return {
48
- type: 'ImageFile',
49
- value: val
50
- };
51
- };
52
- /**
53
- * 图片消息
54
- * @param val Buffer 或带协议的字符串(https:// | http:// | file:// | base64://)
55
- * @returns
56
- */
57
- const Image = (val) => {
58
- return {
59
- type: 'Image',
60
- // 自动转为 base64 格式字符串,或者直接使用带协议的字符串
61
- value: typeof val === 'string' ? val : `base64://${val.toString('base64')}`
62
- };
63
- };
64
- /**
65
- * @deprecated 废弃,推荐使用 Image
66
- */
67
- Image.url = ImageURL;
68
- /**
69
- * @deprecated 废弃,推荐使用 Image
70
- */
71
- Image.file = ImageFile;
72
- /**
73
- * 提及
74
- * @param UserId 默认 @ 所有人
75
- * @param options 默认 user
76
- * @returns
77
- */
78
- const Mention = (UserId, options) => {
79
- return {
80
- type: 'Mention',
81
- value: UserId,
82
- options: options ?? {
83
- belong: 'user'
84
- }
85
- };
86
- };
87
- const Button = (title, data, options) => {
88
- return {
89
- type: 'Button',
90
- value: title,
91
- options: {
92
- data, // command 数据,必填
93
- ...options
94
- }
95
- };
96
- };
97
- const ButtonGroup = (...rows) => {
98
- return {
99
- type: 'BT.group',
100
- value: rows
101
- };
102
- };
103
- const ButtonRow = (...buttons) => {
104
- return {
105
- type: 'BT.row',
106
- value: buttons
107
- };
108
- };
109
- Button.group = ButtonGroup;
110
- Button.row = ButtonRow;
111
- const BT = Button;
112
- /**
113
- *
114
- * @param values 要显示的文本
115
- * @returns
116
- */
117
- const Markdown = (...values) => {
118
- return {
119
- type: 'Markdown',
120
- value: values
121
- };
122
- };
123
- /**
124
- *
125
- * @param text 要显示的文本
126
- * @returns
127
- */
128
- Markdown.text = (text) => {
129
- return {
130
- type: 'MD.text',
131
- value: text
132
- };
133
- };
134
- Markdown.mention = (uid, options) => {
135
- return {
136
- type: 'MD.mention',
137
- // 如果没有传 uid,默认 @所有人;如果传了 uid,就 @指定用户
138
- value: uid || 'everyone',
139
- options: options ?? {
140
- belong: 'user'
141
- }
142
- };
143
- };
144
- Markdown.button = (title, data) => {
145
- return {
146
- type: 'MD.button',
147
- value: title,
148
- options: data
149
- };
150
- };
151
- /**
152
- * originalContent
153
- */
154
- Markdown.content = (text) => {
155
- return {
156
- type: 'MD.content',
157
- value: text
158
- };
159
- };
160
- /**
161
- *
162
- * @param text 要显示的文本
163
- * @returns
164
- */
165
- Markdown.title = (text) => {
166
- return {
167
- type: 'MD.title',
168
- value: text
169
- };
170
- };
171
- /**
172
- *
173
- * @param text 要显示的文本
174
- * @returns
175
- */
176
- Markdown.subtitle = (text) => {
177
- return {
178
- type: 'MD.subtitle',
179
- value: text
180
- };
181
- };
182
- /**
183
- *
184
- * @param text 要显示的文本
185
- * @returns
186
- */
187
- Markdown.bold = (text) => {
188
- return {
189
- type: 'MD.bold',
190
- value: text
191
- };
192
- };
193
- /**
194
- *
195
- * @param text 要显示的文本
196
- * @returns
197
- */
198
- Markdown.italic = (text) => {
199
- return {
200
- type: 'MD.italic',
201
- value: text
202
- };
203
- };
204
- /**
205
- *
206
- * @param text 要显示的文本
207
- * @returns
208
- */
209
- Markdown.italicStar = (text) => {
210
- return {
211
- type: 'MD.italicStar',
212
- value: text
213
- };
214
- };
215
- /**
216
- *
217
- * @param text 要显示的文本
218
- * @returns
219
- */
220
- Markdown.strikethrough = (text) => {
221
- return {
222
- type: 'MD.strikethrough',
223
- value: text
224
- };
225
- };
226
- /**
227
- *
228
- * @param text 要显示的文本
229
- * @param url 链接地址
230
- * @returns
231
- */
232
- Markdown.link = (text, url) => {
233
- return {
234
- type: 'MD.link',
235
- value: { text, url }
236
- };
237
- };
238
- /**
239
- *
240
- * @param url 图片地址
241
- * @param options 图片选项
242
- * @returns
243
- */
244
- Markdown.image = (url, options) => {
245
- return {
246
- type: 'MD.image',
247
- value: url,
248
- options
249
- };
250
- };
251
- /**
252
- *
253
- * @param items
254
- * @returns
255
- */
256
- Markdown.list = (...items) => {
257
- return {
258
- type: 'MD.list',
259
- value: items
260
- };
261
- };
262
- /**
263
- *
264
- * @param indexOrText
265
- * @param text
266
- * @returns
267
- */
268
- Markdown.listItem = (indexOrText, text) => {
269
- return {
270
- type: 'MD.listItem',
271
- value: typeof indexOrText === 'number' ? { index: indexOrText, text } : indexOrText
272
- };
273
- };
274
- /**
275
- *
276
- * @param text 块引用的文本内容
277
- * @returns
278
- */
279
- Markdown.blockquote = (text) => {
280
- return {
281
- type: 'MD.blockquote',
282
- value: text
283
- };
284
- };
285
- /**
286
- *
287
- * @returns
288
- */
289
- Markdown.divider = () => {
290
- return {
291
- type: 'MD.divider'
292
- };
293
- };
294
- /**
295
- * @param value 是否换多行
296
- * @returns
297
- */
298
- Markdown.newline = (value = false) => {
299
- return {
300
- type: 'MD.newline',
301
- value: value
302
- };
303
- };
304
- Markdown.code = (value, options) => {
305
- return {
306
- type: 'MD.code',
307
- value: value,
308
- options: options
309
- };
310
- };
311
- const MD = Markdown;
312
- /**
313
- * 纯 Markdown 文本
314
- * @param val 原始 Markdown 字符串
315
- * @returns
316
- */
317
- const MarkdownOriginal = (val) => {
318
- return {
319
- type: 'MarkdownOriginal',
320
- value: val
321
- };
322
- };
323
- /**
324
- * 附件消息
325
- * @param val 带协议的字符串(https:// | http:// | file:// | base64://)
326
- * @param options 附件选项
327
- * @returns
328
- */
329
- const Attachment = (val, options) => {
330
- return {
331
- type: 'Attachment',
332
- value: val,
333
- options
334
- };
335
- };
336
- /**
337
- * 音频消息
338
- * @param val 带协议的字符串(https:// | http:// | file:// | base64://)
339
- * @returns
340
- */
341
- const Audio = (val) => {
342
- return {
343
- type: 'Audio',
344
- value: val
345
- };
346
- };
347
- /**
348
- * 视频消息
349
- * @param val 带协议的字符串(https:// | http:// | file:// | base64://)
350
- * @returns
351
- */
352
- const Video = (val) => {
353
- return {
354
- type: 'Video',
355
- value: val
356
- };
357
- };
358
-
359
- export { Attachment, Audio, BT, Button, Image, ImageFile, ImageURL, Link, MD, Markdown, MarkdownOriginal, Mention, Text, Video };
@@ -1,215 +0,0 @@
1
- import { DataButtonGroup, DataMarkDown, DataEnums, EventKeys, Events } from '../../types/index.js';
2
- import { Text, Image, Link, ImageFile, ImageURL, Mention, BT, MD, MarkdownOriginal, Attachment, Audio, Video } from './message-format-old.js';
3
- export declare class FormatButtonGroup {
4
- #private;
5
- /**
6
- * 获取按钮组数据
7
- */
8
- get value(): DataButtonGroup;
9
- /**
10
- * 吸收另一个 FormatButtonGroup 的数据
11
- * @param group 要吸收的 FormatButtonGroup 实例
12
- * @returns 当前实例
13
- */
14
- absorb(group: FormatButtonGroup): this;
15
- /**
16
- * 新增一行按钮
17
- * @returns 当前实例
18
- */
19
- addRow(): this;
20
- /**
21
- * 添加一个按钮到当前行,若无行则自动创建
22
- */
23
- addButton(...args: Parameters<typeof BT>): this;
24
- /**
25
- * 清空
26
- */
27
- clear(): this;
28
- }
29
- export declare class FormatMarkDown {
30
- #private;
31
- /**
32
- * 获取 Markdown 数据
33
- */
34
- get value(): DataMarkDown;
35
- /**
36
- * 吸收另一个 FormatMarkDown 的数据
37
- * @param md 要吸收的 FormatMarkDown 实例
38
- * @returns 当前实例
39
- */
40
- absorb(md: FormatMarkDown): this;
41
- /**
42
- * 添加原始文本
43
- */
44
- addContent(...args: Parameters<typeof MD.content>): this;
45
- /**
46
- * 添加文本
47
- */
48
- addText(...args: Parameters<typeof MD.text>): this;
49
- /**
50
- * 添加标题
51
- */
52
- addTitle(...args: Parameters<typeof MD.title>): this;
53
- /**
54
- * 添加副标题
55
- */
56
- addSubtitle(...args: Parameters<typeof MD.subtitle>): this;
57
- /**
58
- * 添加粗体
59
- */
60
- addBold(...args: Parameters<typeof MD.bold>): this;
61
- /**
62
- * 添加斜体
63
- */
64
- addItalic(...args: Parameters<typeof MD.italic>): this;
65
- /**
66
- * 添加斜体(星号)
67
- */
68
- addItalicStar(...args: Parameters<typeof MD.italicStar>): this;
69
- /**
70
- * 添加删除线
71
- */
72
- addStrikethrough(...args: Parameters<typeof MD.strikethrough>): this;
73
- /**
74
- * 添加链接
75
- */
76
- addLink(...args: Parameters<typeof MD.link>): this;
77
- /**
78
- * 添加图片
79
- */
80
- addImage(...args: Parameters<typeof MD.image>): this;
81
- /**
82
- * 添加列表
83
- */
84
- addList(...args: Parameters<typeof MD.list>): this;
85
- /**
86
- * 添加引用
87
- */
88
- addBlockquote(...args: Parameters<typeof MD.blockquote>): this;
89
- /**
90
- * 添加分割线
91
- */
92
- addDivider(): this;
93
- /**
94
- * 添加换行
95
- */
96
- addNewline(...args: Parameters<typeof MD.newline>): this;
97
- /**
98
- * 添加代码
99
- */
100
- addCode(...args: Parameters<typeof MD.code>): this;
101
- /**
102
- * 换行
103
- */
104
- addBreak(): this;
105
- addMention(...args: Parameters<typeof MD.mention>): this;
106
- addButton(...args: Parameters<typeof MD.button>): this;
107
- /**
108
- * 清空
109
- */
110
- clear(): this;
111
- }
112
- /**
113
- * 消息格式化构建器
114
- *
115
- * @example
116
- * ```ts
117
- * const format = Format.create()
118
- * format.addText('hello').addBreak().addText('world')
119
- * message.send({ format })
120
- * ```
121
- */
122
- export declare class Format {
123
- #private;
124
- /**
125
- * 创建一个新的 Format 实例
126
- */
127
- static create(): Format;
128
- /**
129
- * 创建一个新的 Markdown Format 实例
130
- */
131
- static createMarkdown(): FormatMarkDown;
132
- /**
133
- * 创建一个新的 Button Format 实例
134
- */
135
- static createButtonGroup(): FormatButtonGroup;
136
- /**
137
- * 获取内部格式化数据
138
- */
139
- get value(): DataEnums[];
140
- absorb(format: Format): this;
141
- /**
142
- * 添加文本
143
- */
144
- addText(...args: Parameters<typeof Text>): this;
145
- /**
146
- * 添加图片 (Buffer 或带协议字符串)
147
- */
148
- addImage(...args: Parameters<typeof Image>): this;
149
- /**
150
- * 添加提及
151
- */
152
- addMention(...args: Parameters<typeof Mention>): this;
153
- /**
154
- * 添加按钮组
155
- */
156
- addButtonGroup(bt: FormatButtonGroup): this;
157
- addButtonGroup(...args: Parameters<typeof BT.group>): this;
158
- /**
159
- * 添加结构化 Markdown
160
- */
161
- addMarkdown(md: FormatMarkDown): this;
162
- addMarkdown(...args: Parameters<typeof MD>): this;
163
- /**
164
- * 添加纯 Markdown 文本
165
- */
166
- addMarkdownOriginal(...args: Parameters<typeof MarkdownOriginal>): this;
167
- /**
168
- * 添加附件
169
- */
170
- addAttachment(...args: Parameters<typeof Attachment>): this;
171
- /**
172
- * 添加音频
173
- */
174
- addAudio(...args: Parameters<typeof Audio>): this;
175
- /**
176
- * 添加视频
177
- */
178
- addVideo(...args: Parameters<typeof Video>): this;
179
- /**
180
- * 添加链接
181
- * @deprecated 废弃,这个应该是md语法里的
182
- */
183
- addLink(...args: Parameters<typeof Link>): this;
184
- /**
185
- * 添加图片文件
186
- * @deprecated 废弃,推荐使用 addImage
187
- */
188
- addImageFile(...args: Parameters<typeof ImageFile>): this;
189
- /**
190
- * 添加图片链接
191
- * @deprecated 废弃,推荐使用 addImage
192
- */
193
- addImageURL(...args: Parameters<typeof ImageURL>): this;
194
- /**
195
- * 清空
196
- */
197
- clear(): this;
198
- }
199
- /**
200
- * 创建event
201
- * @param options
202
- * @returns
203
- */
204
- export declare function createEvent<T extends EventKeys>(options: {
205
- event: any;
206
- selects: T | T[];
207
- regular?: RegExp;
208
- prefix?: string;
209
- exact?: string;
210
- }): Events[T] & {
211
- selects: boolean;
212
- regular: boolean;
213
- prefix: boolean;
214
- exact: boolean;
215
- };