add hyperlink to paragraph and doc

This commit is contained in:
Ivan Lopez
2018-05-06 22:24:16 -05:00
parent 195c62f80b
commit 9d7fd55e4c
3 changed files with 20 additions and 1 deletions

View File

@ -2,3 +2,4 @@ export * from "./formatting";
export * from "./paragraph";
export * from "./properties";
export * from "./run";
export * from "./links";

View File

@ -13,6 +13,7 @@ import { ISpacingProperties, Spacing } from "./formatting/spacing";
import { Style } from "./formatting/style";
import { CenterTabStop, LeftTabStop, MaxRightTabStop, RightTabStop } from "./formatting/tab-stop";
import { NumberProperties } from "./formatting/unordered-list";
import { Hyperlink } from "./links";
import { ParagraphProperties } from "./properties";
export class Paragraph extends XmlComponent {
@ -32,6 +33,11 @@ export class Paragraph extends XmlComponent {
return this;
}
public addHyperLink(hyperlink: Hyperlink): Paragraph {
this.root.push(hyperlink);
return this;
}
public createTextRun(text: string): TextRun {
const run = new TextRun(text);
this.addRun(run);