Files
docx-js/src/file/drawing/text-wrap/wrap-tight.ts

35 lines
799 B
TypeScript
Raw Normal View History

// http://officeopenxml.com/drwPicFloating-textWrap.php
2018-06-09 23:49:01 +01:00
import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
2019-01-10 02:10:20 +00:00
import { IMargins } from "../floating";
interface IWrapTightAttributes {
readonly distT?: number;
readonly distB?: number;
}
class WrapTightAttributes extends XmlAttributeComponent<IWrapTightAttributes> {
protected readonly xmlKeys = {
distT: "distT",
distB: "distB",
};
}
export class WrapTight extends XmlComponent {
constructor(
2019-01-10 02:10:20 +00:00
margins: IMargins = {
top: 0,
bottom: 0,
},
) {
super("wp:wrapTight");
this.root.push(
new WrapTightAttributes({
2019-01-10 02:10:20 +00:00
distT: margins.top,
distB: margins.bottom,
}),
);
}
}