Files
docx-js/src/file/drawing/inline/graphic/graphic-data/pic/blip/blip.ts

25 lines
622 B
TypeScript
Raw Normal View History

import { IMediaData } from "@file/media";
import { XmlAttributeComponent, XmlComponent } from "@file/xml-components";
2017-03-13 00:02:56 +00:00
2021-03-15 00:11:39 +00:00
class BlipAttributes extends XmlAttributeComponent<{
readonly embed: string;
readonly cstate: string;
2021-03-15 00:11:39 +00:00
}> {
protected readonly xmlKeys = {
2017-03-13 00:02:56 +00:00
embed: "r:embed",
2018-01-16 00:43:00 +00:00
cstate: "cstate",
2017-03-13 00:02:56 +00:00
};
}
export class Blip extends XmlComponent {
2022-08-31 07:52:27 +01:00
public constructor(mediaData: IMediaData) {
2017-03-13 00:02:56 +00:00
super("a:blip");
2018-01-23 01:33:12 +00:00
this.root.push(
new BlipAttributes({
2018-12-21 01:39:20 +00:00
embed: `rId{${mediaData.fileName}}`,
2018-01-23 01:33:12 +00:00
cstate: "none",
}),
);
2017-03-13 00:02:56 +00:00
}
}