Revert "Modify sdt-properties to accommodate for children elements"

This reverts commit f706d8e62d.
This commit is contained in:
Juan D
2023-06-22 15:39:39 -04:00
parent 20e0213c7d
commit 58e7dbf445

View File

@ -1,25 +1,9 @@
// http://www.datypic.com/sc/ooxml/e-w_sdtPr-1.html // http://www.datypic.com/sc/ooxml/e-w_sdtPr-1.html
import { CheckBoxUtil } from "@file/checkbox";
import { StringValueElement, XmlComponent } from "@file/xml-components"; import { StringValueElement, XmlComponent } from "@file/xml-components";
export type SdtPrChild =
| CheckBoxUtil;
export interface ISdtPropertiesOptions {
readonly children : readonly SdtPrChild[];
}
export class StructuredDocumentTagProperties extends XmlComponent { export class StructuredDocumentTagProperties extends XmlComponent {
public constructor(alias?: string, options?: ISdtPropertiesOptions) { public constructor(alias: string) {
super("w:sdtPr"); super("w:sdtPr");
this.root.push(new StringValueElement("w:alias", alias));
if(typeof alias === 'string'){
this.root.push(new StringValueElement("w:alias", alias));
}
if(options?.children){
for(const child of options.children){
this.root.push(child)
}
}
} }
} }