1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-28 09:29:49 +02:00

Adjust CustomText in documentation

This commit is contained in:
Sunny Hirai
2021-03-13 18:44:14 -08:00
parent 03e774bed8
commit 1375ba7a40

View File

@@ -11,10 +11,12 @@ To define a custom `Element` or `Text` type, extend the `CustomTypes` interface
```ts
import { Descendant } from 'slate'
type CustomText = { text: string; bold: boolean; italic: boolean }
declare module 'slate' {
interface CustomTypes {
Element: { type: 'paragraph'; children: Descendant[] }
Text: { text: string; bold: boolean; italic: boolean }
Element: { type: 'paragraph'; children: CustomText[] }
Text: CustomText
}
}
```