Files
docx-js/src/file/drawing/text-wrap/wrap-tight.ts
Dolan Miu 982d923553 Improve import alias
@file/ and @export/ instead of file/ and export/ etc
2022-06-26 23:26:42 +01:00

33 lines
747 B
TypeScript

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