:feat: refined defaults
This commit is contained in:
25
src/file/styles/defaults/document-defaults.ts
Normal file
25
src/file/styles/defaults/document-defaults.ts
Normal file
@ -0,0 +1,25 @@
|
||||
import { IParagraphStylePropertiesOptions } from "file/paragraph/properties";
|
||||
import { IRunStylePropertiesOptions } from "file/paragraph/run/properties";
|
||||
import { XmlComponent } from "file/xml-components";
|
||||
import { ParagraphPropertiesDefaults } from "./paragraph-properties";
|
||||
import { RunPropertiesDefaults } from "./run-properties";
|
||||
|
||||
export interface IDocumentDefaultsOptions {
|
||||
readonly paragraph?: IParagraphStylePropertiesOptions;
|
||||
readonly run?: IRunStylePropertiesOptions;
|
||||
}
|
||||
|
||||
export class DocumentDefaults extends XmlComponent {
|
||||
private readonly runPropertiesDefaults: RunPropertiesDefaults;
|
||||
private readonly paragraphPropertiesDefaults: ParagraphPropertiesDefaults;
|
||||
|
||||
constructor(options?: IDocumentDefaultsOptions) {
|
||||
super("w:docDefaults");
|
||||
|
||||
this.runPropertiesDefaults = new RunPropertiesDefaults(options && options.run);
|
||||
this.paragraphPropertiesDefaults = new ParagraphPropertiesDefaults(options && options.paragraph);
|
||||
|
||||
this.root.push(this.runPropertiesDefaults);
|
||||
this.root.push(this.paragraphPropertiesDefaults);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user