mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-06-11 11:45:15 +08:00
fix: update getPos
type inside NodeViewRendererProps
(#5623)
This commit is contained in:
parent
14afcadd7b
commit
37913d5633
9
.changeset/green-wolves-arrive.md
Normal file
9
.changeset/green-wolves-arrive.md
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
"@tiptap/core": major
|
||||||
|
---
|
||||||
|
|
||||||
|
Fix `getPos` type in `NodeViewRendererProps` to potentially be `undefined`
|
||||||
|
|
||||||
|
Breaking change: Types may flag uses of getPos where an `undefined` possibility isn't handled.
|
||||||
|
Why this change was made: To ensure the type reflects the real functionality of this function.
|
||||||
|
How to update: Ensure that the return value of `getPos` exists before making use of the value.
|
@ -236,7 +236,7 @@ export type NodeViewRendererProps = {
|
|||||||
// pass-through from prosemirror
|
// pass-through from prosemirror
|
||||||
node: Parameters<NodeViewConstructor>[0];
|
node: Parameters<NodeViewConstructor>[0];
|
||||||
view: Parameters<NodeViewConstructor>[1];
|
view: Parameters<NodeViewConstructor>[1];
|
||||||
getPos: () => number; // TODO getPos was incorrectly typed before, change to `Parameters<NodeViewConstructor>[2];` in the next major version
|
getPos: Parameters<NodeViewConstructor>[2];
|
||||||
decorations: Parameters<NodeViewConstructor>[3];
|
decorations: Parameters<NodeViewConstructor>[3];
|
||||||
innerDecorations: Parameters<NodeViewConstructor>[4];
|
innerDecorations: Parameters<NodeViewConstructor>[4];
|
||||||
// tiptap-specific
|
// tiptap-specific
|
||||||
|
Loading…
Reference in New Issue
Block a user