File size: 561 Bytes
2daf8de
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import type { Editor } from '@tiptap/core'
import type { ReactPortal } from 'react'

import type { ReactRenderer } from './ReactRenderer.js'

export type EditorWithContentComponent = Editor & {
  contentComponent?: ContentComponent | null
  isEditorContentInitialized?: boolean
}
export type ContentComponent = {
  setRenderer(id: string, renderer: ReactRenderer): void
  removeRenderer(id: string): void
  subscribe: (callback: () => void) => () => void
  getSnapshot: () => Record<string, ReactPortal>
  getServerSnapshot: () => Record<string, ReactPortal>
}