wisemapping-frontend/packages/mindplot/src/components/import/TextImporterFactory.ts

20 lines
498 B
TypeScript
Raw Normal View History

2022-03-08 18:30:34 +01:00
import FreemindImporter from './FreemindImporter';
import FreemindMap from '../export/freemind/Map';
import Importer from './Importer';
type textType = 'mm';
type mapType = FreemindMap
export default class TextImporterFactory {
static create(type: textType, map: mapType): Importer {
let result: Importer;
switch (type) {
case 'mm':
result = new FreemindImporter(map);
return result;
default:
throw new Error(`Unsupported type ${type}`);
}
}
}