Files
docx-js/ts/docx/run/index.ts

39 lines
793 B
TypeScript
Raw Normal View History

2016-03-30 03:50:53 +01:00
import {XmlComponent, Attributes} from "../xml-components";
import {RunProperties} from "./properties";
2016-05-08 17:01:20 +01:00
import {Bold, Italics, Underline} from "./formatting";
2016-03-30 03:50:53 +01:00
2016-04-09 20:16:35 +01:00
export class Run extends XmlComponent {
2016-03-30 03:50:53 +01:00
private properties: RunProperties;
2016-04-03 01:44:18 +01:00
2016-03-30 03:50:53 +01:00
constructor() {
2016-04-09 20:16:35 +01:00
super("w:r");
2016-03-30 03:50:53 +01:00
this.properties = new RunProperties();
2016-04-09 20:16:35 +01:00
this.root.push(this.properties);
2016-03-30 03:50:53 +01:00
}
2016-03-30 04:43:56 +01:00
2016-03-30 04:30:58 +01:00
bold(): Run {
this.properties.push(new Bold());
return this;
}
2016-03-30 04:43:56 +01:00
2016-05-18 17:06:50 +01:00
italic(): Run {
2016-03-30 04:43:56 +01:00
this.properties.push(new Italics());
return this;
}
underline(): Run {
this.properties.push(new Underline());
return this;
}
2016-05-17 23:37:36 +01:00
2016-05-18 17:06:50 +01:00
break(): Run {
// TODO
return this;
}
tab(): Run {
2016-05-17 23:37:36 +01:00
// TODO
return this;
}
2016-03-30 03:50:53 +01:00
}