Public API
Every export of the editor entry, grouped by registry item.
Generated from the TSDoc on editor/src/index.ts. scripts/check-public-docs.mjs fails when an export has no summary or no @category, and when this page is out of date. The longer guide is API reference.
editor-core
| Export | Summary |
|---|---|
createEditorExtensions | Core extensions, with core and starterKit overrides. |
CoreOptions | Which core blocks to include, omit, or configure. findReplace: false turns find off. documentStats: false turns word count off. |
StarterKitOptions | StarterKit options deep-merged over the defaults. |
useDocumentStats | Word count, character count, and reading time for the document and the selection. |
DocumentStats | Words, characters, blocks, reading time, remaining room, and the selection. |
UseDocumentStatsOptions | throttleMs: update at most that often while typing. |
DEFAULT_SHORTCUTS | Default key for every configurable command. |
formatShortcut | Renders a shortcut, with Mod as ⌘ or Ctrl. |
BlockcnCommandId | Id of a command in DEFAULT_SHORTCUTS. |
ShortcutBinding | A key, a list of keys, or false to disable a command. |
ShortcutsOption | Partial shortcut map accepted by createEditorExtensions. |
acceptSlashItem | Runs a slash item, unless onSlashSelect cancels it. |
BlockChange | A block that was inserted or deleted. |
BlockcnHookOptions | Lifecycle hooks passed to createEditorExtensions. |
BlockMove | A block that moved, with its old and new position. |
DropInfo | A drop the editor is about to handle. |
PasteInfo | A paste the editor is about to handle. |
BlockErrorHandler | Called when a React node view throws. The node stays in the document. |
Block | A block read back by editor.blocks, keyed by type. |
BlockApi | editor.blocks: read and edit blocks by id. |
BlockInput | A block to insert. text is its plain text. |
BlockPlacement | before, after, or nested inside a toggle or column. |
BlockPropsMap | Props the core schema stores on each block type. |
defineBlockcnNode | Node.create that stores storage.blockcn flags. |
defineAddon | Stores extensions, slash entries, chrome, and serializers on one add-on. |
BlockcnAddon | One add-on: extensions, slash, chrome, and serializers. |
BLOCKCN_SCHEMA_VERSION | Schema version stored on a document and used by migrations. |
ContentErrorInfo | What onContentError receives when loaded JSON is still invalid. |
DocumentMigration | Rewrites a stored document before the schema check. |
defaultMessages | English copy for every editor string. |
mergeMessages | Deep-merges a partial locale over the English defaults. |
formatMessage | Fills {name} placeholders in a message. |
Messages | The full message catalog. |
PartialMessages | A deep partial of Messages, for a locale override. |
useMessages | The merged messages for the surrounding Editor. |
getMessages | Messages for an editor instance, including outside React. |
I18n | Holds the message catalog on the editor. |
JSONContent | Tiptap's JSON document. What getJSON and renderDocument take. |
editor-shell
| Export | Summary |
|---|---|
Editor | React root: frame, content, chrome, and outline. |
FindReplacePanel | Find and replace panel. Editor.Frame mounts it. |
useEditor | Creates the editor and reports local document changes. |
DEFAULT_EDITOR_CONTENT | Starter document with one example of each block and inline mark. |
isLocalDocChange | Whether a transaction changed the document locally. |
ChangeOptions | Options for the debounced document callback on useEditor. |
UseEditorOptions | useEditor options: Tiptap's options plus onChange. |
useAutosave | Saves after edits settle, and again on hide or unmount. |
AutosaveStatus | idle, dirty, saving, saved, or error. |
UseAutosaveOptions | Debounce and flush options for useAutosave. |
UseAutosaveResult | Status, last save time, error, and flush from useAutosave. |
createBlockcnEditor | Core blocks plus the add-ons you pass. Tables come from table(). |
editor-vanilla
| Export | Summary |
|---|---|
mountBlockcnEditor | Mounts the core editor with a DOM toolbar and slash menu. No React. |
MountBlockcnEditorOptions | Content, messages, and the change callback for mountBlockcnEditor. |
MountedEditor | The editor mountBlockcnEditor returns, plus destroy. |
media-blocks
| Export | Summary |
|---|---|
media | Image, video, audio, file, and link add-on. |
mediaExtensions | Media extensions with no upload function. |
createMediaExtensions | Media extensions with your upload options. |
MediaExtensionsOptions | Upload limits, accept list, and uploadFile for media. |
MediaUpload | Drop target and upload progress for media files. |
createUploadFile | Browser upload to endpoint, with optional bearer headers. |
UploadFileFn | Function the media blocks call to store a file. |
UploadFileOptions | Progress and abort signal passed into an upload. |
UploadFileResult | URL and optional metadata returned by an upload. |
MEDIA_SLASH_CATEGORY | Slash category id for the media blocks. |
MediaToolbars | Floating toolbars for image, video, audio, file, and link. |
excalidraw-block
| Export | Summary |
|---|---|
excalidraw | Whiteboard add-on. |
ExcalidrawOptions | Options for the whiteboard add-on. |
excalidrawExtensions | Whiteboard extensions used when you are not going through the preset. |
createExcalidrawExtensions | Whiteboard extensions with your options. |
excalidrawTheme | Resolves the whiteboard theme from the editor theme. |
EXCALIDRAW_SLASH_CATEGORY | Slash category id for the whiteboard block. |
table-toolbar
| Export | Summary |
|---|---|
table | Table add-on, including the row and column toolbar. |
TableOptions | Options for the table add-on. |
tableExtensions | Table extensions used when you are not going through the preset. |
createTableExtensions | Table extensions with your options. |
tableCellBackgrounds | Named background colours a cell can use. |
TABLE_SLASH_CATEGORY | Slash category id for the table block. |
TableToolbar | Floating row and column toolbar. Not in the default preset since the row and column grips replaced it. |
TableHandleMenu | Menu opened by a table's row and column grips: colour, insert, duplicate, clear, delete, and header toggles. |
export-menu
| Export | Summary |
|---|---|
ExportMenu | Menu that previews a Markdown, HTML, Word, or pasted import, then downloads HTML, Markdown, or Word, or prints a PDF. |
renderDocument | HTML for a stored document. No DOM and no React. |
exportRegistryOf | The serializer map stored on one editor. |
DrawingCollector | Turns a drawing scene into a PNG data URL while exporting. |
ExportRegistryData | Serializers and drawing collector stored for one editor. |
ExportDocPreparer | Rewrites the document before an export serializes it. |
NodeSerializer | HTML function for one node type. |
SerializerMap | Node type to HTML serializer. |
ai-menu
| Export | Summary |
|---|---|
ai | Ask AI add-on. transport wins over endpoint. |
AiOptions | Options for the Ask AI add-on. |
plainTextTransport | Reads a text response as one chunk. |
sseTransport | Reads text/event-stream chunks. |
aiSdkTransport | Adapts a Vercel AI SDK stream. |
AskAIError | Error thrown by a transport and shown in the panel. |
AskAIContext | Document text around the selection, sent with a request. |
AskAIRequest | One Ask AI request: action, selection, and instruction. |
AskAITransport | Yields completion chunks and stops when signal aborts. |
HttpTransportOptions | Headers and URL options for the plain-text transport. |
SseTransportOptions | Headers and URL options for the SSE transport. |
collectAskAIContext | Collects title and nearby block text for an Ask AI request. |
AskAIContextOptions | How much surrounding text collectAskAIContext includes. |
columns
| Export | Summary |
|---|---|
columns | Resizable column layout add-on. |
ColumnsOptions | Options for the columns add-on. |
columnsExtensions | Column extensions used when you are not going through the preset. |
createColumnsExtensions | Column extensions with your options. |
COLUMNS_SLASH_CATEGORY | Slash category id for the columns block. |
math
| Export | Summary |
|---|---|
math | KaTeX block and inline math add-on. |
MathOptions | Options for the math add-on. |
mathExtensions | Math extensions used when you are not going through the preset. |
createMathExtensions | Math extensions with your KaTeX options. |
MATH_SLASH_CATEGORY | Slash category id for the math block. |
mentions
| Export | Summary |
|---|---|
emoji | Custom emoji data and recents for the : list and the callout grid. |
EmojiOptions | Options for emoji(). |
mentions | @ mentions and the : emoji list. |
MentionOptions | Options for the mentions add-on. fetchMentions is required. |
createMentionExtensions | Mention extensions. fetchMentions is required. |
mentionExtensions | Mention extensions with an empty suggestion list. |
mentionSlashCategory | Slash category for inserting a mention. |
MENTION_SLASH_CATEGORY | Default slash category id for mentions. |
mentionLabel | Label shown for a mention suggestion. |
mentionColor | Stable swatch for a person's id. |
MentionColor | Palette name assigned to a mention. |
FetchMentions | Loads mention suggestions for the text after @. |
MentionExtensionsOptions | Options for createMentionExtensions. |
MentionItem | One suggestion: id and label. |
toc
| Export | Summary |
|---|---|
toc | Table-of-contents block add-on. |
TocOptions | Options for the table-of-contents add-on. |
tocExtensions | Contents extensions used when you are not going through the preset. |
createTocExtensions | Contents extensions with your heading levels. |
TOC_SLASH_CATEGORY | Slash category id for the contents block. |
comments
| Export | Summary |
|---|---|
comments | Comment threads anchored to text, with the composer and thread popover. |
CommentsAddonOptions | comments() options, plus chrome: false to mount the popover yourself. |
createCommentExtensions | The comment mark, its plugin, and the export hook, without the preset. |
createMemoryCommentStore | Threads kept in memory; onChange hands them to you to save. |
createYjsCommentStore | Threads in a Y.Map on a collaboration document. |
createCommentThread | Anchors a new thread on a range with its first comment. |
replyToThread | Adds a reply as the current user. |
editComment | Changes the text of one of your comments. |
deleteComment | Deletes one of your comments; the last one takes the thread with it. |
deleteThread | Deletes a thread and removes its highlight. |
resolveThread | Marks a thread resolved and hides its highlight. |
reopenThread | Opens a resolved thread again. |
canComment | Whether the current user may add, reply to, and resolve comments. |
commentsOf | The comments add-on's store and options on an editor, or null. |
commentFootnotes | Comment marks as numbered footnotes plus a list at the end. |
stripCommentMarks | The document with every comment mark removed. |
commentPlainText | A comment body with mention tokens as @Label. |
threadIdsInDoc | Thread ids anchored in a document, in order. |
threadRange | First and last position of a thread's anchor. |
CommentsOptions | Options for createCommentExtensions. |
CommentAuthor | Who wrote a comment. |
CommentEntry | One comment in a thread. |
CommentThread | A thread: status, quote, and comments. |
CommentThreadStatus | open or resolved. |
CommentStore | Storage interface for threads. |
CommentMentionItem | A person offered after @ in a comment. |
FetchCommentMentions | Loads people for @ in a comment. |
MemoryCommentStoreOptions | Options for createMemoryCommentStore. |
CommentFootnotesOptions | Options for commentFootnotes. |
YDocLike | The Y.Doc methods the Yjs store uses. |
YMapLike | The Y.Map methods the Yjs store uses. |
CommentsLayer | Composer for a new comment and the open thread's popover. |
CommentsSidebar | Every anchored thread, open or resolved; works read-only. |
useCommentThreads | Every thread in the editor's store, for your own UI. |
versions
| Export | Summary |
|---|---|
versions | Version history add-on. Pass chrome: false to mount HistoryPanel yourself. |
VersionsAddonOptions | versions() options, plus chrome: false to mount the panel yourself. |
DEFAULT_VERSION_INTERVAL_MS | How often a versions editor snapshots a changed document. |
createMemoryVersionStore | Versions kept in memory. |
createServerVersionStorage | Versions on the example server. checkout requires a write token. |
createVersionExtensions | The versions extension without the history panel. |
diffDocuments | Insertions and deletions between two documents. |
versionsOf | The versions add-on on an editor, or null. |
DiffPart | One step of a text diff. |
VersionsOptions | Options for createVersionExtensions. |
VersionStorage | Where versions are stored. |
VersionRecord | A saved version and its snapshot. |
VersionMeta | A saved version without its snapshot. |
VersionAuthor | Someone recorded on a version. |
HistoryPanel | The history panel: list, preview, diff, name, and restore. |
suggestions
| Export | Summary |
|---|---|
suggestions | Suggestion mode. Pass chrome: false to mount SuggestionModeToggle yourself. |
SuggestionsAddonOptions | suggestions() options, plus chrome: false to mount the toggle yourself. |
SuggestionModeToggle | The editing, suggesting, and viewing toggle. |
SuggestionCards | Suggestion cards. The comments sidebar mounts these when both add-ons are installed. |
createSuggestionExtensions | Extensions for suggestion mode without the toggle. |
suggestionsOf | The suggestions add-on on an editor, or null. |
suggestionMode | The current editing, suggesting, or viewing mode. |
suggestionItems | Suggestions in document order. |
SuggestionAuthor | Someone a suggestion is attributed to. |
SuggestionMode | editing, suggesting, or viewing. |
SuggestionItem | One suggestion, as the sidebar lists it. |
SuggestionsOptions | Options for createSuggestionExtensions. |
link-preview
| Export | Summary |
|---|---|
linkPreview | Paste menu for a lone URL. The app fetches metadata. |
LinkPreviewOptions | Options for linkPreview(). |
pages
| Export | Summary |
|---|---|
pages | Page links. The app owns the page tree, search, and routing. |
PagesOptions | Options for pages(). fetchPages is required. |