Files
docx-js/src/file/drawing/text-wrap/wrap-top-and-bottom.ts
2022-08-31 07:52:27 +01:00

33 lines
782 B
TypeScript

// http://officeopenxml.com/drwPicFloating-textWrap.php
import { XmlAttributeComponent, XmlComponent } from "@file/xml-components";
import { IMargins } from "../floating";
class WrapTopAndBottomAttributes extends XmlAttributeComponent<{
readonly distT?: number;
readonly distB?: number;
}> {
protected readonly xmlKeys = {
distT: "distT",
distB: "distB",
};
}
export class WrapTopAndBottom extends XmlComponent {
public constructor(
margins: IMargins = {
top: 0,
bottom: 0,
},
) {
super("wp:wrapTopAndBottom");
this.root.push(
new WrapTopAndBottomAttributes({
distT: margins.top,
distB: margins.bottom,
}),
);
}
}