2021-03-01 03:28:35 +00:00
|
|
|
import { IViewWrapper } from "file/document-wrapper";
|
2018-02-02 01:56:08 +00:00
|
|
|
import { BaseXmlComponent, IXmlableObject } from "file/xml-components";
|
2016-03-28 00:53:24 +01:00
|
|
|
|
|
|
|
export class Formatter {
|
2021-03-01 03:28:35 +00:00
|
|
|
public format(input: BaseXmlComponent, file?: IViewWrapper): IXmlableObject {
|
2019-12-18 21:11:15 +00:00
|
|
|
const output = input.prepForXml(file);
|
2018-09-20 00:41:57 +01:00
|
|
|
|
|
|
|
if (output) {
|
|
|
|
return output;
|
|
|
|
} else {
|
|
|
|
throw Error("XMLComponent did not format correctly");
|
|
|
|
}
|
2016-03-28 00:53:24 +01:00
|
|
|
}
|
2017-03-09 20:49:14 +01:00
|
|
|
}
|