Change docx folder to more appropriate "file" folder
This commit is contained in:
17
src/file/styles/defaults/index.ts
Normal file
17
src/file/styles/defaults/index.ts
Normal file
@ -0,0 +1,17 @@
|
||||
import { XmlComponent } from "../../xml-components";
|
||||
import { ParagraphPropertiesDefaults } from "./paragraph-properties";
|
||||
import { RunPropertiesDefaults } from "./run-properties";
|
||||
|
||||
export class DocumentDefaults extends XmlComponent {
|
||||
|
||||
private runPropertiesDefaults: RunPropertiesDefaults;
|
||||
private paragraphPropertiesDefaults: ParagraphPropertiesDefaults;
|
||||
|
||||
constructor() {
|
||||
super("w:docDefaults");
|
||||
this.runPropertiesDefaults = new RunPropertiesDefaults();
|
||||
this.paragraphPropertiesDefaults = new ParagraphPropertiesDefaults();
|
||||
this.root.push(this.runPropertiesDefaults);
|
||||
this.root.push(this.paragraphPropertiesDefaults);
|
||||
}
|
||||
}
|
10
src/file/styles/defaults/paragraph-properties.ts
Normal file
10
src/file/styles/defaults/paragraph-properties.ts
Normal file
@ -0,0 +1,10 @@
|
||||
import { ParagraphProperties } from "../../paragraph/properties";
|
||||
import { XmlComponent } from "../../xml-components";
|
||||
|
||||
export class ParagraphPropertiesDefaults extends XmlComponent {
|
||||
|
||||
constructor() {
|
||||
super("w:pPrDefault");
|
||||
this.root.push(new ParagraphProperties());
|
||||
}
|
||||
}
|
24
src/file/styles/defaults/run-properties.ts
Normal file
24
src/file/styles/defaults/run-properties.ts
Normal file
@ -0,0 +1,24 @@
|
||||
import { Size } from "../../paragraph/run/formatting";
|
||||
import { RunProperties } from "../../paragraph/run/properties";
|
||||
import { RunFonts } from "../../paragraph/run/run-fonts";
|
||||
import { XmlComponent } from "../../xml-components";
|
||||
|
||||
export class RunPropertiesDefaults extends XmlComponent {
|
||||
private properties: RunProperties;
|
||||
|
||||
constructor() {
|
||||
super("w:rPrDefault");
|
||||
this.properties = new RunProperties();
|
||||
this.root.push(this.properties);
|
||||
}
|
||||
|
||||
public size(size: number): RunPropertiesDefaults {
|
||||
this.properties.push(new Size(size));
|
||||
return this;
|
||||
}
|
||||
|
||||
public font(fontName: string): RunPropertiesDefaults {
|
||||
this.properties.push(new RunFonts(fontName));
|
||||
return this;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user