Files
docx-js/src/file/styles/defaults/document-defaults.ts

26 lines
1.0 KiB
TypeScript
Raw Normal View History

import { IParagraphStylePropertiesOptions } from "@file/paragraph/properties";
import { IRunStylePropertiesOptions } from "@file/paragraph/run/properties";
import { XmlComponent } from "@file/xml-components";
2020-07-15 14:10:37 +08:00
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;
2022-08-31 07:52:27 +01:00
public constructor(options: IDocumentDefaultsOptions) {
2020-07-15 14:10:37 +08:00
super("w:docDefaults");
2021-03-09 01:37:22 +00:00
this.runPropertiesDefaults = new RunPropertiesDefaults(options.run);
this.paragraphPropertiesDefaults = new ParagraphPropertiesDefaults(options.paragraph);
2020-07-15 14:10:37 +08:00
this.root.push(this.runPropertiesDefaults);
this.root.push(this.paragraphPropertiesDefaults);
}
}