import type { Editor, EditorBinding } from './types'; import { AutomergeDocumentEditor } from './automerge/automergeDocumentEditor'; export const editors: readonly Editor[] = [ { kind: 'automerge', Component: AutomergeDocumentEditor }, ]; const editorsByKind = new Map( editors.map((editor) => [editor.kind, editor]), ); export function resolveEditor(binding: EditorBinding): Editor | undefined { return editorsByKind.get(binding.kind); }