import { MutableRefObject } from 'react'; import { Crepe } from '@milkdown/crepe'; import { usePluginViewFactory, useNodeViewFactory } from '@prosemirror-adapter/react'; import { BrainfishEditorProps, DocumentIssue, MediaUploadHandler, ReviewSuggestionResolveOutcome, ReviewSuggestionsResolveSummary } from '../../types'; interface RegisterPluginsOpts { pluginViewFactory: ReturnType; nodeViewFactory: ReturnType; readOnly: boolean; hasCollab: boolean; onSearchLink?: BrainfishEditorProps['onSearchLink']; onUploadImage?: MediaUploadHandler; onUploadVideo?: MediaUploadHandler; onUploadFile?: MediaUploadHandler; issues?: DocumentIssue[]; onReviewSuggestionSelectRef: MutableRefObject<((suggestionId: string | null) => void) | undefined>; onReviewSuggestionResolveRef: MutableRefObject<((suggestionId: string, outcome: ReviewSuggestionResolveOutcome) => void) | undefined>; onReviewSuggestionsResolvedRef: MutableRefObject<((summary: ReviewSuggestionsResolveSummary) => void) | undefined>; imageErrorFallbackUrlRef: MutableRefObject; } /** * Registers all custom Milkdown plugins on the Crepe editor. * * **Order matters.** ProseMirror iterates plugins in reverse for `handleKeyDown`, * and Crepe's clipboard plugin uses `handlePaste` (not `transformPasted`), so * paste-rewriting plugins must be prepended. Notable orderings: * - `emojiSuggestProsePlugin` registers second-to-last so its keydown runs first. * - `tableHardBreakPlugin` registers last (after emoji) so this runs first on keydown. */ export declare function registerPlugins(crepe: Crepe, opts: RegisterPluginsOpts): void; export {};