@tiptap/core 2.6.2 → 3.0.0-next.1

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.
Files changed (175) hide show
  1. package/dist/index.cjs +4673 -4608
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.cts +3452 -0
  4. package/dist/index.d.ts +3452 -0
  5. package/dist/index.js +4573 -4511
  6. package/dist/index.js.map +1 -1
  7. package/package.json +6 -8
  8. package/src/ExtensionManager.ts +2 -1
  9. package/src/helpers/getAttributesFromExtensions.ts +1 -1
  10. package/src/helpers/getSchemaByResolvedExtensions.ts +1 -1
  11. package/src/helpers/isList.ts +1 -1
  12. package/src/style.ts +2 -6
  13. package/dist/index.umd.js +0 -5159
  14. package/dist/index.umd.js.map +0 -1
  15. package/dist/packages/core/src/CommandManager.d.ts +0 -20
  16. package/dist/packages/core/src/Editor.d.ts +0 -163
  17. package/dist/packages/core/src/EventEmitter.d.ts +0 -11
  18. package/dist/packages/core/src/Extension.d.ts +0 -344
  19. package/dist/packages/core/src/ExtensionManager.d.ts +0 -55
  20. package/dist/packages/core/src/InputRule.d.ts +0 -42
  21. package/dist/packages/core/src/Mark.d.ts +0 -452
  22. package/dist/packages/core/src/Node.d.ts +0 -612
  23. package/dist/packages/core/src/NodePos.d.ts +0 -44
  24. package/dist/packages/core/src/NodeView.d.ts +0 -31
  25. package/dist/packages/core/src/PasteRule.d.ts +0 -50
  26. package/dist/packages/core/src/Tracker.d.ts +0 -11
  27. package/dist/packages/core/src/commands/blur.d.ts +0 -13
  28. package/dist/packages/core/src/commands/clearContent.d.ts +0 -14
  29. package/dist/packages/core/src/commands/clearNodes.d.ts +0 -13
  30. package/dist/packages/core/src/commands/command.d.ts +0 -18
  31. package/dist/packages/core/src/commands/createParagraphNear.d.ts +0 -13
  32. package/dist/packages/core/src/commands/cut.d.ts +0 -20
  33. package/dist/packages/core/src/commands/deleteCurrentNode.d.ts +0 -13
  34. package/dist/packages/core/src/commands/deleteNode.d.ts +0 -15
  35. package/dist/packages/core/src/commands/deleteRange.d.ts +0 -14
  36. package/dist/packages/core/src/commands/deleteSelection.d.ts +0 -13
  37. package/dist/packages/core/src/commands/enter.d.ts +0 -13
  38. package/dist/packages/core/src/commands/exitCode.d.ts +0 -13
  39. package/dist/packages/core/src/commands/extendMarkRange.d.ts +0 -25
  40. package/dist/packages/core/src/commands/first.d.ts +0 -14
  41. package/dist/packages/core/src/commands/focus.d.ts +0 -27
  42. package/dist/packages/core/src/commands/forEach.d.ts +0 -14
  43. package/dist/packages/core/src/commands/index.d.ts +0 -55
  44. package/dist/packages/core/src/commands/insertContent.d.ts +0 -34
  45. package/dist/packages/core/src/commands/insertContentAt.d.ts +0 -47
  46. package/dist/packages/core/src/commands/join.d.ts +0 -41
  47. package/dist/packages/core/src/commands/joinItemBackward.d.ts +0 -13
  48. package/dist/packages/core/src/commands/joinItemForward.d.ts +0 -13
  49. package/dist/packages/core/src/commands/joinTextblockBackward.d.ts +0 -12
  50. package/dist/packages/core/src/commands/joinTextblockForward.d.ts +0 -12
  51. package/dist/packages/core/src/commands/keyboardShortcut.d.ts +0 -14
  52. package/dist/packages/core/src/commands/lift.d.ts +0 -17
  53. package/dist/packages/core/src/commands/liftEmptyBlock.d.ts +0 -13
  54. package/dist/packages/core/src/commands/liftListItem.d.ts +0 -15
  55. package/dist/packages/core/src/commands/newlineInCode.d.ts +0 -13
  56. package/dist/packages/core/src/commands/resetAttributes.d.ts +0 -16
  57. package/dist/packages/core/src/commands/scrollIntoView.d.ts +0 -13
  58. package/dist/packages/core/src/commands/selectAll.d.ts +0 -13
  59. package/dist/packages/core/src/commands/selectNodeBackward.d.ts +0 -13
  60. package/dist/packages/core/src/commands/selectNodeForward.d.ts +0 -13
  61. package/dist/packages/core/src/commands/selectParentNode.d.ts +0 -13
  62. package/dist/packages/core/src/commands/selectTextblockEnd.d.ts +0 -13
  63. package/dist/packages/core/src/commands/selectTextblockStart.d.ts +0 -13
  64. package/dist/packages/core/src/commands/setContent.d.ts +0 -40
  65. package/dist/packages/core/src/commands/setMark.d.ts +0 -15
  66. package/dist/packages/core/src/commands/setMeta.d.ts +0 -16
  67. package/dist/packages/core/src/commands/setNode.d.ts +0 -16
  68. package/dist/packages/core/src/commands/setNodeSelection.d.ts +0 -14
  69. package/dist/packages/core/src/commands/setTextSelection.d.ts +0 -14
  70. package/dist/packages/core/src/commands/sinkListItem.d.ts +0 -15
  71. package/dist/packages/core/src/commands/splitBlock.d.ts +0 -17
  72. package/dist/packages/core/src/commands/splitListItem.d.ts +0 -16
  73. package/dist/packages/core/src/commands/toggleList.d.ts +0 -18
  74. package/dist/packages/core/src/commands/toggleMark.d.ts +0 -30
  75. package/dist/packages/core/src/commands/toggleNode.d.ts +0 -17
  76. package/dist/packages/core/src/commands/toggleWrap.d.ts +0 -16
  77. package/dist/packages/core/src/commands/undoInputRule.d.ts +0 -13
  78. package/dist/packages/core/src/commands/unsetAllMarks.d.ts +0 -13
  79. package/dist/packages/core/src/commands/unsetMark.d.ts +0 -25
  80. package/dist/packages/core/src/commands/updateAttributes.d.ts +0 -24
  81. package/dist/packages/core/src/commands/wrapIn.d.ts +0 -16
  82. package/dist/packages/core/src/commands/wrapInList.d.ts +0 -16
  83. package/dist/packages/core/src/extensions/clipboardTextSerializer.d.ts +0 -5
  84. package/dist/packages/core/src/extensions/commands.d.ts +0 -3
  85. package/dist/packages/core/src/extensions/editable.d.ts +0 -2
  86. package/dist/packages/core/src/extensions/focusEvents.d.ts +0 -2
  87. package/dist/packages/core/src/extensions/index.d.ts +0 -6
  88. package/dist/packages/core/src/extensions/keymap.d.ts +0 -2
  89. package/dist/packages/core/src/extensions/tabindex.d.ts +0 -2
  90. package/dist/packages/core/src/helpers/combineTransactionSteps.d.ts +0 -10
  91. package/dist/packages/core/src/helpers/createChainableState.d.ts +0 -10
  92. package/dist/packages/core/src/helpers/createDocument.d.ts +0 -12
  93. package/dist/packages/core/src/helpers/createNodeFromContent.d.ts +0 -15
  94. package/dist/packages/core/src/helpers/defaultBlockAt.d.ts +0 -7
  95. package/dist/packages/core/src/helpers/findChildren.d.ts +0 -9
  96. package/dist/packages/core/src/helpers/findChildrenInRange.d.ts +0 -10
  97. package/dist/packages/core/src/helpers/findParentNode.d.ts +0 -16
  98. package/dist/packages/core/src/helpers/findParentNodeClosestToPos.d.ts +0 -17
  99. package/dist/packages/core/src/helpers/generateHTML.d.ts +0 -8
  100. package/dist/packages/core/src/helpers/generateJSON.d.ts +0 -8
  101. package/dist/packages/core/src/helpers/generateText.d.ts +0 -12
  102. package/dist/packages/core/src/helpers/getAttributes.d.ts +0 -9
  103. package/dist/packages/core/src/helpers/getAttributesFromExtensions.d.ts +0 -6
  104. package/dist/packages/core/src/helpers/getChangedRanges.d.ts +0 -11
  105. package/dist/packages/core/src/helpers/getDebugJSON.d.ts +0 -8
  106. package/dist/packages/core/src/helpers/getExtensionField.d.ts +0 -9
  107. package/dist/packages/core/src/helpers/getHTMLFromFragment.d.ts +0 -2
  108. package/dist/packages/core/src/helpers/getMarkAttributes.d.ts +0 -3
  109. package/dist/packages/core/src/helpers/getMarkRange.d.ts +0 -3
  110. package/dist/packages/core/src/helpers/getMarkType.d.ts +0 -2
  111. package/dist/packages/core/src/helpers/getMarksBetween.d.ts +0 -3
  112. package/dist/packages/core/src/helpers/getNodeAtPosition.d.ts +0 -11
  113. package/dist/packages/core/src/helpers/getNodeAttributes.d.ts +0 -3
  114. package/dist/packages/core/src/helpers/getNodeType.d.ts +0 -2
  115. package/dist/packages/core/src/helpers/getRenderedAttributes.d.ts +0 -3
  116. package/dist/packages/core/src/helpers/getSchema.d.ts +0 -4
  117. package/dist/packages/core/src/helpers/getSchemaByResolvedExtensions.d.ts +0 -10
  118. package/dist/packages/core/src/helpers/getSchemaTypeByName.d.ts +0 -8
  119. package/dist/packages/core/src/helpers/getSchemaTypeNameByName.d.ts +0 -8
  120. package/dist/packages/core/src/helpers/getSplittedAttributes.d.ts +0 -9
  121. package/dist/packages/core/src/helpers/getText.d.ts +0 -15
  122. package/dist/packages/core/src/helpers/getTextBetween.d.ts +0 -14
  123. package/dist/packages/core/src/helpers/getTextContentFromNodes.d.ts +0 -8
  124. package/dist/packages/core/src/helpers/getTextSerializersFromSchema.d.ts +0 -8
  125. package/dist/packages/core/src/helpers/index.d.ts +0 -50
  126. package/dist/packages/core/src/helpers/injectExtensionAttributesToParseRule.d.ts +0 -9
  127. package/dist/packages/core/src/helpers/isActive.d.ts +0 -2
  128. package/dist/packages/core/src/helpers/isAtEndOfNode.d.ts +0 -2
  129. package/dist/packages/core/src/helpers/isAtStartOfNode.d.ts +0 -2
  130. package/dist/packages/core/src/helpers/isExtensionRulesEnabled.d.ts +0 -2
  131. package/dist/packages/core/src/helpers/isList.d.ts +0 -2
  132. package/dist/packages/core/src/helpers/isMarkActive.d.ts +0 -3
  133. package/dist/packages/core/src/helpers/isNodeActive.d.ts +0 -3
  134. package/dist/packages/core/src/helpers/isNodeEmpty.d.ts +0 -14
  135. package/dist/packages/core/src/helpers/isNodeSelection.d.ts +0 -2
  136. package/dist/packages/core/src/helpers/isTextSelection.d.ts +0 -2
  137. package/dist/packages/core/src/helpers/posToDOMRect.d.ts +0 -2
  138. package/dist/packages/core/src/helpers/resolveFocusPosition.d.ts +0 -4
  139. package/dist/packages/core/src/helpers/selectionToInsertionEnd.d.ts +0 -2
  140. package/dist/packages/core/src/helpers/splitExtensions.d.ts +0 -9
  141. package/dist/packages/core/src/index.d.ts +0 -24
  142. package/dist/packages/core/src/inputRules/index.d.ts +0 -5
  143. package/dist/packages/core/src/inputRules/markInputRule.d.ts +0 -13
  144. package/dist/packages/core/src/inputRules/nodeInputRule.d.ts +0 -23
  145. package/dist/packages/core/src/inputRules/textInputRule.d.ts +0 -10
  146. package/dist/packages/core/src/inputRules/textblockTypeInputRule.d.ts +0 -15
  147. package/dist/packages/core/src/inputRules/wrappingInputRule.d.ts +0 -28
  148. package/dist/packages/core/src/pasteRules/index.d.ts +0 -3
  149. package/dist/packages/core/src/pasteRules/markPasteRule.d.ts +0 -13
  150. package/dist/packages/core/src/pasteRules/nodePasteRule.d.ts +0 -14
  151. package/dist/packages/core/src/pasteRules/textPasteRule.d.ts +0 -10
  152. package/dist/packages/core/src/style.d.ts +0 -1
  153. package/dist/packages/core/src/types.d.ts +0 -253
  154. package/dist/packages/core/src/utilities/callOrReturn.d.ts +0 -9
  155. package/dist/packages/core/src/utilities/createStyleTag.d.ts +0 -1
  156. package/dist/packages/core/src/utilities/deleteProps.d.ts +0 -6
  157. package/dist/packages/core/src/utilities/elementFromString.d.ts +0 -1
  158. package/dist/packages/core/src/utilities/escapeForRegEx.d.ts +0 -1
  159. package/dist/packages/core/src/utilities/findDuplicates.d.ts +0 -1
  160. package/dist/packages/core/src/utilities/fromString.d.ts +0 -1
  161. package/dist/packages/core/src/utilities/index.d.ts +0 -20
  162. package/dist/packages/core/src/utilities/isAndroid.d.ts +0 -1
  163. package/dist/packages/core/src/utilities/isEmptyObject.d.ts +0 -1
  164. package/dist/packages/core/src/utilities/isFunction.d.ts +0 -1
  165. package/dist/packages/core/src/utilities/isMacOS.d.ts +0 -1
  166. package/dist/packages/core/src/utilities/isNumber.d.ts +0 -1
  167. package/dist/packages/core/src/utilities/isPlainObject.d.ts +0 -1
  168. package/dist/packages/core/src/utilities/isRegExp.d.ts +0 -1
  169. package/dist/packages/core/src/utilities/isString.d.ts +0 -1
  170. package/dist/packages/core/src/utilities/isiOS.d.ts +0 -1
  171. package/dist/packages/core/src/utilities/mergeAttributes.d.ts +0 -1
  172. package/dist/packages/core/src/utilities/mergeDeep.d.ts +0 -1
  173. package/dist/packages/core/src/utilities/minMax.d.ts +0 -1
  174. package/dist/packages/core/src/utilities/objectIncludes.d.ts +0 -8
  175. package/dist/packages/core/src/utilities/removeDuplicates.d.ts +0 -8
@@ -0,0 +1,3452 @@
1
+ import { EditorState, Plugin, Transaction, PluginKey, Selection, NodeSelection, TextSelection } from '@tiptap/pm/state';
2
+ import { NodeType, NodeSpec, Node as Node$1, DOMOutputSpec, MarkType, MarkSpec, Mark as Mark$1, ParseOptions, Schema, ResolvedPos, Fragment, ContentMatch, ParseRule } from '@tiptap/pm/model';
3
+ import { NodeView as NodeView$1, EditorProps, EditorView, Decoration } from '@tiptap/pm/view';
4
+ import { Transform } from '@tiptap/pm/transform';
5
+ import * as prosemirror_model from 'prosemirror-model';
6
+
7
+ type StringKeyOf<T> = Extract<keyof T, string>;
8
+ type CallbackType<T extends Record<string, any>, EventName extends StringKeyOf<T>> = T[EventName] extends any[] ? T[EventName] : [T[EventName]];
9
+ type CallbackFunction<T extends Record<string, any>, EventName extends StringKeyOf<T>> = (...props: CallbackType<T, EventName>) => any;
10
+ declare class EventEmitter<T extends Record<string, any>> {
11
+ private callbacks;
12
+ on<EventName extends StringKeyOf<T>>(event: EventName, fn: CallbackFunction<T, EventName>): this;
13
+ emit<EventName extends StringKeyOf<T>>(event: EventName, ...args: CallbackType<T, EventName>): this;
14
+ off<EventName extends StringKeyOf<T>>(event: EventName, fn?: CallbackFunction<T, EventName>): this;
15
+ removeAllListeners(): void;
16
+ }
17
+
18
+ type InputRuleMatch = {
19
+ index: number;
20
+ text: string;
21
+ replaceWith?: string;
22
+ match?: RegExpMatchArray;
23
+ data?: Record<string, any>;
24
+ };
25
+ type InputRuleFinder = RegExp | ((text: string) => InputRuleMatch | null);
26
+ declare class InputRule {
27
+ find: InputRuleFinder;
28
+ handler: (props: {
29
+ state: EditorState;
30
+ range: Range;
31
+ match: ExtendedRegExpMatchArray;
32
+ commands: SingleCommands;
33
+ chain: () => ChainedCommands;
34
+ can: () => CanCommands;
35
+ }) => void | null;
36
+ constructor(config: {
37
+ find: InputRuleFinder;
38
+ handler: (props: {
39
+ state: EditorState;
40
+ range: Range;
41
+ match: ExtendedRegExpMatchArray;
42
+ commands: SingleCommands;
43
+ chain: () => ChainedCommands;
44
+ can: () => CanCommands;
45
+ }) => void | null;
46
+ });
47
+ }
48
+ /**
49
+ * Create an input rules plugin. When enabled, it will cause text
50
+ * input that matches any of the given rules to trigger the rule’s
51
+ * action.
52
+ */
53
+ declare function inputRulesPlugin(props: {
54
+ editor: Editor;
55
+ rules: InputRule[];
56
+ }): Plugin;
57
+
58
+ type PasteRuleMatch = {
59
+ index: number;
60
+ text: string;
61
+ replaceWith?: string;
62
+ match?: RegExpMatchArray;
63
+ data?: Record<string, any>;
64
+ };
65
+ type PasteRuleFinder = RegExp | ((text: string, event?: ClipboardEvent | null) => PasteRuleMatch[] | null | undefined);
66
+ /**
67
+ * Paste rules are used to react to pasted content.
68
+ * @see https://tiptap.dev/guide/custom-extensions/#paste-rules
69
+ */
70
+ declare class PasteRule {
71
+ find: PasteRuleFinder;
72
+ handler: (props: {
73
+ state: EditorState;
74
+ range: Range;
75
+ match: ExtendedRegExpMatchArray;
76
+ commands: SingleCommands;
77
+ chain: () => ChainedCommands;
78
+ can: () => CanCommands;
79
+ pasteEvent: ClipboardEvent | null;
80
+ dropEvent: DragEvent | null;
81
+ }) => void | null;
82
+ constructor(config: {
83
+ find: PasteRuleFinder;
84
+ handler: (props: {
85
+ can: () => CanCommands;
86
+ chain: () => ChainedCommands;
87
+ commands: SingleCommands;
88
+ dropEvent: DragEvent | null;
89
+ match: ExtendedRegExpMatchArray;
90
+ pasteEvent: ClipboardEvent | null;
91
+ range: Range;
92
+ state: EditorState;
93
+ }) => void | null;
94
+ });
95
+ }
96
+ /**
97
+ * Create an paste rules plugin. When enabled, it will cause pasted
98
+ * text that matches any of the given rules to trigger the rule’s
99
+ * action.
100
+ */
101
+ declare function pasteRulesPlugin(props: {
102
+ editor: Editor;
103
+ rules: PasteRule[];
104
+ }): Plugin[];
105
+
106
+ declare module '@tiptap/core' {
107
+ interface NodeConfig<Options = any, Storage = any> {
108
+ [key: string]: any;
109
+ /**
110
+ * The extension name - this must be unique.
111
+ * It will be used to identify the extension.
112
+ *
113
+ * @example 'myExtension'
114
+ */
115
+ name: string;
116
+ /**
117
+ * The priority of your extension. The higher, the earlier it will be called
118
+ * and will take precedence over other extensions with a lower priority.
119
+ * @default 100
120
+ * @example 101
121
+ */
122
+ priority?: number;
123
+ /**
124
+ * The default options for this extension.
125
+ * @example
126
+ * defaultOptions: {
127
+ * myOption: 'foo',
128
+ * myOtherOption: 10,
129
+ * }
130
+ */
131
+ defaultOptions?: Options;
132
+ /**
133
+ * This method will add options to this extension
134
+ * @see https://tiptap.dev/guide/custom-extensions#settings
135
+ * @example
136
+ * addOptions() {
137
+ * return {
138
+ * myOption: 'foo',
139
+ * myOtherOption: 10,
140
+ * }
141
+ */
142
+ addOptions?: (this: {
143
+ name: string;
144
+ parent: Exclude<ParentConfig<NodeConfig<Options, Storage>>['addOptions'], undefined>;
145
+ }) => Options;
146
+ /**
147
+ * The default storage this extension can save data to.
148
+ * @see https://tiptap.dev/guide/custom-extensions#storage
149
+ * @example
150
+ * defaultStorage: {
151
+ * prefetchedUsers: [],
152
+ * loading: false,
153
+ * }
154
+ */
155
+ addStorage?: (this: {
156
+ name: string;
157
+ options: Options;
158
+ parent: Exclude<ParentConfig<NodeConfig<Options, Storage>>['addStorage'], undefined>;
159
+ }) => Storage;
160
+ /**
161
+ * This function adds globalAttributes to specific nodes.
162
+ * @see https://tiptap.dev/guide/custom-extensions#global-attributes
163
+ * @example
164
+ * addGlobalAttributes() {
165
+ * return [
166
+ * {
167
+ // Extend the following extensions
168
+ * types: [
169
+ * 'heading',
170
+ * 'paragraph',
171
+ * ],
172
+ * // … with those attributes
173
+ * attributes: {
174
+ * textAlign: {
175
+ * default: 'left',
176
+ * renderHTML: attributes => ({
177
+ * style: `text-align: ${attributes.textAlign}`,
178
+ * }),
179
+ * parseHTML: element => element.style.textAlign || 'left',
180
+ * },
181
+ * },
182
+ * },
183
+ * ]
184
+ * }
185
+ */
186
+ addGlobalAttributes?: (this: {
187
+ name: string;
188
+ options: Options;
189
+ storage: Storage;
190
+ extensions: (Node | Mark)[];
191
+ parent: ParentConfig<NodeConfig<Options, Storage>>['addGlobalAttributes'];
192
+ }) => GlobalAttributes;
193
+ /**
194
+ * This function adds commands to the editor
195
+ * @see https://tiptap.dev/guide/custom-extensions#keyboard-shortcuts
196
+ * @example
197
+ * addCommands() {
198
+ * return {
199
+ * myCommand: () => ({ chain }) => chain().setMark('type', 'foo').run(),
200
+ * }
201
+ * }
202
+ */
203
+ addCommands?: (this: {
204
+ name: string;
205
+ options: Options;
206
+ storage: Storage;
207
+ editor: Editor;
208
+ type: NodeType;
209
+ parent: ParentConfig<NodeConfig<Options, Storage>>['addCommands'];
210
+ }) => Partial<RawCommands>;
211
+ /**
212
+ * This function registers keyboard shortcuts.
213
+ * @see https://tiptap.dev/guide/custom-extensions#keyboard-shortcuts
214
+ * @example
215
+ * addKeyboardShortcuts() {
216
+ * return {
217
+ * 'Mod-l': () => this.editor.commands.toggleBulletList(),
218
+ * }
219
+ * },
220
+ */
221
+ addKeyboardShortcuts?: (this: {
222
+ name: string;
223
+ options: Options;
224
+ storage: Storage;
225
+ editor: Editor;
226
+ type: NodeType;
227
+ parent: ParentConfig<NodeConfig<Options, Storage>>['addKeyboardShortcuts'];
228
+ }) => {
229
+ [key: string]: KeyboardShortcutCommand;
230
+ };
231
+ /**
232
+ * This function adds input rules to the editor.
233
+ * @see https://tiptap.dev/guide/custom-extensions#input-rules
234
+ * @example
235
+ * addInputRules() {
236
+ * return [
237
+ * markInputRule({
238
+ * find: inputRegex,
239
+ * type: this.type,
240
+ * }),
241
+ * ]
242
+ * },
243
+ */
244
+ addInputRules?: (this: {
245
+ name: string;
246
+ options: Options;
247
+ storage: Storage;
248
+ editor: Editor;
249
+ type: NodeType;
250
+ parent: ParentConfig<NodeConfig<Options, Storage>>['addInputRules'];
251
+ }) => InputRule[];
252
+ /**
253
+ * This function adds paste rules to the editor.
254
+ * @see https://tiptap.dev/guide/custom-extensions#paste-rules
255
+ * @example
256
+ * addPasteRules() {
257
+ * return [
258
+ * markPasteRule({
259
+ * find: pasteRegex,
260
+ * type: this.type,
261
+ * }),
262
+ * ]
263
+ * },
264
+ */
265
+ addPasteRules?: (this: {
266
+ name: string;
267
+ options: Options;
268
+ storage: Storage;
269
+ editor: Editor;
270
+ type: NodeType;
271
+ parent: ParentConfig<NodeConfig<Options, Storage>>['addPasteRules'];
272
+ }) => PasteRule[];
273
+ /**
274
+ * This function adds Prosemirror plugins to the editor
275
+ * @see https://tiptap.dev/guide/custom-extensions#prosemirror-plugins
276
+ * @example
277
+ * addProseMirrorPlugins() {
278
+ * return [
279
+ * customPlugin(),
280
+ * ]
281
+ * }
282
+ */
283
+ addProseMirrorPlugins?: (this: {
284
+ name: string;
285
+ options: Options;
286
+ storage: Storage;
287
+ editor: Editor;
288
+ type: NodeType;
289
+ parent: ParentConfig<NodeConfig<Options, Storage>>['addProseMirrorPlugins'];
290
+ }) => Plugin[];
291
+ /**
292
+ * This function adds additional extensions to the editor. This is useful for
293
+ * building extension kits.
294
+ * @example
295
+ * addExtensions() {
296
+ * return [
297
+ * BulletList,
298
+ * OrderedList,
299
+ * ListItem
300
+ * ]
301
+ * }
302
+ */
303
+ addExtensions?: (this: {
304
+ name: string;
305
+ options: Options;
306
+ storage: Storage;
307
+ parent: ParentConfig<NodeConfig<Options, Storage>>['addExtensions'];
308
+ }) => Extensions;
309
+ /**
310
+ * This function extends the schema of the node.
311
+ * @example
312
+ * extendNodeSchema() {
313
+ * return {
314
+ * group: 'inline',
315
+ * selectable: false,
316
+ * }
317
+ * }
318
+ */
319
+ extendNodeSchema?: ((this: {
320
+ name: string;
321
+ options: Options;
322
+ storage: Storage;
323
+ parent: ParentConfig<NodeConfig<Options, Storage>>['extendNodeSchema'];
324
+ }, extension: Node) => Record<string, any>) | null;
325
+ /**
326
+ * This function extends the schema of the mark.
327
+ * @example
328
+ * extendMarkSchema() {
329
+ * return {
330
+ * group: 'inline',
331
+ * selectable: false,
332
+ * }
333
+ * }
334
+ */
335
+ extendMarkSchema?: ((this: {
336
+ name: string;
337
+ options: Options;
338
+ storage: Storage;
339
+ parent: ParentConfig<NodeConfig<Options, Storage>>['extendMarkSchema'];
340
+ editor?: Editor;
341
+ }, extension: Node) => Record<string, any>) | null;
342
+ /**
343
+ * The editor is not ready yet.
344
+ */
345
+ onBeforeCreate?: ((this: {
346
+ name: string;
347
+ options: Options;
348
+ storage: Storage;
349
+ editor: Editor;
350
+ type: NodeType;
351
+ parent: ParentConfig<NodeConfig<Options, Storage>>['onBeforeCreate'];
352
+ }) => void) | null;
353
+ /**
354
+ * The editor is ready.
355
+ */
356
+ onCreate?: ((this: {
357
+ name: string;
358
+ options: Options;
359
+ storage: Storage;
360
+ editor: Editor;
361
+ type: NodeType;
362
+ parent: ParentConfig<NodeConfig<Options, Storage>>['onCreate'];
363
+ }) => void) | null;
364
+ /**
365
+ * The content has changed.
366
+ */
367
+ onUpdate?: ((this: {
368
+ name: string;
369
+ options: Options;
370
+ storage: Storage;
371
+ editor: Editor;
372
+ type: NodeType;
373
+ parent: ParentConfig<NodeConfig<Options, Storage>>['onUpdate'];
374
+ }) => void) | null;
375
+ /**
376
+ * The selection has changed.
377
+ */
378
+ onSelectionUpdate?: ((this: {
379
+ name: string;
380
+ options: Options;
381
+ storage: Storage;
382
+ editor: Editor;
383
+ type: NodeType;
384
+ parent: ParentConfig<NodeConfig<Options, Storage>>['onSelectionUpdate'];
385
+ }) => void) | null;
386
+ /**
387
+ * The editor state has changed.
388
+ */
389
+ onTransaction?: ((this: {
390
+ name: string;
391
+ options: Options;
392
+ storage: Storage;
393
+ editor: Editor;
394
+ type: NodeType;
395
+ parent: ParentConfig<NodeConfig<Options, Storage>>['onTransaction'];
396
+ }, props: {
397
+ editor: Editor;
398
+ transaction: Transaction;
399
+ }) => void) | null;
400
+ /**
401
+ * The editor is focused.
402
+ */
403
+ onFocus?: ((this: {
404
+ name: string;
405
+ options: Options;
406
+ storage: Storage;
407
+ editor: Editor;
408
+ type: NodeType;
409
+ parent: ParentConfig<NodeConfig<Options, Storage>>['onFocus'];
410
+ }, props: {
411
+ event: FocusEvent;
412
+ }) => void) | null;
413
+ /**
414
+ * The editor isn’t focused anymore.
415
+ */
416
+ onBlur?: ((this: {
417
+ name: string;
418
+ options: Options;
419
+ storage: Storage;
420
+ editor: Editor;
421
+ type: NodeType;
422
+ parent: ParentConfig<NodeConfig<Options, Storage>>['onBlur'];
423
+ }, props: {
424
+ event: FocusEvent;
425
+ }) => void) | null;
426
+ /**
427
+ * The editor is destroyed.
428
+ */
429
+ onDestroy?: ((this: {
430
+ name: string;
431
+ options: Options;
432
+ storage: Storage;
433
+ editor: Editor;
434
+ type: NodeType;
435
+ parent: ParentConfig<NodeConfig<Options, Storage>>['onDestroy'];
436
+ }) => void) | null;
437
+ /**
438
+ * Node View
439
+ */
440
+ addNodeView?: ((this: {
441
+ name: string;
442
+ options: Options;
443
+ storage: Storage;
444
+ editor: Editor;
445
+ type: NodeType;
446
+ parent: ParentConfig<NodeConfig<Options, Storage>>['addNodeView'];
447
+ }) => NodeViewRenderer) | null;
448
+ /**
449
+ * Defines if this node should be a top level node (doc)
450
+ * @default false
451
+ * @example true
452
+ */
453
+ topNode?: boolean;
454
+ /**
455
+ * The content expression for this node, as described in the [schema
456
+ * guide](/docs/guide/#schema.content_expressions). When not given,
457
+ * the node does not allow any content.
458
+ *
459
+ * You can read more about it on the Prosemirror documentation here
460
+ * @see https://prosemirror.net/docs/guide/#schema.content_expressions
461
+ * @default undefined
462
+ * @example content: 'block+'
463
+ * @example content: 'headline paragraph block*'
464
+ */
465
+ content?: NodeSpec['content'] | ((this: {
466
+ name: string;
467
+ options: Options;
468
+ storage: Storage;
469
+ parent: ParentConfig<NodeConfig<Options, Storage>>['content'];
470
+ editor?: Editor;
471
+ }) => NodeSpec['content']);
472
+ /**
473
+ * The marks that are allowed inside of this node. May be a
474
+ * space-separated string referring to mark names or groups, `"_"`
475
+ * to explicitly allow all marks, or `""` to disallow marks. When
476
+ * not given, nodes with inline content default to allowing all
477
+ * marks, other nodes default to not allowing marks.
478
+ *
479
+ * @example marks: 'strong em'
480
+ */
481
+ marks?: NodeSpec['marks'] | ((this: {
482
+ name: string;
483
+ options: Options;
484
+ storage: Storage;
485
+ parent: ParentConfig<NodeConfig<Options, Storage>>['marks'];
486
+ editor?: Editor;
487
+ }) => NodeSpec['marks']);
488
+ /**
489
+ * The group or space-separated groups to which this node belongs,
490
+ * which can be referred to in the content expressions for the
491
+ * schema.
492
+ *
493
+ * By default Tiptap uses the groups 'block' and 'inline' for nodes. You
494
+ * can also use custom groups if you want to group specific nodes together
495
+ * and handle them in your schema.
496
+ * @example group: 'block'
497
+ * @example group: 'inline'
498
+ * @example group: 'customBlock' // this uses a custom group
499
+ */
500
+ group?: NodeSpec['group'] | ((this: {
501
+ name: string;
502
+ options: Options;
503
+ storage: Storage;
504
+ parent: ParentConfig<NodeConfig<Options, Storage>>['group'];
505
+ editor?: Editor;
506
+ }) => NodeSpec['group']);
507
+ /**
508
+ * Should be set to true for inline nodes. (Implied for text nodes.)
509
+ */
510
+ inline?: NodeSpec['inline'] | ((this: {
511
+ name: string;
512
+ options: Options;
513
+ storage: Storage;
514
+ parent: ParentConfig<NodeConfig<Options, Storage>>['inline'];
515
+ editor?: Editor;
516
+ }) => NodeSpec['inline']);
517
+ /**
518
+ * Can be set to true to indicate that, though this isn't a [leaf
519
+ * node](https://prosemirror.net/docs/ref/#model.NodeType.isLeaf), it doesn't have directly editable
520
+ * content and should be treated as a single unit in the view.
521
+ *
522
+ * @example atom: true
523
+ */
524
+ atom?: NodeSpec['atom'] | ((this: {
525
+ name: string;
526
+ options: Options;
527
+ storage: Storage;
528
+ parent: ParentConfig<NodeConfig<Options, Storage>>['atom'];
529
+ editor?: Editor;
530
+ }) => NodeSpec['atom']);
531
+ /**
532
+ * Controls whether nodes of this type can be selected as a [node
533
+ * selection](https://prosemirror.net/docs/ref/#state.NodeSelection). Defaults to true for non-text
534
+ * nodes.
535
+ *
536
+ * @default true
537
+ * @example selectable: false
538
+ */
539
+ selectable?: NodeSpec['selectable'] | ((this: {
540
+ name: string;
541
+ options: Options;
542
+ storage: Storage;
543
+ parent: ParentConfig<NodeConfig<Options, Storage>>['selectable'];
544
+ editor?: Editor;
545
+ }) => NodeSpec['selectable']);
546
+ /**
547
+ * Determines whether nodes of this type can be dragged without
548
+ * being selected. Defaults to false.
549
+ *
550
+ * @default: false
551
+ * @example: draggable: true
552
+ */
553
+ draggable?: NodeSpec['draggable'] | ((this: {
554
+ name: string;
555
+ options: Options;
556
+ storage: Storage;
557
+ parent: ParentConfig<NodeConfig<Options, Storage>>['draggable'];
558
+ editor?: Editor;
559
+ }) => NodeSpec['draggable']);
560
+ /**
561
+ * Can be used to indicate that this node contains code, which
562
+ * causes some commands to behave differently.
563
+ */
564
+ code?: NodeSpec['code'] | ((this: {
565
+ name: string;
566
+ options: Options;
567
+ storage: Storage;
568
+ parent: ParentConfig<NodeConfig<Options, Storage>>['code'];
569
+ editor?: Editor;
570
+ }) => NodeSpec['code']);
571
+ /**
572
+ * Controls way whitespace in this a node is parsed. The default is
573
+ * `"normal"`, which causes the [DOM parser](https://prosemirror.net/docs/ref/#model.DOMParser) to
574
+ * collapse whitespace in normal mode, and normalize it (replacing
575
+ * newlines and such with spaces) otherwise. `"pre"` causes the
576
+ * parser to preserve spaces inside the node. When this option isn't
577
+ * given, but [`code`](https://prosemirror.net/docs/ref/#model.NodeSpec.code) is true, `whitespace`
578
+ * will default to `"pre"`. Note that this option doesn't influence
579
+ * the way the node is rendered—that should be handled by `toDOM`
580
+ * and/or styling.
581
+ */
582
+ whitespace?: NodeSpec['whitespace'] | ((this: {
583
+ name: string;
584
+ options: Options;
585
+ storage: Storage;
586
+ parent: ParentConfig<NodeConfig<Options, Storage>>['whitespace'];
587
+ editor?: Editor;
588
+ }) => NodeSpec['whitespace']);
589
+ /**
590
+ * When enabled, enables both
591
+ * [`definingAsContext`](https://prosemirror.net/docs/ref/#model.NodeSpec.definingAsContext) and
592
+ * [`definingForContent`](https://prosemirror.net/docs/ref/#model.NodeSpec.definingForContent).
593
+ *
594
+ * @default false
595
+ * @example isolating: true
596
+ */
597
+ defining?: NodeSpec['defining'] | ((this: {
598
+ name: string;
599
+ options: Options;
600
+ storage: Storage;
601
+ parent: ParentConfig<NodeConfig<Options, Storage>>['defining'];
602
+ editor?: Editor;
603
+ }) => NodeSpec['defining']);
604
+ /**
605
+ * When enabled (default is false), the sides of nodes of this type
606
+ * count as boundaries that regular editing operations, like
607
+ * backspacing or lifting, won't cross. An example of a node that
608
+ * should probably have this enabled is a table cell.
609
+ */
610
+ isolating?: NodeSpec['isolating'] | ((this: {
611
+ name: string;
612
+ options: Options;
613
+ storage: Storage;
614
+ parent: ParentConfig<NodeConfig<Options, Storage>>['isolating'];
615
+ editor?: Editor;
616
+ }) => NodeSpec['isolating']);
617
+ /**
618
+ * Associates DOM parser information with this node, which can be
619
+ * used by [`DOMParser.fromSchema`](https://prosemirror.net/docs/ref/#model.DOMParser^fromSchema) to
620
+ * automatically derive a parser. The `node` field in the rules is
621
+ * implied (the name of this node will be filled in automatically).
622
+ * If you supply your own parser, you do not need to also specify
623
+ * parsing rules in your schema.
624
+ *
625
+ * @example parseHTML: [{ tag: 'div', attrs: { 'data-id': 'my-block' } }]
626
+ */
627
+ parseHTML?: (this: {
628
+ name: string;
629
+ options: Options;
630
+ storage: Storage;
631
+ parent: ParentConfig<NodeConfig<Options, Storage>>['parseHTML'];
632
+ editor?: Editor;
633
+ }) => NodeSpec['parseDOM'];
634
+ /**
635
+ * A description of a DOM structure. Can be either a string, which is
636
+ * interpreted as a text node, a DOM node, which is interpreted as
637
+ * itself, a `{dom, contentDOM}` object, or an array.
638
+ *
639
+ * An array describes a DOM element. The first value in the array
640
+ * should be a string—the name of the DOM element, optionally prefixed
641
+ * by a namespace URL and a space. If the second element is plain
642
+ * object, it is interpreted as a set of attributes for the element.
643
+ * Any elements after that (including the 2nd if it's not an attribute
644
+ * object) are interpreted as children of the DOM elements, and must
645
+ * either be valid `DOMOutputSpec` values, or the number zero.
646
+ *
647
+ * The number zero (pronounced “hole”) is used to indicate the place
648
+ * where a node's child nodes should be inserted. If it occurs in an
649
+ * output spec, it should be the only child element in its parent
650
+ * node.
651
+ *
652
+ * @example toDOM: ['div[data-id="my-block"]', { class: 'my-block' }, 0]
653
+ */
654
+ renderHTML?: ((this: {
655
+ name: string;
656
+ options: Options;
657
+ storage: Storage;
658
+ parent: ParentConfig<NodeConfig<Options, Storage>>['renderHTML'];
659
+ editor?: Editor;
660
+ }, props: {
661
+ node: Node$1;
662
+ HTMLAttributes: Record<string, any>;
663
+ }) => DOMOutputSpec) | null;
664
+ /**
665
+ * renders the node as text
666
+ * @example renderText: () => 'foo
667
+ */
668
+ renderText?: ((this: {
669
+ name: string;
670
+ options: Options;
671
+ storage: Storage;
672
+ parent: ParentConfig<NodeConfig<Options, Storage>>['renderText'];
673
+ editor?: Editor;
674
+ }, props: {
675
+ node: Node$1;
676
+ pos: number;
677
+ parent: Node$1;
678
+ index: number;
679
+ }) => string) | null;
680
+ /**
681
+ * Add attributes to the node
682
+ * @example addAttributes: () => ({ class: 'foo' })
683
+ */
684
+ addAttributes?: (this: {
685
+ name: string;
686
+ options: Options;
687
+ storage: Storage;
688
+ parent: ParentConfig<NodeConfig<Options, Storage>>['addAttributes'];
689
+ editor?: Editor;
690
+ }) => Attributes | {};
691
+ }
692
+ }
693
+ /**
694
+ * The Node class is used to create custom node extensions.
695
+ * @see https://tiptap.dev/api/extensions#create-a-new-extension
696
+ */
697
+ declare class Node<Options = any, Storage = any> {
698
+ type: string;
699
+ name: string;
700
+ parent: Node | null;
701
+ child: Node | null;
702
+ options: Options;
703
+ storage: Storage;
704
+ config: NodeConfig;
705
+ constructor(config?: Partial<NodeConfig<Options, Storage>>);
706
+ static create<O = any, S = any>(config?: Partial<NodeConfig<O, S>>): Node<O, S>;
707
+ configure(options?: Partial<Options>): Node<Options, Storage>;
708
+ extend<ExtendedOptions = Options, ExtendedStorage = Storage>(extendedConfig?: Partial<NodeConfig<ExtendedOptions, ExtendedStorage>>): Node<ExtendedOptions, ExtendedStorage>;
709
+ }
710
+
711
+ declare module '@tiptap/core' {
712
+ interface MarkConfig<Options = any, Storage = any> {
713
+ [key: string]: any;
714
+ /**
715
+ * The extension name - this must be unique.
716
+ * It will be used to identify the extension.
717
+ *
718
+ * @example 'myExtension'
719
+ */
720
+ name: string;
721
+ /**
722
+ * The priority of your extension. The higher, the earlier it will be called
723
+ * and will take precedence over other extensions with a lower priority.
724
+ * @default 100
725
+ * @example 101
726
+ */
727
+ priority?: number;
728
+ /**
729
+ * The default options for this extension.
730
+ * @example
731
+ * defaultOptions: {
732
+ * myOption: 'foo',
733
+ * myOtherOption: 10,
734
+ * }
735
+ */
736
+ defaultOptions?: Options;
737
+ /**
738
+ * This method will add options to this extension
739
+ * @see https://tiptap.dev/guide/custom-extensions#settings
740
+ * @example
741
+ * addOptions() {
742
+ * return {
743
+ * myOption: 'foo',
744
+ * myOtherOption: 10,
745
+ * }
746
+ */
747
+ addOptions?: (this: {
748
+ name: string;
749
+ parent: Exclude<ParentConfig<MarkConfig<Options, Storage>>['addOptions'], undefined>;
750
+ }) => Options;
751
+ /**
752
+ * The default storage this extension can save data to.
753
+ * @see https://tiptap.dev/guide/custom-extensions#storage
754
+ * @example
755
+ * defaultStorage: {
756
+ * prefetchedUsers: [],
757
+ * loading: false,
758
+ * }
759
+ */
760
+ addStorage?: (this: {
761
+ name: string;
762
+ options: Options;
763
+ parent: Exclude<ParentConfig<MarkConfig<Options, Storage>>['addStorage'], undefined>;
764
+ }) => Storage;
765
+ /**
766
+ * This function adds globalAttributes to specific nodes.
767
+ * @see https://tiptap.dev/guide/custom-extensions#global-attributes
768
+ * @example
769
+ * addGlobalAttributes() {
770
+ * return [
771
+ * {
772
+ // Extend the following extensions
773
+ * types: [
774
+ * 'heading',
775
+ * 'paragraph',
776
+ * ],
777
+ * // … with those attributes
778
+ * attributes: {
779
+ * textAlign: {
780
+ * default: 'left',
781
+ * renderHTML: attributes => ({
782
+ * style: `text-align: ${attributes.textAlign}`,
783
+ * }),
784
+ * parseHTML: element => element.style.textAlign || 'left',
785
+ * },
786
+ * },
787
+ * },
788
+ * ]
789
+ * }
790
+ */
791
+ addGlobalAttributes?: (this: {
792
+ name: string;
793
+ options: Options;
794
+ storage: Storage;
795
+ extensions: (Node | Mark)[];
796
+ parent: ParentConfig<MarkConfig<Options, Storage>>['addGlobalAttributes'];
797
+ }) => GlobalAttributes;
798
+ /**
799
+ * This function adds commands to the editor
800
+ * @see https://tiptap.dev/guide/custom-extensions#keyboard-shortcuts
801
+ * @example
802
+ * addCommands() {
803
+ * return {
804
+ * myCommand: () => ({ chain }) => chain().setMark('type', 'foo').run(),
805
+ * }
806
+ * }
807
+ */
808
+ addCommands?: (this: {
809
+ name: string;
810
+ options: Options;
811
+ storage: Storage;
812
+ editor: Editor;
813
+ type: MarkType;
814
+ parent: ParentConfig<MarkConfig<Options, Storage>>['addCommands'];
815
+ }) => Partial<RawCommands>;
816
+ /**
817
+ * This function registers keyboard shortcuts.
818
+ * @see https://tiptap.dev/guide/custom-extensions#keyboard-shortcuts
819
+ * @example
820
+ * addKeyboardShortcuts() {
821
+ * return {
822
+ * 'Mod-l': () => this.editor.commands.toggleBulletList(),
823
+ * }
824
+ * },
825
+ */
826
+ addKeyboardShortcuts?: (this: {
827
+ name: string;
828
+ options: Options;
829
+ storage: Storage;
830
+ editor: Editor;
831
+ type: MarkType;
832
+ parent: ParentConfig<MarkConfig<Options, Storage>>['addKeyboardShortcuts'];
833
+ }) => {
834
+ [key: string]: KeyboardShortcutCommand;
835
+ };
836
+ /**
837
+ * This function adds input rules to the editor.
838
+ * @see https://tiptap.dev/guide/custom-extensions#input-rules
839
+ * @example
840
+ * addInputRules() {
841
+ * return [
842
+ * markInputRule({
843
+ * find: inputRegex,
844
+ * type: this.type,
845
+ * }),
846
+ * ]
847
+ * },
848
+ */
849
+ addInputRules?: (this: {
850
+ name: string;
851
+ options: Options;
852
+ storage: Storage;
853
+ editor: Editor;
854
+ type: MarkType;
855
+ parent: ParentConfig<MarkConfig<Options, Storage>>['addInputRules'];
856
+ }) => InputRule[];
857
+ /**
858
+ * This function adds paste rules to the editor.
859
+ * @see https://tiptap.dev/guide/custom-extensions#paste-rules
860
+ * @example
861
+ * addPasteRules() {
862
+ * return [
863
+ * markPasteRule({
864
+ * find: pasteRegex,
865
+ * type: this.type,
866
+ * }),
867
+ * ]
868
+ * },
869
+ */
870
+ addPasteRules?: (this: {
871
+ name: string;
872
+ options: Options;
873
+ storage: Storage;
874
+ editor: Editor;
875
+ type: MarkType;
876
+ parent: ParentConfig<MarkConfig<Options, Storage>>['addPasteRules'];
877
+ }) => PasteRule[];
878
+ /**
879
+ * This function adds Prosemirror plugins to the editor
880
+ * @see https://tiptap.dev/guide/custom-extensions#prosemirror-plugins
881
+ * @example
882
+ * addProseMirrorPlugins() {
883
+ * return [
884
+ * customPlugin(),
885
+ * ]
886
+ * }
887
+ */
888
+ addProseMirrorPlugins?: (this: {
889
+ name: string;
890
+ options: Options;
891
+ storage: Storage;
892
+ editor: Editor;
893
+ type: MarkType;
894
+ parent: ParentConfig<MarkConfig<Options, Storage>>['addProseMirrorPlugins'];
895
+ }) => Plugin[];
896
+ /**
897
+ * This function adds additional extensions to the editor. This is useful for
898
+ * building extension kits.
899
+ * @example
900
+ * addExtensions() {
901
+ * return [
902
+ * BulletList,
903
+ * OrderedList,
904
+ * ListItem
905
+ * ]
906
+ * }
907
+ */
908
+ addExtensions?: (this: {
909
+ name: string;
910
+ options: Options;
911
+ storage: Storage;
912
+ parent: ParentConfig<MarkConfig<Options, Storage>>['addExtensions'];
913
+ }) => Extensions;
914
+ /**
915
+ * This function extends the schema of the node.
916
+ * @example
917
+ * extendNodeSchema() {
918
+ * return {
919
+ * group: 'inline',
920
+ * selectable: false,
921
+ * }
922
+ * }
923
+ */
924
+ extendNodeSchema?: ((this: {
925
+ name: string;
926
+ options: Options;
927
+ storage: Storage;
928
+ parent: ParentConfig<MarkConfig<Options, Storage>>['extendNodeSchema'];
929
+ }, extension: Node) => Record<string, any>) | null;
930
+ /**
931
+ * This function extends the schema of the mark.
932
+ * @example
933
+ * extendMarkSchema() {
934
+ * return {
935
+ * group: 'inline',
936
+ * selectable: false,
937
+ * }
938
+ * }
939
+ */
940
+ extendMarkSchema?: ((this: {
941
+ name: string;
942
+ options: Options;
943
+ storage: Storage;
944
+ parent: ParentConfig<MarkConfig<Options, Storage>>['extendMarkSchema'];
945
+ }, extension: Mark) => Record<string, any>) | null;
946
+ /**
947
+ * The editor is not ready yet.
948
+ */
949
+ onBeforeCreate?: ((this: {
950
+ name: string;
951
+ options: Options;
952
+ storage: Storage;
953
+ editor: Editor;
954
+ type: MarkType;
955
+ parent: ParentConfig<MarkConfig<Options, Storage>>['onBeforeCreate'];
956
+ }) => void) | null;
957
+ /**
958
+ * The editor is ready.
959
+ */
960
+ onCreate?: ((this: {
961
+ name: string;
962
+ options: Options;
963
+ storage: Storage;
964
+ editor: Editor;
965
+ type: MarkType;
966
+ parent: ParentConfig<MarkConfig<Options, Storage>>['onCreate'];
967
+ }) => void) | null;
968
+ /**
969
+ * The content has changed.
970
+ */
971
+ onUpdate?: ((this: {
972
+ name: string;
973
+ options: Options;
974
+ storage: Storage;
975
+ editor: Editor;
976
+ type: MarkType;
977
+ parent: ParentConfig<MarkConfig<Options, Storage>>['onUpdate'];
978
+ }) => void) | null;
979
+ /**
980
+ * The selection has changed.
981
+ */
982
+ onSelectionUpdate?: ((this: {
983
+ name: string;
984
+ options: Options;
985
+ storage: Storage;
986
+ editor: Editor;
987
+ type: MarkType;
988
+ parent: ParentConfig<MarkConfig<Options, Storage>>['onSelectionUpdate'];
989
+ }) => void) | null;
990
+ /**
991
+ * The editor state has changed.
992
+ */
993
+ onTransaction?: ((this: {
994
+ name: string;
995
+ options: Options;
996
+ storage: Storage;
997
+ editor: Editor;
998
+ type: MarkType;
999
+ parent: ParentConfig<MarkConfig<Options, Storage>>['onTransaction'];
1000
+ }, props: {
1001
+ editor: Editor;
1002
+ transaction: Transaction;
1003
+ }) => void) | null;
1004
+ /**
1005
+ * The editor is focused.
1006
+ */
1007
+ onFocus?: ((this: {
1008
+ name: string;
1009
+ options: Options;
1010
+ storage: Storage;
1011
+ editor: Editor;
1012
+ type: MarkType;
1013
+ parent: ParentConfig<MarkConfig<Options, Storage>>['onFocus'];
1014
+ }, props: {
1015
+ event: FocusEvent;
1016
+ }) => void) | null;
1017
+ /**
1018
+ * The editor isn’t focused anymore.
1019
+ */
1020
+ onBlur?: ((this: {
1021
+ name: string;
1022
+ options: Options;
1023
+ storage: Storage;
1024
+ editor: Editor;
1025
+ type: MarkType;
1026
+ parent: ParentConfig<MarkConfig<Options, Storage>>['onBlur'];
1027
+ }, props: {
1028
+ event: FocusEvent;
1029
+ }) => void) | null;
1030
+ /**
1031
+ * The editor is destroyed.
1032
+ */
1033
+ onDestroy?: ((this: {
1034
+ name: string;
1035
+ options: Options;
1036
+ storage: Storage;
1037
+ editor: Editor;
1038
+ type: MarkType;
1039
+ parent: ParentConfig<MarkConfig<Options, Storage>>['onDestroy'];
1040
+ }) => void) | null;
1041
+ /**
1042
+ * Keep mark after split node
1043
+ */
1044
+ keepOnSplit?: boolean | (() => boolean);
1045
+ /**
1046
+ * Inclusive
1047
+ */
1048
+ inclusive?: MarkSpec['inclusive'] | ((this: {
1049
+ name: string;
1050
+ options: Options;
1051
+ storage: Storage;
1052
+ parent: ParentConfig<MarkConfig<Options, Storage>>['inclusive'];
1053
+ editor?: Editor;
1054
+ }) => MarkSpec['inclusive']);
1055
+ /**
1056
+ * Excludes
1057
+ */
1058
+ excludes?: MarkSpec['excludes'] | ((this: {
1059
+ name: string;
1060
+ options: Options;
1061
+ storage: Storage;
1062
+ parent: ParentConfig<MarkConfig<Options, Storage>>['excludes'];
1063
+ editor?: Editor;
1064
+ }) => MarkSpec['excludes']);
1065
+ /**
1066
+ * Marks this Mark as exitable
1067
+ */
1068
+ exitable?: boolean | (() => boolean);
1069
+ /**
1070
+ * Group
1071
+ */
1072
+ group?: MarkSpec['group'] | ((this: {
1073
+ name: string;
1074
+ options: Options;
1075
+ storage: Storage;
1076
+ parent: ParentConfig<MarkConfig<Options, Storage>>['group'];
1077
+ editor?: Editor;
1078
+ }) => MarkSpec['group']);
1079
+ /**
1080
+ * Spanning
1081
+ */
1082
+ spanning?: MarkSpec['spanning'] | ((this: {
1083
+ name: string;
1084
+ options: Options;
1085
+ storage: Storage;
1086
+ parent: ParentConfig<MarkConfig<Options, Storage>>['spanning'];
1087
+ editor?: Editor;
1088
+ }) => MarkSpec['spanning']);
1089
+ /**
1090
+ * Code
1091
+ */
1092
+ code?: boolean | ((this: {
1093
+ name: string;
1094
+ options: Options;
1095
+ storage: Storage;
1096
+ parent: ParentConfig<MarkConfig<Options, Storage>>['code'];
1097
+ editor?: Editor;
1098
+ }) => boolean);
1099
+ /**
1100
+ * Parse HTML
1101
+ */
1102
+ parseHTML?: (this: {
1103
+ name: string;
1104
+ options: Options;
1105
+ storage: Storage;
1106
+ parent: ParentConfig<MarkConfig<Options, Storage>>['parseHTML'];
1107
+ editor?: Editor;
1108
+ }) => MarkSpec['parseDOM'];
1109
+ /**
1110
+ * Render HTML
1111
+ */
1112
+ renderHTML?: ((this: {
1113
+ name: string;
1114
+ options: Options;
1115
+ storage: Storage;
1116
+ parent: ParentConfig<MarkConfig<Options, Storage>>['renderHTML'];
1117
+ editor?: Editor;
1118
+ }, props: {
1119
+ mark: Mark$1;
1120
+ HTMLAttributes: Record<string, any>;
1121
+ }) => DOMOutputSpec) | null;
1122
+ /**
1123
+ * Attributes
1124
+ */
1125
+ addAttributes?: (this: {
1126
+ name: string;
1127
+ options: Options;
1128
+ storage: Storage;
1129
+ parent: ParentConfig<MarkConfig<Options, Storage>>['addAttributes'];
1130
+ editor?: Editor;
1131
+ }) => Attributes | {};
1132
+ }
1133
+ }
1134
+ /**
1135
+ * The Mark class is used to create custom mark extensions.
1136
+ * @see https://tiptap.dev/api/extensions#create-a-new-extension
1137
+ */
1138
+ declare class Mark<Options = any, Storage = any> {
1139
+ type: string;
1140
+ name: string;
1141
+ parent: Mark | null;
1142
+ child: Mark | null;
1143
+ options: Options;
1144
+ storage: Storage;
1145
+ config: MarkConfig;
1146
+ constructor(config?: Partial<MarkConfig<Options, Storage>>);
1147
+ static create<O = any, S = any>(config?: Partial<MarkConfig<O, S>>): Mark<O, S>;
1148
+ configure(options?: Partial<Options>): Mark<Options, Storage>;
1149
+ extend<ExtendedOptions = Options, ExtendedStorage = Storage>(extendedConfig?: Partial<MarkConfig<ExtendedOptions, ExtendedStorage>>): Mark<ExtendedOptions, ExtendedStorage>;
1150
+ static handleExit({ editor, mark }: {
1151
+ editor: Editor;
1152
+ mark: Mark;
1153
+ }): boolean;
1154
+ }
1155
+
1156
+ declare module '@tiptap/core' {
1157
+ interface ExtensionConfig<Options = any, Storage = any> {
1158
+ [key: string]: any;
1159
+ /**
1160
+ * The extension name - this must be unique.
1161
+ * It will be used to identify the extension.
1162
+ *
1163
+ * @example 'myExtension'
1164
+ */
1165
+ name: string;
1166
+ /**
1167
+ * The priority of your extension. The higher, the earlier it will be called
1168
+ * and will take precedence over other extensions with a lower priority.
1169
+ * @default 100
1170
+ * @example 101
1171
+ */
1172
+ priority?: number;
1173
+ /**
1174
+ * The default options for this extension.
1175
+ * @example
1176
+ * defaultOptions: {
1177
+ * myOption: 'foo',
1178
+ * myOtherOption: 10,
1179
+ * }
1180
+ */
1181
+ defaultOptions?: Options;
1182
+ /**
1183
+ * This method will add options to this extension
1184
+ * @see https://tiptap.dev/docs/editor/guide/custom-extensions#settings
1185
+ * @example
1186
+ * addOptions() {
1187
+ * return {
1188
+ * myOption: 'foo',
1189
+ * myOtherOption: 10,
1190
+ * }
1191
+ */
1192
+ addOptions?: (this: {
1193
+ name: string;
1194
+ parent: Exclude<ParentConfig<ExtensionConfig<Options, Storage>>['addOptions'], undefined>;
1195
+ }) => Options;
1196
+ /**
1197
+ * The default storage this extension can save data to.
1198
+ * @see https://tiptap.dev/docs/editor/guide/custom-extensions#storage
1199
+ * @example
1200
+ * defaultStorage: {
1201
+ * prefetchedUsers: [],
1202
+ * loading: false,
1203
+ * }
1204
+ */
1205
+ addStorage?: (this: {
1206
+ name: string;
1207
+ options: Options;
1208
+ parent: Exclude<ParentConfig<ExtensionConfig<Options, Storage>>['addStorage'], undefined>;
1209
+ }) => Storage;
1210
+ /**
1211
+ * This function adds globalAttributes to specific nodes.
1212
+ * @see https://tiptap.dev/docs/editor/guide/custom-extensions#global-attributes
1213
+ * @example
1214
+ * addGlobalAttributes() {
1215
+ * return [
1216
+ * {
1217
+ // Extend the following extensions
1218
+ * types: [
1219
+ * 'heading',
1220
+ * 'paragraph',
1221
+ * ],
1222
+ * // … with those attributes
1223
+ * attributes: {
1224
+ * textAlign: {
1225
+ * default: 'left',
1226
+ * renderHTML: attributes => ({
1227
+ * style: `text-align: ${attributes.textAlign}`,
1228
+ * }),
1229
+ * parseHTML: element => element.style.textAlign || 'left',
1230
+ * },
1231
+ * },
1232
+ * },
1233
+ * ]
1234
+ * }
1235
+ */
1236
+ addGlobalAttributes?: (this: {
1237
+ name: string;
1238
+ options: Options;
1239
+ storage: Storage;
1240
+ extensions: (Node | Mark)[];
1241
+ parent: ParentConfig<ExtensionConfig<Options, Storage>>['addGlobalAttributes'];
1242
+ }) => GlobalAttributes;
1243
+ /**
1244
+ * This function adds commands to the editor
1245
+ * @see https://tiptap.dev/docs/editor/guide/custom-extensions#commands
1246
+ * @example
1247
+ * addCommands() {
1248
+ * return {
1249
+ * myCommand: () => ({ chain }) => chain().setMark('type', 'foo').run(),
1250
+ * }
1251
+ * }
1252
+ */
1253
+ addCommands?: (this: {
1254
+ name: string;
1255
+ options: Options;
1256
+ storage: Storage;
1257
+ editor: Editor;
1258
+ parent: ParentConfig<ExtensionConfig<Options, Storage>>['addCommands'];
1259
+ }) => Partial<RawCommands>;
1260
+ /**
1261
+ * This function registers keyboard shortcuts.
1262
+ * @see https://tiptap.dev/docs/editor/guide/custom-extensions#keyboard-shortcuts
1263
+ * @example
1264
+ * addKeyboardShortcuts() {
1265
+ * return {
1266
+ * 'Mod-l': () => this.editor.commands.toggleBulletList(),
1267
+ * }
1268
+ * },
1269
+ */
1270
+ addKeyboardShortcuts?: (this: {
1271
+ name: string;
1272
+ options: Options;
1273
+ storage: Storage;
1274
+ editor: Editor;
1275
+ parent: ParentConfig<ExtensionConfig<Options, Storage>>['addKeyboardShortcuts'];
1276
+ }) => {
1277
+ [key: string]: KeyboardShortcutCommand;
1278
+ };
1279
+ /**
1280
+ * This function adds input rules to the editor.
1281
+ * @see https://tiptap.dev/docs/editor/guide/custom-extensions#input-rules
1282
+ * @example
1283
+ * addInputRules() {
1284
+ * return [
1285
+ * markInputRule({
1286
+ * find: inputRegex,
1287
+ * type: this.type,
1288
+ * }),
1289
+ * ]
1290
+ * },
1291
+ */
1292
+ addInputRules?: (this: {
1293
+ name: string;
1294
+ options: Options;
1295
+ storage: Storage;
1296
+ editor: Editor;
1297
+ parent: ParentConfig<ExtensionConfig<Options, Storage>>['addInputRules'];
1298
+ }) => InputRule[];
1299
+ /**
1300
+ * This function adds paste rules to the editor.
1301
+ * @see https://tiptap.dev/docs/editor/guide/custom-extensions#paste-rules
1302
+ * @example
1303
+ * addPasteRules() {
1304
+ * return [
1305
+ * markPasteRule({
1306
+ * find: pasteRegex,
1307
+ * type: this.type,
1308
+ * }),
1309
+ * ]
1310
+ * },
1311
+ */
1312
+ addPasteRules?: (this: {
1313
+ name: string;
1314
+ options: Options;
1315
+ storage: Storage;
1316
+ editor: Editor;
1317
+ parent: ParentConfig<ExtensionConfig<Options, Storage>>['addPasteRules'];
1318
+ }) => PasteRule[];
1319
+ /**
1320
+ * This function adds Prosemirror plugins to the editor
1321
+ * @see https://tiptap.dev/docs/editor/guide/custom-extensions#prosemirror-plugins
1322
+ * @example
1323
+ * addProseMirrorPlugins() {
1324
+ * return [
1325
+ * customPlugin(),
1326
+ * ]
1327
+ * }
1328
+ */
1329
+ addProseMirrorPlugins?: (this: {
1330
+ name: string;
1331
+ options: Options;
1332
+ storage: Storage;
1333
+ editor: Editor;
1334
+ parent: ParentConfig<ExtensionConfig<Options, Storage>>['addProseMirrorPlugins'];
1335
+ }) => Plugin[];
1336
+ /**
1337
+ * This function adds additional extensions to the editor. This is useful for
1338
+ * building extension kits.
1339
+ * @example
1340
+ * addExtensions() {
1341
+ * return [
1342
+ * BulletList,
1343
+ * OrderedList,
1344
+ * ListItem
1345
+ * ]
1346
+ * }
1347
+ */
1348
+ addExtensions?: (this: {
1349
+ name: string;
1350
+ options: Options;
1351
+ storage: Storage;
1352
+ parent: ParentConfig<ExtensionConfig<Options, Storage>>['addExtensions'];
1353
+ }) => Extensions;
1354
+ /**
1355
+ * This function extends the schema of the node.
1356
+ * @example
1357
+ * extendNodeSchema() {
1358
+ * return {
1359
+ * group: 'inline',
1360
+ * selectable: false,
1361
+ * }
1362
+ * }
1363
+ */
1364
+ extendNodeSchema?: ((this: {
1365
+ name: string;
1366
+ options: Options;
1367
+ storage: Storage;
1368
+ parent: ParentConfig<ExtensionConfig<Options, Storage>>['extendNodeSchema'];
1369
+ }, extension: Node) => Record<string, any>) | null;
1370
+ /**
1371
+ * This function extends the schema of the mark.
1372
+ * @example
1373
+ * extendMarkSchema() {
1374
+ * return {
1375
+ * group: 'inline',
1376
+ * selectable: false,
1377
+ * }
1378
+ * }
1379
+ */
1380
+ extendMarkSchema?: ((this: {
1381
+ name: string;
1382
+ options: Options;
1383
+ storage: Storage;
1384
+ parent: ParentConfig<ExtensionConfig<Options, Storage>>['extendMarkSchema'];
1385
+ }, extension: Mark) => Record<string, any>) | null;
1386
+ /**
1387
+ * The editor is not ready yet.
1388
+ */
1389
+ onBeforeCreate?: ((this: {
1390
+ name: string;
1391
+ options: Options;
1392
+ storage: Storage;
1393
+ editor: Editor;
1394
+ parent: ParentConfig<ExtensionConfig<Options, Storage>>['onBeforeCreate'];
1395
+ }) => void) | null;
1396
+ /**
1397
+ * The editor is ready.
1398
+ */
1399
+ onCreate?: ((this: {
1400
+ name: string;
1401
+ options: Options;
1402
+ storage: Storage;
1403
+ editor: Editor;
1404
+ parent: ParentConfig<ExtensionConfig<Options, Storage>>['onCreate'];
1405
+ }) => void) | null;
1406
+ /**
1407
+ * The content has changed.
1408
+ */
1409
+ onUpdate?: ((this: {
1410
+ name: string;
1411
+ options: Options;
1412
+ storage: Storage;
1413
+ editor: Editor;
1414
+ parent: ParentConfig<ExtensionConfig<Options, Storage>>['onUpdate'];
1415
+ }) => void) | null;
1416
+ /**
1417
+ * The selection has changed.
1418
+ */
1419
+ onSelectionUpdate?: ((this: {
1420
+ name: string;
1421
+ options: Options;
1422
+ storage: Storage;
1423
+ editor: Editor;
1424
+ parent: ParentConfig<ExtensionConfig<Options, Storage>>['onSelectionUpdate'];
1425
+ }) => void) | null;
1426
+ /**
1427
+ * The editor state has changed.
1428
+ */
1429
+ onTransaction?: ((this: {
1430
+ name: string;
1431
+ options: Options;
1432
+ storage: Storage;
1433
+ editor: Editor;
1434
+ parent: ParentConfig<ExtensionConfig<Options, Storage>>['onTransaction'];
1435
+ }, props: {
1436
+ editor: Editor;
1437
+ transaction: Transaction;
1438
+ }) => void) | null;
1439
+ /**
1440
+ * The editor is focused.
1441
+ */
1442
+ onFocus?: ((this: {
1443
+ name: string;
1444
+ options: Options;
1445
+ storage: Storage;
1446
+ editor: Editor;
1447
+ parent: ParentConfig<ExtensionConfig<Options, Storage>>['onFocus'];
1448
+ }, props: {
1449
+ event: FocusEvent;
1450
+ }) => void) | null;
1451
+ /**
1452
+ * The editor isn’t focused anymore.
1453
+ */
1454
+ onBlur?: ((this: {
1455
+ name: string;
1456
+ options: Options;
1457
+ storage: Storage;
1458
+ editor: Editor;
1459
+ parent: ParentConfig<ExtensionConfig<Options, Storage>>['onBlur'];
1460
+ }, props: {
1461
+ event: FocusEvent;
1462
+ }) => void) | null;
1463
+ /**
1464
+ * The editor is destroyed.
1465
+ */
1466
+ onDestroy?: ((this: {
1467
+ name: string;
1468
+ options: Options;
1469
+ storage: Storage;
1470
+ editor: Editor;
1471
+ parent: ParentConfig<ExtensionConfig<Options, Storage>>['onDestroy'];
1472
+ }) => void) | null;
1473
+ }
1474
+ }
1475
+ /**
1476
+ * The Extension class is the base class for all extensions.
1477
+ * @see https://tiptap.dev/api/extensions#create-a-new-extension
1478
+ */
1479
+ declare class Extension<Options = any, Storage = any> {
1480
+ type: string;
1481
+ name: string;
1482
+ parent: Extension | null;
1483
+ child: Extension | null;
1484
+ options: Options;
1485
+ storage: Storage;
1486
+ config: ExtensionConfig;
1487
+ constructor(config?: Partial<ExtensionConfig<Options, Storage>>);
1488
+ static create<O = any, S = any>(config?: Partial<ExtensionConfig<O, S>>): Extension<O, S>;
1489
+ configure(options?: Partial<Options>): Extension<Options, Storage>;
1490
+ extend<ExtendedOptions = Options, ExtendedStorage = Storage>(extendedConfig?: Partial<ExtensionConfig<ExtendedOptions, ExtendedStorage>>): Extension<ExtendedOptions, ExtendedStorage>;
1491
+ }
1492
+
1493
+ type AnyConfig = ExtensionConfig | NodeConfig | MarkConfig;
1494
+ type AnyExtension = Extension | Node | Mark;
1495
+ type Extensions = AnyExtension[];
1496
+ type ParentConfig<T> = Partial<{
1497
+ [P in keyof T]: Required<T>[P] extends (...args: any) => any ? (...args: Parameters<Required<T>[P]>) => ReturnType<Required<T>[P]> : T[P];
1498
+ }>;
1499
+ type Primitive = null | undefined | string | number | boolean | symbol | bigint;
1500
+ type RemoveThis<T> = T extends (...args: any) => any ? (...args: Parameters<T>) => ReturnType<T> : T;
1501
+ type MaybeReturnType<T> = T extends (...args: any) => any ? ReturnType<T> : T;
1502
+ type MaybeThisParameterType<T> = Exclude<T, Primitive> extends (...args: any) => any ? ThisParameterType<Exclude<T, Primitive>> : any;
1503
+ interface EditorEvents {
1504
+ beforeCreate: {
1505
+ editor: Editor;
1506
+ };
1507
+ create: {
1508
+ editor: Editor;
1509
+ };
1510
+ contentError: {
1511
+ editor: Editor;
1512
+ error: Error;
1513
+ /**
1514
+ * If called, will re-initialize the editor with the collaboration extension removed.
1515
+ * This will prevent syncing back deletions of content not present in the current schema.
1516
+ */
1517
+ disableCollaboration: () => void;
1518
+ };
1519
+ update: {
1520
+ editor: Editor;
1521
+ transaction: Transaction;
1522
+ };
1523
+ selectionUpdate: {
1524
+ editor: Editor;
1525
+ transaction: Transaction;
1526
+ };
1527
+ beforeTransaction: {
1528
+ editor: Editor;
1529
+ transaction: Transaction;
1530
+ nextState: EditorState;
1531
+ };
1532
+ transaction: {
1533
+ editor: Editor;
1534
+ transaction: Transaction;
1535
+ };
1536
+ focus: {
1537
+ editor: Editor;
1538
+ event: FocusEvent;
1539
+ transaction: Transaction;
1540
+ };
1541
+ blur: {
1542
+ editor: Editor;
1543
+ event: FocusEvent;
1544
+ transaction: Transaction;
1545
+ };
1546
+ destroy: void;
1547
+ }
1548
+ type EnableRules = (AnyExtension | string)[] | boolean;
1549
+ interface EditorOptions {
1550
+ element: Element;
1551
+ content: Content;
1552
+ extensions: Extensions;
1553
+ injectCSS: boolean;
1554
+ injectNonce: string | undefined;
1555
+ autofocus: FocusPosition;
1556
+ editable: boolean;
1557
+ editorProps: EditorProps;
1558
+ parseOptions: ParseOptions;
1559
+ coreExtensionOptions?: {
1560
+ clipboardTextSerializer?: {
1561
+ blockSeparator?: string;
1562
+ };
1563
+ };
1564
+ enableInputRules: EnableRules;
1565
+ enablePasteRules: EnableRules;
1566
+ enableCoreExtensions: boolean;
1567
+ /**
1568
+ * If `true`, the editor will check the content for errors on initialization.
1569
+ * Emitting the `contentError` event if the content is invalid.
1570
+ * Which can be used to show a warning or error message to the user.
1571
+ * @default false
1572
+ */
1573
+ enableContentCheck: boolean;
1574
+ onBeforeCreate: (props: EditorEvents['beforeCreate']) => void;
1575
+ onCreate: (props: EditorEvents['create']) => void;
1576
+ /**
1577
+ * Called when the editor encounters an error while parsing the content.
1578
+ * Only enabled if `enableContentCheck` is `true`.
1579
+ */
1580
+ onContentError: (props: EditorEvents['contentError']) => void;
1581
+ onUpdate: (props: EditorEvents['update']) => void;
1582
+ onSelectionUpdate: (props: EditorEvents['selectionUpdate']) => void;
1583
+ onTransaction: (props: EditorEvents['transaction']) => void;
1584
+ onFocus: (props: EditorEvents['focus']) => void;
1585
+ onBlur: (props: EditorEvents['blur']) => void;
1586
+ onDestroy: (props: EditorEvents['destroy']) => void;
1587
+ }
1588
+ type HTMLContent = string;
1589
+ type JSONContent = {
1590
+ type?: string;
1591
+ attrs?: Record<string, any>;
1592
+ content?: JSONContent[];
1593
+ marks?: {
1594
+ type: string;
1595
+ attrs?: Record<string, any>;
1596
+ [key: string]: any;
1597
+ }[];
1598
+ text?: string;
1599
+ [key: string]: any;
1600
+ };
1601
+ type Content = HTMLContent | JSONContent | JSONContent[] | null;
1602
+ type CommandProps = {
1603
+ editor: Editor;
1604
+ tr: Transaction;
1605
+ commands: SingleCommands;
1606
+ can: () => CanCommands;
1607
+ chain: () => ChainedCommands;
1608
+ state: EditorState;
1609
+ view: EditorView;
1610
+ dispatch: ((args?: any) => any) | undefined;
1611
+ };
1612
+ type Command = (props: CommandProps) => boolean;
1613
+ type CommandSpec = (...args: any[]) => Command;
1614
+ type KeyboardShortcutCommand = (props: {
1615
+ editor: Editor;
1616
+ }) => boolean;
1617
+ type Attribute = {
1618
+ default?: any;
1619
+ rendered?: boolean;
1620
+ renderHTML?: ((attributes: Record<string, any>) => Record<string, any> | null) | null;
1621
+ parseHTML?: ((element: HTMLElement) => any | null) | null;
1622
+ keepOnSplit?: boolean;
1623
+ isRequired?: boolean;
1624
+ };
1625
+ type Attributes = {
1626
+ [key: string]: Attribute;
1627
+ };
1628
+ type ExtensionAttribute = {
1629
+ type: string;
1630
+ name: string;
1631
+ attribute: Required<Attribute>;
1632
+ };
1633
+ type GlobalAttributes = {
1634
+ /**
1635
+ * The node & mark types this attribute should be applied to.
1636
+ */
1637
+ types: string[];
1638
+ /**
1639
+ * The attributes to add to the node or mark types.
1640
+ */
1641
+ attributes: Record<string, Attribute | undefined>;
1642
+ }[];
1643
+ type PickValue<T, K extends keyof T> = T[K];
1644
+ type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
1645
+ type Diff<T extends keyof any, U extends keyof any> = ({
1646
+ [P in T]: P;
1647
+ } & {
1648
+ [P in U]: never;
1649
+ } & {
1650
+ [x: string]: never;
1651
+ })[T];
1652
+ type Overwrite<T, U> = Pick<T, Diff<keyof T, keyof U>> & U;
1653
+ type ValuesOf<T> = T[keyof T];
1654
+ type KeysWithTypeOf<T, Type> = {
1655
+ [P in keyof T]: T[P] extends Type ? P : never;
1656
+ }[keyof T];
1657
+ type DecorationWithType = Decoration & {
1658
+ type: NodeType;
1659
+ };
1660
+ type NodeViewProps = {
1661
+ editor: Editor;
1662
+ node: Node$1;
1663
+ decorations: DecorationWithType[];
1664
+ selected: boolean;
1665
+ extension: Node;
1666
+ getPos: () => number;
1667
+ updateAttributes: (attributes: Record<string, any>) => void;
1668
+ deleteNode: () => void;
1669
+ };
1670
+ interface NodeViewRendererOptions {
1671
+ stopEvent: ((props: {
1672
+ event: Event;
1673
+ }) => boolean) | null;
1674
+ ignoreMutation: ((props: {
1675
+ mutation: MutationRecord | {
1676
+ type: 'selection';
1677
+ target: Element;
1678
+ };
1679
+ }) => boolean) | null;
1680
+ contentDOMElementTag: string;
1681
+ }
1682
+ type NodeViewRendererProps = {
1683
+ editor: Editor;
1684
+ node: Node$1;
1685
+ getPos: (() => number) | boolean;
1686
+ HTMLAttributes: Record<string, any>;
1687
+ decorations: Decoration[];
1688
+ extension: Node;
1689
+ };
1690
+ type NodeViewRenderer = (props: NodeViewRendererProps) => NodeView$1 | {};
1691
+ type AnyCommands = Record<string, (...args: any[]) => Command>;
1692
+ type UnionCommands<T = Command> = UnionToIntersection<ValuesOf<Pick<Commands<T>, KeysWithTypeOf<Commands<T>, {}>>>>;
1693
+ type RawCommands = {
1694
+ [Item in keyof UnionCommands]: UnionCommands<Command>[Item];
1695
+ };
1696
+ type SingleCommands = {
1697
+ [Item in keyof UnionCommands]: UnionCommands<boolean>[Item];
1698
+ };
1699
+ type ChainedCommands = {
1700
+ [Item in keyof UnionCommands]: UnionCommands<ChainedCommands>[Item];
1701
+ } & {
1702
+ run: () => boolean;
1703
+ };
1704
+ type CanCommands = SingleCommands & {
1705
+ chain: () => ChainedCommands;
1706
+ };
1707
+ type FocusPosition = 'start' | 'end' | 'all' | number | boolean | null;
1708
+ type Range = {
1709
+ from: number;
1710
+ to: number;
1711
+ };
1712
+ type NodeRange = {
1713
+ node: Node$1;
1714
+ from: number;
1715
+ to: number;
1716
+ };
1717
+ type MarkRange = {
1718
+ mark: Mark$1;
1719
+ from: number;
1720
+ to: number;
1721
+ };
1722
+ type Predicate = (node: Node$1) => boolean;
1723
+ type NodeWithPos = {
1724
+ node: Node$1;
1725
+ pos: number;
1726
+ };
1727
+ type TextSerializer = (props: {
1728
+ node: Node$1;
1729
+ pos: number;
1730
+ parent: Node$1;
1731
+ index: number;
1732
+ range: Range;
1733
+ }) => string;
1734
+ type ExtendedRegExpMatchArray = RegExpMatchArray & {
1735
+ data?: Record<string, any>;
1736
+ };
1737
+ type Dispatch = ((args?: any) => any) | undefined;
1738
+
1739
+ declare class ExtensionManager {
1740
+ editor: Editor;
1741
+ schema: Schema;
1742
+ extensions: Extensions;
1743
+ splittableMarks: string[];
1744
+ constructor(extensions: Extensions, editor: Editor);
1745
+ /**
1746
+ * Returns a flattened and sorted extension list while
1747
+ * also checking for duplicated extensions and warns the user.
1748
+ * @param extensions An array of Tiptap extensions
1749
+ * @returns An flattened and sorted array of Tiptap extensions
1750
+ */
1751
+ static resolve(extensions: Extensions): Extensions;
1752
+ /**
1753
+ * Create a flattened array of extensions by traversing the `addExtensions` field.
1754
+ * @param extensions An array of Tiptap extensions
1755
+ * @returns A flattened array of Tiptap extensions
1756
+ */
1757
+ static flatten(extensions: Extensions): Extensions;
1758
+ /**
1759
+ * Sort extensions by priority.
1760
+ * @param extensions An array of Tiptap extensions
1761
+ * @returns A sorted array of Tiptap extensions by priority
1762
+ */
1763
+ static sort(extensions: Extensions): Extensions;
1764
+ /**
1765
+ * Get all commands from the extensions.
1766
+ * @returns An object with all commands where the key is the command name and the value is the command function
1767
+ */
1768
+ get commands(): RawCommands;
1769
+ /**
1770
+ * Get all registered Prosemirror plugins from the extensions.
1771
+ * @returns An array of Prosemirror plugins
1772
+ */
1773
+ get plugins(): Plugin[];
1774
+ /**
1775
+ * Get all attributes from the extensions.
1776
+ * @returns An array of attributes
1777
+ */
1778
+ get attributes(): ExtensionAttribute[];
1779
+ /**
1780
+ * Get all node views from the extensions.
1781
+ * @returns An object with all node views where the key is the node name and the value is the node view function
1782
+ */
1783
+ get nodeViews(): any;
1784
+ /**
1785
+ * Go through all extensions, create extension storages & setup marks
1786
+ * & bind editor event listener.
1787
+ */
1788
+ private setupExtensions;
1789
+ }
1790
+
1791
+ declare class NodePos {
1792
+ private resolvedPos;
1793
+ private isBlock;
1794
+ private editor;
1795
+ private get name();
1796
+ constructor(pos: ResolvedPos, editor: Editor, isBlock?: boolean, node?: Node$1 | null);
1797
+ private currentNode;
1798
+ get node(): Node$1;
1799
+ get element(): HTMLElement;
1800
+ actualDepth: number | null;
1801
+ get depth(): number;
1802
+ get pos(): number;
1803
+ get content(): Fragment;
1804
+ set content(content: Content);
1805
+ get attributes(): {
1806
+ [key: string]: any;
1807
+ };
1808
+ get textContent(): string;
1809
+ get size(): number;
1810
+ get from(): number;
1811
+ get range(): Range;
1812
+ get to(): number;
1813
+ get parent(): NodePos | null;
1814
+ get before(): NodePos | null;
1815
+ get after(): NodePos | null;
1816
+ get children(): NodePos[];
1817
+ get firstChild(): NodePos | null;
1818
+ get lastChild(): NodePos | null;
1819
+ closest(selector: string, attributes?: {
1820
+ [key: string]: any;
1821
+ }): NodePos | null;
1822
+ querySelector(selector: string, attributes?: {
1823
+ [key: string]: any;
1824
+ }): NodePos | null;
1825
+ querySelectorAll(selector: string, attributes?: {
1826
+ [key: string]: any;
1827
+ }, firstItemOnly?: boolean): NodePos[];
1828
+ setAttribute(attributes: {
1829
+ [key: string]: any;
1830
+ }): void;
1831
+ }
1832
+
1833
+ type ClipboardTextSerializerOptions = {
1834
+ blockSeparator?: string;
1835
+ };
1836
+ declare const ClipboardTextSerializer: Extension<ClipboardTextSerializerOptions, any>;
1837
+
1838
+ declare module '@tiptap/core' {
1839
+ interface Commands<ReturnType> {
1840
+ blur: {
1841
+ /**
1842
+ * Removes focus from the editor.
1843
+ * @example editor.commands.blur()
1844
+ */
1845
+ blur: () => ReturnType;
1846
+ };
1847
+ }
1848
+ }
1849
+
1850
+ declare module '@tiptap/core' {
1851
+ interface Commands<ReturnType> {
1852
+ clearContent: {
1853
+ /**
1854
+ * Clear the whole document.
1855
+ * @param emitUpdate Whether to emit an update event.
1856
+ * @example editor.commands.clearContent()
1857
+ */
1858
+ clearContent: (emitUpdate?: boolean) => ReturnType;
1859
+ };
1860
+ }
1861
+ }
1862
+
1863
+ declare module '@tiptap/core' {
1864
+ interface Commands<ReturnType> {
1865
+ clearNodes: {
1866
+ /**
1867
+ * Normalize nodes to a simple paragraph.
1868
+ * @example editor.commands.clearNodes()
1869
+ */
1870
+ clearNodes: () => ReturnType;
1871
+ };
1872
+ }
1873
+ }
1874
+
1875
+ declare module '@tiptap/core' {
1876
+ interface Commands<ReturnType> {
1877
+ command: {
1878
+ /**
1879
+ * Define a command inline.
1880
+ * @param fn The command function.
1881
+ * @example
1882
+ * editor.commands.command(({ tr, state }) => {
1883
+ * ...
1884
+ * return true
1885
+ * })
1886
+ */
1887
+ command: (fn: (props: Parameters<Command>[0]) => boolean) => ReturnType;
1888
+ };
1889
+ }
1890
+ }
1891
+
1892
+ declare module '@tiptap/core' {
1893
+ interface Commands<ReturnType> {
1894
+ createParagraphNear: {
1895
+ /**
1896
+ * Create a paragraph nearby.
1897
+ * @example editor.commands.createParagraphNear()
1898
+ */
1899
+ createParagraphNear: () => ReturnType;
1900
+ };
1901
+ }
1902
+ }
1903
+
1904
+ declare module '@tiptap/core' {
1905
+ interface Commands<ReturnType> {
1906
+ cut: {
1907
+ /**
1908
+ * Cuts content from a range and inserts it at a given position.
1909
+ * @param range The range to cut.
1910
+ * @param range.from The start position of the range.
1911
+ * @param range.to The end position of the range.
1912
+ * @param targetPos The position to insert the content at.
1913
+ * @example editor.commands.cut({ from: 1, to: 3 }, 5)
1914
+ */
1915
+ cut: ({ from, to }: {
1916
+ from: number;
1917
+ to: number;
1918
+ }, targetPos: number) => ReturnType;
1919
+ };
1920
+ }
1921
+ }
1922
+
1923
+ declare module '@tiptap/core' {
1924
+ interface Commands<ReturnType> {
1925
+ deleteCurrentNode: {
1926
+ /**
1927
+ * Delete the node that currently has the selection anchor.
1928
+ * @example editor.commands.deleteCurrentNode()
1929
+ */
1930
+ deleteCurrentNode: () => ReturnType;
1931
+ };
1932
+ }
1933
+ }
1934
+
1935
+ declare module '@tiptap/core' {
1936
+ interface Commands<ReturnType> {
1937
+ deleteNode: {
1938
+ /**
1939
+ * Delete a node with a given type or name.
1940
+ * @param typeOrName The type or name of the node.
1941
+ * @example editor.commands.deleteNode('paragraph')
1942
+ */
1943
+ deleteNode: (typeOrName: string | NodeType) => ReturnType;
1944
+ };
1945
+ }
1946
+ }
1947
+
1948
+ declare module '@tiptap/core' {
1949
+ interface Commands<ReturnType> {
1950
+ deleteRange: {
1951
+ /**
1952
+ * Delete a given range.
1953
+ * @param range The range to delete.
1954
+ * @example editor.commands.deleteRange({ from: 1, to: 3 })
1955
+ */
1956
+ deleteRange: (range: Range) => ReturnType;
1957
+ };
1958
+ }
1959
+ }
1960
+
1961
+ declare module '@tiptap/core' {
1962
+ interface Commands<ReturnType> {
1963
+ deleteSelection: {
1964
+ /**
1965
+ * Delete the selection, if there is one.
1966
+ * @example editor.commands.deleteSelection()
1967
+ */
1968
+ deleteSelection: () => ReturnType;
1969
+ };
1970
+ }
1971
+ }
1972
+
1973
+ declare module '@tiptap/core' {
1974
+ interface Commands<ReturnType> {
1975
+ enter: {
1976
+ /**
1977
+ * Trigger enter.
1978
+ * @example editor.commands.enter()
1979
+ */
1980
+ enter: () => ReturnType;
1981
+ };
1982
+ }
1983
+ }
1984
+
1985
+ declare module '@tiptap/core' {
1986
+ interface Commands<ReturnType> {
1987
+ exitCode: {
1988
+ /**
1989
+ * Exit from a code block.
1990
+ * @example editor.commands.exitCode()
1991
+ */
1992
+ exitCode: () => ReturnType;
1993
+ };
1994
+ }
1995
+ }
1996
+
1997
+ declare module '@tiptap/core' {
1998
+ interface Commands<ReturnType> {
1999
+ extendMarkRange: {
2000
+ /**
2001
+ * Extends the text selection to the current mark by type or name.
2002
+ * @param typeOrName The type or name of the mark.
2003
+ * @param attributes The attributes of the mark.
2004
+ * @example editor.commands.extendMarkRange('bold')
2005
+ * @example editor.commands.extendMarkRange('mention', { userId: "1" })
2006
+ */
2007
+ extendMarkRange: (
2008
+ /**
2009
+ * The type or name of the mark.
2010
+ */
2011
+ typeOrName: string | MarkType,
2012
+ /**
2013
+ * The attributes of the mark.
2014
+ */
2015
+ attributes?: Record<string, any>) => ReturnType;
2016
+ };
2017
+ }
2018
+ }
2019
+
2020
+ declare module '@tiptap/core' {
2021
+ interface Commands<ReturnType> {
2022
+ first: {
2023
+ /**
2024
+ * Runs one command after the other and stops at the first which returns true.
2025
+ * @param commands The commands to run.
2026
+ * @example editor.commands.first([command1, command2])
2027
+ */
2028
+ first: (commands: Command[] | ((props: CommandProps) => Command[])) => ReturnType;
2029
+ };
2030
+ }
2031
+ }
2032
+
2033
+ declare module '@tiptap/core' {
2034
+ interface Commands<ReturnType> {
2035
+ focus: {
2036
+ /**
2037
+ * Focus the editor at the given position.
2038
+ * @param position The position to focus at.
2039
+ * @param options.scrollIntoView Scroll the focused position into view after focusing
2040
+ * @example editor.commands.focus()
2041
+ * @example editor.commands.focus(32, { scrollIntoView: false })
2042
+ */
2043
+ focus: (
2044
+ /**
2045
+ * The position to focus at.
2046
+ */
2047
+ position?: FocusPosition,
2048
+ /**
2049
+ * Optional options
2050
+ * @default { scrollIntoView: true }
2051
+ */
2052
+ options?: {
2053
+ scrollIntoView?: boolean;
2054
+ }) => ReturnType;
2055
+ };
2056
+ }
2057
+ }
2058
+
2059
+ declare module '@tiptap/core' {
2060
+ interface Commands<ReturnType> {
2061
+ forEach: {
2062
+ /**
2063
+ * Loop through an array of items.
2064
+ */
2065
+ forEach: <T>(items: T[], fn: (item: T, props: CommandProps & {
2066
+ index: number;
2067
+ }) => boolean) => ReturnType;
2068
+ };
2069
+ }
2070
+ }
2071
+
2072
+ declare module '@tiptap/core' {
2073
+ interface Commands<ReturnType> {
2074
+ insertContent: {
2075
+ /**
2076
+ * Insert a node or string of HTML at the current position.
2077
+ * @example editor.commands.insertContent('<h1>Example</h1>')
2078
+ * @example editor.commands.insertContent('<h1>Example</h1>', { updateSelection: false })
2079
+ */
2080
+ insertContent: (
2081
+ /**
2082
+ * The ProseMirror content to insert.
2083
+ */
2084
+ value: Content,
2085
+ /**
2086
+ * Optional options
2087
+ */
2088
+ options?: {
2089
+ /**
2090
+ * Options for parsing the content.
2091
+ */
2092
+ parseOptions?: ParseOptions;
2093
+ /**
2094
+ * Whether to update the selection after inserting the content.
2095
+ */
2096
+ updateSelection?: boolean;
2097
+ applyInputRules?: boolean;
2098
+ applyPasteRules?: boolean;
2099
+ }) => ReturnType;
2100
+ };
2101
+ }
2102
+ }
2103
+
2104
+ declare module '@tiptap/core' {
2105
+ interface Commands<ReturnType> {
2106
+ insertContentAt: {
2107
+ /**
2108
+ * Insert a node or string of HTML at a specific position.
2109
+ * @example editor.commands.insertContentAt(0, '<h1>Example</h1>')
2110
+ */
2111
+ insertContentAt: (
2112
+ /**
2113
+ * The position to insert the content at.
2114
+ */
2115
+ position: number | Range,
2116
+ /**
2117
+ * The ProseMirror content to insert.
2118
+ */
2119
+ value: Content,
2120
+ /**
2121
+ * Optional options
2122
+ */
2123
+ options?: {
2124
+ /**
2125
+ * Options for parsing the content.
2126
+ */
2127
+ parseOptions?: ParseOptions;
2128
+ /**
2129
+ * Whether to update the selection after inserting the content.
2130
+ */
2131
+ updateSelection?: boolean;
2132
+ /**
2133
+ * Whether to apply input rules after inserting the content.
2134
+ */
2135
+ applyInputRules?: boolean;
2136
+ /**
2137
+ * Whether to apply paste rules after inserting the content.
2138
+ */
2139
+ applyPasteRules?: boolean;
2140
+ /**
2141
+ * Whether to throw an error if the content is invalid.
2142
+ */
2143
+ errorOnInvalidContent?: boolean;
2144
+ }) => ReturnType;
2145
+ };
2146
+ }
2147
+ }
2148
+
2149
+ declare module '@tiptap/core' {
2150
+ interface Commands<ReturnType> {
2151
+ joinUp: {
2152
+ /**
2153
+ * Join the selected block or, if there is a text selection, the closest ancestor block of the selection that can be joined, with the sibling above it.
2154
+ * @example editor.commands.joinUp()
2155
+ */
2156
+ joinUp: () => ReturnType;
2157
+ };
2158
+ joinDown: {
2159
+ /**
2160
+ * Join the selected block, or the closest ancestor of the selection that can be joined, with the sibling after it.
2161
+ * @example editor.commands.joinDown()
2162
+ */
2163
+ joinDown: () => ReturnType;
2164
+ };
2165
+ joinBackward: {
2166
+ /**
2167
+ * If the selection is empty and at the start of a textblock, try to reduce the distance between that block and the one before it—if there's a block directly before it that can be joined, join them.
2168
+ * If not, try to move the selected block closer to the next one in the document structure by lifting it out of its
2169
+ * parent or moving it into a parent of the previous block. Will use the view for accurate (bidi-aware) start-of-textblock detection if given.
2170
+ * @example editor.commands.joinBackward()
2171
+ */
2172
+ joinBackward: () => ReturnType;
2173
+ };
2174
+ joinForward: {
2175
+ /**
2176
+ * If the selection is empty and the cursor is at the end of a textblock, try to reduce or remove the boundary between that block and the one after it,
2177
+ * either by joining them or by moving the other block closer to this one in the tree structure.
2178
+ * Will use the view for accurate start-of-textblock detection if given.
2179
+ * @example editor.commands.joinForward()
2180
+ */
2181
+ joinForward: () => ReturnType;
2182
+ };
2183
+ }
2184
+ }
2185
+
2186
+ declare module '@tiptap/core' {
2187
+ interface Commands<ReturnType> {
2188
+ joinItemBackward: {
2189
+ /**
2190
+ * Join two items backward.
2191
+ * @example editor.commands.joinItemBackward()
2192
+ */
2193
+ joinItemBackward: () => ReturnType;
2194
+ };
2195
+ }
2196
+ }
2197
+
2198
+ declare module '@tiptap/core' {
2199
+ interface Commands<ReturnType> {
2200
+ joinItemForward: {
2201
+ /**
2202
+ * Join two items Forwards.
2203
+ * @example editor.commands.joinItemForward()
2204
+ */
2205
+ joinItemForward: () => ReturnType;
2206
+ };
2207
+ }
2208
+ }
2209
+
2210
+ declare module '@tiptap/core' {
2211
+ interface Commands<ReturnType> {
2212
+ joinTextblockBackward: {
2213
+ /**
2214
+ * A more limited form of joinBackward that only tries to join the current textblock to the one before it, if the cursor is at the start of a textblock.
2215
+ */
2216
+ joinTextblockBackward: () => ReturnType;
2217
+ };
2218
+ }
2219
+ }
2220
+
2221
+ declare module '@tiptap/core' {
2222
+ interface Commands<ReturnType> {
2223
+ joinTextblockForward: {
2224
+ /**
2225
+ * A more limited form of joinForward that only tries to join the current textblock to the one after it, if the cursor is at the end of a textblock.
2226
+ */
2227
+ joinTextblockForward: () => ReturnType;
2228
+ };
2229
+ }
2230
+ }
2231
+
2232
+ declare module '@tiptap/core' {
2233
+ interface Commands<ReturnType> {
2234
+ keyboardShortcut: {
2235
+ /**
2236
+ * Trigger a keyboard shortcut.
2237
+ * @param name The name of the keyboard shortcut.
2238
+ * @example editor.commands.keyboardShortcut('Mod-b')
2239
+ */
2240
+ keyboardShortcut: (name: string) => ReturnType;
2241
+ };
2242
+ }
2243
+ }
2244
+
2245
+ declare module '@tiptap/core' {
2246
+ interface Commands<ReturnType> {
2247
+ lift: {
2248
+ /**
2249
+ * Removes an existing wrap if possible lifting the node out of it
2250
+ * @param typeOrName The type or name of the node.
2251
+ * @param attributes The attributes of the node.
2252
+ * @example editor.commands.lift('paragraph')
2253
+ * @example editor.commands.lift('heading', { level: 1 })
2254
+ */
2255
+ lift: (typeOrName: string | NodeType, attributes?: Record<string, any>) => ReturnType;
2256
+ };
2257
+ }
2258
+ }
2259
+
2260
+ declare module '@tiptap/core' {
2261
+ interface Commands<ReturnType> {
2262
+ liftEmptyBlock: {
2263
+ /**
2264
+ * If the cursor is in an empty textblock that can be lifted, lift the block.
2265
+ * @example editor.commands.liftEmptyBlock()
2266
+ */
2267
+ liftEmptyBlock: () => ReturnType;
2268
+ };
2269
+ }
2270
+ }
2271
+
2272
+ declare module '@tiptap/core' {
2273
+ interface Commands<ReturnType> {
2274
+ liftListItem: {
2275
+ /**
2276
+ * Create a command to lift the list item around the selection up into a wrapping list.
2277
+ * @param typeOrName The type or name of the node.
2278
+ * @example editor.commands.liftListItem('listItem')
2279
+ */
2280
+ liftListItem: (typeOrName: string | NodeType) => ReturnType;
2281
+ };
2282
+ }
2283
+ }
2284
+
2285
+ declare module '@tiptap/core' {
2286
+ interface Commands<ReturnType> {
2287
+ newlineInCode: {
2288
+ /**
2289
+ * Add a newline character in code.
2290
+ * @example editor.commands.newlineInCode()
2291
+ */
2292
+ newlineInCode: () => ReturnType;
2293
+ };
2294
+ }
2295
+ }
2296
+
2297
+ declare module '@tiptap/core' {
2298
+ interface Commands<ReturnType> {
2299
+ resetAttributes: {
2300
+ /**
2301
+ * Resets some node attributes to the default value.
2302
+ * @param typeOrName The type or name of the node.
2303
+ * @param attributes The attributes of the node to reset.
2304
+ * @example editor.commands.resetAttributes('heading', 'level')
2305
+ */
2306
+ resetAttributes: (typeOrName: string | NodeType | MarkType, attributes: string | string[]) => ReturnType;
2307
+ };
2308
+ }
2309
+ }
2310
+
2311
+ declare module '@tiptap/core' {
2312
+ interface Commands<ReturnType> {
2313
+ scrollIntoView: {
2314
+ /**
2315
+ * Scroll the selection into view.
2316
+ * @example editor.commands.scrollIntoView()
2317
+ */
2318
+ scrollIntoView: () => ReturnType;
2319
+ };
2320
+ }
2321
+ }
2322
+
2323
+ declare module '@tiptap/core' {
2324
+ interface Commands<ReturnType> {
2325
+ selectAll: {
2326
+ /**
2327
+ * Select the whole document.
2328
+ * @example editor.commands.selectAll()
2329
+ */
2330
+ selectAll: () => ReturnType;
2331
+ };
2332
+ }
2333
+ }
2334
+
2335
+ declare module '@tiptap/core' {
2336
+ interface Commands<ReturnType> {
2337
+ selectNodeBackward: {
2338
+ /**
2339
+ * Select a node backward.
2340
+ * @example editor.commands.selectNodeBackward()
2341
+ */
2342
+ selectNodeBackward: () => ReturnType;
2343
+ };
2344
+ }
2345
+ }
2346
+
2347
+ declare module '@tiptap/core' {
2348
+ interface Commands<ReturnType> {
2349
+ selectNodeForward: {
2350
+ /**
2351
+ * Select a node forward.
2352
+ * @example editor.commands.selectNodeForward()
2353
+ */
2354
+ selectNodeForward: () => ReturnType;
2355
+ };
2356
+ }
2357
+ }
2358
+
2359
+ declare module '@tiptap/core' {
2360
+ interface Commands<ReturnType> {
2361
+ selectParentNode: {
2362
+ /**
2363
+ * Select the parent node.
2364
+ * @example editor.commands.selectParentNode()
2365
+ */
2366
+ selectParentNode: () => ReturnType;
2367
+ };
2368
+ }
2369
+ }
2370
+
2371
+ declare module '@tiptap/core' {
2372
+ interface Commands<ReturnType> {
2373
+ selectTextblockEnd: {
2374
+ /**
2375
+ * Moves the cursor to the end of current text block.
2376
+ * @example editor.commands.selectTextblockEnd()
2377
+ */
2378
+ selectTextblockEnd: () => ReturnType;
2379
+ };
2380
+ }
2381
+ }
2382
+
2383
+ declare module '@tiptap/core' {
2384
+ interface Commands<ReturnType> {
2385
+ selectTextblockStart: {
2386
+ /**
2387
+ * Moves the cursor to the start of current text block.
2388
+ * @example editor.commands.selectTextblockStart()
2389
+ */
2390
+ selectTextblockStart: () => ReturnType;
2391
+ };
2392
+ }
2393
+ }
2394
+
2395
+ declare module '@tiptap/core' {
2396
+ interface Commands<ReturnType> {
2397
+ setContent: {
2398
+ /**
2399
+ * Replace the whole document with new content.
2400
+ * @param content The new content.
2401
+ * @param emitUpdate Whether to emit an update event.
2402
+ * @param parseOptions Options for parsing the content.
2403
+ * @example editor.commands.setContent('<p>Example text</p>')
2404
+ */
2405
+ setContent: (
2406
+ /**
2407
+ * The new content.
2408
+ */
2409
+ content: Content,
2410
+ /**
2411
+ * Whether to emit an update event.
2412
+ * @default false
2413
+ */
2414
+ emitUpdate?: boolean,
2415
+ /**
2416
+ * Options for parsing the content.
2417
+ * @default {}
2418
+ */
2419
+ parseOptions?: ParseOptions,
2420
+ /**
2421
+ * Options for `setContent`.
2422
+ */
2423
+ options?: {
2424
+ /**
2425
+ * Whether to throw an error if the content is invalid.
2426
+ */
2427
+ errorOnInvalidContent?: boolean;
2428
+ }) => ReturnType;
2429
+ };
2430
+ }
2431
+ }
2432
+
2433
+ declare module '@tiptap/core' {
2434
+ interface Commands<ReturnType> {
2435
+ setMark: {
2436
+ /**
2437
+ * Add a mark with new attributes.
2438
+ * @param typeOrName The mark type or name.
2439
+ * @example editor.commands.setMark('bold', { level: 1 })
2440
+ */
2441
+ setMark: (typeOrName: string | MarkType, attributes?: Record<string, any>) => ReturnType;
2442
+ };
2443
+ }
2444
+ }
2445
+
2446
+ declare module '@tiptap/core' {
2447
+ interface Commands<ReturnType> {
2448
+ setMeta: {
2449
+ /**
2450
+ * Store a metadata property in the current transaction.
2451
+ * @param key The key of the metadata property.
2452
+ * @param value The value to store.
2453
+ * @example editor.commands.setMeta('foo', 'bar')
2454
+ */
2455
+ setMeta: (key: string | Plugin | PluginKey, value: any) => ReturnType;
2456
+ };
2457
+ }
2458
+ }
2459
+
2460
+ declare module '@tiptap/core' {
2461
+ interface Commands<ReturnType> {
2462
+ setNode: {
2463
+ /**
2464
+ * Replace a given range with a node.
2465
+ * @param typeOrName The type or name of the node
2466
+ * @param attributes The attributes of the node
2467
+ * @example editor.commands.setNode('paragraph')
2468
+ */
2469
+ setNode: (typeOrName: string | NodeType, attributes?: Record<string, any>) => ReturnType;
2470
+ };
2471
+ }
2472
+ }
2473
+
2474
+ declare module '@tiptap/core' {
2475
+ interface Commands<ReturnType> {
2476
+ setNodeSelection: {
2477
+ /**
2478
+ * Creates a NodeSelection.
2479
+ * @param position - Position of the node.
2480
+ * @example editor.commands.setNodeSelection(10)
2481
+ */
2482
+ setNodeSelection: (position: number) => ReturnType;
2483
+ };
2484
+ }
2485
+ }
2486
+
2487
+ declare module '@tiptap/core' {
2488
+ interface Commands<ReturnType> {
2489
+ setTextSelection: {
2490
+ /**
2491
+ * Creates a TextSelection.
2492
+ * @param position The position of the selection.
2493
+ * @example editor.commands.setTextSelection(10)
2494
+ */
2495
+ setTextSelection: (position: number | Range) => ReturnType;
2496
+ };
2497
+ }
2498
+ }
2499
+
2500
+ declare module '@tiptap/core' {
2501
+ interface Commands<ReturnType> {
2502
+ sinkListItem: {
2503
+ /**
2504
+ * Sink the list item down into an inner list.
2505
+ * @param typeOrName The type or name of the node.
2506
+ * @example editor.commands.sinkListItem('listItem')
2507
+ */
2508
+ sinkListItem: (typeOrName: string | NodeType) => ReturnType;
2509
+ };
2510
+ }
2511
+ }
2512
+
2513
+ declare module '@tiptap/core' {
2514
+ interface Commands<ReturnType> {
2515
+ splitBlock: {
2516
+ /**
2517
+ * Forks a new node from an existing node.
2518
+ * @param options.keepMarks Keep marks from the previous node.
2519
+ * @example editor.commands.splitBlock()
2520
+ * @example editor.commands.splitBlock({ keepMarks: true })
2521
+ */
2522
+ splitBlock: (options?: {
2523
+ keepMarks?: boolean;
2524
+ }) => ReturnType;
2525
+ };
2526
+ }
2527
+ }
2528
+
2529
+ declare module '@tiptap/core' {
2530
+ interface Commands<ReturnType> {
2531
+ splitListItem: {
2532
+ /**
2533
+ * Splits one list item into two list items.
2534
+ * @param typeOrName The type or name of the node.
2535
+ * @param overrideAttrs The attributes to ensure on the new node.
2536
+ * @example editor.commands.splitListItem('listItem')
2537
+ */
2538
+ splitListItem: (typeOrName: string | NodeType, overrideAttrs?: Record<string, any>) => ReturnType;
2539
+ };
2540
+ }
2541
+ }
2542
+
2543
+ declare module '@tiptap/core' {
2544
+ interface Commands<ReturnType> {
2545
+ toggleList: {
2546
+ /**
2547
+ * Toggle between different list types.
2548
+ * @param listTypeOrName The type or name of the list.
2549
+ * @param itemTypeOrName The type or name of the list item.
2550
+ * @param keepMarks Keep marks when toggling.
2551
+ * @param attributes Attributes for the new list.
2552
+ * @example editor.commands.toggleList('bulletList', 'listItem')
2553
+ */
2554
+ toggleList: (listTypeOrName: string | NodeType, itemTypeOrName: string | NodeType, keepMarks?: boolean, attributes?: Record<string, any>) => ReturnType;
2555
+ };
2556
+ }
2557
+ }
2558
+
2559
+ declare module '@tiptap/core' {
2560
+ interface Commands<ReturnType> {
2561
+ toggleMark: {
2562
+ /**
2563
+ * Toggle a mark on and off.
2564
+ * @param typeOrName The mark type or name.
2565
+ * @param attributes The attributes of the mark.
2566
+ * @param options.extendEmptyMarkRange Removes the mark even across the current selection. Defaults to `false`.
2567
+ * @example editor.commands.toggleMark('bold')
2568
+ */
2569
+ toggleMark: (
2570
+ /**
2571
+ * The mark type or name.
2572
+ */
2573
+ typeOrName: string | MarkType,
2574
+ /**
2575
+ * The attributes of the mark.
2576
+ */
2577
+ attributes?: Record<string, any>, options?: {
2578
+ /**
2579
+ * Removes the mark even across the current selection. Defaults to `false`.
2580
+ */
2581
+ extendEmptyMarkRange?: boolean;
2582
+ }) => ReturnType;
2583
+ };
2584
+ }
2585
+ }
2586
+
2587
+ declare module '@tiptap/core' {
2588
+ interface Commands<ReturnType> {
2589
+ toggleNode: {
2590
+ /**
2591
+ * Toggle a node with another node.
2592
+ * @param typeOrName The type or name of the node.
2593
+ * @param toggleTypeOrName The type or name of the node to toggle.
2594
+ * @param attributes The attributes of the node.
2595
+ * @example editor.commands.toggleNode('heading', 'paragraph')
2596
+ */
2597
+ toggleNode: (typeOrName: string | NodeType, toggleTypeOrName: string | NodeType, attributes?: Record<string, any>) => ReturnType;
2598
+ };
2599
+ }
2600
+ }
2601
+
2602
+ declare module '@tiptap/core' {
2603
+ interface Commands<ReturnType> {
2604
+ toggleWrap: {
2605
+ /**
2606
+ * Wraps nodes in another node, or removes an existing wrap.
2607
+ * @param typeOrName The type or name of the node.
2608
+ * @param attributes The attributes of the node.
2609
+ * @example editor.commands.toggleWrap('blockquote')
2610
+ */
2611
+ toggleWrap: (typeOrName: string | NodeType, attributes?: Record<string, any>) => ReturnType;
2612
+ };
2613
+ }
2614
+ }
2615
+
2616
+ declare module '@tiptap/core' {
2617
+ interface Commands<ReturnType> {
2618
+ undoInputRule: {
2619
+ /**
2620
+ * Undo an input rule.
2621
+ * @example editor.commands.undoInputRule()
2622
+ */
2623
+ undoInputRule: () => ReturnType;
2624
+ };
2625
+ }
2626
+ }
2627
+
2628
+ declare module '@tiptap/core' {
2629
+ interface Commands<ReturnType> {
2630
+ unsetAllMarks: {
2631
+ /**
2632
+ * Remove all marks in the current selection.
2633
+ * @example editor.commands.unsetAllMarks()
2634
+ */
2635
+ unsetAllMarks: () => ReturnType;
2636
+ };
2637
+ }
2638
+ }
2639
+
2640
+ declare module '@tiptap/core' {
2641
+ interface Commands<ReturnType> {
2642
+ unsetMark: {
2643
+ /**
2644
+ * Remove all marks in the current selection.
2645
+ * @param typeOrName The mark type or name.
2646
+ * @param options.extendEmptyMarkRange Removes the mark even across the current selection. Defaults to `false`.
2647
+ * @example editor.commands.unsetMark('bold')
2648
+ */
2649
+ unsetMark: (
2650
+ /**
2651
+ * The mark type or name.
2652
+ */
2653
+ typeOrName: string | MarkType, options?: {
2654
+ /**
2655
+ * Removes the mark even across the current selection. Defaults to `false`.
2656
+ */
2657
+ extendEmptyMarkRange?: boolean;
2658
+ }) => ReturnType;
2659
+ };
2660
+ }
2661
+ }
2662
+
2663
+ declare module '@tiptap/core' {
2664
+ interface Commands<ReturnType> {
2665
+ updateAttributes: {
2666
+ /**
2667
+ * Update attributes of a node or mark.
2668
+ * @param typeOrName The type or name of the node or mark.
2669
+ * @param attributes The attributes of the node or mark.
2670
+ * @example editor.commands.updateAttributes('mention', { userId: "2" })
2671
+ */
2672
+ updateAttributes: (
2673
+ /**
2674
+ * The type or name of the node or mark.
2675
+ */
2676
+ typeOrName: string | NodeType | MarkType,
2677
+ /**
2678
+ * The attributes of the node or mark.
2679
+ */
2680
+ attributes: Record<string, any>) => ReturnType;
2681
+ };
2682
+ }
2683
+ }
2684
+
2685
+ declare module '@tiptap/core' {
2686
+ interface Commands<ReturnType> {
2687
+ wrapIn: {
2688
+ /**
2689
+ * Wraps nodes in another node.
2690
+ * @param typeOrName The type or name of the node.
2691
+ * @param attributes The attributes of the node.
2692
+ * @example editor.commands.wrapIn('blockquote')
2693
+ */
2694
+ wrapIn: (typeOrName: string | NodeType, attributes?: Record<string, any>) => ReturnType;
2695
+ };
2696
+ }
2697
+ }
2698
+
2699
+ declare module '@tiptap/core' {
2700
+ interface Commands<ReturnType> {
2701
+ wrapInList: {
2702
+ /**
2703
+ * Wrap a node in a list.
2704
+ * @param typeOrName The type or name of the node.
2705
+ * @param attributes The attributes of the node.
2706
+ * @example editor.commands.wrapInList('bulletList')
2707
+ */
2708
+ wrapInList: (typeOrName: string | NodeType, attributes?: Record<string, any>) => ReturnType;
2709
+ };
2710
+ }
2711
+ }
2712
+
2713
+ declare const Commands$1: Extension<any, any>;
2714
+
2715
+ declare const Editable: Extension<any, any>;
2716
+
2717
+ declare const FocusEvents: Extension<any, any>;
2718
+
2719
+ declare const Keymap: Extension<any, any>;
2720
+
2721
+ declare const Tabindex: Extension<any, any>;
2722
+
2723
+ declare const index_ClipboardTextSerializer: typeof ClipboardTextSerializer;
2724
+ declare const index_Editable: typeof Editable;
2725
+ declare const index_FocusEvents: typeof FocusEvents;
2726
+ declare const index_Keymap: typeof Keymap;
2727
+ declare const index_Tabindex: typeof Tabindex;
2728
+ declare namespace index {
2729
+ export { index_ClipboardTextSerializer as ClipboardTextSerializer, Commands$1 as Commands, index_Editable as Editable, index_FocusEvents as FocusEvents, index_Keymap as Keymap, index_Tabindex as Tabindex };
2730
+ }
2731
+
2732
+ interface TiptapEditorHTMLElement extends HTMLElement {
2733
+ editor?: Editor;
2734
+ }
2735
+ declare class Editor extends EventEmitter<EditorEvents> {
2736
+ private commandManager;
2737
+ extensionManager: ExtensionManager;
2738
+ private css;
2739
+ schema: Schema;
2740
+ view: EditorView;
2741
+ isFocused: boolean;
2742
+ /**
2743
+ * The editor is considered initialized after the `create` event has been emitted.
2744
+ */
2745
+ isInitialized: boolean;
2746
+ extensionStorage: Record<string, any>;
2747
+ options: EditorOptions;
2748
+ constructor(options?: Partial<EditorOptions>);
2749
+ /**
2750
+ * Returns the editor storage.
2751
+ */
2752
+ get storage(): Record<string, any>;
2753
+ /**
2754
+ * An object of all registered commands.
2755
+ */
2756
+ get commands(): SingleCommands;
2757
+ /**
2758
+ * Create a command chain to call multiple commands at once.
2759
+ */
2760
+ chain(): ChainedCommands;
2761
+ /**
2762
+ * Check if a command or a command chain can be executed. Without executing it.
2763
+ */
2764
+ can(): CanCommands;
2765
+ /**
2766
+ * Inject CSS styles.
2767
+ */
2768
+ private injectCSS;
2769
+ /**
2770
+ * Update editor options.
2771
+ *
2772
+ * @param options A list of options
2773
+ */
2774
+ setOptions(options?: Partial<EditorOptions>): void;
2775
+ /**
2776
+ * Update editable state of the editor.
2777
+ */
2778
+ setEditable(editable: boolean, emitUpdate?: boolean): void;
2779
+ /**
2780
+ * Returns whether the editor is editable.
2781
+ */
2782
+ get isEditable(): boolean;
2783
+ /**
2784
+ * Returns the editor state.
2785
+ */
2786
+ get state(): EditorState;
2787
+ /**
2788
+ * Register a ProseMirror plugin.
2789
+ *
2790
+ * @param plugin A ProseMirror plugin
2791
+ * @param handlePlugins Control how to merge the plugin into the existing plugins.
2792
+ */
2793
+ registerPlugin(plugin: Plugin, handlePlugins?: (newPlugin: Plugin, plugins: Plugin[]) => Plugin[]): void;
2794
+ /**
2795
+ * Unregister a ProseMirror plugin.
2796
+ *
2797
+ * @param nameOrPluginKey The plugins name
2798
+ */
2799
+ unregisterPlugin(nameOrPluginKey: string | PluginKey): void;
2800
+ /**
2801
+ * Creates an extension manager.
2802
+ */
2803
+ private createExtensionManager;
2804
+ /**
2805
+ * Creates an command manager.
2806
+ */
2807
+ private createCommandManager;
2808
+ /**
2809
+ * Creates a ProseMirror schema.
2810
+ */
2811
+ private createSchema;
2812
+ /**
2813
+ * Creates a ProseMirror view.
2814
+ */
2815
+ private createView;
2816
+ /**
2817
+ * Creates all node views.
2818
+ */
2819
+ createNodeViews(): void;
2820
+ /**
2821
+ * Prepend class name to element.
2822
+ */
2823
+ prependClass(): void;
2824
+ isCapturingTransaction: boolean;
2825
+ private capturedTransaction;
2826
+ captureTransaction(fn: Function): Transaction | null;
2827
+ /**
2828
+ * The callback over which to send transactions (state updates) produced by the view.
2829
+ *
2830
+ * @param transaction An editor state transaction
2831
+ */
2832
+ private dispatchTransaction;
2833
+ /**
2834
+ * Get attributes of the currently selected node or mark.
2835
+ */
2836
+ getAttributes(nameOrType: string | NodeType | MarkType): Record<string, any>;
2837
+ /**
2838
+ * Returns if the currently selected node or mark is active.
2839
+ *
2840
+ * @param name Name of the node or mark
2841
+ * @param attributes Attributes of the node or mark
2842
+ */
2843
+ isActive(name: string, attributes?: {}): boolean;
2844
+ isActive(attributes: {}): boolean;
2845
+ /**
2846
+ * Get the document as JSON.
2847
+ */
2848
+ getJSON(): JSONContent;
2849
+ /**
2850
+ * Get the document as HTML.
2851
+ */
2852
+ getHTML(): string;
2853
+ /**
2854
+ * Get the document as text.
2855
+ */
2856
+ getText(options?: {
2857
+ blockSeparator?: string;
2858
+ textSerializers?: Record<string, TextSerializer>;
2859
+ }): string;
2860
+ /**
2861
+ * Check if there is no content.
2862
+ */
2863
+ get isEmpty(): boolean;
2864
+ /**
2865
+ * Get the number of characters for the current document.
2866
+ *
2867
+ * @deprecated
2868
+ */
2869
+ getCharacterCount(): number;
2870
+ /**
2871
+ * Destroy the editor.
2872
+ */
2873
+ destroy(): void;
2874
+ /**
2875
+ * Check if the editor is already destroyed.
2876
+ */
2877
+ get isDestroyed(): boolean;
2878
+ $node(selector: string, attributes?: {
2879
+ [key: string]: any;
2880
+ }): NodePos | null;
2881
+ $nodes(selector: string, attributes?: {
2882
+ [key: string]: any;
2883
+ }): NodePos[] | null;
2884
+ $pos(pos: number): NodePos;
2885
+ get $doc(): NodePos;
2886
+ }
2887
+
2888
+ declare class CommandManager {
2889
+ editor: Editor;
2890
+ rawCommands: AnyCommands;
2891
+ customState?: EditorState;
2892
+ constructor(props: {
2893
+ editor: Editor;
2894
+ state?: EditorState;
2895
+ });
2896
+ get hasCustomState(): boolean;
2897
+ get state(): EditorState;
2898
+ get commands(): SingleCommands;
2899
+ get chain(): () => ChainedCommands;
2900
+ get can(): () => CanCommands;
2901
+ createChain(startTr?: Transaction, shouldDispatch?: boolean): ChainedCommands;
2902
+ createCan(startTr?: Transaction): CanCommands;
2903
+ buildProps(tr: Transaction, shouldDispatch?: boolean): CommandProps;
2904
+ }
2905
+
2906
+ /**
2907
+ * Returns a new `Transform` based on all steps of the passed transactions.
2908
+ * @param oldDoc The Prosemirror node to start from
2909
+ * @param transactions The transactions to combine
2910
+ * @returns A new `Transform` with all steps of the passed transactions
2911
+ */
2912
+ declare function combineTransactionSteps(oldDoc: Node$1, transactions: Transaction[]): Transform;
2913
+
2914
+ /**
2915
+ * Takes a Transaction & Editor State and turns it into a chainable state object
2916
+ * @param config The transaction and state to create the chainable state from
2917
+ * @returns A chainable Editor state object
2918
+ */
2919
+ declare function createChainableState(config: {
2920
+ transaction: Transaction;
2921
+ state: EditorState;
2922
+ }): EditorState;
2923
+
2924
+ /**
2925
+ * Create a new Prosemirror document node from content.
2926
+ * @param content The JSON or HTML content to create the document from
2927
+ * @param schema The Prosemirror schema to use for the document
2928
+ * @param parseOptions Options for the parser
2929
+ * @returns The created Prosemirror document node
2930
+ */
2931
+ declare function createDocument(content: Content, schema: Schema, parseOptions?: ParseOptions, options?: {
2932
+ errorOnInvalidContent?: boolean;
2933
+ }): Node$1;
2934
+
2935
+ type CreateNodeFromContentOptions = {
2936
+ slice?: boolean;
2937
+ parseOptions?: ParseOptions;
2938
+ errorOnInvalidContent?: boolean;
2939
+ };
2940
+ /**
2941
+ * Takes a JSON or HTML content and creates a Prosemirror node or fragment from it.
2942
+ * @param content The JSON or HTML content to create the node from
2943
+ * @param schema The Prosemirror schema to use for the node
2944
+ * @param options Options for the parser
2945
+ * @returns The created Prosemirror node or fragment
2946
+ */
2947
+ declare function createNodeFromContent(content: Content, schema: Schema, options?: CreateNodeFromContentOptions): Node$1 | Fragment;
2948
+
2949
+ /**
2950
+ * Gets the default block type at a given match
2951
+ * @param match The content match to get the default block type from
2952
+ * @returns The default block type or null
2953
+ */
2954
+ declare function defaultBlockAt(match: ContentMatch): NodeType | null;
2955
+
2956
+ /**
2957
+ * Find children inside a Prosemirror node that match a predicate.
2958
+ * @param node The Prosemirror node to search in
2959
+ * @param predicate The predicate to match
2960
+ * @returns An array of nodes with their positions
2961
+ */
2962
+ declare function findChildren(node: Node$1, predicate: Predicate): NodeWithPos[];
2963
+
2964
+ /**
2965
+ * Same as `findChildren` but searches only within a `range`.
2966
+ * @param node The Prosemirror node to search in
2967
+ * @param range The range to search in
2968
+ * @param predicate The predicate to match
2969
+ * @returns An array of nodes with their positions
2970
+ */
2971
+ declare function findChildrenInRange(node: Node$1, range: Range, predicate: Predicate): NodeWithPos[];
2972
+
2973
+ /**
2974
+ * Finds the closest parent node to the current selection that matches a predicate.
2975
+ * @param predicate The predicate to match
2976
+ * @returns A command that finds the closest parent node to the current selection that matches the predicate
2977
+ * @example ```js
2978
+ * findParentNode(node => node.type.name === 'paragraph')
2979
+ * ```
2980
+ */
2981
+ declare function findParentNode(predicate: Predicate): (selection: Selection) => {
2982
+ pos: number;
2983
+ start: number;
2984
+ depth: number;
2985
+ node: prosemirror_model.Node;
2986
+ } | undefined;
2987
+
2988
+ /**
2989
+ * Finds the closest parent node to a resolved position that matches a predicate.
2990
+ * @param $pos The resolved position to search from
2991
+ * @param predicate The predicate to match
2992
+ * @returns The closest parent node to the resolved position that matches the predicate
2993
+ * @example ```js
2994
+ * findParentNodeClosestToPos($from, node => node.type.name === 'paragraph')
2995
+ * ```
2996
+ */
2997
+ declare function findParentNodeClosestToPos($pos: ResolvedPos, predicate: Predicate): {
2998
+ pos: number;
2999
+ start: number;
3000
+ depth: number;
3001
+ node: Node$1;
3002
+ } | undefined;
3003
+
3004
+ /**
3005
+ * Generate HTML from a JSONContent
3006
+ * @param doc The JSONContent to generate HTML from
3007
+ * @param extensions The extensions to use for the schema
3008
+ * @returns The generated HTML
3009
+ */
3010
+ declare function generateHTML(doc: JSONContent, extensions: Extensions): string;
3011
+
3012
+ /**
3013
+ * Generate JSONContent from HTML
3014
+ * @param html The HTML to generate JSONContent from
3015
+ * @param extensions The extensions to use for the schema
3016
+ * @returns The generated JSONContent
3017
+ */
3018
+ declare function generateJSON(html: string, extensions: Extensions): Record<string, any>;
3019
+
3020
+ /**
3021
+ * Generate raw text from a JSONContent
3022
+ * @param doc The JSONContent to generate text from
3023
+ * @param extensions The extensions to use for the schema
3024
+ * @param options Options for the text generation f.e. blockSeparator or textSerializers
3025
+ * @returns The generated text
3026
+ */
3027
+ declare function generateText(doc: JSONContent, extensions: Extensions, options?: {
3028
+ blockSeparator?: string;
3029
+ textSerializers?: Record<string, TextSerializer>;
3030
+ }): string;
3031
+
3032
+ /**
3033
+ * Get node or mark attributes by type or name on the current editor state
3034
+ * @param state The current editor state
3035
+ * @param typeOrName The node or mark type or name
3036
+ * @returns The attributes of the node or mark or an empty object
3037
+ */
3038
+ declare function getAttributes(state: EditorState, typeOrName: string | NodeType | MarkType): Record<string, any>;
3039
+
3040
+ /**
3041
+ * Get a list of all extension attributes defined in `addAttribute` and `addGlobalAttribute`.
3042
+ * @param extensions List of extensions
3043
+ */
3044
+ declare function getAttributesFromExtensions(extensions: Extensions): ExtensionAttribute[];
3045
+
3046
+ type ChangedRange = {
3047
+ oldRange: Range;
3048
+ newRange: Range;
3049
+ };
3050
+ /**
3051
+ * Returns a list of changed ranges
3052
+ * based on the first and last state of all steps.
3053
+ */
3054
+ declare function getChangedRanges(transform: Transform): ChangedRange[];
3055
+
3056
+ interface DebugJSONContent extends JSONContent {
3057
+ from: number;
3058
+ to: number;
3059
+ }
3060
+ declare function getDebugJSON(node: Node$1, startOffset?: number): DebugJSONContent;
3061
+
3062
+ /**
3063
+ * Returns a field from an extension
3064
+ * @param extension The Tiptap extension
3065
+ * @param field The field, for example `renderHTML` or `priority`
3066
+ * @param context The context object that should be passed as `this` into the function
3067
+ * @returns The field value
3068
+ */
3069
+ declare function getExtensionField<T = any>(extension: AnyExtension, field: string, context?: Omit<MaybeThisParameterType<T>, 'parent'>): RemoveThis<T>;
3070
+
3071
+ declare function getHTMLFromFragment(fragment: Fragment, schema: Schema): string;
3072
+
3073
+ declare function getMarkAttributes(state: EditorState, typeOrName: string | MarkType): Record<string, any>;
3074
+
3075
+ declare function getMarkRange($pos: ResolvedPos, type: MarkType, attributes?: Record<string, any>): Range | void;
3076
+
3077
+ declare function getMarksBetween(from: number, to: number, doc: Node$1): MarkRange[];
3078
+
3079
+ declare function getMarkType(nameOrType: string | MarkType, schema: Schema): MarkType;
3080
+
3081
+ /**
3082
+ * Finds the first node of a given type or name in the current selection.
3083
+ * @param state The editor state.
3084
+ * @param typeOrName The node type or name.
3085
+ * @param pos The position to start searching from.
3086
+ * @param maxDepth The maximum depth to search.
3087
+ * @returns The node and the depth as an array.
3088
+ */
3089
+ declare const getNodeAtPosition: (state: EditorState, typeOrName: string | NodeType, pos: number, maxDepth?: number) => [Node$1 | null, number];
3090
+
3091
+ declare function getNodeAttributes(state: EditorState, typeOrName: string | NodeType): Record<string, any>;
3092
+
3093
+ declare function getNodeType(nameOrType: string | NodeType, schema: Schema): NodeType;
3094
+
3095
+ declare function getRenderedAttributes(nodeOrMark: Node$1 | Mark$1, extensionAttributes: ExtensionAttribute[]): Record<string, any>;
3096
+
3097
+ declare function getSchema(extensions: Extensions, editor?: Editor): Schema;
3098
+
3099
+ /**
3100
+ * Creates a new Prosemirror schema based on the given extensions.
3101
+ * @param extensions An array of Tiptap extensions
3102
+ * @param editor The editor instance
3103
+ * @returns A Prosemirror schema
3104
+ */
3105
+ declare function getSchemaByResolvedExtensions(extensions: Extensions, editor?: Editor): Schema;
3106
+
3107
+ /**
3108
+ * Tries to get a node or mark type by its name.
3109
+ * @param name The name of the node or mark type
3110
+ * @param schema The Prosemiror schema to search in
3111
+ * @returns The node or mark type, or null if it doesn't exist
3112
+ */
3113
+ declare function getSchemaTypeByName(name: string, schema: Schema): NodeType | MarkType | null;
3114
+
3115
+ /**
3116
+ * Get the type of a schema item by its name.
3117
+ * @param name The name of the schema item
3118
+ * @param schema The Prosemiror schema to search in
3119
+ * @returns The type of the schema item (`node` or `mark`), or null if it doesn't exist
3120
+ */
3121
+ declare function getSchemaTypeNameByName(name: string, schema: Schema): 'node' | 'mark' | null;
3122
+
3123
+ /**
3124
+ * Return attributes of an extension that should be splitted by keepOnSplit flag
3125
+ * @param extensionAttributes Array of extension attributes
3126
+ * @param typeName The type of the extension
3127
+ * @param attributes The attributes of the extension
3128
+ * @returns The splitted attributes
3129
+ */
3130
+ declare function getSplittedAttributes(extensionAttributes: ExtensionAttribute[], typeName: string, attributes: Record<string, any>): Record<string, any>;
3131
+
3132
+ /**
3133
+ * Gets the text of a Prosemirror node
3134
+ * @param node The Prosemirror node
3135
+ * @param options Options for the text serializer & block separator
3136
+ * @returns The text of the node
3137
+ * @example ```js
3138
+ * const text = getText(node, { blockSeparator: '\n' })
3139
+ * ```
3140
+ */
3141
+ declare function getText(node: Node$1, options?: {
3142
+ blockSeparator?: string;
3143
+ textSerializers?: Record<string, TextSerializer>;
3144
+ }): string;
3145
+
3146
+ /**
3147
+ * Gets the text between two positions in a Prosemirror node
3148
+ * and serializes it using the given text serializers and block separator (see getText)
3149
+ * @param startNode The Prosemirror node to start from
3150
+ * @param range The range of the text to get
3151
+ * @param options Options for the text serializer & block separator
3152
+ * @returns The text between the two positions
3153
+ */
3154
+ declare function getTextBetween(startNode: Node$1, range: Range, options?: {
3155
+ blockSeparator?: string;
3156
+ textSerializers?: Record<string, TextSerializer>;
3157
+ }): string;
3158
+
3159
+ /**
3160
+ * Returns the text content of a resolved prosemirror position
3161
+ * @param $from The resolved position to get the text content from
3162
+ * @param maxMatch The maximum number of characters to match
3163
+ * @returns The text content
3164
+ */
3165
+ declare const getTextContentFromNodes: ($from: ResolvedPos, maxMatch?: number) => string;
3166
+
3167
+ /**
3168
+ * Find text serializers `toText` in a Prosemirror schema
3169
+ * @param schema The Prosemirror schema to search in
3170
+ * @returns A record of text serializers by node name
3171
+ */
3172
+ declare function getTextSerializersFromSchema(schema: Schema): Record<string, TextSerializer>;
3173
+
3174
+ /**
3175
+ * This function merges extension attributes into parserule attributes (`attrs` or `getAttrs`).
3176
+ * Cancels when `getAttrs` returned `false`.
3177
+ * @param parseRule ProseMirror ParseRule
3178
+ * @param extensionAttributes List of attributes to inject
3179
+ */
3180
+ declare function injectExtensionAttributesToParseRule(parseRule: ParseRule, extensionAttributes: ExtensionAttribute[]): ParseRule;
3181
+
3182
+ declare function isActive(state: EditorState, name: string | null, attributes?: Record<string, any>): boolean;
3183
+
3184
+ declare const isAtEndOfNode: (state: EditorState, nodeType?: string) => boolean;
3185
+
3186
+ declare const isAtStartOfNode: (state: EditorState) => boolean;
3187
+
3188
+ declare function isExtensionRulesEnabled(extension: AnyExtension, enabled: EnableRules): boolean;
3189
+
3190
+ declare function isList(name: string, extensions: Extensions): boolean;
3191
+
3192
+ declare function isMarkActive(state: EditorState, typeOrName: MarkType | string | null, attributes?: Record<string, any>): boolean;
3193
+
3194
+ declare function isNodeActive(state: EditorState, typeOrName: NodeType | string | null, attributes?: Record<string, any>): boolean;
3195
+
3196
+ /**
3197
+ * Returns true if the given prosemirror node is empty.
3198
+ */
3199
+ declare function isNodeEmpty(node: Node$1, { checkChildren, ignoreWhitespace, }?: {
3200
+ /**
3201
+ * When true (default), it will also check if all children are empty.
3202
+ */
3203
+ checkChildren?: boolean;
3204
+ /**
3205
+ * When true, it will ignore whitespace when checking for emptiness.
3206
+ */
3207
+ ignoreWhitespace?: boolean;
3208
+ }): boolean;
3209
+
3210
+ declare function isNodeSelection(value: unknown): value is NodeSelection;
3211
+
3212
+ declare function isTextSelection(value: unknown): value is TextSelection;
3213
+
3214
+ declare function posToDOMRect(view: EditorView, from: number, to: number): DOMRect;
3215
+
3216
+ declare function resolveFocusPosition(doc: Node$1, position?: FocusPosition): Selection | null;
3217
+
3218
+ declare function selectionToInsertionEnd(tr: Transaction, startLen: number, bias: number): void;
3219
+
3220
+ declare function splitExtensions(extensions: Extensions): {
3221
+ baseExtensions: Extension<any, any>[];
3222
+ nodeExtensions: Node<any, any>[];
3223
+ markExtensions: Mark<any, any>[];
3224
+ };
3225
+
3226
+ /**
3227
+ * Build an input rule that adds a mark when the
3228
+ * matched text is typed into it.
3229
+ * @see https://tiptap.dev/guide/custom-extensions/#input-rules
3230
+ */
3231
+ declare function markInputRule(config: {
3232
+ find: InputRuleFinder;
3233
+ type: MarkType;
3234
+ getAttributes?: Record<string, any> | ((match: ExtendedRegExpMatchArray) => Record<string, any>) | false | null;
3235
+ }): InputRule;
3236
+
3237
+ /**
3238
+ * Build an input rule that adds a node when the
3239
+ * matched text is typed into it.
3240
+ * @see https://tiptap.dev/guide/custom-extensions/#input-rules
3241
+ */
3242
+ declare function nodeInputRule(config: {
3243
+ /**
3244
+ * The regex to match.
3245
+ */
3246
+ find: InputRuleFinder;
3247
+ /**
3248
+ * The node type to add.
3249
+ */
3250
+ type: NodeType;
3251
+ /**
3252
+ * A function that returns the attributes for the node
3253
+ * can also be an object of attributes
3254
+ */
3255
+ getAttributes?: Record<string, any> | ((match: ExtendedRegExpMatchArray) => Record<string, any>) | false | null;
3256
+ }): InputRule;
3257
+
3258
+ /**
3259
+ * Build an input rule that changes the type of a textblock when the
3260
+ * matched text is typed into it. When using a regular expresion you’ll
3261
+ * probably want the regexp to start with `^`, so that the pattern can
3262
+ * only occur at the start of a textblock.
3263
+ * @see https://tiptap.dev/guide/custom-extensions/#input-rules
3264
+ */
3265
+ declare function textblockTypeInputRule(config: {
3266
+ find: InputRuleFinder;
3267
+ type: NodeType;
3268
+ getAttributes?: Record<string, any> | ((match: ExtendedRegExpMatchArray) => Record<string, any>) | false | null;
3269
+ }): InputRule;
3270
+
3271
+ /**
3272
+ * Build an input rule that replaces text when the
3273
+ * matched text is typed into it.
3274
+ * @see https://tiptap.dev/guide/custom-extensions/#input-rules
3275
+ */
3276
+ declare function textInputRule(config: {
3277
+ find: InputRuleFinder;
3278
+ replace: string;
3279
+ }): InputRule;
3280
+
3281
+ /**
3282
+ * Build an input rule for automatically wrapping a textblock when a
3283
+ * given string is typed. When using a regular expresion you’ll
3284
+ * probably want the regexp to start with `^`, so that the pattern can
3285
+ * only occur at the start of a textblock.
3286
+ *
3287
+ * `type` is the type of node to wrap in.
3288
+ *
3289
+ * By default, if there’s a node with the same type above the newly
3290
+ * wrapped node, the rule will try to join those
3291
+ * two nodes. You can pass a join predicate, which takes a regular
3292
+ * expression match and the node before the wrapped node, and can
3293
+ * return a boolean to indicate whether a join should happen.
3294
+ * @see https://tiptap.dev/guide/custom-extensions/#input-rules
3295
+ */
3296
+ declare function wrappingInputRule(config: {
3297
+ find: InputRuleFinder;
3298
+ type: NodeType;
3299
+ keepMarks?: boolean;
3300
+ keepAttributes?: boolean;
3301
+ editor?: Editor;
3302
+ getAttributes?: Record<string, any> | ((match: ExtendedRegExpMatchArray) => Record<string, any>) | false | null;
3303
+ joinPredicate?: (match: ExtendedRegExpMatchArray, node: Node$1) => boolean;
3304
+ }): InputRule;
3305
+
3306
+ /**
3307
+ * Node views are used to customize the rendered DOM structure of a node.
3308
+ * @see https://tiptap.dev/guide/node-views
3309
+ */
3310
+ declare class NodeView<Component, NodeEditor extends Editor = Editor, Options extends NodeViewRendererOptions = NodeViewRendererOptions> implements NodeView$1 {
3311
+ component: Component;
3312
+ editor: NodeEditor;
3313
+ options: Options;
3314
+ extension: Node;
3315
+ node: Node$1;
3316
+ decorations: DecorationWithType[];
3317
+ getPos: any;
3318
+ isDragging: boolean;
3319
+ constructor(component: Component, props: NodeViewRendererProps, options?: Partial<Options>);
3320
+ mount(): void;
3321
+ get dom(): HTMLElement;
3322
+ get contentDOM(): HTMLElement | null;
3323
+ onDragStart(event: DragEvent): void;
3324
+ stopEvent(event: Event): boolean;
3325
+ ignoreMutation(mutation: MutationRecord | {
3326
+ type: 'selection';
3327
+ target: Element;
3328
+ }): boolean;
3329
+ updateAttributes(attributes: {}): void;
3330
+ deleteNode(): void;
3331
+ }
3332
+
3333
+ /**
3334
+ * Build an paste rule that adds a mark when the
3335
+ * matched text is pasted into it.
3336
+ * @see https://tiptap.dev/guide/custom-extensions/#paste-rules
3337
+ */
3338
+ declare function markPasteRule(config: {
3339
+ find: PasteRuleFinder;
3340
+ type: MarkType;
3341
+ getAttributes?: Record<string, any> | ((match: ExtendedRegExpMatchArray, event: ClipboardEvent) => Record<string, any>) | false | null;
3342
+ }): PasteRule;
3343
+
3344
+ /**
3345
+ * Build an paste rule that adds a node when the
3346
+ * matched text is pasted into it.
3347
+ * @see https://tiptap.dev/guide/custom-extensions/#paste-rules
3348
+ */
3349
+ declare function nodePasteRule(config: {
3350
+ find: PasteRuleFinder;
3351
+ type: NodeType;
3352
+ getAttributes?: Record<string, any> | ((match: ExtendedRegExpMatchArray, event: ClipboardEvent) => Record<string, any>) | false | null;
3353
+ getContent?: JSONContent[] | ((attrs: Record<string, any>) => JSONContent[]) | false | null;
3354
+ }): PasteRule;
3355
+
3356
+ /**
3357
+ * Build an paste rule that replaces text when the
3358
+ * matched text is pasted into it.
3359
+ * @see https://tiptap.dev/guide/custom-extensions/#paste-rules
3360
+ */
3361
+ declare function textPasteRule(config: {
3362
+ find: PasteRuleFinder;
3363
+ replace: string;
3364
+ }): PasteRule;
3365
+
3366
+ interface TrackerResult {
3367
+ position: number;
3368
+ deleted: boolean;
3369
+ }
3370
+ declare class Tracker {
3371
+ transaction: Transaction;
3372
+ currentStep: number;
3373
+ constructor(transaction: Transaction);
3374
+ map(position: number): TrackerResult;
3375
+ }
3376
+
3377
+ /**
3378
+ * Optionally calls `value` as a function.
3379
+ * Otherwise it is returned directly.
3380
+ * @param value Function or any value.
3381
+ * @param context Optional context to bind to function.
3382
+ * @param props Optional props to pass to function.
3383
+ */
3384
+ declare function callOrReturn<T>(value: T, context?: any, ...props: any[]): MaybeReturnType<T>;
3385
+
3386
+ declare function createStyleTag(style: string, nonce?: string, suffix?: string): HTMLStyleElement;
3387
+
3388
+ /**
3389
+ * Remove a property or an array of properties from an object
3390
+ * @param obj Object
3391
+ * @param key Key to remove
3392
+ */
3393
+ declare function deleteProps(obj: Record<string, any>, propOrProps: string | string[]): Record<string, any>;
3394
+
3395
+ declare function elementFromString(value: string): HTMLElement;
3396
+
3397
+ declare function escapeForRegEx(string: string): string;
3398
+
3399
+ declare function findDuplicates(items: any[]): any[];
3400
+
3401
+ declare function fromString(value: any): any;
3402
+
3403
+ declare function isEmptyObject(value?: {}): boolean;
3404
+
3405
+ declare function isFunction(value: any): value is Function;
3406
+
3407
+ declare function isiOS(): boolean;
3408
+
3409
+ declare function isMacOS(): boolean;
3410
+
3411
+ declare function isNumber(value: any): value is number;
3412
+
3413
+ declare function isPlainObject(value: any): value is Record<string, any>;
3414
+
3415
+ declare function isRegExp(value: any): value is RegExp;
3416
+
3417
+ declare function isString(value: any): value is string;
3418
+
3419
+ declare function mergeAttributes(...objects: Record<string, any>[]): Record<string, any>;
3420
+
3421
+ declare function mergeDeep(target: Record<string, any>, source: Record<string, any>): Record<string, any>;
3422
+
3423
+ declare function minMax(value?: number, min?: number, max?: number): number;
3424
+
3425
+ /**
3426
+ * Check if object1 includes object2
3427
+ * @param object1 Object
3428
+ * @param object2 Object
3429
+ */
3430
+ declare function objectIncludes(object1: Record<string, any>, object2: Record<string, any>, options?: {
3431
+ strict: boolean;
3432
+ }): boolean;
3433
+
3434
+ /**
3435
+ * Removes duplicated values within an array.
3436
+ * Supports numbers, strings and objects.
3437
+ */
3438
+ declare function removeDuplicates<T>(array: T[], by?: {
3439
+ (value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;
3440
+ (value: any, replacer?: (number | string)[] | null, space?: string | number): string;
3441
+ }): T[];
3442
+
3443
+ interface Commands<ReturnType = any> {
3444
+ }
3445
+ interface ExtensionConfig<Options = any, Storage = any> {
3446
+ }
3447
+ interface NodeConfig<Options = any, Storage = any> {
3448
+ }
3449
+ interface MarkConfig<Options = any, Storage = any> {
3450
+ }
3451
+
3452
+ export { type AnyCommands, type AnyConfig, type AnyExtension, type Attribute, type Attributes, type CanCommands, type ChainedCommands, type ChangedRange, type Command, CommandManager, type CommandProps, type CommandSpec, type Commands, type Content, type CreateNodeFromContentOptions, type DecorationWithType, type Diff, type Dispatch, Editor, type EditorEvents, type EditorOptions, type EnableRules, type ExtendedRegExpMatchArray, Extension, type ExtensionAttribute, type ExtensionConfig, type Extensions, type FocusPosition, type GlobalAttributes, type HTMLContent, InputRule, type InputRuleFinder, type InputRuleMatch, type JSONContent, type KeyboardShortcutCommand, type KeysWithTypeOf, Mark, type MarkConfig, type MarkRange, type MaybeReturnType, type MaybeThisParameterType, Node, type NodeConfig, NodePos, type NodeRange, NodeView, type NodeViewProps, type NodeViewRenderer, type NodeViewRendererOptions, type NodeViewRendererProps, type NodeWithPos, type Overwrite, type ParentConfig, PasteRule, type PasteRuleFinder, type PasteRuleMatch, type PickValue, type Predicate, type Primitive, type Range, type RawCommands, type RemoveThis, type SingleCommands, type TextSerializer, type TiptapEditorHTMLElement, Tracker, type TrackerResult, type UnionCommands, type UnionToIntersection, type ValuesOf, callOrReturn, combineTransactionSteps, createChainableState, createDocument, createNodeFromContent, createStyleTag, defaultBlockAt, deleteProps, elementFromString, escapeForRegEx, index as extensions, findChildren, findChildrenInRange, findDuplicates, findParentNode, findParentNodeClosestToPos, fromString, generateHTML, generateJSON, generateText, getAttributes, getAttributesFromExtensions, getChangedRanges, getDebugJSON, getExtensionField, getHTMLFromFragment, getMarkAttributes, getMarkRange, getMarkType, getMarksBetween, getNodeAtPosition, getNodeAttributes, getNodeType, getRenderedAttributes, getSchema, getSchemaByResolvedExtensions, getSchemaTypeByName, getSchemaTypeNameByName, getSplittedAttributes, getText, getTextBetween, getTextContentFromNodes, getTextSerializersFromSchema, injectExtensionAttributesToParseRule, inputRulesPlugin, isActive, isAtEndOfNode, isAtStartOfNode, isEmptyObject, isExtensionRulesEnabled, isFunction, isList, isMacOS, isMarkActive, isNodeActive, isNodeEmpty, isNodeSelection, isNumber, isPlainObject, isRegExp, isString, isTextSelection, isiOS, markInputRule, markPasteRule, mergeAttributes, mergeDeep, minMax, nodeInputRule, nodePasteRule, objectIncludes, pasteRulesPlugin, posToDOMRect, removeDuplicates, resolveFocusPosition, selectionToInsertionEnd, splitExtensions, textInputRule, textPasteRule, textblockTypeInputRule, wrappingInputRule };