diff --git a/src/constants.ts b/src/constants.ts index e5a3b23..6f0d1a8 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -147,6 +147,10 @@ export interface RichTextListCheckNode extends RichTextListNode { listType: "check"; } +export interface RichTextLinebreakNode extends RichTextNode { + type: "linebreak"; +} + export interface RichTextTextNode extends RichTextNode { type: "text"; format: number; @@ -218,6 +222,9 @@ export const isListNodeBulletListNode = (node: RichTextListNode): node is RichTe export const isListNodeCheckListNode = (node: RichTextListNode): node is RichTextListCheckNode => node.listType === "check"; +export const isNodeLinebreakNode = (node: RichTextNode): node is RichTextLinebreakNode => + node.type === "linebreak"; + export const isNodeTextNode = (node: RichTextNode): node is RichTextTextNode => node.type === "text";