@tiptap/extension-character-count 2.0.0-beta.2 → 2.0.0-beta.200

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -7,8 +7,8 @@
7
7
  ## Introduction
8
8
  tiptap is a headless wrapper around [ProseMirror](https://ProseMirror.net) – a toolkit for building rich text WYSIWYG editors, which is already in use at many well-known companies such as *New York Times*, *The Guardian* or *Atlassian*.
9
9
 
10
- ## Offical Documentation
10
+ ## Official Documentation
11
11
  Documentation can be found on the [tiptap website](https://tiptap.dev).
12
12
 
13
13
  ## License
14
- tiptap is open sourced software licensed under the [MIT license](https://github.com/ueberdosis/tiptap-next/blob/main/LICENSE.md).
14
+ tiptap is open sourced software licensed under the [MIT license](https://github.com/ueberdosis/tiptap/blob/main/LICENSE.md).
@@ -1,7 +1,28 @@
1
1
  import { Extension } from '@tiptap/core';
2
- import { PluginKey } from 'prosemirror-state';
3
- export declare const pluginKey: PluginKey<any, any>;
2
+ import { Node as ProseMirrorNode } from 'prosemirror-model';
4
3
  export interface CharacterCountOptions {
5
- limit?: number;
4
+ /**
5
+ * The maximum number of characters that should be allowed. Defaults to `0`.
6
+ */
7
+ limit: number | null | undefined;
8
+ /**
9
+ * The mode by which the size is calculated. Defaults to 'textSize'.
10
+ */
11
+ mode: 'textSize' | 'nodeSize';
6
12
  }
7
- export declare const CharacterCount: Extension<CharacterCountOptions>;
13
+ export interface CharacterCountStorage {
14
+ /**
15
+ * Get the number of characters for the current document.
16
+ */
17
+ characters: (options?: {
18
+ node?: ProseMirrorNode;
19
+ mode?: 'textSize' | 'nodeSize';
20
+ }) => number;
21
+ /**
22
+ * Get the number of words for the current document.
23
+ */
24
+ words: (options?: {
25
+ node?: ProseMirrorNode;
26
+ }) => number;
27
+ }
28
+ export declare const CharacterCount: Extension<CharacterCountOptions, CharacterCountStorage>;