Files
docx-js/src/file/drawing/text-wrap/wrap-top-and-bottom.ts

34 lines
874 B
TypeScript
Raw Normal View History

// http://officeopenxml.com/drwPicFloating-textWrap.php
import { XmlComponent, XmlAttributeComponent } from "file/xml-components";
import { Distance } from "../drawing";
interface IWrapTopAndBottomAttributes {
distT?: number;
distB?: number;
}
class WrapTopAndBottomAttributes extends XmlAttributeComponent<IWrapTopAndBottomAttributes> {
protected xmlKeys = {
distT: "distT",
distB: "distB",
};
}
export class WrapTopAndBottom extends XmlComponent {
constructor(distanceFromText?: Distance) {
super("wp:wrapTopAndBottom");
distanceFromText = distanceFromText || {
distT: 0,
distB: 0,
};
this.root.push(
new WrapTopAndBottomAttributes({
distT: distanceFromText.distT,
distB: distanceFromText.distB,
}),
);
}
}