@waline/client 1.4.0 → 1.5.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.
@@ -106,7 +106,8 @@ interface EmojiInfo {
106
106
  declare type EmojiMaps = Record<string, string>;
107
107
  declare type Meta = 'nick' | 'mail' | 'link';
108
108
  declare type UploadImage = (image: File) => Promise<string>;
109
- declare type PreviewMath = (blockMode: boolean, tex: string) => string;
109
+ declare type Highlighter = ((code: string, lang: string) => string) | ((code: string, lang: string, callback?: (error: unknown | undefined, code?: string) => void) => void);
110
+ declare type TexRenderer = (blockMode: boolean, tex: string) => string;
110
111
  interface DeprecatedValineOptions {
111
112
  /**
112
113
  * @deprecated Use `locale.placeholder` instead, will be dropped in V2
@@ -214,6 +215,14 @@ interface DeprecatedValineOptions {
214
215
  * @default 微博表情包
215
216
  */
216
217
  emojiMaps?: EmojiMaps;
218
+ /**
219
+ * @deprecated Use `tex` instead
220
+ *
221
+ * 自定义 Tex 处理方法,用于预览。
222
+ *
223
+ * Custom math formula parse callback for preview.
224
+ */
225
+ previewMath?: TexRenderer | false;
217
226
  /**
218
227
  * @deprecated Use `login` instead, will be dropped in V2
219
228
  *
@@ -370,10 +379,8 @@ interface WalineOptions extends DeprecatedValineOptions {
370
379
  * 代码高亮
371
380
  *
372
381
  * Code highlighting
373
- *
374
- * @default true
375
382
  */
376
- highlight?: boolean;
383
+ highlight?: Highlighter | false;
377
384
  /**
378
385
  * 设置表情包
379
386
  *
@@ -397,7 +404,7 @@ interface WalineOptions extends DeprecatedValineOptions {
397
404
  *
398
405
  * Custom math formula parse callback for preview.
399
406
  */
400
- previewMath?: PreviewMath | false;
407
+ tex?: TexRenderer | false;
401
408
  /**
402
409
  *
403
410
  * 登录模式状态,可选值: