Skip to content

Commit

Permalink
fix: export type Level for external use (#2354)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
webri and Britta Weiland authored Jan 5, 2022
1 parent 17363af commit 77095c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/extension-heading/src/heading.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
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 {
levels: Level[],
Expand Down

0 comments on commit 77095c4

Please sign in to comment.