Make tab and page numbers declarative

This commit is contained in:
Dolan
2019-11-21 01:02:46 +00:00
parent b2aeb2d83c
commit 7dfb016faa
17 changed files with 124 additions and 103 deletions

View File

@ -1,13 +1,8 @@
import { FootnoteReferenceRun } from "file/footnotes/footnote/run/reference-run";
import { IRunOptions, Run } from "./run";
import { Text } from "./run-components/text";
export interface ITextRunOptions extends IRunOptions {
readonly text: string;
}
export class TextRun extends Run {
constructor(options: ITextRunOptions | string) {
constructor(options: IRunOptions | string) {
if (typeof options === "string") {
super({});
this.root.push(new Text(options));
@ -15,11 +10,5 @@ export class TextRun extends Run {
}
super(options);
this.root.push(new Text(options.text));
}
public referenceFootnote(id: number): TextRun {
this.root.push(new FootnoteReferenceRun(id));
return this;
}
}