2018-01-10 00:29:17 +00:00
|
|
|
import { XmlComponent } from "file/xml-components";
|
|
|
|
import { RelationshipAttributes } from "./relationship-attributes";
|
|
|
|
|
|
|
|
export type RelationshipType =
|
|
|
|
| "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image"
|
|
|
|
| "http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme"
|
|
|
|
| "http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings"
|
|
|
|
| "http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles"
|
|
|
|
| "http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable"
|
|
|
|
| "http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings"
|
2018-01-29 01:54:50 +00:00
|
|
|
| "http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering"
|
2018-01-29 21:53:22 +00:00
|
|
|
| "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header"
|
2018-02-04 00:58:34 +00:00
|
|
|
| "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer"
|
|
|
|
| "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument"
|
|
|
|
| "http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties"
|
2018-05-06 22:23:35 -05:00
|
|
|
| "http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties"
|
2018-06-11 00:48:50 +01:00
|
|
|
| "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink"
|
|
|
|
| "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes";
|
2018-05-06 22:23:35 -05:00
|
|
|
|
2018-12-05 00:05:11 +00:00
|
|
|
export enum TargetModeType {
|
|
|
|
EXTERNAL = "External",
|
|
|
|
}
|
2018-01-10 00:29:17 +00:00
|
|
|
|
|
|
|
export class Relationship extends XmlComponent {
|
2018-05-06 22:23:35 -05:00
|
|
|
constructor(id: string, type: RelationshipType, target: string, targetMode?: TargetModeType) {
|
2018-01-10 00:29:17 +00:00
|
|
|
super("Relationship");
|
|
|
|
|
2018-01-23 01:33:12 +00:00
|
|
|
this.root.push(
|
|
|
|
new RelationshipAttributes({
|
|
|
|
id,
|
|
|
|
type,
|
|
|
|
target,
|
2018-05-06 22:23:35 -05:00
|
|
|
targetMode,
|
2018-01-23 01:33:12 +00:00
|
|
|
}),
|
|
|
|
);
|
2018-01-10 00:29:17 +00:00
|
|
|
}
|
|
|
|
}
|