From 1375ba7a4065df3e3c87bd6793c08603de5e8cda Mon Sep 17 00:00:00 2001 From: Sunny Hirai Date: Sat, 13 Mar 2021 18:44:14 -0800 Subject: [PATCH] Adjust CustomText in documentation --- docs/concepts/11-typescript.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/concepts/11-typescript.md b/docs/concepts/11-typescript.md index 74fcb2f6a..2408498dc 100644 --- a/docs/concepts/11-typescript.md +++ b/docs/concepts/11-typescript.md @@ -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 } } ```