fixed all tslint errors
This commit is contained in:
@ -3,10 +3,10 @@ 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();
|
||||
@ -14,7 +14,7 @@ export class DocumentDefaults extends XmlComponent {
|
||||
this.root.push(this.runPropertiesDefaults);
|
||||
this.root.push(this.paragraphPropertiesDefaults);
|
||||
}
|
||||
|
||||
|
||||
clearVariables(): void {
|
||||
this.runPropertiesDefaults.clearVariables();
|
||||
this.paragraphPropertiesDefaults.clearVariables();
|
||||
|
@ -5,6 +5,6 @@ export class RunPropertiesDefaults extends XmlComponent {
|
||||
|
||||
constructor() {
|
||||
super("w:rPrDefault");
|
||||
this.root.push(new RunProperties());
|
||||
this.root.push(new RunProperties());
|
||||
}
|
||||
}
|
@ -3,7 +3,7 @@ import {DocumentDefaults} from "./defaults";
|
||||
import {ParagraphPropertiesDefaults} from "./defaults/paragraph-properties";
|
||||
import {RunPropertiesDefaults} from "./defaults/run-properties";
|
||||
import {Heading1Style, Heading2Style, TitleStyle, Heading3Style, Heading4Style, Heading5Style, Heading6Style, ListParagraph} from "./style";
|
||||
//import {StyleAttributes} from "./style/attributes";
|
||||
// import {StyleAttributes} from "./style/attributes";
|
||||
import {ParagraphProperties} from "../docx/paragraph/properties";
|
||||
import {RunProperties} from "../docx/run/properties";
|
||||
import {Color, Size, Italics} from "../docx/run/formatting";
|
||||
@ -11,46 +11,46 @@ import {Color, Size, Italics} from "../docx/run/formatting";
|
||||
export class DefaultStylesFactory {
|
||||
|
||||
newInstance(): Styles {
|
||||
var styles = new Styles();
|
||||
let styles = new Styles();
|
||||
styles.push(new DocumentDefaults());
|
||||
|
||||
var titleStyle = new TitleStyle();
|
||||
let titleStyle = new TitleStyle();
|
||||
titleStyle.addRunProperty(new Size(56));
|
||||
styles.push(titleStyle);
|
||||
|
||||
var heading1Style = new Heading1Style();
|
||||
let heading1Style = new Heading1Style();
|
||||
heading1Style.addRunProperty(new Color("2E74B5"));
|
||||
heading1Style.addRunProperty(new Size(32));
|
||||
styles.push(heading1Style);
|
||||
|
||||
var heading2Style = new Heading2Style();
|
||||
let heading2Style = new Heading2Style();
|
||||
heading2Style.addRunProperty(new Color("2E74B5"));
|
||||
heading2Style.addRunProperty(new Size(26));
|
||||
styles.push(heading2Style);
|
||||
|
||||
var heading3Style = new Heading3Style();
|
||||
let heading3Style = new Heading3Style();
|
||||
heading3Style.addRunProperty(new Color("1F4D78"));
|
||||
heading3Style.addRunProperty(new Size(24));
|
||||
styles.push(heading3Style);
|
||||
|
||||
var heading4Style = new Heading4Style();
|
||||
let heading4Style = new Heading4Style();
|
||||
heading4Style.addRunProperty(new Color("2E74B5"));
|
||||
heading4Style.addRunProperty(new Italics());
|
||||
styles.push(heading4Style);
|
||||
|
||||
var heading5Style = new Heading5Style();
|
||||
let heading5Style = new Heading5Style();
|
||||
heading5Style.addRunProperty(new Color("2E74B5"));
|
||||
styles.push(heading5Style);
|
||||
|
||||
var heading6Style = new Heading6Style();
|
||||
let heading6Style = new Heading6Style();
|
||||
heading6Style.addRunProperty(new Color("1F4D78"));
|
||||
styles.push(heading6Style);
|
||||
|
||||
var listParagraph = new ListParagraph();
|
||||
//listParagraph.addParagraphProperty();
|
||||
|
||||
let listParagraph = new ListParagraph();
|
||||
// listParagraph.addParagraphProperty();
|
||||
styles.push(listParagraph);
|
||||
|
||||
//console.log(JSON.stringify(styles, null, " "));
|
||||
// console.log(JSON.stringify(styles, null, " "));
|
||||
return styles;
|
||||
}
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
import {XmlComponent} from "../docx/xml-components";
|
||||
import {DocumentAttributes} from "../docx/document/document-attributes"
|
||||
import {DocumentAttributes} from "../docx/document/document-attributes";
|
||||
import {DocumentDefaults} from "./defaults";
|
||||
import {LatentStyles} from "./latent-styles";
|
||||
import {LatentStyleException} from "./latent-styles/exceptions";
|
||||
@ -16,21 +16,21 @@ export class Styles extends XmlComponent {
|
||||
w14: "http://schemas.microsoft.com/office/word/2010/wordml",
|
||||
w15: "http://schemas.microsoft.com/office/word/2012/wordml",
|
||||
Ignorable: "w14 w15"
|
||||
}))
|
||||
//var latentStyles = new LatentStyles();
|
||||
//latentStyles.push(new LatentStyleException(new LatentStyleExceptionAttributes({
|
||||
}));
|
||||
// let latentStyles = new LatentStyles();
|
||||
// latentStyles.push(new LatentStyleException(new LatentStyleExceptionAttributes({
|
||||
// name: "Normal"
|
||||
//})));
|
||||
//this.root.push(latentStyles);
|
||||
// })));
|
||||
// this.root.push(latentStyles);
|
||||
}
|
||||
|
||||
push(style: XmlComponent): void {
|
||||
this.root.push(style);
|
||||
}
|
||||
|
||||
|
||||
clearVariables() {
|
||||
this.root.forEach(element => {
|
||||
element.clearVariables();
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
@ -2,10 +2,10 @@ import {XmlComponent} from "../../../docx/xml-components";
|
||||
|
||||
interface LatentStyleExceptionAttributesProperties {
|
||||
name?: string;
|
||||
uiPriority?: string,
|
||||
qFormat?: string,
|
||||
semiHidden?: string,
|
||||
unhideWhenUsed?: string
|
||||
uiPriority?: string;
|
||||
qFormat?: string;
|
||||
semiHidden?: string;
|
||||
unhideWhenUsed?: string;
|
||||
}
|
||||
|
||||
export class LatentStyleExceptionAttributes extends XmlComponent {
|
||||
@ -21,7 +21,7 @@ export class LatentStyleExceptionAttributes extends XmlComponent {
|
||||
|
||||
constructor(properties?: LatentStyleExceptionAttributesProperties) {
|
||||
super("_attr");
|
||||
this._attr = properties
|
||||
this._attr = properties;
|
||||
|
||||
if (!properties) {
|
||||
this._attr = {};
|
||||
|
@ -2,11 +2,11 @@ import {XmlComponent} from "../../docx/xml-components";
|
||||
import {LatentStyleException} from "./exceptions";
|
||||
|
||||
export class LatentStyles extends XmlComponent {
|
||||
|
||||
|
||||
constructor() {
|
||||
super("w:latentStyles");
|
||||
}
|
||||
|
||||
|
||||
push(latentException: LatentStyleException): void {
|
||||
this.root.push(latentException);
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ export class UnhideWhenUsed extends XmlComponent {
|
||||
}
|
||||
|
||||
export class QuickFormat extends XmlComponent {
|
||||
|
||||
|
||||
constructor() {
|
||||
super("w:qFormat");
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ export class ParagraphStyle extends Style {
|
||||
|
||||
constructor(styleId: string) {
|
||||
|
||||
var attributes = new StyleAttributes({
|
||||
let attributes = new StyleAttributes({
|
||||
type: "paragraph",
|
||||
styleId: styleId
|
||||
});
|
||||
@ -111,7 +111,7 @@ export class Heading6Style extends HeadingStyle {
|
||||
}
|
||||
|
||||
export class ListParagraph extends ParagraphStyle {
|
||||
|
||||
|
||||
constructor() {
|
||||
super("ListParagraph");
|
||||
this.root.push(new Name("List Paragraph"));
|
||||
|
Reference in New Issue
Block a user