@waline/client 3.12.2 → 3.14.0

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/dist/slim.d.ts CHANGED
@@ -1,741 +1,772 @@
1
- import { RecentCommentData, WalineUser } from '@waline/api';
2
- export * from '@waline/api';
1
+ import { RecentCommentData, WalineUser } from "@waline/api";
2
+ export * from "@waline/api";
3
3
 
4
+ //#region src/typings/base.d.ts
4
5
  type WalineCommentSorting = 'latest' | 'oldest' | 'hottest';
5
6
  type WalineEmojiPresets = `//${string}` | `http://${string}` | `https://${string}`;
6
7
  interface WalineEmojiInfo {
7
- /**
8
- * 选项卡上的 Emoji 名称
9
- *
10
- * Emoji name show on tab
11
- */
12
- name: string;
13
- /**
14
- * 所在文件夹链接
15
- *
16
- * Current folder link
17
- */
18
- folder?: string;
19
- /**
20
- * Emoji 通用路径前缀
21
- *
22
- * Common prefix of Emoji icons
23
- */
24
- prefix?: string;
25
- /**
26
- * Emoji 图片的类型,会作为文件扩展名使用
27
- *
28
- * Type of Emoji icons, will be regarded as file extension
29
- */
30
- type?: string;
31
- /**
32
- * 选项卡显示的 Emoji 图标
33
- *
34
- * Emoji icon show on tab
35
- */
36
- icon: string;
37
- /**
38
- * Emoji 图片列表
39
- *
40
- * Emoji image list
41
- */
42
- items: string[];
8
+ /**
9
+ * 选项卡上的 Emoji 名称
10
+ *
11
+ * Emoji name show on tab
12
+ */
13
+ name: string;
14
+ /**
15
+ * 所在文件夹链接
16
+ *
17
+ * Current folder link
18
+ */
19
+ folder?: string;
20
+ /**
21
+ * Emoji 通用路径前缀
22
+ *
23
+ * Common prefix of Emoji icons
24
+ */
25
+ prefix?: string;
26
+ /**
27
+ * Emoji 图片的类型,会作为文件扩展名使用
28
+ *
29
+ * Type of Emoji icons, will be regarded as file extension
30
+ */
31
+ type?: string;
32
+ /**
33
+ * 选项卡显示的 Emoji 图标
34
+ *
35
+ * Emoji icon show on tab
36
+ */
37
+ icon: string;
38
+ /**
39
+ * Emoji 图片列表
40
+ *
41
+ * Emoji image list
42
+ */
43
+ items: string[];
43
44
  }
44
45
  type WalineEmojiMaps = Record<string, string>;
45
46
  type WalineLoginStatus = 'enable' | 'disable' | 'force';
46
47
  interface WalineSearchImageData extends Record<string, unknown> {
47
- /**
48
- * 图片链接
49
- *
50
- * Image link
51
- */
52
- src: string;
53
- /**
54
- * 图片标题
55
- *
56
- * @description 用于图片的 alt 属性
57
- *
58
- * Image title
59
- *
60
- * @description Used for alt attribute of image
61
- */
62
- title?: string;
63
- /**
64
- * 图片缩略图
65
- *
66
- * @description 为了更好的加载性能,我们会优先在列表中使用此缩略图
67
- *
68
- * Image preview link
69
- *
70
- * @description For better loading performance, we will use this thumbnail first in the list
71
- *
72
- * @default src
73
- */
74
- preview?: string;
48
+ /**
49
+ * 图片链接
50
+ *
51
+ * Image link
52
+ */
53
+ src: string;
54
+ /**
55
+ * 图片标题
56
+ *
57
+ * 用于图片的 alt 属性
58
+ *
59
+ * Image title
60
+ *
61
+ * Used for alt attribute of image
62
+ */
63
+ title?: string;
64
+ /**
65
+ * 图片缩略图
66
+ *
67
+ * 为了更好的加载性能,我们会优先在列表中使用此缩略图
68
+ *
69
+ * Image preview link
70
+ *
71
+ * For better loading performance, we will use this thumbnail first in the list
72
+ *
73
+ * @default src
74
+ */
75
+ preview?: string;
75
76
  }
76
77
  type WalineSearchResult = WalineSearchImageData[];
77
78
  interface WalineSearchOptions {
78
- /**
79
- * 搜索操作
80
- *
81
- * Search action
82
- */
83
- search: (word: string) => Promise<WalineSearchResult>;
84
- /**
85
- * 打开列表时展示的默认结果
86
- *
87
- * Default result when opening list
88
- *
89
- * @default () => search('')
90
- */
91
- default?: () => Promise<WalineSearchResult>;
92
- /**
93
- * 获取更多的操作
94
- *
95
- * @description 会在列表滚动到底部时触发,如果你的搜索服务支持分页功能,你应该设置此项实现无限滚动
96
- *
97
- * Fetch more action
98
- *
99
- * @description It will be triggered when the list scrolls to the bottom. If your search service supports paging, you should set this to achieve infinite scrolling
100
- *
101
- * @default (word) => search(word)
102
- */
103
- more?: (word: string, currentCount: number) => Promise<WalineSearchResult>;
79
+ /**
80
+ * 搜索操作
81
+ *
82
+ * Search action
83
+ */
84
+ search: (word: string) => Promise<WalineSearchResult>;
85
+ /**
86
+ * 打开列表时展示的默认结果
87
+ *
88
+ * Default result when opening list
89
+ *
90
+ * @default () => search('')
91
+ */
92
+ default?: () => Promise<WalineSearchResult>;
93
+ /**
94
+ * 获取更多的操作
95
+ *
96
+ * 会在列表滚动到底部时触发,如果你的搜索服务支持分页功能,你应该设置此项实现无限滚动
97
+ *
98
+ * Fetch more action
99
+ *
100
+ * It will be triggered when the list scrolls to the bottom. If your search service supports
101
+ * paging, you should set this to achieve infinite scrolling
102
+ *
103
+ * @default (word) => search(word)
104
+ */
105
+ more?: (word: string, currentCount: number) => Promise<WalineSearchResult>;
104
106
  }
105
107
  type WalineMeta = 'nick' | 'mail' | 'link';
106
108
  type WalineImageUploader = (image: File) => Promise<string>;
107
109
  type WalineHighlighter = (code: string, lang: string) => string;
108
110
  type WalineTeXRenderer = (blockMode: boolean, tex: string) => string;
109
-
111
+ //#endregion
112
+ //#region src/typings/locale.d.ts
110
113
  interface WalineDateLocale {
111
- seconds: string;
112
- minutes: string;
113
- hours: string;
114
- days: string;
115
- now: string;
114
+ seconds: string;
115
+ minutes: string;
116
+ hours: string;
117
+ days: string;
118
+ now: string;
116
119
  }
117
120
  type WalineLevelLocale = Record<`level${number}`, string>;
118
121
  interface WalineReactionLocale {
119
- reactionTitle: string;
120
- reaction0: string;
121
- reaction1: string;
122
- reaction2: string;
123
- reaction3: string;
124
- reaction4: string;
125
- reaction5: string;
126
- reaction6: string;
127
- reaction7: string;
128
- reaction8: string;
122
+ reactionTitle: string;
123
+ reaction0: string;
124
+ reaction1: string;
125
+ reaction2: string;
126
+ reaction3: string;
127
+ reaction4: string;
128
+ reaction5: string;
129
+ reaction6: string;
130
+ reaction7: string;
131
+ reaction8: string;
129
132
  }
130
133
  interface WalineLocale extends WalineDateLocale, WalineLevelLocale, WalineReactionLocale {
131
- nick: string;
132
- mail: string;
133
- link: string;
134
- optional: string;
135
- placeholder: string;
136
- sofa: string;
137
- submit: string;
138
- comment: string;
139
- refresh: string;
140
- more: string;
141
- uploading: string;
142
- login: string;
143
- admin: string;
144
- sticky: string;
145
- word: string;
146
- anonymous: string;
147
- gif: string;
148
- gifSearchPlaceholder: string;
149
- approved: string;
150
- waiting: string;
151
- spam: string;
152
- unsticky: string;
153
- oldest: string;
154
- latest: string;
155
- hottest: string;
156
- nickError: string;
157
- mailError: string;
158
- wordHint: string;
159
- like: string;
160
- cancelLike: string;
161
- reply: string;
162
- cancelReply: string;
163
- preview: string;
164
- emoji: string;
165
- uploadImage: string;
166
- profile: string;
167
- logout: string;
168
- commentUnderReview: string;
169
- subPostComment: string;
170
- subSiteComment: string;
171
- subscribeToReplies: string;
134
+ nick: string;
135
+ mail: string;
136
+ link: string;
137
+ optional: string;
138
+ placeholder: string;
139
+ sofa: string;
140
+ submit: string;
141
+ comment: string;
142
+ refresh: string;
143
+ more: string;
144
+ uploading: string;
145
+ login: string;
146
+ admin: string;
147
+ sticky: string;
148
+ word: string;
149
+ anonymous: string;
150
+ gif: string;
151
+ gifSearchPlaceholder: string; // manage
152
+ approved: string;
153
+ waiting: string;
154
+ spam: string;
155
+ unsticky: string; // sorting
156
+ oldest: string;
157
+ latest: string;
158
+ hottest: string; // hint
159
+ nickError: string;
160
+ mailError: string;
161
+ wordHint: string; // i18n
162
+ like: string;
163
+ cancelLike: string;
164
+ reply: string;
165
+ cancelReply: string;
166
+ preview: string;
167
+ emoji: string;
168
+ uploadImage: string;
169
+ profile: string;
170
+ logout: string;
171
+ commentUnderReview: string;
172
+ subPostComment: string;
173
+ subSiteComment: string;
174
+ subscribeToReplies: string;
172
175
  }
173
-
176
+ //#endregion
177
+ //#region src/typings/waline.d.ts
174
178
  interface WalineProps {
175
- /**
176
- * Waline 的服务端地址
177
- *
178
- * Waline server address url
179
- */
180
- serverURL: string;
181
- /**
182
- * 当前 _文章页_ 路径,用于区分不同的 _文章页_ ,以保证正确读取该 _文章页_ 下的评论列表
183
- *
184
- * 你可以将其设置为 `window.location.pathname`
185
- *
186
- * Article path id. Used to distinguish different _article pages_ to ensure loading the correct comment list under the _article page_.
187
- *
188
- * You can set it to `window.location.pathname`
189
- */
190
- path: string;
191
- /**
192
- * 评论者相关属性
193
- *
194
- * `Meta` 可选值: `'nick'`, `'mail'`, `'link'`
195
- *
196
- * Reviewer attributes.
197
- *
198
- * Optional values for `Meta`: `'nick'`, `'mail'`, `'link'`
199
- *
200
- * @default ['nick', 'mail', 'link']
201
- */
202
- meta?: WalineMeta[];
203
- /**
204
- * 设置**必填项**,默认昵称为匿名
205
- *
206
- * Set required fields, default anonymous with nickname
207
- *
208
- * @default []
209
- */
210
- requiredMeta?: WalineMeta[];
211
- /**
212
- * 评论字数限制。填入单个数字时为最大字数限制
213
- *
214
- * @description 设置为 `0` 时无限制
215
- *
216
- * Comment word s limit. When a single number is filled in, it 's the maximum number of comment words.
217
- *
218
- * @description No limit when set to `0`.
219
- *
220
- * @default 0
221
- */
222
- wordLimit?: number | [number, number];
223
- /**
224
- * 评论列表分页,每页条数
225
- *
226
- * number of pages per page
227
- *
228
- * @default 10
229
- */
230
- pageSize?: number;
231
- /**
232
- * Waline 显示语言
233
- *
234
- * 可选值:
235
- *
236
- * - `'zh'`
237
- * - `'zh-cn'`
238
- * - `'zh-CN'`
239
- * - `'zh-tw'`
240
- * - `'zh-TW'`
241
- * - `'en'`
242
- * - `'en-US'`
243
- * - `'en-us'`
244
- * - `'jp'`
245
- * - `'jp-jp'`
246
- * - `'jp-JP'`
247
- * - `'pt-br'`
248
- * - `'pt-BR'`
249
- * - `'ru'`
250
- * - `'ru-ru'`
251
- * - `'ru-RU'`
252
- * - `'fr-FR'`
253
- * - `'fr'`
254
- *
255
- * Display language for waline
256
- *
257
- * Optional value:
258
- *
259
- * - `'zh'`
260
- * - `'zh-cn'`
261
- * - `'zh-CN'`
262
- * - `'zh-tw'`
263
- * - `'zh-TW'`
264
- * - `'en'`
265
- * - `'en-US'`
266
- * - `'en-us'`
267
- * - `'jp'`
268
- * - `'jp-jp'`
269
- * - `'jp-JP'`
270
- * - `'pt-br'`
271
- * - `'pt-BR'`
272
- * - `'ru'`
273
- * - `'ru-ru'`
274
- * - `'ru-RU'`
275
- * - `'fr-FR'`
276
- * - `'fr'`
277
- *
278
- * @default navigator.language
279
- */
280
- lang?: string;
281
- /**
282
- * 自定义 waline 语言显示
283
- *
284
- * @see [自定义语言](https://waline.js.org/client/i18n.html)
285
- *
286
- * Custom display language in waline
287
- *
288
- * @see [I18n](https://waline.js.org/en/client/i18n.html)
289
- */
290
- locale?: Partial<WalineLocale>;
291
- /**
292
- * 评论列表排序方式
293
- *
294
- * Sorting method for comment list
295
- *
296
- * @default 'latest'
297
- */
298
- commentSorting?: WalineCommentSorting;
299
- /**
300
- * 是否启用暗黑模式适配
301
- *
302
- * @description 设置 `'auto'` 会根据设备暗黑模式自适应。填入 CSS 选择器会在对应选择器生效时启用夜间模式。
303
- *
304
- * Whether to enable darkmode support
305
- *
306
- * @description Setting `'auto'` will display darkmode due to device settings. Filling in CSS selector will enable darkmode only when the selector match waline ancestor nodes.
307
- */
308
- dark?: string | boolean;
309
- /**
310
- *
311
- * 登录模式状态,可选值:
312
- *
313
- * - `'enable'`: 启用登录 (默认)
314
- * - `'disable'`: 禁用登录,用户只能填写信息评论
315
- * - `'force'`: 强制登录,用户必须注册并登录才可发布评论
316
- *
317
- * Login mode status, optional values:
318
- *
319
- * - `'enable'`: enable login (default)
320
- * - `'disable'`: Login is disabled, users should fill in information to comment
321
- * - `'force'`: Forced login, users must login to comment
322
- *
323
- * @default 'enable'
324
- */
325
- login?: WalineLoginStatus;
326
- /**
327
- * 是否在页脚隐藏版权信息
328
- *
329
- * 为了支持 Waline,我们强烈建议你开启它
330
- *
331
- * Whether hide copyright in footer
332
- *
333
- * We strongly recommended you to keep it on to support waline
334
- *
335
- */
336
- noCopyright?: boolean;
337
- /**
338
- * 是否隐藏 RSS 订阅入口
339
- *
340
- * Whether to hide RSS subscription links
341
- *
342
- * @default false
343
- */
344
- noRss?: boolean;
345
- /**
346
- * recaptcha v3 客户端 key
347
- *
348
- * recaptcha v3 client key
349
- */
350
- recaptchaV3Key?: string;
351
- /**
352
- * turnstile 客户端 key
353
- *
354
- * turnstile client key
355
- */
356
- turnstileKey?: string;
357
- /**
358
- * 文章反应
359
- *
360
- * Article reaction
361
- *
362
- * @default false
363
- */
364
- reaction?: string[] | boolean;
365
- /**
366
- * 设置表情包
367
- *
368
- * Set Emojis
369
- *
370
- * @default ['//unpkg.com/@waline/emojis@1.1.0/weibo']
371
- */
372
- emoji?: (WalineEmojiInfo | WalineEmojiPresets)[];
373
- /**
374
- * 设置搜索功能
375
- *
376
- * Customize Search feature
377
- */
378
- search?: WalineSearchOptions;
379
- /**
380
- * 代码块高亮器
381
- *
382
- * Code fence highlighter
383
- */
384
- highlighter?: WalineHighlighter;
385
- /**
386
- * 自定义图片上传方法,方便更好的存储图片
387
- *
388
- * 方法执行时会将图片对象传入。
389
- *
390
- * Custom image upload callback to manage picture by yourself.
391
- *
392
- * We will pass a picture file object when execute it.
393
- */
394
- imageUploader?: WalineImageUploader;
395
- /**
396
- * 自定义数学公式处理方法,用于预览。
397
- *
398
- * Custom math formula parse callback for preview.
399
- */
400
- texRenderer?: WalineTeXRenderer;
179
+ /**
180
+ * Waline 的服务端地址
181
+ *
182
+ * Waline server address url
183
+ */
184
+ serverURL: string;
185
+ /**
186
+ * 当前 _文章页_ 路径,用于区分不同的 _文章页_ ,以保证正确读取该 _文章页_ 下的评论列表
187
+ *
188
+ * 你可以将其设置为 `window.location.pathname`
189
+ *
190
+ * Article path id. Used to distinguish different _article pages_ to ensure loading the correct
191
+ * comment list under the _article page_.
192
+ *
193
+ * You can set it to `window.location.pathname`
194
+ */
195
+ path: string;
196
+ /**
197
+ * 评论者相关属性
198
+ *
199
+ * `Meta` 可选值: `'nick'`, `'mail'`, `'link'`
200
+ *
201
+ * Reviewer attributes.
202
+ *
203
+ * Optional values for `Meta`: `'nick'`, `'mail'`, `'link'`
204
+ *
205
+ * @default ['nick', 'mail', 'link']
206
+ */
207
+ meta?: WalineMeta[];
208
+ /**
209
+ * 设置**必填项**,默认昵称为匿名
210
+ *
211
+ * Set required fields, default anonymous with nickname
212
+ *
213
+ * @default [ ]
214
+ */
215
+ requiredMeta?: WalineMeta[];
216
+ /**
217
+ * 评论字数限制。填入单个数字时为最大字数限制
218
+ *
219
+ * 设置为 `0` 时无限制
220
+ *
221
+ * Comment word s limit. When a single number is filled in, it 's the maximum number of comment
222
+ * words.
223
+ *
224
+ * No limit when set to `0`.
225
+ *
226
+ * @default 0
227
+ */
228
+ wordLimit?: number | [number, number];
229
+ /**
230
+ * 评论列表分页,每页条数
231
+ *
232
+ * Number of pages per page
233
+ *
234
+ * @default 10
235
+ */
236
+ pageSize?: number;
237
+ /**
238
+ * Waline 显示语言
239
+ *
240
+ * 可选值:
241
+ *
242
+ * - `'zh'`
243
+ * - `'zh-cn'`
244
+ * - `'zh-CN'`
245
+ * - `'zh-tw'`
246
+ * - `'zh-TW'`
247
+ * - `'en'`
248
+ * - `'en-US'`
249
+ * - `'en-us'`
250
+ * - `'jp'`
251
+ * - `'jp-jp'`
252
+ * - `'jp-JP'`
253
+ * - `'pt-br'`
254
+ * - `'pt-BR'`
255
+ * - `'ru'`
256
+ * - `'ru-ru'`
257
+ * - `'ru-RU'`
258
+ * - `'fr-FR'`
259
+ * - `'fr'`
260
+ *
261
+ * Display language for waline
262
+ *
263
+ * Optional value:
264
+ *
265
+ * - `'zh'`
266
+ * - `'zh-cn'`
267
+ * - `'zh-CN'`
268
+ * - `'zh-tw'`
269
+ * - `'zh-TW'`
270
+ * - `'en'`
271
+ * - `'en-US'`
272
+ * - `'en-us'`
273
+ * - `'jp'`
274
+ * - `'jp-jp'`
275
+ * - `'jp-JP'`
276
+ * - `'pt-br'`
277
+ * - `'pt-BR'`
278
+ * - `'ru'`
279
+ * - `'ru-ru'`
280
+ * - `'ru-RU'`
281
+ * - `'fr-FR'`
282
+ * - `'fr'`
283
+ *
284
+ * @default navigator.language
285
+ */
286
+ lang?: string;
287
+ /**
288
+ * 自定义 waline 语言显示
289
+ *
290
+ * @see [自定义语言](https://waline.js.org/client/i18n.html)
291
+ *
292
+ * Custom display language in waline
293
+ * @see [I18n](https://waline.js.org/en/client/i18n.html)
294
+ */
295
+ locale?: Partial<WalineLocale>;
296
+ /**
297
+ * 评论列表排序方式
298
+ *
299
+ * Sorting method for comment list
300
+ *
301
+ * @default 'latest'
302
+ */
303
+ commentSorting?: WalineCommentSorting;
304
+ /**
305
+ * 是否启用暗黑模式适配
306
+ *
307
+ * 设置 `'auto'` 会根据设备暗黑模式自适应。填入 CSS 选择器会在对应选择器生效时启用夜间模式。
308
+ *
309
+ * Whether to enable darkmode support
310
+ *
311
+ * Setting `'auto'` will display darkmode due to device settings. Filling in CSS selector will
312
+ * enable darkmode only when the selector match waline ancestor nodes.
313
+ */
314
+ dark?: string | boolean;
315
+ /**
316
+ * 登录模式状态,可选值:
317
+ *
318
+ * - `'enable'`: 启用登录 (默认)
319
+ * - `'disable'`: 禁用登录,用户只能填写信息评论
320
+ * - `'force'`: 强制登录,用户必须注册并登录才可发布评论
321
+ *
322
+ * Login mode status, optional values:
323
+ *
324
+ * - `'enable'`: enable login (default)
325
+ * - `'disable'`: Login is disabled, users should fill in information to comment
326
+ * - `'force'`: Forced login, users must login to comment
327
+ *
328
+ * @default 'enable'
329
+ */
330
+ login?: WalineLoginStatus;
331
+ /**
332
+ * 是否在页脚隐藏版权信息
333
+ *
334
+ * 为了支持 Waline,我们强烈建议你开启它
335
+ *
336
+ * Whether hide copyright in footer
337
+ *
338
+ * We strongly recommended you to keep it on to support waline
339
+ */
340
+ noCopyright?: boolean;
341
+ /**
342
+ * 是否隐藏 RSS 订阅入口
343
+ *
344
+ * Whether to hide RSS subscription links
345
+ *
346
+ * @default false
347
+ */
348
+ noRss?: boolean;
349
+ /**
350
+ * Recaptcha v3 客户端 key
351
+ *
352
+ * Recaptcha v3 client key
353
+ */
354
+ recaptchaV3Key?: string;
355
+ /**
356
+ * Turnstile 客户端 key
357
+ *
358
+ * Turnstile client key
359
+ */
360
+ turnstileKey?: string;
361
+ /**
362
+ * 文章反应
363
+ *
364
+ * Article reaction
365
+ *
366
+ * @default false
367
+ */
368
+ reaction?: string[] | boolean;
369
+ /**
370
+ * 设置表情包
371
+ *
372
+ * Set Emojis
373
+ *
374
+ * @default ['//unpkg.com/@waline/emojis@1.1.0/weibo']
375
+ */
376
+ emoji?: (WalineEmojiInfo | WalineEmojiPresets)[];
377
+ /**
378
+ * 设置搜索功能
379
+ *
380
+ * Customize Search feature
381
+ */
382
+ search?: WalineSearchOptions | boolean;
383
+ /**
384
+ * 代码块高亮器
385
+ *
386
+ * Code fence highlighter
387
+ */
388
+ highlighter?: WalineHighlighter;
389
+ /**
390
+ * 自定义图片上传方法,方便更好的存储图片
391
+ *
392
+ * 方法执行时会将图片对象传入。
393
+ *
394
+ * Custom image upload callback to manage picture by yourself.
395
+ *
396
+ * We will pass a picture file object when execute it.
397
+ */
398
+ imageUploader?: WalineImageUploader;
399
+ /**
400
+ * 自定义数学公式处理方法,用于预览。
401
+ *
402
+ * Custom math formula parse callback for preview.
403
+ */
404
+ texRenderer?: WalineTeXRenderer;
401
405
  }
402
-
406
+ //#endregion
407
+ //#region src/typings/options.d.ts
403
408
  interface WalineInitOptions extends Omit<WalineProps, 'path' | 'emoji' | 'search' | 'highlighter' | 'imageUploader' | 'texRenderer'> {
404
- /**
405
- * Waline 的初始化挂载器。必须是一个**有效的** CSS 选择器 或 HTML 元素
406
- *
407
- * The DOM element to be mounted on initialization. It must be a **valid** CSS selector string or HTML Element.
408
- */
409
- el?: string | HTMLElement | null;
410
- /**
411
- * 评论数统计
412
- *
413
- * Comment number support
414
- *
415
- * @default true
416
- */
417
- comment?: string | boolean;
418
- /**
419
- * 页面访问量统计
420
- *
421
- * Pageview number support
422
- *
423
- * @default true
424
- */
425
- pageview?: string | boolean;
426
- /**
427
- * 当前 _文章页_ 路径,用于区分不同的 _文章页_ ,以保证正确读取该 _文章页_ 下的评论列表
428
- *
429
- * 你可以将其设置为 `window.location.pathname`
430
- *
431
- * Article path id. Used to distinguish different _article pages_ to ensure loading the correct comment list under the _article page_.
432
- *
433
- * You can set it to `window.location.pathname`
434
- *
435
- * @default window.location.pathname
436
- */
437
- path?: string;
438
- /**
439
- * 设置表情包
440
- *
441
- * Set Emojis
442
- *
443
- * @default ['//unpkg.com/@waline/emojis@1.1.0/weibo']
444
- */
445
- emoji?: (WalineEmojiInfo | WalineEmojiPresets)[] | boolean;
446
- /**
447
- * 设置搜索功能
448
- *
449
- * Customize Search feature
450
- *
451
- * @default true
452
- */
453
- search?: WalineSearchOptions | boolean;
454
- /**
455
- * 代码高亮
456
- *
457
- * Code highlighting
458
- *
459
- * @default true
460
- */
461
- highlighter?: WalineHighlighter | boolean;
462
- /**
463
- * 自定义图片上传方法,方便更好的存储图片
464
- *
465
- * 方法执行时会将图片对象传入。
466
- *
467
- * Custom image upload callback to manage picture by yourself.
468
- *
469
- * We will pass a picture file object when execute it.
470
- *
471
- * @default true
472
- */
473
- imageUploader?: WalineImageUploader | boolean;
474
- /**
475
- * 自定义数学公式处理方法,用于预览。
476
- *
477
- * Custom math formula parse callback for preview.
478
- *
479
- * @default true
480
- */
481
- texRenderer?: WalineTeXRenderer | boolean;
409
+ /**
410
+ * Waline 的初始化挂载器。必须是一个**有效的** CSS 选择器 或 HTML 元素
411
+ *
412
+ * The DOM element to be mounted on initialization. It must be a **valid** CSS selector string or
413
+ * HTML Element.
414
+ */
415
+ el?: string | HTMLElement | null;
416
+ /**
417
+ * 评论数统计
418
+ *
419
+ * Comment number support
420
+ *
421
+ * @default true
422
+ */
423
+ comment?: string | boolean;
424
+ /**
425
+ * 页面访问量统计
426
+ *
427
+ * Pageview number support
428
+ *
429
+ * @default true
430
+ */
431
+ pageview?: string | boolean;
432
+ /**
433
+ * 当前 _文章页_ 路径,用于区分不同的 _文章页_ ,以保证正确读取该 _文章页_ 下的评论列表
434
+ *
435
+ * 你可以将其设置为 `window.location.pathname`
436
+ *
437
+ * Article path id. Used to distinguish different _article pages_ to ensure loading the correct
438
+ * comment list under the _article page_.
439
+ *
440
+ * You can set it to `window.location.pathname`
441
+ *
442
+ * @default window.location.pathname
443
+ */
444
+ path?: string;
445
+ /**
446
+ * 设置表情包
447
+ *
448
+ * Set Emojis
449
+ *
450
+ * @default ['//unpkg.com/@waline/emojis@1.1.0/weibo']
451
+ */
452
+ emoji?: (WalineEmojiInfo | WalineEmojiPresets)[] | boolean;
453
+ /**
454
+ * 设置搜索功能
455
+ *
456
+ * Customize Search feature
457
+ *
458
+ * @default true
459
+ */
460
+ search?: WalineSearchOptions | boolean;
461
+ /**
462
+ * 代码高亮
463
+ *
464
+ * Code highlighting
465
+ *
466
+ * @default true
467
+ */
468
+ highlighter?: WalineHighlighter | boolean;
469
+ /**
470
+ * 自定义图片上传方法,方便更好的存储图片
471
+ *
472
+ * 方法执行时会将图片对象传入。
473
+ *
474
+ * Custom image upload callback to manage picture by yourself.
475
+ *
476
+ * We will pass a picture file object when execute it.
477
+ *
478
+ * @default true
479
+ */
480
+ imageUploader?: WalineImageUploader | boolean;
481
+ /**
482
+ * 自定义数学公式处理方法,用于预览。
483
+ *
484
+ * Custom math formula parse callback for preview.
485
+ *
486
+ * @default true
487
+ */
488
+ texRenderer?: WalineTeXRenderer | boolean;
482
489
  }
490
+ // oxlint-disable-next-line typescript/explicit-module-boundary-types, typescript/no-explicit-any
483
491
  type WalineAbort = (reason?: any) => void;
484
-
492
+ //#endregion
493
+ //#region src/config/i18n/index.d.ts
485
494
  type Locales = Record<string, WalineLocale>;
486
495
  declare const DEFAULT_LOCALES: Locales;
487
-
496
+ //#endregion
497
+ //#region src/comment.d.ts
488
498
  interface WalineCommentCountOptions {
489
- /**
490
- * Waline 服务端地址
491
- *
492
- * Waline server url
493
- */
494
- serverURL: string;
495
- /**
496
- * 评论数 CSS 选择器
497
- *
498
- * Comment count CSS selector
499
- *
500
- * @default '.waline-comment-count'
501
- */
502
- selector?: string;
503
- /**
504
- * 需要获取的默认路径
505
- *
506
- * Path to be fetched by default
507
- *
508
- * @default window.location.pathname
509
- */
510
- path?: string;
511
- /**
512
- * 错误提示消息所使用的语言
513
- *
514
- * Language of error message
515
- *
516
- * @default navigator.language
517
- */
518
- lang?: string;
499
+ /**
500
+ * Waline 服务端地址
501
+ *
502
+ * Waline server url
503
+ */
504
+ serverURL: string;
505
+ /**
506
+ * 评论数 CSS 选择器
507
+ *
508
+ * Comment count CSS selector
509
+ *
510
+ * @default '.waline-comment-count'
511
+ */
512
+ selector?: string;
513
+ /**
514
+ * 需要获取的默认路径
515
+ *
516
+ * Path to be fetched by default
517
+ *
518
+ * @default window.location.pathname
519
+ */
520
+ path?: string;
521
+ /**
522
+ * 错误提示消息所使用的语言
523
+ *
524
+ * Language of error message
525
+ *
526
+ * @default navigator.language
527
+ */
528
+ lang?: string;
519
529
  }
520
- declare const commentCount: ({ serverURL, path, selector, lang, }: WalineCommentCountOptions) => WalineAbort;
521
-
530
+ declare const commentCount: ({
531
+ serverURL,
532
+ path,
533
+ selector,
534
+ lang
535
+ }: WalineCommentCountOptions) => WalineAbort;
536
+ //#endregion
537
+ //#region src/init.d.ts
522
538
  interface WalineInstance {
523
- /**
524
- * Waline 被挂载到的元素
525
- *
526
- * @description 当通过 `el: null` 初始化,值为 `null`
527
- *
528
- * Element where Waline is mounted
529
- *
530
- * @description when initialized with `el: null`, it will be `null`
531
- */
532
- el: HTMLElement | null;
533
- /**
534
- * 更新 Waline 实例
535
- *
536
- * @description 只要不设置`path` 选项,更新时它就会被重置为 `windows.location.pathname`
537
- *
538
- * Update Waline instance
539
- *
540
- * @description when not setting `path` option, it will be reset to `window.location.pathname`
541
- */
542
- update: (newOptions?: Partial<Omit<WalineInitOptions, 'el'>>) => void;
543
- /**
544
- * 取消挂载并摧毁 Waline 实例
545
- *
546
- * Unmount and destroy Waline instance
547
- */
548
- destroy: () => void;
539
+ /**
540
+ * Waline 被挂载到的元素
541
+ *
542
+ * 当通过 `el: null` 初始化,值为 `null` Element where Waline is mounted
543
+ *
544
+ * When initialized with `el: null`, it will be `null`
545
+ */
546
+ el: HTMLElement | null;
547
+ /**
548
+ * 更新 Waline 实例
549
+ *
550
+ * 只要不设置`path` 选项,更新时它就会被重置为 `windows.location.pathname` Update Waline instance
551
+ *
552
+ * When not setting `path` option, it will be reset to `window.location.pathname`
553
+ */
554
+ update: (newOptions?: Partial<Omit<WalineInitOptions, 'el'>>) => void;
555
+ /**
556
+ * 取消挂载并摧毁 Waline 实例
557
+ *
558
+ * Unmount and destroy Waline instance
559
+ */
560
+ destroy: () => void;
549
561
  }
550
- declare const init: ({ el, path, comment, pageview, ...initProps }: WalineInitOptions) => WalineInstance | null;
551
-
562
+ declare const init: ({
563
+ el,
564
+ path,
565
+ comment,
566
+ pageview,
567
+ ...initProps
568
+ }: WalineInitOptions) => WalineInstance | null;
569
+ //#endregion
570
+ //#region src/pageview.d.ts
552
571
  interface WalinePageviewCountOptions {
553
- /**
554
- * Waline 服务端地址
555
- *
556
- * Waline server url
557
- */
558
- serverURL: string;
559
- /**
560
- * 浏览量 CSS 选择器
561
- *
562
- * Pageview CSS selector
563
- *
564
- * @default '.waline-pageview-count'
565
- */
566
- selector?: string;
567
- /**
568
- * 需要更新和获取的路径
569
- *
570
- * Path to be fetched and updated
571
- *
572
- * @default window.location.pathname
573
- */
574
- path?: string;
575
- /**
576
- * 是否在查询时更新 path 的浏览量
577
- *
578
- * Whether update pageviews when fetching path result
579
- *
580
- * @default true
581
- */
582
- update?: boolean;
583
- /**
584
- * 错误提示消息所使用的语言
585
- *
586
- * Language of error message
587
- *
588
- * @default navigator.language
589
- */
590
- lang?: string;
572
+ /**
573
+ * Waline 服务端地址
574
+ *
575
+ * Waline server url
576
+ */
577
+ serverURL: string;
578
+ /**
579
+ * 浏览量 CSS 选择器
580
+ *
581
+ * Pageview CSS selector
582
+ *
583
+ * @default '.waline-pageview-count'
584
+ */
585
+ selector?: string;
586
+ /**
587
+ * 需要更新和获取的路径
588
+ *
589
+ * Path to be fetched and updated
590
+ *
591
+ * @default window.location.pathname
592
+ */
593
+ path?: string;
594
+ /**
595
+ * 是否在查询时更新 path 的浏览量
596
+ *
597
+ * Whether update pageviews when fetching path result
598
+ *
599
+ * @default true
600
+ */
601
+ update?: boolean;
602
+ /**
603
+ * 错误提示消息所使用的语言
604
+ *
605
+ * Language of error message
606
+ *
607
+ * @default navigator.language
608
+ */
609
+ lang?: string;
591
610
  }
592
- declare const pageviewCount: ({ serverURL, path, selector, update, lang, }: WalinePageviewCountOptions) => WalineAbort;
593
-
611
+ declare const pageviewCount: ({
612
+ serverURL,
613
+ path,
614
+ selector,
615
+ update,
616
+ lang
617
+ }: WalinePageviewCountOptions) => WalineAbort;
618
+ //#endregion
619
+ //#region src/version.d.ts
594
620
  declare const version: string;
595
-
621
+ //#endregion
622
+ //#region src/widgets/recentComments.d.ts
596
623
  interface WalineRecentCommentsOptions {
597
- /**
598
- * Waline 服务端地址
599
- *
600
- * Waline serverURL
601
- */
602
- serverURL: string;
603
- /**
604
- * 获取最新评论的数量
605
- *
606
- * fetch number of latest comments
607
- */
608
- count: number;
609
- /**
610
- * 需要挂载的元素
611
- *
612
- * Element to be mounted
613
- */
614
- el?: string | HTMLElement;
615
- /**
616
- * 错误提示消息所使用的语言
617
- *
618
- * Language of error message
619
- *
620
- * @default navigator.language
621
- */
622
- lang?: string;
624
+ /**
625
+ * Waline 服务端地址
626
+ *
627
+ * Waline serverURL
628
+ */
629
+ serverURL: string;
630
+ /**
631
+ * 获取最新评论的数量
632
+ *
633
+ * Fetch number of latest comments
634
+ */
635
+ count: number;
636
+ /**
637
+ * 需要挂载的元素
638
+ *
639
+ * Element to be mounted
640
+ */
641
+ el?: string | HTMLElement;
642
+ /**
643
+ * 错误提示消息所使用的语言
644
+ *
645
+ * Language of error message
646
+ *
647
+ * @default navigator.language
648
+ */
649
+ lang?: string;
623
650
  }
624
651
  interface WalineRecentCommentsResult {
625
- /**
626
- * 评论数据
627
- *
628
- * Comment Data
629
- */
630
- comments: RecentCommentData[];
631
- /**
632
- * 取消挂载挂件
633
- *
634
- * Umount widget
635
- */
636
- destroy: () => void;
652
+ /**
653
+ * 评论数据
654
+ *
655
+ * Comment Data
656
+ */
657
+ comments: RecentCommentData[];
658
+ /**
659
+ * 取消挂载挂件
660
+ *
661
+ * Umount widget
662
+ */
663
+ destroy: () => void;
637
664
  }
638
- declare const RecentComments: ({ el, serverURL, count, lang, }: WalineRecentCommentsOptions) => Promise<WalineRecentCommentsResult>;
639
-
665
+ declare const RecentComments: ({
666
+ el,
667
+ serverURL,
668
+ count,
669
+ lang
670
+ }: WalineRecentCommentsOptions) => Promise<WalineRecentCommentsResult>;
671
+ //#endregion
672
+ //#region src/widgets/userList.d.ts
640
673
  interface WalineUserListOptions {
641
- /**
642
- * Waline 服务端地址
643
- *
644
- * Waline serverURL
645
- */
646
- serverURL: string;
647
- /**
648
- * 获取用户列表的数量
649
- *
650
- * fetch number of user list
651
- */
652
- count: number;
653
- /**
654
- * 需要挂载的元素
655
- *
656
- * Element to be mounted
657
- */
658
- el?: string | HTMLElement;
659
- /**
660
- * 错误提示消息所使用的语言
661
- *
662
- * Language of error message
663
- *
664
- * @default navigator.language
665
- */
666
- lang?: string;
667
- /**
668
- * 自定义 waline 语言显示
669
- *
670
- * @see [自定义语言](https://waline.js.org/client/i18n.html)
671
- *
672
- * Custom display language in waline
673
- *
674
- * @see [I18n](https://waline.js.org/en/client/i18n.html)
675
- */
676
- locale?: WalineLocale;
677
- /**
678
- * 列表模式还是头像墙模式
679
- *
680
- * list mode or avatar wall mode
681
- *
682
- * @default 'list'
683
- */
684
- mode?: 'list' | 'wall';
674
+ /**
675
+ * Waline 服务端地址
676
+ *
677
+ * Waline serverURL
678
+ */
679
+ serverURL: string;
680
+ /**
681
+ * 获取用户列表的数量
682
+ *
683
+ * Fetch number of user list
684
+ */
685
+ count: number;
686
+ /**
687
+ * 需要挂载的元素
688
+ *
689
+ * Element to be mounted
690
+ */
691
+ el?: string | HTMLElement;
692
+ /**
693
+ * 错误提示消息所使用的语言
694
+ *
695
+ * Language of error message
696
+ *
697
+ * @default navigator.language
698
+ */
699
+ lang?: string;
700
+ /**
701
+ * 自定义 waline 语言显示
702
+ *
703
+ * @see [自定义语言](https://waline.js.org/client/i18n.html)
704
+ *
705
+ * Custom display language in waline
706
+ * @see [I18n](https://waline.js.org/en/client/i18n.html)
707
+ */
708
+ locale?: WalineLocale;
709
+ /**
710
+ * 列表模式还是头像墙模式
711
+ *
712
+ * List mode or avatar wall mode
713
+ *
714
+ * @default 'list'
715
+ */
716
+ mode?: 'list' | 'wall';
685
717
  }
686
718
  interface WalineUserListResult {
687
- /**
688
- * 用户数据
689
- *
690
- * User Data
691
- */
692
- users: WalineUser[];
693
- /**
694
- * 取消挂载挂件
695
- *
696
- * Umount widget
697
- */
698
- destroy: () => void;
719
+ /**
720
+ * 用户数据
721
+ *
722
+ * User Data
723
+ */
724
+ users: WalineUser[];
725
+ /**
726
+ * 取消挂载挂件
727
+ *
728
+ * Umount widget
729
+ */
730
+ destroy: () => void;
699
731
  }
700
- declare const UserList: ({ el, serverURL, count, locale, lang, mode, }: WalineUserListOptions) => Promise<WalineUserListResult>;
701
-
702
- /**
703
- * Options for the star rating widget.
704
- */
732
+ declare const UserList: ({
733
+ el,
734
+ serverURL,
735
+ count,
736
+ locale,
737
+ lang,
738
+ mode
739
+ }: WalineUserListOptions) => Promise<WalineUserListResult>;
740
+ //#endregion
741
+ //#region src/widgets/star/index.d.ts
742
+ /** Options for the star rating widget. */
705
743
  interface WalineStarOptions {
706
- /**
707
- * Element or CSS selector on which to mount the widget.
708
- */
709
- el?: string | HTMLElement;
710
- /**
711
- * Path identifying the current page or article.
712
- */
713
- path: string;
714
- /**
715
- * Language code used by the widget, such as `en` or `zh-CN`.
716
- */
717
- lang?: string;
718
- /**
719
- * Waline server URL.
720
- */
721
- serverURL: string;
722
- /**
723
- * Callback invoked after the user submits a rating.
724
- *
725
- * @param score The score selected by the user.
726
- */
727
- onRate?: (score: number) => void;
744
+ /** Element or CSS selector on which to mount the widget. */
745
+ el?: string | HTMLElement;
746
+ /** Path identifying the current page or article. */
747
+ path: string;
748
+ /** Language code used by the widget, such as `en` or `zh-CN`. */
749
+ lang?: string;
750
+ /** Waline server URL. */
751
+ serverURL: string;
752
+ /**
753
+ * Callback invoked after the user submits a rating.
754
+ *
755
+ * @param score The score selected by the user.
756
+ */
757
+ onRate?: (score: number) => void;
728
758
  }
729
- /**
730
- * Star widget result.
731
- */
759
+ /** Star widget result. */
732
760
  interface WalineStarResult {
733
- /**
734
- * Destroy star widget instance.
735
- */
736
- destroy: () => void;
761
+ /** Destroy star widget instance. */
762
+ destroy: () => void;
737
763
  }
738
- declare const Star: ({ el, path, lang, serverURL, onRate, }: WalineStarOptions) => WalineStarResult;
739
-
740
- export { RecentComments, Star, UserList, commentCount, DEFAULT_LOCALES as defaultLocales, init, pageviewCount, version };
741
- export type { WalineAbort, WalineCommentCountOptions, WalineCommentSorting, WalineDateLocale, WalineEmojiInfo, WalineEmojiMaps, WalineEmojiPresets, WalineHighlighter, WalineImageUploader, WalineInitOptions, WalineInstance, WalineLevelLocale, WalineLocale, WalineLoginStatus, WalineMeta, WalinePageviewCountOptions, WalineProps, WalineReactionLocale, WalineRecentCommentsOptions, WalineRecentCommentsResult, WalineSearchImageData, WalineSearchOptions, WalineSearchResult, WalineStarOptions, WalineStarResult, WalineTeXRenderer, WalineUserListOptions, WalineUserListResult };
764
+ declare const Star: ({
765
+ el,
766
+ path,
767
+ lang,
768
+ serverURL,
769
+ onRate
770
+ }: WalineStarOptions) => WalineStarResult;
771
+ //#endregion
772
+ export { RecentComments, Star, UserList, WalineAbort, WalineCommentCountOptions, WalineCommentSorting, WalineDateLocale, WalineEmojiInfo, WalineEmojiMaps, WalineEmojiPresets, WalineHighlighter, WalineImageUploader, WalineInitOptions, WalineInstance, WalineLevelLocale, WalineLocale, WalineLoginStatus, WalineMeta, WalinePageviewCountOptions, WalineProps, WalineReactionLocale, WalineRecentCommentsOptions, WalineRecentCommentsResult, WalineSearchImageData, WalineSearchOptions, WalineSearchResult, WalineStarOptions, WalineStarResult, WalineTeXRenderer, WalineUserListOptions, WalineUserListResult, commentCount, DEFAULT_LOCALES as defaultLocales, init, pageviewCount, version };