From 39ba9aadd7ae34c3897ee053229f2986d799b0b9 Mon Sep 17 00:00:00 2001 From: Sunny Hirai Date: Mon, 29 Mar 2021 08:58:58 -0700 Subject: [PATCH] Improve custom-types in slate unit tests --- .../interfaces/CustomTypes/custom-types.ts | 52 ++++--------------- 1 file changed, 10 insertions(+), 42 deletions(-) diff --git a/packages/slate/test/interfaces/CustomTypes/custom-types.ts b/packages/slate/test/interfaces/CustomTypes/custom-types.ts index 13b60661b..a15f46555 100644 --- a/packages/slate/test/interfaces/CustomTypes/custom-types.ts +++ b/packages/slate/test/interfaces/CustomTypes/custom-types.ts @@ -1,61 +1,29 @@ -// import { Descendant, Element, Text, CustomTypes, BaseText } from 'slate' - -// export type HeadingElement = { -// type: 'heading' -// level: number -// children: Descendant[] -// } - -// export type ListItemElement = { -// type: 'list-item' -// depth: number -// children: Descendant[] -// } - -// export type CustomText = { -// placeholder: string -// bold: boolean -// italic: boolean -// text: string -// } - -// export type BoldCustomText = { -// bold: boolean -// text: string -// } - -// declare module 'slate' { -// interface CustomTypes { -// Element: HeadingElement | ListItemElement -// Text: CustomText -// } -// } - import { - BaseText, BaseEditor, BaseSelection, BasePoint, BaseRange, - BaseElement, + Descendant, } from 'slate' -// import { Prettify } from './prettify' export type HeadingElement = { type: 'heading' level: number -} & BaseElement + children: Descendant[] +} export type ListItemElement = { type: 'list-item' depth: number -} & BaseElement + children: Descendant[] +} export type CustomText = { - placeholder: string - bold: boolean - italic: boolean -} & BaseText + placeholder?: string + bold?: boolean + italic?: boolean + text: string +} export type CustomElement = HeadingElement | ListItemElement