From ed7f93a2b84234b365f74ff39424f72ca5cf42ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20K=C3=BChn?= Date: Fri, 10 Dec 2021 17:41:36 +0100 Subject: [PATCH] fix: mark characterCount storage method types as optional --- .../src/character-count.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/extension-character-count/src/character-count.ts b/packages/extension-character-count/src/character-count.ts index b4a0ca7e9e1..010c4a956d9 100644 --- a/packages/extension-character-count/src/character-count.ts +++ b/packages/extension-character-count/src/character-count.ts @@ -17,7 +17,7 @@ export interface CharacterCountStorage { /** * Get the number of characters for the current document. */ - characters?: (options?: { + characters: (options?: { node?: ProseMirrorNode, mode?: 'textSize' | 'nodeSize', }) => number, @@ -25,7 +25,7 @@ export interface CharacterCountStorage { /** * Get the number of words for the current document. */ - words?: (options?: { + words: (options?: { node?: ProseMirrorNode, }) => number, } @@ -42,8 +42,8 @@ export const CharacterCount = Extension.create 0, + words: () => 0, } }, @@ -84,8 +84,8 @@ export const CharacterCount = Extension.create limit) { return false