fix: export type Level for external use (#2354)

Export type `Level` to externally work with levels that are passed to the `setHeading` and `toggleHeading` commands, instead of only being able to pass literal numbers.

Example:
```
// where `selectedHeadingLevel` changes as part of other logic
this.editor.commands.toggleHeading({ level: this.selectedHeadingLevel })
```

Co-authored-by: Britta Weiland <weiland@bryter.io>
This commit is contained in:
Britta Weiland
2022-01-05 09:15:47 +01:00
committed by GitHub
parent 17363afde0
commit 77095c4d52

View File

@@ -1,6 +1,6 @@
import { Node, mergeAttributes, textblockTypeInputRule } from '@tiptap/core' import { Node, mergeAttributes, textblockTypeInputRule } from '@tiptap/core'
type Level = 1 | 2 | 3 | 4 | 5 | 6 export type Level = 1 | 2 | 3 | 4 | 5 | 6
export interface HeadingOptions { export interface HeadingOptions {
levels: Level[], levels: Level[],