dongyukun
2025-06-11 be8c88629deffba4c6adc894f641f5010d64d9ce
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import { SlateDescendant } from '@wangeditor/editor'
 
declare module 'slate' {
  interface CustomTypes {
    // 扩展 text
    Text: {
      text: string
      bold?: boolean
      italic?: boolean
      code?: boolean
      through?: boolean
      underline?: boolean
      sup?: boolean
      sub?: boolean
      color?: string
      bgColor?: string
      fontSize?: string
      fontFamily?: string
    }
 
    // 扩展 Element 的 type 属性
    Element: {
      type: string
      children: SlateDescendant[]
    }
  }
}