mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-15 19:47:57 +01:00
20 lines
541 B
TypeScript
20 lines
541 B
TypeScript
import WisemappingImporter from './WisemappingImporter';
|
|
import FreemindImporter from './FreemindImporter';
|
|
import Importer from './Importer';
|
|
|
|
export default class TextImporterFactory {
|
|
static create(type: string, map: string): Importer {
|
|
let result: Importer;
|
|
switch (type) {
|
|
case 'wxml':
|
|
result = new WisemappingImporter(map);
|
|
return result;
|
|
case 'mm':
|
|
result = new FreemindImporter(map);
|
|
return result;
|
|
default:
|
|
throw new Error(`Unsupported type ${type}`);
|
|
}
|
|
}
|
|
}
|