dongyukun
2024-11-15 1d160a52bb6d146d6130e449af0f57ba92cbe015
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[]
    }
  }
}