2025-10-15 11:29:20 +08:00
|
|
|
import { SlateDescendant } from '@wangeditor-next/editor'
|
2023-02-11 00:44:00 +08:00
|
|
|
|
|
|
|
|
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[]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|