Files
docx-js/src/file/paragraph/formatting/indent.ts

28 lines
767 B
TypeScript
Raw Normal View History

2017-09-21 14:56:46 +01:00
// http://officeopenxml.com/WPindentation.php
import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
2016-05-21 00:02:46 +01:00
2018-08-21 02:46:21 +01:00
export interface IIndentAttributesProperties {
readonly left?: number;
readonly hanging?: number;
readonly firstLine?: number;
readonly start?: number;
readonly end?: number;
2016-05-21 00:02:46 +01:00
}
class IndentAttributes extends XmlAttributeComponent<IIndentAttributesProperties> {
protected readonly xmlKeys = {
left: "w:left",
hanging: "w:hanging",
firstLine: "w:firstLine",
start: "w:start",
end: "w:end",
};
2016-05-21 00:02:46 +01:00
}
export class Indent extends XmlComponent {
2018-08-21 02:46:21 +01:00
constructor(attrs: IIndentAttributesProperties) {
2016-05-21 00:02:46 +01:00
super("w:ind");
this.root.push(new IndentAttributes(attrs));
2016-05-21 00:02:46 +01:00
}
}