API Referencev1.3.2
@eigenpal/docx-editor-core/prosemirror/commentOps
Functions(3)
fn
packages/core/src/prosemirror/commentOps.ts:49addCommentToRange
Locate the comment range (paragraph, narrowed by `search`), add the comment mark, dispatch, and return the created Comment. Returns null when the schema lacks a comment mark or the range can't be resolved. The caller owns adding the comment to its own state and showing the sidebar.
declare function addCommentToRange(view: EditorView, options: AddCommentOptions, allocator: CommentIdAllocator): Comment | null;fn
packages/core/src/prosemirror/commentOps.ts:93applyProposedChange
Apply a tracked change (insertion / deletion / replace) to the located range. `search === ''` means a pure insertion at the paragraph end; `replaceWith === ''` means a pure deletion. Refuses to layer onto an existing tracked change. Returns true when a change was dispatched, false otherwise.
declare function applyProposedChange(view: EditorView, options: ProposeChangeOptions, allocator: CommentIdAllocator): boolean;fn
packages/core/src/prosemirror/commentOps.ts:15createComment
Build a Comment object with a freshly-allocated ID.
declare function createComment(allocator: CommentIdAllocator, text: string, authorName: string, parentId?: number): Comment;Interfaces(2)
interface
packages/core/src/prosemirror/commentOps.ts:36AddCommentOptions
interface AddCommentOptions| Member | Type | Summary |
|---|---|---|
| author | string | |
| paraId | string | |
| search? | string | |
| text | string |
interface
packages/core/src/prosemirror/commentOps.ts:80ProposeChangeOptions
interface ProposeChangeOptions| Member | Type | Summary |
|---|---|---|
| author | string | |
| paraId | string | |
| replaceWith | string | |
| search | string |