mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-15 19:47:57 +01:00
20 lines
498 B
TypeScript
20 lines
498 B
TypeScript
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}`);
|
|
}
|
|
}
|
|
}
|