2022-06-26 23:26:42 +01:00
|
|
|
import { XmlComponent } from "@file/xml-components";
|
2018-01-10 00:29:17 +00:00
|
|
|
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"
|
2020-08-03 14:58:30 +12:00
|
|
|
| "http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-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"
|
2022-03-03 09:59:09 +08:00
|
|
|
| "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes"
|
2023-12-30 02:23:54 +00:00
|
|
|
| "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments"
|
|
|
|
| "http://schemas.openxmlformats.org/officeDocument/2006/relationships/font";
|
2018-05-06 22:23:35 -05:00
|
|
|
|
2023-12-22 10:25:00 +09:00
|
|
|
export const TargetModeType = {
|
|
|
|
EXTERNAL: "External",
|
|
|
|
} as const;
|
2018-01-10 00:29:17 +00:00
|
|
|
|
|
|
|
export class Relationship extends XmlComponent {
|
2023-12-22 10:25:00 +09:00
|
|
|
public constructor(
|
|
|
|
id: string,
|
|
|
|
type: RelationshipType,
|
|
|
|
target: string,
|
|
|
|
targetMode?: (typeof TargetModeType)[keyof typeof 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
|
|
|
}
|
|
|
|
}
|