Files
docx-js/src/export/formatter.ts
Dolan Miu fe8b0a6b2b #1699 Allow images to work with Hyperlink
Add stack to IContext for prepForXml
2022-12-26 15:12:44 +00:00

15 lines
495 B
TypeScript

import { BaseXmlComponent, IContext, IXmlableObject } from "@file/xml-components";
export class Formatter {
// tslint:disable-next-line: no-object-literal-type-assertion
public format(input: BaseXmlComponent, context: IContext = { stack: [] } as unknown as IContext): IXmlableObject {
const output = input.prepForXml(context);
if (output) {
return output;
} else {
throw Error("XMLComponent did not format correctly");
}
}
}