mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-22 23:12:52 +02:00
Improve custom-types in slate unit tests
This commit is contained in:
@@ -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 {
|
import {
|
||||||
BaseText,
|
|
||||||
BaseEditor,
|
BaseEditor,
|
||||||
BaseSelection,
|
BaseSelection,
|
||||||
BasePoint,
|
BasePoint,
|
||||||
BaseRange,
|
BaseRange,
|
||||||
BaseElement,
|
Descendant,
|
||||||
} from 'slate'
|
} from 'slate'
|
||||||
// import { Prettify } from './prettify'
|
|
||||||
|
|
||||||
export type HeadingElement = {
|
export type HeadingElement = {
|
||||||
type: 'heading'
|
type: 'heading'
|
||||||
level: number
|
level: number
|
||||||
} & BaseElement
|
children: Descendant[]
|
||||||
|
}
|
||||||
|
|
||||||
export type ListItemElement = {
|
export type ListItemElement = {
|
||||||
type: 'list-item'
|
type: 'list-item'
|
||||||
depth: number
|
depth: number
|
||||||
} & BaseElement
|
children: Descendant[]
|
||||||
|
}
|
||||||
|
|
||||||
export type CustomText = {
|
export type CustomText = {
|
||||||
placeholder: string
|
placeholder?: string
|
||||||
bold: boolean
|
bold?: boolean
|
||||||
italic: boolean
|
italic?: boolean
|
||||||
} & BaseText
|
text: string
|
||||||
|
}
|
||||||
|
|
||||||
export type CustomElement = HeadingElement | ListItemElement
|
export type CustomElement = HeadingElement | ListItemElement
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user