2018-09-26 02:17:39 +01:00
|
|
|
// http://www.datypic.com/sc/ooxml/e-w_sdtPr-1.html
|
2023-06-22 14:42:17 -04:00
|
|
|
import { CheckBoxUtil } from "@file/checkbox";
|
2022-11-03 00:30:16 +00:00
|
|
|
import { StringValueElement, XmlComponent } from "@file/xml-components";
|
2018-09-19 11:01:07 -03:00
|
|
|
|
2023-06-22 14:42:17 -04:00
|
|
|
export type SdtPrChild =
|
|
|
|
| CheckBoxUtil;
|
|
|
|
|
|
|
|
export interface ISdtPropertiesOptions {
|
|
|
|
readonly children : readonly SdtPrChild[];
|
|
|
|
}
|
2018-09-26 02:17:39 +01:00
|
|
|
export class StructuredDocumentTagProperties extends XmlComponent {
|
2023-06-22 14:42:17 -04:00
|
|
|
public constructor(alias?: string, options?: ISdtPropertiesOptions) {
|
2018-09-20 10:47:10 -03:00
|
|
|
super("w:sdtPr");
|
2023-06-22 14:42:17 -04:00
|
|
|
|
|
|
|
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)
|
|
|
|
}
|
|
|
|
}
|
2018-09-19 11:01:07 -03:00
|
|
|
}
|
|
|
|
}
|