Files
docx-js/src/file/drawing/inline/graphic/index.ts

24 lines
639 B
TypeScript
Raw Normal View History

import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
2017-03-13 00:02:56 +00:00
import { GraphicData } from "./graphic-data";
2017-03-13 00:40:39 +00:00
interface IGraphicProperties {
a: string;
}
class GraphicAttributes extends XmlAttributeComponent<IGraphicProperties> {
protected xmlKeys = {
a: "xmlns:a",
};
}
export class Graphic extends XmlComponent {
2018-01-22 20:42:57 +00:00
constructor(referenceId: number, x: number, y: number) {
super("a:graphic");
2017-03-13 00:40:39 +00:00
this.root.push(new GraphicAttributes({
a: "http://schemas.openxmlformats.org/drawingml/2006/main",
}));
2018-01-22 20:42:57 +00:00
this.root.push(new GraphicData(referenceId, x, y));
}
}