Files
docx-js/ts/docx/paragraph/indent.ts

28 lines
619 B
TypeScript
Raw Normal View History

import { XmlAttributeComponent, XmlComponent } from "../xml-components";
2016-05-21 00:02:46 +01:00
interface IndentAttributesProperties {
2016-05-26 15:08:34 +01:00
left: number;
hanging: number;
2016-05-21 00:02:46 +01:00
}
class IndentAttributes extends XmlAttributeComponent {
2016-05-26 15:08:34 +01:00
2016-05-21 00:02:46 +01:00
constructor(properties: IndentAttributesProperties) {
super({
left: "w:left",
hanging: "w:hanging",
2016-05-21 00:02:46 +01:00
}, properties);
}
}
export class Indent extends XmlComponent {
2016-05-26 15:08:34 +01:00
constructor(left: number, hanging?: number) {
2016-05-21 00:02:46 +01:00
super("w:ind");
this.root.push(new IndentAttributes({
left: left,
hanging: hanging,
2016-05-21 00:02:46 +01:00
}));
}
}