docx
Version:
Easily generate .docx files with JS/TS with a nice declarative API. Works for Node and on the Browser.
19 lines (16 loc) • 528 B
text/typescript
import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
class SymbolAttributes extends XmlAttributeComponent<{
readonly char: string;
readonly symbolfont?: string;
}> {
protected readonly xmlKeys = {
char: "w:char",
symbolfont: "w:font",
};
}
export class Symbol extends XmlComponent {
constructor(char: string = "", symbolfont: string = "Wingdings") {
super("w:sym");
this.root.push(new SymbolAttributes({ char: char, symbolfont: symbolfont }));
}
}