1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-22 15:02:51 +02:00

Improve custom-types in slate unit tests

This commit is contained in:
Sunny Hirai
2021-03-29 08:58:58 -07:00
parent b5cb9ee6db
commit 39ba9aadd7

View File

@@ -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