2019-03-05 17:17:06 +01:00
|
|
|
import { XmlComponent } from "file/xml-components";
|
2021-02-27 01:40:55 +00:00
|
|
|
import { CompatibilitySetting } from "./compatibility-setting/compatibility-setting";
|
2019-03-05 17:17:06 +01:00
|
|
|
|
|
|
|
class DoNotExpandShiftReturn extends XmlComponent {
|
|
|
|
constructor() {
|
|
|
|
super("w:doNotExpandShiftReturn");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-02-27 01:40:55 +00:00
|
|
|
export interface ICompatibilityOptions {
|
|
|
|
readonly doNotExpandShiftReturn?: boolean;
|
|
|
|
readonly version?: number;
|
|
|
|
}
|
|
|
|
|
2019-03-05 17:17:06 +01:00
|
|
|
export class Compatibility extends XmlComponent {
|
2021-02-27 01:40:55 +00:00
|
|
|
constructor(options: ICompatibilityOptions) {
|
2019-03-05 17:17:06 +01:00
|
|
|
super("w:compat");
|
|
|
|
|
2021-02-27 01:40:55 +00:00
|
|
|
if (options.doNotExpandShiftReturn) {
|
|
|
|
this.root.push(new DoNotExpandShiftReturn());
|
|
|
|
}
|
2019-03-05 17:17:06 +01:00
|
|
|
|
2021-02-27 01:40:55 +00:00
|
|
|
if (options.version) {
|
|
|
|
this.root.push(new CompatibilitySetting(options.version));
|
|
|
|
}
|
2019-03-05 17:17:06 +01:00
|
|
|
}
|
|
|
|
}
|