move indent.ts over to paragraph and add a #indent method
This commit is contained in:
27
ts/docx/paragraph/indent.ts
Normal file
27
ts/docx/paragraph/indent.ts
Normal file
@ -0,0 +1,27 @@
|
||||
import { XmlAttributeComponent, XmlComponent } from "../docx/xml-components";
|
||||
|
||||
interface IndentAttributesProperties {
|
||||
left: number;
|
||||
hanging: number;
|
||||
}
|
||||
|
||||
class IndentAttributes extends XmlAttributeComponent {
|
||||
|
||||
constructor(properties: IndentAttributesProperties) {
|
||||
super({
|
||||
left: "w:left",
|
||||
hanging: "w:hanging",
|
||||
}, properties);
|
||||
}
|
||||
}
|
||||
|
||||
export class Indent extends XmlComponent {
|
||||
|
||||
constructor(left: number, hanging?: number) {
|
||||
super("w:ind");
|
||||
this.root.push(new IndentAttributes({
|
||||
left: left,
|
||||
hanging: hanging,
|
||||
}));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user