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