@tiptap/react 2.0.0-beta.91 → 2.0.0-beta.92

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 (279) hide show
  1. package/dist/packages/core/src/CommandManager.d.ts +20 -0
  2. package/dist/packages/core/src/Editor.d.ts +145 -0
  3. package/dist/packages/core/src/EventEmitter.d.ts +11 -0
  4. package/dist/packages/core/src/Extension.d.ts +227 -0
  5. package/dist/packages/core/src/ExtensionManager.d.ts +18 -0
  6. package/dist/packages/core/src/InputRule.d.ts +42 -0
  7. package/dist/packages/core/src/Mark.d.ts +319 -0
  8. package/dist/packages/core/src/Node.d.ts +388 -0
  9. package/dist/packages/core/src/NodeView.d.ts +27 -0
  10. package/dist/packages/core/src/PasteRule.d.ts +42 -0
  11. package/dist/packages/core/src/Tracker.d.ts +11 -0
  12. package/dist/packages/core/src/commands/blur.d.ts +12 -0
  13. package/dist/packages/core/src/commands/clearContent.d.ts +12 -0
  14. package/dist/packages/core/src/commands/clearNodes.d.ts +12 -0
  15. package/dist/packages/core/src/commands/command.d.ts +12 -0
  16. package/dist/packages/core/src/commands/createParagraphNear.d.ts +12 -0
  17. package/dist/packages/core/src/commands/deleteNode.d.ts +13 -0
  18. package/dist/packages/core/src/commands/deleteRange.d.ts +12 -0
  19. package/dist/packages/core/src/commands/deleteSelection.d.ts +12 -0
  20. package/dist/packages/core/src/commands/enter.d.ts +12 -0
  21. package/dist/packages/core/src/commands/exitCode.d.ts +12 -0
  22. package/dist/packages/core/src/commands/extendMarkRange.d.ts +13 -0
  23. package/dist/packages/core/src/commands/first.d.ts +12 -0
  24. package/dist/packages/core/src/commands/focus.d.ts +12 -0
  25. package/dist/packages/core/src/commands/forEach.d.ts +14 -0
  26. package/dist/packages/core/src/commands/insertContent.d.ts +16 -0
  27. package/dist/packages/core/src/commands/insertContentAt.d.ts +16 -0
  28. package/dist/packages/core/src/commands/joinBackward.d.ts +12 -0
  29. package/dist/packages/core/src/commands/joinForward.d.ts +12 -0
  30. package/dist/packages/core/src/commands/keyboardShortcut.d.ts +12 -0
  31. package/dist/packages/core/src/commands/lift.d.ts +13 -0
  32. package/dist/packages/core/src/commands/liftEmptyBlock.d.ts +12 -0
  33. package/dist/packages/core/src/commands/liftListItem.d.ts +13 -0
  34. package/dist/packages/core/src/commands/newlineInCode.d.ts +12 -0
  35. package/dist/packages/core/src/commands/resetAttributes.d.ts +13 -0
  36. package/dist/packages/core/src/commands/scrollIntoView.d.ts +12 -0
  37. package/dist/packages/core/src/commands/selectAll.d.ts +12 -0
  38. package/dist/packages/core/src/commands/selectNodeBackward.d.ts +12 -0
  39. package/dist/packages/core/src/commands/selectNodeForward.d.ts +12 -0
  40. package/dist/packages/core/src/commands/selectParentNode.d.ts +12 -0
  41. package/dist/packages/core/src/commands/setContent.d.ts +13 -0
  42. package/dist/packages/core/src/commands/setMark.d.ts +13 -0
  43. package/dist/packages/core/src/commands/setMeta.d.ts +12 -0
  44. package/dist/packages/core/src/commands/setNode.d.ts +13 -0
  45. package/dist/packages/core/src/commands/setNodeSelection.d.ts +12 -0
  46. package/dist/packages/core/src/commands/setTextSelection.d.ts +12 -0
  47. package/dist/packages/core/src/commands/sinkListItem.d.ts +13 -0
  48. package/dist/packages/core/src/commands/splitBlock.d.ts +14 -0
  49. package/dist/packages/core/src/commands/splitListItem.d.ts +13 -0
  50. package/dist/packages/core/src/commands/toggleList.d.ts +13 -0
  51. package/dist/packages/core/src/commands/toggleMark.d.ts +18 -0
  52. package/dist/packages/core/src/commands/toggleNode.d.ts +13 -0
  53. package/dist/packages/core/src/commands/toggleWrap.d.ts +13 -0
  54. package/dist/packages/core/src/commands/undoInputRule.d.ts +12 -0
  55. package/dist/packages/core/src/commands/unsetAllMarks.d.ts +12 -0
  56. package/dist/packages/core/src/commands/unsetMark.d.ts +18 -0
  57. package/dist/packages/core/src/commands/updateAttributes.d.ts +13 -0
  58. package/dist/packages/core/src/commands/wrapIn.d.ts +13 -0
  59. package/dist/packages/core/src/commands/wrapInList.d.ts +13 -0
  60. package/dist/packages/core/src/extensions/clipboardTextSerializer.d.ts +2 -0
  61. package/dist/packages/core/src/extensions/commands.d.ts +98 -0
  62. package/dist/packages/core/src/extensions/editable.d.ts +2 -0
  63. package/dist/packages/core/src/extensions/focusEvents.d.ts +2 -0
  64. package/dist/packages/core/src/extensions/index.d.ts +6 -0
  65. package/dist/packages/core/src/extensions/keymap.d.ts +2 -0
  66. package/dist/packages/core/src/extensions/tabindex.d.ts +2 -0
  67. package/dist/packages/core/src/helpers/createChainableState.d.ts +5 -0
  68. package/dist/packages/core/src/helpers/createDocument.d.ts +3 -0
  69. package/dist/packages/core/src/helpers/createNodeFromContent.d.ts +7 -0
  70. package/dist/packages/core/src/helpers/findChildren.d.ts +3 -0
  71. package/dist/packages/core/src/helpers/findChildrenInRange.d.ts +6 -0
  72. package/dist/packages/core/src/helpers/findParentNode.d.ts +9 -0
  73. package/dist/packages/core/src/helpers/findParentNodeClosestToPos.d.ts +8 -0
  74. package/dist/packages/core/src/helpers/generateHTML.d.ts +2 -0
  75. package/dist/packages/core/src/helpers/generateJSON.d.ts +2 -0
  76. package/dist/packages/core/src/helpers/generateText.d.ts +5 -0
  77. package/dist/packages/core/src/helpers/getAttributes.d.ts +3 -0
  78. package/dist/packages/core/src/helpers/getAttributesFromExtensions.d.ts +6 -0
  79. package/dist/packages/core/src/helpers/getDebugJSON.d.ts +8 -0
  80. package/dist/packages/core/src/helpers/getExtensionField.d.ts +2 -0
  81. package/dist/packages/core/src/helpers/getHTMLFromFragment.d.ts +2 -0
  82. package/dist/packages/core/src/helpers/getMarkAttributes.d.ts +3 -0
  83. package/dist/packages/core/src/helpers/getMarkRange.d.ts +3 -0
  84. package/dist/packages/core/src/helpers/getMarkType.d.ts +2 -0
  85. package/dist/packages/core/src/helpers/getMarksBetween.d.ts +3 -0
  86. package/dist/packages/core/src/helpers/getNodeAttributes.d.ts +3 -0
  87. package/dist/packages/core/src/helpers/getNodeType.d.ts +2 -0
  88. package/dist/packages/core/src/helpers/getRenderedAttributes.d.ts +3 -0
  89. package/dist/packages/core/src/helpers/getSchema.d.ts +3 -0
  90. package/dist/packages/core/src/helpers/getSchemaByResolvedExtensions.d.ts +3 -0
  91. package/dist/packages/core/src/helpers/getSchemaTypeByName.d.ts +2 -0
  92. package/dist/packages/core/src/helpers/getSchemaTypeNameByName.d.ts +2 -0
  93. package/dist/packages/core/src/helpers/getSplittedAttributes.d.ts +2 -0
  94. package/dist/packages/core/src/helpers/getText.d.ts +6 -0
  95. package/dist/packages/core/src/helpers/getTextBetween.d.ts +6 -0
  96. package/dist/packages/core/src/helpers/getTextSeralizersFromSchema.d.ts +3 -0
  97. package/dist/packages/core/src/helpers/injectExtensionAttributesToParseRule.d.ts +9 -0
  98. package/dist/packages/core/src/helpers/isActive.d.ts +2 -0
  99. package/dist/packages/core/src/helpers/isList.d.ts +2 -0
  100. package/dist/packages/core/src/helpers/isMarkActive.d.ts +3 -0
  101. package/dist/packages/core/src/helpers/isNodeActive.d.ts +3 -0
  102. package/dist/packages/core/src/helpers/isNodeEmpty.d.ts +2 -0
  103. package/dist/packages/core/src/helpers/isNodeSelection.d.ts +2 -0
  104. package/dist/packages/core/src/helpers/isTextSelection.d.ts +2 -0
  105. package/dist/packages/core/src/helpers/posToDOMRect.d.ts +2 -0
  106. package/dist/packages/core/src/helpers/selectionToInsertionEnd.d.ts +2 -0
  107. package/dist/packages/core/src/helpers/splitExtensions.d.ts +9 -0
  108. package/dist/packages/core/src/index.d.ts +57 -0
  109. package/dist/packages/core/src/inputRules/markInputRule.d.ts +12 -0
  110. package/dist/packages/core/src/inputRules/nodeInputRule.d.ts +12 -0
  111. package/dist/packages/core/src/inputRules/textInputRule.d.ts +9 -0
  112. package/dist/packages/core/src/inputRules/textblockTypeInputRule.d.ts +14 -0
  113. package/dist/packages/core/src/inputRules/wrappingInputRule.d.ts +23 -0
  114. package/dist/packages/core/src/pasteRules/markPasteRule.d.ts +12 -0
  115. package/dist/packages/core/src/pasteRules/textPasteRule.d.ts +9 -0
  116. package/dist/packages/core/src/style.d.ts +2 -0
  117. package/dist/packages/core/src/types.d.ts +209 -0
  118. package/dist/packages/core/src/utilities/callOrReturn.d.ts +9 -0
  119. package/dist/packages/core/src/utilities/createStyleTag.d.ts +1 -0
  120. package/dist/packages/core/src/utilities/deleteProps.d.ts +6 -0
  121. package/dist/packages/core/src/utilities/elementFromString.d.ts +1 -0
  122. package/dist/packages/core/src/utilities/findDuplicates.d.ts +1 -0
  123. package/dist/packages/core/src/utilities/fromString.d.ts +1 -0
  124. package/dist/packages/core/src/utilities/isClass.d.ts +1 -0
  125. package/dist/packages/core/src/utilities/isEmptyObject.d.ts +1 -0
  126. package/dist/packages/core/src/utilities/isFunction.d.ts +1 -0
  127. package/dist/packages/core/src/utilities/isNumber.d.ts +1 -0
  128. package/dist/packages/core/src/utilities/isObject.d.ts +1 -0
  129. package/dist/packages/core/src/utilities/isPlainObject.d.ts +1 -0
  130. package/dist/packages/core/src/utilities/isRegExp.d.ts +1 -0
  131. package/dist/packages/core/src/utilities/isString.d.ts +1 -0
  132. package/dist/packages/core/src/utilities/isiOS.d.ts +1 -0
  133. package/dist/packages/core/src/utilities/mergeAttributes.d.ts +1 -0
  134. package/dist/packages/core/src/utilities/mergeDeep.d.ts +1 -0
  135. package/dist/packages/core/src/utilities/minMax.d.ts +1 -0
  136. package/dist/packages/core/src/utilities/objectIncludes.d.ts +8 -0
  137. package/dist/packages/core/src/utilities/removeElement.d.ts +1 -0
  138. package/dist/packages/extension-blockquote/src/blockquote.d.ts +24 -0
  139. package/dist/packages/extension-blockquote/src/index.d.ts +3 -0
  140. package/dist/packages/extension-bold/src/bold.d.ts +27 -0
  141. package/dist/packages/extension-bold/src/index.d.ts +3 -0
  142. package/dist/packages/extension-bubble-menu/src/bubble-menu-plugin.d.ts +43 -0
  143. package/dist/packages/extension-bubble-menu/src/bubble-menu.d.ts +6 -0
  144. package/dist/packages/extension-bubble-menu/src/index.d.ts +4 -0
  145. package/dist/packages/extension-bullet-list/src/bullet-list.d.ts +16 -0
  146. package/dist/packages/extension-bullet-list/src/index.d.ts +3 -0
  147. package/dist/packages/extension-character-count/src/character-count.d.ts +7 -0
  148. package/dist/packages/extension-character-count/src/index.d.ts +3 -0
  149. package/dist/packages/extension-code/src/code.d.ts +25 -0
  150. package/dist/packages/extension-code/src/index.d.ts +3 -0
  151. package/dist/packages/extension-code-block/src/code-block.d.ts +26 -0
  152. package/dist/packages/extension-code-block/src/index.d.ts +3 -0
  153. package/dist/packages/extension-code-block-lowlight/src/code-block-lowlight.d.ts +6 -0
  154. package/dist/packages/extension-code-block-lowlight/src/index.d.ts +3 -0
  155. package/dist/packages/extension-code-block-lowlight/src/lowlight-plugin.d.ts +6 -0
  156. package/dist/packages/extension-collaboration/src/collaboration.d.ts +30 -0
  157. package/dist/packages/extension-collaboration/src/helpers/isChangeOrigin.d.ts +2 -0
  158. package/dist/packages/extension-collaboration/src/index.d.ts +4 -0
  159. package/dist/packages/extension-collaboration-cursor/src/collaboration-cursor.d.ts +37 -0
  160. package/dist/packages/extension-collaboration-cursor/src/index.d.ts +3 -0
  161. package/dist/packages/extension-color/src/color.d.ts +21 -0
  162. package/dist/packages/extension-color/src/index.d.ts +3 -0
  163. package/dist/packages/extension-document/src/document.d.ts +2 -0
  164. package/dist/packages/extension-document/src/index.d.ts +3 -0
  165. package/dist/packages/extension-dropcursor/src/dropcursor.d.ts +7 -0
  166. package/dist/packages/extension-dropcursor/src/index.d.ts +3 -0
  167. package/dist/packages/extension-floating-menu/src/floating-menu-plugin.d.ts +40 -0
  168. package/dist/packages/extension-floating-menu/src/floating-menu.d.ts +6 -0
  169. package/dist/packages/extension-floating-menu/src/index.d.ts +4 -0
  170. package/dist/packages/extension-focus/src/focus.d.ts +6 -0
  171. package/dist/packages/extension-focus/src/index.d.ts +3 -0
  172. package/dist/packages/extension-font-family/src/font-family.d.ts +21 -0
  173. package/dist/packages/extension-font-family/src/index.d.ts +3 -0
  174. package/dist/packages/extension-gapcursor/src/gapcursor.d.ts +15 -0
  175. package/dist/packages/extension-gapcursor/src/index.d.ts +3 -0
  176. package/dist/packages/extension-hard-break/src/hard-break.d.ts +16 -0
  177. package/dist/packages/extension-hard-break/src/index.d.ts +3 -0
  178. package/dist/packages/extension-heading/src/heading.d.ts +26 -0
  179. package/dist/packages/extension-heading/src/index.d.ts +3 -0
  180. package/dist/packages/extension-highlight/src/highlight.d.ts +30 -0
  181. package/dist/packages/extension-highlight/src/index.d.ts +3 -0
  182. package/dist/packages/extension-history/src/history.d.ts +20 -0
  183. package/dist/packages/extension-history/src/index.d.ts +3 -0
  184. package/dist/packages/extension-horizontal-rule/src/horizontal-rule.d.ts +15 -0
  185. package/dist/packages/extension-horizontal-rule/src/index.d.ts +3 -0
  186. package/dist/packages/extension-image/src/image.d.ts +21 -0
  187. package/dist/packages/extension-image/src/index.d.ts +3 -0
  188. package/dist/packages/extension-italic/src/index.d.ts +3 -0
  189. package/dist/packages/extension-italic/src/italic.d.ts +27 -0
  190. package/dist/packages/extension-link/src/index.d.ts +3 -0
  191. package/dist/packages/extension-link/src/link.d.ts +40 -0
  192. package/dist/packages/extension-list-item/src/index.d.ts +3 -0
  193. package/dist/packages/extension-list-item/src/list-item.d.ts +5 -0
  194. package/dist/packages/extension-mention/src/index.d.ts +3 -0
  195. package/dist/packages/extension-mention/src/mention.d.ts +14 -0
  196. package/dist/packages/extension-ordered-list/src/index.d.ts +3 -0
  197. package/dist/packages/extension-ordered-list/src/ordered-list.d.ts +16 -0
  198. package/dist/packages/extension-paragraph/src/index.d.ts +3 -0
  199. package/dist/packages/extension-paragraph/src/paragraph.d.ts +15 -0
  200. package/dist/packages/extension-placeholder/src/index.d.ts +3 -0
  201. package/dist/packages/extension-placeholder/src/placeholder.d.ts +15 -0
  202. package/dist/packages/extension-strike/src/index.d.ts +3 -0
  203. package/dist/packages/extension-strike/src/strike.d.ts +25 -0
  204. package/dist/packages/extension-subscript/src/index.d.ts +3 -0
  205. package/dist/packages/extension-subscript/src/subscript.d.ts +23 -0
  206. package/dist/packages/extension-superscript/src/index.d.ts +3 -0
  207. package/dist/packages/extension-superscript/src/superscript.d.ts +23 -0
  208. package/dist/packages/extension-table/src/TableView.d.ts +17 -0
  209. package/dist/packages/extension-table/src/index.d.ts +4 -0
  210. package/dist/packages/extension-table/src/table.d.ts +55 -0
  211. package/dist/packages/extension-table/src/utilities/createCell.d.ts +2 -0
  212. package/dist/packages/extension-table/src/utilities/createTable.d.ts +2 -0
  213. package/dist/packages/extension-table/src/utilities/deleteTableWhenAllCellsSelected.d.ts +2 -0
  214. package/dist/packages/extension-table/src/utilities/getTableNodeTypes.d.ts +4 -0
  215. package/dist/packages/extension-table/src/utilities/isCellSelection.d.ts +2 -0
  216. package/dist/packages/extension-table-cell/src/index.d.ts +3 -0
  217. package/dist/packages/extension-table-cell/src/table-cell.d.ts +5 -0
  218. package/dist/packages/extension-table-header/src/index.d.ts +3 -0
  219. package/dist/packages/extension-table-header/src/table-header.d.ts +5 -0
  220. package/dist/packages/extension-table-row/src/index.d.ts +3 -0
  221. package/dist/packages/extension-table-row/src/table-row.d.ts +5 -0
  222. package/dist/packages/extension-task-item/src/index.d.ts +3 -0
  223. package/dist/packages/extension-task-item/src/task-item.d.ts +7 -0
  224. package/dist/packages/extension-task-list/src/index.d.ts +3 -0
  225. package/dist/packages/extension-task-list/src/task-list.d.ts +15 -0
  226. package/dist/packages/extension-text/src/index.d.ts +3 -0
  227. package/dist/packages/extension-text/src/text.d.ts +2 -0
  228. package/dist/packages/extension-text-align/src/index.d.ts +3 -0
  229. package/dist/packages/extension-text-align/src/text-align.d.ts +21 -0
  230. package/dist/packages/extension-text-style/src/index.d.ts +3 -0
  231. package/dist/packages/extension-text-style/src/text-style.d.ts +15 -0
  232. package/dist/packages/extension-typography/src/index.d.ts +3 -0
  233. package/dist/packages/extension-typography/src/typography.d.ts +23 -0
  234. package/dist/packages/extension-underline/src/index.d.ts +3 -0
  235. package/dist/packages/extension-underline/src/underline.d.ts +23 -0
  236. package/dist/packages/html/src/generateHTML.d.ts +2 -0
  237. package/dist/packages/html/src/generateJSON.d.ts +2 -0
  238. package/dist/packages/html/src/getHTMLFromFragment.d.ts +2 -0
  239. package/dist/packages/html/src/index.d.ts +2 -0
  240. package/dist/packages/react/src/BubbleMenu.d.ts +8 -0
  241. package/dist/packages/react/src/Editor.d.ts +6 -0
  242. package/dist/packages/react/src/EditorContent.d.ts +19 -0
  243. package/dist/packages/react/src/FloatingMenu.d.ts +8 -0
  244. package/dist/packages/react/src/NodeViewContent.d.ts +6 -0
  245. package/dist/packages/react/src/NodeViewWrapper.d.ts +6 -0
  246. package/dist/packages/react/src/ReactNodeViewRenderer.d.ts +13 -0
  247. package/dist/packages/react/src/ReactRenderer.d.ts +26 -0
  248. package/dist/packages/react/src/index.d.ts +10 -0
  249. package/dist/packages/react/src/useEditor.d.ts +4 -0
  250. package/dist/packages/react/src/useReactNodeView.d.ts +7 -0
  251. package/dist/packages/starter-kit/src/index.d.ts +3 -0
  252. package/dist/packages/starter-kit/src/starter-kit.d.ts +37 -0
  253. package/dist/packages/suggestion/src/findSuggestionMatch.d.ts +15 -0
  254. package/dist/packages/suggestion/src/index.d.ts +4 -0
  255. package/dist/packages/suggestion/src/suggestion.d.ts +49 -0
  256. package/dist/tests/cypress/integration/core/can.spec.d.ts +1 -0
  257. package/dist/tests/cypress/integration/core/editorProps.spec.d.ts +1 -0
  258. package/dist/tests/cypress/integration/core/extendExtensions.spec.d.ts +1 -0
  259. package/dist/tests/cypress/integration/core/extendMarkRange.spec.d.ts +1 -0
  260. package/dist/tests/cypress/integration/core/extensionOptions.spec.d.ts +1 -0
  261. package/dist/tests/cypress/integration/core/fromString.spec.d.ts +1 -0
  262. package/dist/tests/cypress/integration/core/generateHTML.spec.d.ts +1 -0
  263. package/dist/tests/cypress/integration/core/generateJSON.spec.d.ts +1 -0
  264. package/dist/tests/cypress/integration/core/isActive.spec.d.ts +1 -0
  265. package/dist/tests/cypress/integration/core/isClass.spec.d.ts +1 -0
  266. package/dist/tests/cypress/integration/core/mergeAttributes.spec.d.ts +1 -0
  267. package/dist/tests/cypress/integration/core/mergeDeep.spec.d.ts +1 -0
  268. package/dist/tests/cypress/integration/core/pluginOrder.spec.d.ts +1 -0
  269. package/dist/tests/cypress/integration/extensions/bold.spec.d.ts +1 -0
  270. package/dist/tests/cypress/integration/extensions/codeBlockLowlight.spec.d.ts +1 -0
  271. package/dist/tests/cypress/integration/html/generateHTML.spec.d.ts +1 -0
  272. package/dist/tests/cypress/integration/html/generateJSON.spec.d.ts +1 -0
  273. package/dist/tiptap-react.cjs.js +371 -0
  274. package/dist/tiptap-react.cjs.js.map +1 -0
  275. package/dist/tiptap-react.esm.js +348 -0
  276. package/dist/tiptap-react.esm.js.map +1 -0
  277. package/dist/tiptap-react.umd.js +371 -0
  278. package/dist/tiptap-react.umd.js.map +1 -0
  279. package/package.json +4 -4
@@ -0,0 +1,18 @@
1
+ import { MarkType } from 'prosemirror-model';
2
+ import { RawCommands } from '../types';
3
+ declare module '@tiptap/core' {
4
+ interface Commands<ReturnType> {
5
+ toggleMark: {
6
+ /**
7
+ * Toggle a mark on and off.
8
+ */
9
+ toggleMark: (typeOrName: string | MarkType, attributes?: Record<string, any>, options?: {
10
+ /**
11
+ * Removes the mark even across the current selection. Defaults to `false`.
12
+ */
13
+ extendEmptyMarkRange?: boolean;
14
+ }) => ReturnType;
15
+ };
16
+ }
17
+ }
18
+ export declare const toggleMark: RawCommands['toggleMark'];
@@ -0,0 +1,13 @@
1
+ import { NodeType } from 'prosemirror-model';
2
+ import { RawCommands } from '../types';
3
+ declare module '@tiptap/core' {
4
+ interface Commands<ReturnType> {
5
+ toggleNode: {
6
+ /**
7
+ * Toggle a node with another node.
8
+ */
9
+ toggleNode: (typeOrName: string | NodeType, toggleTypeOrName: string | NodeType, attributes?: Record<string, any>) => ReturnType;
10
+ };
11
+ }
12
+ }
13
+ export declare const toggleNode: RawCommands['toggleNode'];
@@ -0,0 +1,13 @@
1
+ import { NodeType } from 'prosemirror-model';
2
+ import { RawCommands } from '../types';
3
+ declare module '@tiptap/core' {
4
+ interface Commands<ReturnType> {
5
+ toggleWrap: {
6
+ /**
7
+ * Wraps nodes in another node, or removes an existing wrap.
8
+ */
9
+ toggleWrap: (typeOrName: string | NodeType, attributes?: Record<string, any>) => ReturnType;
10
+ };
11
+ }
12
+ }
13
+ export declare const toggleWrap: RawCommands['toggleWrap'];
@@ -0,0 +1,12 @@
1
+ import { RawCommands } from '../types';
2
+ declare module '@tiptap/core' {
3
+ interface Commands<ReturnType> {
4
+ undoInputRule: {
5
+ /**
6
+ * Undo an input rule.
7
+ */
8
+ undoInputRule: () => ReturnType;
9
+ };
10
+ }
11
+ }
12
+ export declare const undoInputRule: RawCommands['undoInputRule'];
@@ -0,0 +1,12 @@
1
+ import { RawCommands } from '../types';
2
+ declare module '@tiptap/core' {
3
+ interface Commands<ReturnType> {
4
+ unsetAllMarks: {
5
+ /**
6
+ * Remove all marks in the current selection.
7
+ */
8
+ unsetAllMarks: () => ReturnType;
9
+ };
10
+ }
11
+ }
12
+ export declare const unsetAllMarks: RawCommands['unsetAllMarks'];
@@ -0,0 +1,18 @@
1
+ import { MarkType } from 'prosemirror-model';
2
+ import { RawCommands } from '../types';
3
+ declare module '@tiptap/core' {
4
+ interface Commands<ReturnType> {
5
+ unsetMark: {
6
+ /**
7
+ * Remove all marks in the current selection.
8
+ */
9
+ unsetMark: (typeOrName: string | MarkType, options?: {
10
+ /**
11
+ * Removes the mark even across the current selection. Defaults to `false`.
12
+ */
13
+ extendEmptyMarkRange?: boolean;
14
+ }) => ReturnType;
15
+ };
16
+ }
17
+ }
18
+ export declare const unsetMark: RawCommands['unsetMark'];
@@ -0,0 +1,13 @@
1
+ import { NodeType, MarkType } from 'prosemirror-model';
2
+ import { RawCommands } from '../types';
3
+ declare module '@tiptap/core' {
4
+ interface Commands<ReturnType> {
5
+ updateAttributes: {
6
+ /**
7
+ * Update attributes of a node or mark.
8
+ */
9
+ updateAttributes: (typeOrName: string | NodeType | MarkType, attributes: Record<string, any>) => ReturnType;
10
+ };
11
+ }
12
+ }
13
+ export declare const updateAttributes: RawCommands['updateAttributes'];
@@ -0,0 +1,13 @@
1
+ import { NodeType } from 'prosemirror-model';
2
+ import { RawCommands } from '../types';
3
+ declare module '@tiptap/core' {
4
+ interface Commands<ReturnType> {
5
+ wrapIn: {
6
+ /**
7
+ * Wraps nodes in another node.
8
+ */
9
+ wrapIn: (typeOrName: string | NodeType, attributes?: Record<string, any>) => ReturnType;
10
+ };
11
+ }
12
+ }
13
+ export declare const wrapIn: RawCommands['wrapIn'];
@@ -0,0 +1,13 @@
1
+ import { NodeType } from 'prosemirror-model';
2
+ import { RawCommands } from '../types';
3
+ declare module '@tiptap/core' {
4
+ interface Commands<ReturnType> {
5
+ wrapInList: {
6
+ /**
7
+ * Wrap a node in a list.
8
+ */
9
+ wrapInList: (typeOrName: string | NodeType, attributes?: Record<string, any>) => ReturnType;
10
+ };
11
+ }
12
+ }
13
+ export declare const wrapInList: RawCommands['wrapInList'];
@@ -0,0 +1,2 @@
1
+ import { Extension } from '../Extension';
2
+ export declare const ClipboardTextSerializer: Extension<any, any>;
@@ -0,0 +1,98 @@
1
+ import { Extension } from '../Extension';
2
+ import * as blur from '../commands/blur';
3
+ import * as clearContent from '../commands/clearContent';
4
+ import * as clearNodes from '../commands/clearNodes';
5
+ import * as command from '../commands/command';
6
+ import * as createParagraphNear from '../commands/createParagraphNear';
7
+ import * as deleteNode from '../commands/deleteNode';
8
+ import * as deleteRange from '../commands/deleteRange';
9
+ import * as deleteSelection from '../commands/deleteSelection';
10
+ import * as enter from '../commands/enter';
11
+ import * as exitCode from '../commands/exitCode';
12
+ import * as extendMarkRange from '../commands/extendMarkRange';
13
+ import * as first from '../commands/first';
14
+ import * as focus from '../commands/focus';
15
+ import * as forEach from '../commands/forEach';
16
+ import * as insertContent from '../commands/insertContent';
17
+ import * as insertContentAt from '../commands/insertContentAt';
18
+ import * as joinBackward from '../commands/joinBackward';
19
+ import * as joinForward from '../commands/joinForward';
20
+ import * as keyboardShortcut from '../commands/keyboardShortcut';
21
+ import * as lift from '../commands/lift';
22
+ import * as liftEmptyBlock from '../commands/liftEmptyBlock';
23
+ import * as liftListItem from '../commands/liftListItem';
24
+ import * as newlineInCode from '../commands/newlineInCode';
25
+ import * as resetAttributes from '../commands/resetAttributes';
26
+ import * as scrollIntoView from '../commands/scrollIntoView';
27
+ import * as selectAll from '../commands/selectAll';
28
+ import * as selectNodeBackward from '../commands/selectNodeBackward';
29
+ import * as selectNodeForward from '../commands/selectNodeForward';
30
+ import * as selectParentNode from '../commands/selectParentNode';
31
+ import * as setContent from '../commands/setContent';
32
+ import * as setMark from '../commands/setMark';
33
+ import * as setMeta from '../commands/setMeta';
34
+ import * as setNode from '../commands/setNode';
35
+ import * as setNodeSelection from '../commands/setNodeSelection';
36
+ import * as setTextSelection from '../commands/setTextSelection';
37
+ import * as sinkListItem from '../commands/sinkListItem';
38
+ import * as splitBlock from '../commands/splitBlock';
39
+ import * as splitListItem from '../commands/splitListItem';
40
+ import * as toggleList from '../commands/toggleList';
41
+ import * as toggleMark from '../commands/toggleMark';
42
+ import * as toggleNode from '../commands/toggleNode';
43
+ import * as toggleWrap from '../commands/toggleWrap';
44
+ import * as undoInputRule from '../commands/undoInputRule';
45
+ import * as unsetAllMarks from '../commands/unsetAllMarks';
46
+ import * as unsetMark from '../commands/unsetMark';
47
+ import * as updateAttributes from '../commands/updateAttributes';
48
+ import * as wrapIn from '../commands/wrapIn';
49
+ import * as wrapInList from '../commands/wrapInList';
50
+ export { blur };
51
+ export { clearContent };
52
+ export { clearNodes };
53
+ export { command };
54
+ export { createParagraphNear };
55
+ export { deleteNode };
56
+ export { deleteRange };
57
+ export { deleteSelection };
58
+ export { enter };
59
+ export { exitCode };
60
+ export { extendMarkRange };
61
+ export { first };
62
+ export { focus };
63
+ export { forEach };
64
+ export { insertContent };
65
+ export { insertContentAt };
66
+ export { joinBackward };
67
+ export { joinForward };
68
+ export { keyboardShortcut };
69
+ export { lift };
70
+ export { liftEmptyBlock };
71
+ export { liftListItem };
72
+ export { newlineInCode };
73
+ export { resetAttributes };
74
+ export { scrollIntoView };
75
+ export { selectAll };
76
+ export { selectNodeBackward };
77
+ export { selectNodeForward };
78
+ export { selectParentNode };
79
+ export { setContent };
80
+ export { setMark };
81
+ export { setMeta };
82
+ export { setNode };
83
+ export { setNodeSelection };
84
+ export { setTextSelection };
85
+ export { sinkListItem };
86
+ export { splitBlock };
87
+ export { splitListItem };
88
+ export { toggleList };
89
+ export { toggleMark };
90
+ export { toggleNode };
91
+ export { toggleWrap };
92
+ export { undoInputRule };
93
+ export { unsetAllMarks };
94
+ export { unsetMark };
95
+ export { updateAttributes };
96
+ export { wrapIn };
97
+ export { wrapInList };
98
+ export declare const Commands: Extension<any, any>;
@@ -0,0 +1,2 @@
1
+ import { Extension } from '../Extension';
2
+ export declare const Editable: Extension<any, any>;
@@ -0,0 +1,2 @@
1
+ import { Extension } from '../Extension';
2
+ export declare const FocusEvents: Extension<any, any>;
@@ -0,0 +1,6 @@
1
+ export { ClipboardTextSerializer } from './clipboardTextSerializer';
2
+ export { Commands } from './commands';
3
+ export { Editable } from './editable';
4
+ export { FocusEvents } from './focusEvents';
5
+ export { Keymap } from './keymap';
6
+ export { Tabindex } from './tabindex';
@@ -0,0 +1,2 @@
1
+ import { Extension } from '../Extension';
2
+ export declare const Keymap: Extension<any, any>;
@@ -0,0 +1,2 @@
1
+ import { Extension } from '../Extension';
2
+ export declare const Tabindex: Extension<any, any>;
@@ -0,0 +1,5 @@
1
+ import { EditorState, Transaction } from 'prosemirror-state';
2
+ export default function createChainableState(config: {
3
+ transaction: Transaction;
4
+ state: EditorState;
5
+ }): EditorState;
@@ -0,0 +1,3 @@
1
+ import { Schema, Node as ProseMirrorNode, ParseOptions } from 'prosemirror-model';
2
+ import { Content } from '../types';
3
+ export default function createDocument(content: Content, schema: Schema, parseOptions?: ParseOptions): ProseMirrorNode;
@@ -0,0 +1,7 @@
1
+ import { Schema, Node as ProseMirrorNode, Fragment, ParseOptions } from 'prosemirror-model';
2
+ import { Content } from '../types';
3
+ export declare type CreateNodeFromContentOptions = {
4
+ slice?: boolean;
5
+ parseOptions?: ParseOptions;
6
+ };
7
+ export default function createNodeFromContent(content: Content, schema: Schema, options?: CreateNodeFromContentOptions): ProseMirrorNode | Fragment;
@@ -0,0 +1,3 @@
1
+ import { Node as ProseMirrorNode } from 'prosemirror-model';
2
+ import { Predicate, NodeWithPos } from '../types';
3
+ export default function findChildren(node: ProseMirrorNode, predicate: Predicate): NodeWithPos[];
@@ -0,0 +1,6 @@
1
+ import { Node as ProseMirrorNode } from 'prosemirror-model';
2
+ import { Predicate, Range, NodeWithPos } from '../types';
3
+ /**
4
+ * Same as `findChildren` but searches only within a `range`.
5
+ */
6
+ export default function findChildrenInRange(node: ProseMirrorNode, range: Range, predicate: Predicate): NodeWithPos[];
@@ -0,0 +1,9 @@
1
+ /// <reference types="prosemirror-model" />
2
+ import { Selection } from 'prosemirror-state';
3
+ import { Predicate } from '../types';
4
+ export default function findParentNode(predicate: Predicate): (selection: Selection) => {
5
+ pos: number;
6
+ start: number;
7
+ depth: number;
8
+ node: import("prosemirror-model").Node<any>;
9
+ } | undefined;
@@ -0,0 +1,8 @@
1
+ import { ResolvedPos, Node as ProseMirrorNode } from 'prosemirror-model';
2
+ import { Predicate } from '../types';
3
+ export default function findParentNodeClosestToPos($pos: ResolvedPos, predicate: Predicate): ({
4
+ pos: number;
5
+ start: number;
6
+ depth: number;
7
+ node: ProseMirrorNode;
8
+ } | undefined);
@@ -0,0 +1,2 @@
1
+ import { Extensions, JSONContent } from '../types';
2
+ export default function generateHTML(doc: JSONContent, extensions: Extensions): string;
@@ -0,0 +1,2 @@
1
+ import { Extensions } from '../types';
2
+ export default function generateJSON(html: string, extensions: Extensions): Record<string, any>;
@@ -0,0 +1,5 @@
1
+ import { Extensions, JSONContent, TextSerializer } from '../types';
2
+ export default function generateText(doc: JSONContent, extensions: Extensions, options?: {
3
+ blockSeparator?: string;
4
+ textSerializers?: Record<string, TextSerializer>;
5
+ }): string;
@@ -0,0 +1,3 @@
1
+ import { MarkType, NodeType } from 'prosemirror-model';
2
+ import { EditorState } from 'prosemirror-state';
3
+ export default function getAttributes(state: EditorState, typeOrName: string | NodeType | MarkType): Record<string, any>;
@@ -0,0 +1,6 @@
1
+ import { Extensions, ExtensionAttribute } from '../types';
2
+ /**
3
+ * Get a list of all extension attributes defined in `addAttribute` and `addGlobalAttribute`.
4
+ * @param extensions List of extensions
5
+ */
6
+ export default function getAttributesFromExtensions(extensions: Extensions): ExtensionAttribute[];
@@ -0,0 +1,8 @@
1
+ import { Node as ProseMirrorNode } from 'prosemirror-model';
2
+ import { JSONContent } from '../types';
3
+ interface DebugJSONContent extends JSONContent {
4
+ from: number;
5
+ to: number;
6
+ }
7
+ export default function getDebugJSON(node: ProseMirrorNode, startOffset?: number): DebugJSONContent;
8
+ export {};
@@ -0,0 +1,2 @@
1
+ import { AnyExtension, RemoveThis, MaybeThisParameterType } from '../types';
2
+ export default function getExtensionField<T = any>(extension: AnyExtension, field: string, context?: Omit<MaybeThisParameterType<T>, 'parent'>): RemoveThis<T>;
@@ -0,0 +1,2 @@
1
+ import { Schema, Fragment } from 'prosemirror-model';
2
+ export default function getHTMLFromFragment(fragment: Fragment, schema: Schema): string;
@@ -0,0 +1,3 @@
1
+ import { EditorState } from 'prosemirror-state';
2
+ import { MarkType } from 'prosemirror-model';
3
+ export default function getMarkAttributes(state: EditorState, typeOrName: string | MarkType): Record<string, any>;
@@ -0,0 +1,3 @@
1
+ import { MarkType, ResolvedPos } from 'prosemirror-model';
2
+ import { Range } from '../types';
3
+ export default function getMarkRange($pos: ResolvedPos, type: MarkType, attributes?: Record<string, any>): Range | void;
@@ -0,0 +1,2 @@
1
+ import { MarkType, Schema } from 'prosemirror-model';
2
+ export default function getMarkType(nameOrType: string | MarkType, schema: Schema): MarkType;
@@ -0,0 +1,3 @@
1
+ import { EditorState } from 'prosemirror-state';
2
+ import { MarkRange } from '../types';
3
+ export default function getMarksBetween(from: number, to: number, state: EditorState): MarkRange[];
@@ -0,0 +1,3 @@
1
+ import { EditorState } from 'prosemirror-state';
2
+ import { NodeType } from 'prosemirror-model';
3
+ export default function getNodeAttributes(state: EditorState, typeOrName: string | NodeType): Record<string, any>;
@@ -0,0 +1,2 @@
1
+ import { NodeType, Schema } from 'prosemirror-model';
2
+ export default function getNodeType(nameOrType: string | NodeType, schema: Schema): NodeType;
@@ -0,0 +1,3 @@
1
+ import { Node, Mark } from 'prosemirror-model';
2
+ import { ExtensionAttribute } from '../types';
3
+ export default function getRenderedAttributes(nodeOrMark: Node | Mark, extensionAttributes: ExtensionAttribute[]): Record<string, any>;
@@ -0,0 +1,3 @@
1
+ import { Schema } from 'prosemirror-model';
2
+ import { Extensions } from '../types';
3
+ export default function getSchema(extensions: Extensions): Schema;
@@ -0,0 +1,3 @@
1
+ import { Schema } from 'prosemirror-model';
2
+ import { Extensions } from '../types';
3
+ export default function getSchemaByResolvedExtensions(extensions: Extensions): Schema;
@@ -0,0 +1,2 @@
1
+ import { MarkType, NodeType, Schema } from 'prosemirror-model';
2
+ export default function getSchemaTypeByName(name: string, schema: Schema): NodeType | MarkType | null;
@@ -0,0 +1,2 @@
1
+ import { Schema } from 'prosemirror-model';
2
+ export default function getSchemaTypeNameByName(name: string, schema: Schema): 'node' | 'mark' | null;
@@ -0,0 +1,2 @@
1
+ import { ExtensionAttribute } from '../types';
2
+ export default function getSplittedAttributes(extensionAttributes: ExtensionAttribute[], typeName: string, attributes: Record<string, any>): Record<string, any>;
@@ -0,0 +1,6 @@
1
+ import { TextSerializer } from '../types';
2
+ import { Node as ProseMirrorNode } from 'prosemirror-model';
3
+ export default function getText(node: ProseMirrorNode, options?: {
4
+ blockSeparator?: string;
5
+ textSerializers?: Record<string, TextSerializer>;
6
+ }): string;
@@ -0,0 +1,6 @@
1
+ import { Range, TextSerializer } from '../types';
2
+ import { Node as ProseMirrorNode } from 'prosemirror-model';
3
+ export default function getTextBetween(startNode: ProseMirrorNode, range: Range, options?: {
4
+ blockSeparator?: string;
5
+ textSerializers?: Record<string, TextSerializer>;
6
+ }): string;
@@ -0,0 +1,3 @@
1
+ import { Schema } from 'prosemirror-model';
2
+ import { TextSerializer } from '../types';
3
+ export default function getTextSeralizersFromSchema(schema: Schema): Record<string, TextSerializer>;
@@ -0,0 +1,9 @@
1
+ import { ParseRule } from 'prosemirror-model';
2
+ import { ExtensionAttribute } from '../types';
3
+ /**
4
+ * This function merges extension attributes into parserule attributes (`attrs` or `getAttrs`).
5
+ * Cancels when `getAttrs` returned `false`.
6
+ * @param parseRule ProseMirror ParseRule
7
+ * @param extensionAttributes List of attributes to inject
8
+ */
9
+ export default function injectExtensionAttributesToParseRule(parseRule: ParseRule, extensionAttributes: ExtensionAttribute[]): ParseRule;
@@ -0,0 +1,2 @@
1
+ import { EditorState } from 'prosemirror-state';
2
+ export default function isActive(state: EditorState, name: string | null, attributes?: Record<string, any>): boolean;
@@ -0,0 +1,2 @@
1
+ import { Extensions } from '../types';
2
+ export default function isList(name: string, extensions: Extensions): boolean;
@@ -0,0 +1,3 @@
1
+ import { EditorState } from 'prosemirror-state';
2
+ import { MarkType } from 'prosemirror-model';
3
+ export default function isMarkActive(state: EditorState, typeOrName: MarkType | string | null, attributes?: Record<string, any>): boolean;
@@ -0,0 +1,3 @@
1
+ import { EditorState } from 'prosemirror-state';
2
+ import { NodeType } from 'prosemirror-model';
3
+ export default function isNodeActive(state: EditorState, typeOrName: NodeType | string | null, attributes?: Record<string, any>): boolean;
@@ -0,0 +1,2 @@
1
+ import { Node as ProseMirrorNode } from 'prosemirror-model';
2
+ export default function isNodeEmpty(node: ProseMirrorNode): boolean;
@@ -0,0 +1,2 @@
1
+ import { NodeSelection } from 'prosemirror-state';
2
+ export default function isNodeSelection(value: unknown): value is NodeSelection;
@@ -0,0 +1,2 @@
1
+ import { TextSelection } from 'prosemirror-state';
2
+ export default function isTextSelection(value: unknown): value is TextSelection;
@@ -0,0 +1,2 @@
1
+ import { EditorView } from 'prosemirror-view';
2
+ export default function posToDOMRect(view: EditorView, from: number, to: number): DOMRect;
@@ -0,0 +1,2 @@
1
+ import { Transaction } from 'prosemirror-state';
2
+ export default function selectionToInsertionEnd(tr: Transaction, startLen: number, bias: number): void;
@@ -0,0 +1,9 @@
1
+ import { Extensions } from '../types';
2
+ import { Extension } from '../Extension';
3
+ import { Node } from '../Node';
4
+ import { Mark } from '../Mark';
5
+ export default function splitExtensions(extensions: Extensions): {
6
+ baseExtensions: Extension<any, any>[];
7
+ nodeExtensions: Node<any, any>[];
8
+ markExtensions: Mark<any, any>[];
9
+ };
@@ -0,0 +1,57 @@
1
+ import * as extensions from './extensions';
2
+ export { extensions };
3
+ export * from './Editor';
4
+ export * from './Extension';
5
+ export * from './Node';
6
+ export * from './Mark';
7
+ export * from './NodeView';
8
+ export * from './Tracker';
9
+ export * from './InputRule';
10
+ export * from './PasteRule';
11
+ export * from './CommandManager';
12
+ export * from './types';
13
+ export { default as nodeInputRule } from './inputRules/nodeInputRule';
14
+ export { default as markInputRule } from './inputRules/markInputRule';
15
+ export { default as textblockTypeInputRule } from './inputRules/textblockTypeInputRule';
16
+ export { default as textInputRule } from './inputRules/textInputRule';
17
+ export { default as wrappingInputRule } from './inputRules/wrappingInputRule';
18
+ export { default as markPasteRule } from './pasteRules/markPasteRule';
19
+ export { default as textPasteRule } from './pasteRules/textPasteRule';
20
+ export { default as callOrReturn } from './utilities/callOrReturn';
21
+ export { default as mergeAttributes } from './utilities/mergeAttributes';
22
+ export { default as getExtensionField } from './helpers/getExtensionField';
23
+ export { default as findChildren } from './helpers/findChildren';
24
+ export { default as findChildrenInRange } from './helpers/findChildrenInRange';
25
+ export { default as findParentNode } from './helpers/findParentNode';
26
+ export { default as findParentNodeClosestToPos } from './helpers/findParentNodeClosestToPos';
27
+ export { default as generateHTML } from './helpers/generateHTML';
28
+ export { default as generateJSON } from './helpers/generateJSON';
29
+ export { default as generateText } from './helpers/generateText';
30
+ export { default as getSchema } from './helpers/getSchema';
31
+ export { default as getHTMLFromFragment } from './helpers/getHTMLFromFragment';
32
+ export { default as getDebugJSON } from './helpers/getDebugJSON';
33
+ export { default as getAttributes } from './helpers/getAttributes';
34
+ export { default as getMarkAttributes } from './helpers/getMarkAttributes';
35
+ export { default as getMarkRange } from './helpers/getMarkRange';
36
+ export { default as getMarkType } from './helpers/getMarkType';
37
+ export { default as getMarksBetween } from './helpers/getMarksBetween';
38
+ export { default as getNodeAttributes } from './helpers/getNodeAttributes';
39
+ export { default as getNodeType } from './helpers/getNodeType';
40
+ export { default as getText } from './helpers/getText';
41
+ export { default as getTextBetween } from './helpers/getTextBetween';
42
+ export { default as isActive } from './helpers/isActive';
43
+ export { default as isList } from './helpers/isList';
44
+ export { default as isMarkActive } from './helpers/isMarkActive';
45
+ export { default as isNodeActive } from './helpers/isNodeActive';
46
+ export { default as isNodeEmpty } from './helpers/isNodeEmpty';
47
+ export { default as isNodeSelection } from './helpers/isNodeSelection';
48
+ export { default as isTextSelection } from './helpers/isTextSelection';
49
+ export { default as posToDOMRect } from './helpers/posToDOMRect';
50
+ export interface Commands<ReturnType = any> {
51
+ }
52
+ export interface ExtensionConfig<Options = any, Storage = any> {
53
+ }
54
+ export interface NodeConfig<Options = any, Storage = any> {
55
+ }
56
+ export interface MarkConfig<Options = any, Storage = any> {
57
+ }
@@ -0,0 +1,12 @@
1
+ import { InputRule, InputRuleFinder } from '../InputRule';
2
+ import { MarkType } from 'prosemirror-model';
3
+ import { ExtendedRegExpMatchArray } from '../types';
4
+ /**
5
+ * Build an input rule that adds a mark when the
6
+ * matched text is typed into it.
7
+ */
8
+ export default function markInputRule(config: {
9
+ find: InputRuleFinder;
10
+ type: MarkType;
11
+ getAttributes?: Record<string, any> | ((match: ExtendedRegExpMatchArray) => Record<string, any>) | false | null;
12
+ }): InputRule;
@@ -0,0 +1,12 @@
1
+ import { NodeType } from 'prosemirror-model';
2
+ import { InputRule, InputRuleFinder } from '../InputRule';
3
+ import { ExtendedRegExpMatchArray } from '../types';
4
+ /**
5
+ * Build an input rule that adds a node when the
6
+ * matched text is typed into it.
7
+ */
8
+ export default function nodeInputRule(config: {
9
+ find: InputRuleFinder;
10
+ type: NodeType;
11
+ getAttributes?: Record<string, any> | ((match: ExtendedRegExpMatchArray) => Record<string, any>) | false | null;
12
+ }): InputRule;
@@ -0,0 +1,9 @@
1
+ import { InputRule, InputRuleFinder } from '../InputRule';
2
+ /**
3
+ * Build an input rule that replaces text when the
4
+ * matched text is typed into it.
5
+ */
6
+ export default function textInputRule(config: {
7
+ find: InputRuleFinder;
8
+ replace: string;
9
+ }): InputRule;
@@ -0,0 +1,14 @@
1
+ import { InputRule, InputRuleFinder } from '../InputRule';
2
+ import { NodeType } from 'prosemirror-model';
3
+ import { ExtendedRegExpMatchArray } from '../types';
4
+ /**
5
+ * Build an input rule that changes the type of a textblock when the
6
+ * matched text is typed into it. When using a regular expresion you’ll
7
+ * probably want the regexp to start with `^`, so that the pattern can
8
+ * only occur at the start of a textblock.
9
+ */
10
+ export default function textblockTypeInputRule(config: {
11
+ find: InputRuleFinder;
12
+ type: NodeType;
13
+ getAttributes?: Record<string, any> | ((match: ExtendedRegExpMatchArray) => Record<string, any>) | false | null;
14
+ }): InputRule;