2018-12-21 01:39:20 +00:00
|
|
|
import { IMediaData } from "file/media";
|
2017-12-30 20:25:16 +00:00
|
|
|
import { XmlAttributeComponent, XmlComponent } from "file/xml-components";
|
2017-03-13 00:02:56 +00:00
|
|
|
|
2017-03-13 00:40:39 +00:00
|
|
|
interface IBlipProperties {
|
2018-11-02 02:51:57 +00:00
|
|
|
readonly embed: string;
|
|
|
|
readonly cstate: string;
|
2017-03-13 00:02:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
class BlipAttributes extends XmlAttributeComponent<IBlipProperties> {
|
2018-11-02 02:51:57 +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 {
|
2018-12-21 01:39:20 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
}
|