@waline/client 2.11.2 → 2.11.3

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/waline.d.cts CHANGED
@@ -37,39 +37,64 @@ interface WalineEmojiInfo {
37
37
  items: string[];
38
38
  }
39
39
  declare type WalineEmojiMaps = Record<string, string>;
40
- interface WalineSearchResult extends Record<string, unknown> {
40
+ interface WalineSearchImageData extends Record<string, unknown> {
41
41
  /**
42
+ * 图片链接
43
+ *
42
44
  * Image link
43
45
  */
44
46
  src: string;
45
47
  /**
46
- * Image title, optional
48
+ * 图片标题
49
+ *
50
+ * @description 用于图片的 alt 属性
51
+ *
52
+ * Image title
53
+ *
54
+ * @description Used for alt attribute of image
47
55
  */
48
56
  title?: string;
49
57
  /**
50
- * Image preview link, optional
58
+ * 图片缩略图
59
+ *
60
+ * @description 为了更好的加载性能,我们会优先在列表中使用此缩略图
61
+ *
62
+ * Image preview link
63
+ *
64
+ * @description For better loading performance, we will use this thumbnail first in the list
51
65
  *
52
66
  * @default src
53
67
  */
54
68
  preview?: string;
55
69
  }
70
+ declare type WalineSearchResult = WalineSearchImageData[];
56
71
  interface WalineSearchOptions {
57
72
  /**
73
+ * 搜索操作
74
+ *
58
75
  * Search action
59
76
  */
60
- search: (word: string) => Promise<WalineSearchResult[]>;
77
+ search: (word: string) => Promise<WalineSearchResult>;
61
78
  /**
62
- * Default search action
79
+ * 打开列表时展示的默认结果
80
+ *
81
+ * Default result when opening list
63
82
  *
64
83
  * @default () => search('')
65
84
  */
66
- default?: () => Promise<WalineSearchResult[]>;
85
+ default?: () => Promise<WalineSearchResult>;
67
86
  /**
87
+ * 获取更多的操作
88
+ *
89
+ * @description 会在列表滚动到底部时触发,如果你的搜索服务支持分页功能,你应该设置此项实现无限滚动
90
+ *
68
91
  * Fetch more action
69
92
  *
93
+ * @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
94
+ *
70
95
  * @default (word) => search(word)
71
96
  */
72
- more?: (word: string, currectCount: number) => Promise<WalineSearchResult[]>;
97
+ more?: (word: string, currectCount: number) => Promise<WalineSearchResult>;
73
98
  }
74
99
  declare type WalineMeta = 'nick' | 'mail' | 'link';
75
100
  declare type WalineImageUploader = (image: File) => Promise<string>;
@@ -160,37 +185,37 @@ interface WalineDateLocale {
160
185
  now: string;
161
186
  }
162
187
  declare type WalineLevelLocale = Record<`level${number}`, string>;
163
- interface WalineLocale extends WalineDateLocale, WalineLevelLocale {
188
+ interface WalineReactionLocale {
189
+ reactionTitle: string;
190
+ reaction0: string;
191
+ reaction1: string;
192
+ reaction2: string;
193
+ reaction3: string;
194
+ reaction4: string;
195
+ reaction5: string;
196
+ reaction6: string;
197
+ reaction7: string;
198
+ reaction8: string;
199
+ }
200
+ interface WalineLocale extends WalineDateLocale, WalineLevelLocale, WalineReactionLocale {
164
201
  nick: string;
165
- nickError: string;
166
202
  mail: string;
167
- mailError: string;
168
203
  link: string;
169
204
  optional: string;
170
205
  placeholder: string;
171
206
  sofa: string;
172
207
  submit: string;
173
- like: string;
174
- cancelLike: string;
175
- reply: string;
176
- cancelReply: string;
177
208
  comment: string;
178
209
  refresh: string;
179
210
  more: string;
180
- preview: string;
181
- emoji: string;
182
- uploadImage: string;
183
211
  uploading: string;
184
212
  login: string;
185
- logout: string;
186
213
  admin: string;
187
214
  sticky: string;
188
215
  word: string;
189
- wordHint: string;
190
216
  anonymous: string;
191
217
  gif: string;
192
218
  gifSearchPlaceholder: string;
193
- profile: string;
194
219
  approved: string;
195
220
  waiting: string;
196
221
  spam: string;
@@ -198,16 +223,18 @@ interface WalineLocale extends WalineDateLocale, WalineLevelLocale {
198
223
  oldest: string;
199
224
  latest: string;
200
225
  hottest: string;
201
- reactionTitle: string;
202
- reaction0: string;
203
- reaction1: string;
204
- reaction2: string;
205
- reaction3: string;
206
- reaction4: string;
207
- reaction5: string;
208
- reaction6: string;
209
- reaction7: string;
210
- reaction8: string;
226
+ nickError: string;
227
+ mailError: string;
228
+ wordHint: string;
229
+ like: string;
230
+ cancelLike: string;
231
+ reply: string;
232
+ cancelReply: string;
233
+ preview: string;
234
+ emoji: string;
235
+ uploadImage: string;
236
+ profile: string;
237
+ logout: string;
211
238
  }
212
239
 
213
240
  interface WalineProps {
@@ -601,4 +628,4 @@ interface WalineRecentCommentsResult {
601
628
  }
602
629
  declare const RecentComments: ({ el, serverURL, count, lang, }: WalineRecentCommentsOptions) => Promise<WalineRecentCommentsResult>;
603
630
 
604
- export { RecentComments, WalineAbort, WalineComment, WalineCommentCountOptions, WalineCommentData, WalineCommentStatus, WalineDateLocale, WalineEmojiInfo, WalineEmojiMaps, WalineHighlighter, WalineImageUploader, WalineInitOptions, WalineInstance, WalineLevelLocale, WalineLocale, WalineMeta, WalinePageviewCountOptions, WalineProps, WalineRecentCommentsOptions, WalineRecentCommentsResult, WalineSearchOptions, WalineSearchResult, WalineTexRenderer, commentCount, defaultLocales, init, pageviewCount, version };
631
+ export { RecentComments, WalineAbort, WalineComment, WalineCommentCountOptions, WalineCommentData, WalineCommentStatus, WalineDateLocale, WalineEmojiInfo, WalineEmojiMaps, WalineHighlighter, WalineImageUploader, WalineInitOptions, WalineInstance, WalineLevelLocale, WalineLocale, WalineMeta, WalinePageviewCountOptions, WalineProps, WalineReactionLocale, WalineRecentCommentsOptions, WalineRecentCommentsResult, WalineSearchImageData, WalineSearchOptions, WalineSearchResult, WalineTexRenderer, commentCount, defaultLocales, init, pageviewCount, version };
package/dist/waline.d.mts CHANGED
@@ -37,39 +37,64 @@ interface WalineEmojiInfo {
37
37
  items: string[];
38
38
  }
39
39
  declare type WalineEmojiMaps = Record<string, string>;
40
- interface WalineSearchResult extends Record<string, unknown> {
40
+ interface WalineSearchImageData extends Record<string, unknown> {
41
41
  /**
42
+ * 图片链接
43
+ *
42
44
  * Image link
43
45
  */
44
46
  src: string;
45
47
  /**
46
- * Image title, optional
48
+ * 图片标题
49
+ *
50
+ * @description 用于图片的 alt 属性
51
+ *
52
+ * Image title
53
+ *
54
+ * @description Used for alt attribute of image
47
55
  */
48
56
  title?: string;
49
57
  /**
50
- * Image preview link, optional
58
+ * 图片缩略图
59
+ *
60
+ * @description 为了更好的加载性能,我们会优先在列表中使用此缩略图
61
+ *
62
+ * Image preview link
63
+ *
64
+ * @description For better loading performance, we will use this thumbnail first in the list
51
65
  *
52
66
  * @default src
53
67
  */
54
68
  preview?: string;
55
69
  }
70
+ declare type WalineSearchResult = WalineSearchImageData[];
56
71
  interface WalineSearchOptions {
57
72
  /**
73
+ * 搜索操作
74
+ *
58
75
  * Search action
59
76
  */
60
- search: (word: string) => Promise<WalineSearchResult[]>;
77
+ search: (word: string) => Promise<WalineSearchResult>;
61
78
  /**
62
- * Default search action
79
+ * 打开列表时展示的默认结果
80
+ *
81
+ * Default result when opening list
63
82
  *
64
83
  * @default () => search('')
65
84
  */
66
- default?: () => Promise<WalineSearchResult[]>;
85
+ default?: () => Promise<WalineSearchResult>;
67
86
  /**
87
+ * 获取更多的操作
88
+ *
89
+ * @description 会在列表滚动到底部时触发,如果你的搜索服务支持分页功能,你应该设置此项实现无限滚动
90
+ *
68
91
  * Fetch more action
69
92
  *
93
+ * @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
94
+ *
70
95
  * @default (word) => search(word)
71
96
  */
72
- more?: (word: string, currectCount: number) => Promise<WalineSearchResult[]>;
97
+ more?: (word: string, currectCount: number) => Promise<WalineSearchResult>;
73
98
  }
74
99
  declare type WalineMeta = 'nick' | 'mail' | 'link';
75
100
  declare type WalineImageUploader = (image: File) => Promise<string>;
@@ -160,37 +185,37 @@ interface WalineDateLocale {
160
185
  now: string;
161
186
  }
162
187
  declare type WalineLevelLocale = Record<`level${number}`, string>;
163
- interface WalineLocale extends WalineDateLocale, WalineLevelLocale {
188
+ interface WalineReactionLocale {
189
+ reactionTitle: string;
190
+ reaction0: string;
191
+ reaction1: string;
192
+ reaction2: string;
193
+ reaction3: string;
194
+ reaction4: string;
195
+ reaction5: string;
196
+ reaction6: string;
197
+ reaction7: string;
198
+ reaction8: string;
199
+ }
200
+ interface WalineLocale extends WalineDateLocale, WalineLevelLocale, WalineReactionLocale {
164
201
  nick: string;
165
- nickError: string;
166
202
  mail: string;
167
- mailError: string;
168
203
  link: string;
169
204
  optional: string;
170
205
  placeholder: string;
171
206
  sofa: string;
172
207
  submit: string;
173
- like: string;
174
- cancelLike: string;
175
- reply: string;
176
- cancelReply: string;
177
208
  comment: string;
178
209
  refresh: string;
179
210
  more: string;
180
- preview: string;
181
- emoji: string;
182
- uploadImage: string;
183
211
  uploading: string;
184
212
  login: string;
185
- logout: string;
186
213
  admin: string;
187
214
  sticky: string;
188
215
  word: string;
189
- wordHint: string;
190
216
  anonymous: string;
191
217
  gif: string;
192
218
  gifSearchPlaceholder: string;
193
- profile: string;
194
219
  approved: string;
195
220
  waiting: string;
196
221
  spam: string;
@@ -198,16 +223,18 @@ interface WalineLocale extends WalineDateLocale, WalineLevelLocale {
198
223
  oldest: string;
199
224
  latest: string;
200
225
  hottest: string;
201
- reactionTitle: string;
202
- reaction0: string;
203
- reaction1: string;
204
- reaction2: string;
205
- reaction3: string;
206
- reaction4: string;
207
- reaction5: string;
208
- reaction6: string;
209
- reaction7: string;
210
- reaction8: string;
226
+ nickError: string;
227
+ mailError: string;
228
+ wordHint: string;
229
+ like: string;
230
+ cancelLike: string;
231
+ reply: string;
232
+ cancelReply: string;
233
+ preview: string;
234
+ emoji: string;
235
+ uploadImage: string;
236
+ profile: string;
237
+ logout: string;
211
238
  }
212
239
 
213
240
  interface WalineProps {
@@ -601,4 +628,4 @@ interface WalineRecentCommentsResult {
601
628
  }
602
629
  declare const RecentComments: ({ el, serverURL, count, lang, }: WalineRecentCommentsOptions) => Promise<WalineRecentCommentsResult>;
603
630
 
604
- export { RecentComments, WalineAbort, WalineComment, WalineCommentCountOptions, WalineCommentData, WalineCommentStatus, WalineDateLocale, WalineEmojiInfo, WalineEmojiMaps, WalineHighlighter, WalineImageUploader, WalineInitOptions, WalineInstance, WalineLevelLocale, WalineLocale, WalineMeta, WalinePageviewCountOptions, WalineProps, WalineRecentCommentsOptions, WalineRecentCommentsResult, WalineSearchOptions, WalineSearchResult, WalineTexRenderer, commentCount, defaultLocales, init, pageviewCount, version };
631
+ export { RecentComments, WalineAbort, WalineComment, WalineCommentCountOptions, WalineCommentData, WalineCommentStatus, WalineDateLocale, WalineEmojiInfo, WalineEmojiMaps, WalineHighlighter, WalineImageUploader, WalineInitOptions, WalineInstance, WalineLevelLocale, WalineLocale, WalineMeta, WalinePageviewCountOptions, WalineProps, WalineReactionLocale, WalineRecentCommentsOptions, WalineRecentCommentsResult, WalineSearchImageData, WalineSearchOptions, WalineSearchResult, WalineTexRenderer, commentCount, defaultLocales, init, pageviewCount, version };
package/dist/waline.d.ts CHANGED
@@ -37,39 +37,64 @@ interface WalineEmojiInfo {
37
37
  items: string[];
38
38
  }
39
39
  declare type WalineEmojiMaps = Record<string, string>;
40
- interface WalineSearchResult extends Record<string, unknown> {
40
+ interface WalineSearchImageData extends Record<string, unknown> {
41
41
  /**
42
+ * 图片链接
43
+ *
42
44
  * Image link
43
45
  */
44
46
  src: string;
45
47
  /**
46
- * Image title, optional
48
+ * 图片标题
49
+ *
50
+ * @description 用于图片的 alt 属性
51
+ *
52
+ * Image title
53
+ *
54
+ * @description Used for alt attribute of image
47
55
  */
48
56
  title?: string;
49
57
  /**
50
- * Image preview link, optional
58
+ * 图片缩略图
59
+ *
60
+ * @description 为了更好的加载性能,我们会优先在列表中使用此缩略图
61
+ *
62
+ * Image preview link
63
+ *
64
+ * @description For better loading performance, we will use this thumbnail first in the list
51
65
  *
52
66
  * @default src
53
67
  */
54
68
  preview?: string;
55
69
  }
70
+ declare type WalineSearchResult = WalineSearchImageData[];
56
71
  interface WalineSearchOptions {
57
72
  /**
73
+ * 搜索操作
74
+ *
58
75
  * Search action
59
76
  */
60
- search: (word: string) => Promise<WalineSearchResult[]>;
77
+ search: (word: string) => Promise<WalineSearchResult>;
61
78
  /**
62
- * Default search action
79
+ * 打开列表时展示的默认结果
80
+ *
81
+ * Default result when opening list
63
82
  *
64
83
  * @default () => search('')
65
84
  */
66
- default?: () => Promise<WalineSearchResult[]>;
85
+ default?: () => Promise<WalineSearchResult>;
67
86
  /**
87
+ * 获取更多的操作
88
+ *
89
+ * @description 会在列表滚动到底部时触发,如果你的搜索服务支持分页功能,你应该设置此项实现无限滚动
90
+ *
68
91
  * Fetch more action
69
92
  *
93
+ * @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
94
+ *
70
95
  * @default (word) => search(word)
71
96
  */
72
- more?: (word: string, currectCount: number) => Promise<WalineSearchResult[]>;
97
+ more?: (word: string, currectCount: number) => Promise<WalineSearchResult>;
73
98
  }
74
99
  declare type WalineMeta = 'nick' | 'mail' | 'link';
75
100
  declare type WalineImageUploader = (image: File) => Promise<string>;
@@ -160,37 +185,37 @@ interface WalineDateLocale {
160
185
  now: string;
161
186
  }
162
187
  declare type WalineLevelLocale = Record<`level${number}`, string>;
163
- interface WalineLocale extends WalineDateLocale, WalineLevelLocale {
188
+ interface WalineReactionLocale {
189
+ reactionTitle: string;
190
+ reaction0: string;
191
+ reaction1: string;
192
+ reaction2: string;
193
+ reaction3: string;
194
+ reaction4: string;
195
+ reaction5: string;
196
+ reaction6: string;
197
+ reaction7: string;
198
+ reaction8: string;
199
+ }
200
+ interface WalineLocale extends WalineDateLocale, WalineLevelLocale, WalineReactionLocale {
164
201
  nick: string;
165
- nickError: string;
166
202
  mail: string;
167
- mailError: string;
168
203
  link: string;
169
204
  optional: string;
170
205
  placeholder: string;
171
206
  sofa: string;
172
207
  submit: string;
173
- like: string;
174
- cancelLike: string;
175
- reply: string;
176
- cancelReply: string;
177
208
  comment: string;
178
209
  refresh: string;
179
210
  more: string;
180
- preview: string;
181
- emoji: string;
182
- uploadImage: string;
183
211
  uploading: string;
184
212
  login: string;
185
- logout: string;
186
213
  admin: string;
187
214
  sticky: string;
188
215
  word: string;
189
- wordHint: string;
190
216
  anonymous: string;
191
217
  gif: string;
192
218
  gifSearchPlaceholder: string;
193
- profile: string;
194
219
  approved: string;
195
220
  waiting: string;
196
221
  spam: string;
@@ -198,16 +223,18 @@ interface WalineLocale extends WalineDateLocale, WalineLevelLocale {
198
223
  oldest: string;
199
224
  latest: string;
200
225
  hottest: string;
201
- reactionTitle: string;
202
- reaction0: string;
203
- reaction1: string;
204
- reaction2: string;
205
- reaction3: string;
206
- reaction4: string;
207
- reaction5: string;
208
- reaction6: string;
209
- reaction7: string;
210
- reaction8: string;
226
+ nickError: string;
227
+ mailError: string;
228
+ wordHint: string;
229
+ like: string;
230
+ cancelLike: string;
231
+ reply: string;
232
+ cancelReply: string;
233
+ preview: string;
234
+ emoji: string;
235
+ uploadImage: string;
236
+ profile: string;
237
+ logout: string;
211
238
  }
212
239
 
213
240
  interface WalineProps {
@@ -601,4 +628,4 @@ interface WalineRecentCommentsResult {
601
628
  }
602
629
  declare const RecentComments: ({ el, serverURL, count, lang, }: WalineRecentCommentsOptions) => Promise<WalineRecentCommentsResult>;
603
630
 
604
- export { RecentComments, WalineAbort, WalineComment, WalineCommentCountOptions, WalineCommentData, WalineCommentStatus, WalineDateLocale, WalineEmojiInfo, WalineEmojiMaps, WalineHighlighter, WalineImageUploader, WalineInitOptions, WalineInstance, WalineLevelLocale, WalineLocale, WalineMeta, WalinePageviewCountOptions, WalineProps, WalineRecentCommentsOptions, WalineRecentCommentsResult, WalineSearchOptions, WalineSearchResult, WalineTexRenderer, commentCount, defaultLocales, init, pageviewCount, version };
631
+ export { RecentComments, WalineAbort, WalineComment, WalineCommentCountOptions, WalineCommentData, WalineCommentStatus, WalineDateLocale, WalineEmojiInfo, WalineEmojiMaps, WalineHighlighter, WalineImageUploader, WalineInitOptions, WalineInstance, WalineLevelLocale, WalineLocale, WalineMeta, WalinePageviewCountOptions, WalineProps, WalineReactionLocale, WalineRecentCommentsOptions, WalineRecentCommentsResult, WalineSearchImageData, WalineSearchOptions, WalineSearchResult, WalineTexRenderer, commentCount, defaultLocales, init, pageviewCount, version };