import { VisEditorConstructor } from './visualize_app/types' ; const DEFAULT_NAME = 'default' ; export const createVisEditorsRegistry = ( ) => { const map = new Map < string , VisEditorConstructor < any > > ( ) ; return { registerDefault : ( editor ) => { map . set ( DEFAULT_NAME , editor ) ; } , register : < TVisParams > ( name , editor ) => { if ( name ) { map . set ( name , editor ) ; } } , get : ( name ) => map . get ( name || DEFAULT_NAME ) , } ; } ; export type VisEditorsRegistry = ReturnType < typeof createVisEditorsRegistry > ;