@docx4j/core-ts 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/NOTICE +12 -0
- package/README.md +126 -0
- package/dist/index.d.mts +7 -0
- package/dist/index.mjs +10 -0
- package/dist/model/content/Body.d.mts +107 -0
- package/dist/model/content/Body.mjs +363 -0
- package/dist/model/content/Font.d.mts +46 -0
- package/dist/model/content/Font.mjs +50 -0
- package/dist/model/content/Paragraph.d.mts +99 -0
- package/dist/model/content/Paragraph.mjs +364 -0
- package/dist/model/content/Range.d.mts +34 -0
- package/dist/model/content/Range.mjs +94 -0
- package/dist/model/content/index.d.mts +7 -0
- package/dist/model/content/index.mjs +9 -0
- package/dist/model/content/search.d.mts +12 -0
- package/dist/model/content/search.mjs +68 -0
- package/dist/model/content/tree.d.mts +40 -0
- package/dist/model/content/tree.mjs +120 -0
- package/dist/model/index.d.mts +1 -0
- package/dist/model/index.mjs +2 -0
- package/dist/opc/ContentTypeManager.d.mts +37 -0
- package/dist/opc/ContentTypeManager.mjs +126 -0
- package/dist/opc/ContentTypes.d.mts +118 -0
- package/dist/opc/ContentTypes.mjs +139 -0
- package/dist/opc/FlatOpcPartStore.d.mts +42 -0
- package/dist/opc/FlatOpcPartStore.mjs +151 -0
- package/dist/opc/Load.d.mts +18 -0
- package/dist/opc/Load.mjs +123 -0
- package/dist/opc/PartName.d.mts +46 -0
- package/dist/opc/PartName.mjs +132 -0
- package/dist/opc/PartStore.d.mts +45 -0
- package/dist/opc/PartStore.mjs +54 -0
- package/dist/opc/Save.d.mts +9 -0
- package/dist/opc/Save.mjs +52 -0
- package/dist/opc/ZipPartStore.d.mts +32 -0
- package/dist/opc/ZipPartStore.mjs +117 -0
- package/dist/opc/exceptions.d.mts +17 -0
- package/dist/opc/exceptions.mjs +22 -0
- package/dist/opc/index.d.mts +12 -0
- package/dist/opc/index.mjs +13 -0
- package/dist/opc/mce/preprocessor.d.mts +15 -0
- package/dist/opc/mce/preprocessor.mjs +74 -0
- package/dist/opc/mce/understood.d.mts +1 -0
- package/dist/opc/mce/understood.mjs +98 -0
- package/dist/packages/OpcPackage.d.mts +62 -0
- package/dist/packages/OpcPackage.mjs +133 -0
- package/dist/packages/PresentationMLPackage.d.mts +12 -0
- package/dist/packages/PresentationMLPackage.mjs +39 -0
- package/dist/packages/SpreadsheetMLPackage.d.mts +12 -0
- package/dist/packages/SpreadsheetMLPackage.mjs +38 -0
- package/dist/packages/WordprocessingMLPackage.d.mts +49 -0
- package/dist/packages/WordprocessingMLPackage.mjs +130 -0
- package/dist/packages/index.d.mts +5 -0
- package/dist/packages/index.mjs +6 -0
- package/dist/packages/registry.d.mts +7 -0
- package/dist/packages/registry.mjs +18 -0
- package/dist/parts/BinaryPart.d.mts +38 -0
- package/dist/parts/BinaryPart.mjs +72 -0
- package/dist/parts/DefaultXmlPart.d.mts +29 -0
- package/dist/parts/DefaultXmlPart.mjs +63 -0
- package/dist/parts/Namespaces.d.mts +99 -0
- package/dist/parts/Namespaces.mjs +99 -0
- package/dist/parts/Part.d.mts +50 -0
- package/dist/parts/Part.mjs +68 -0
- package/dist/parts/PartRegistry.d.mts +20 -0
- package/dist/parts/PartRegistry.mjs +142 -0
- package/dist/parts/Parts.d.mts +13 -0
- package/dist/parts/Parts.mjs +28 -0
- package/dist/parts/RelationshipsPart.d.mts +66 -0
- package/dist/parts/RelationshipsPart.mjs +224 -0
- package/dist/parts/XmlPart.d.mts +46 -0
- package/dist/parts/XmlPart.mjs +87 -0
- package/dist/parts/customXml/index.d.mts +9 -0
- package/dist/parts/customXml/index.mjs +11 -0
- package/dist/parts/dml/index.d.mts +54 -0
- package/dist/parts/dml/index.mjs +83 -0
- package/dist/parts/docProps/index.d.mts +14 -0
- package/dist/parts/docProps/index.mjs +18 -0
- package/dist/parts/index.d.mts +14 -0
- package/dist/parts/index.mjs +15 -0
- package/dist/parts/pml/index.d.mts +53 -0
- package/dist/parts/pml/index.mjs +90 -0
- package/dist/parts/sml/index.d.mts +61 -0
- package/dist/parts/sml/index.mjs +107 -0
- package/dist/parts/wml/defaultStyles.d.mts +1 -0
- package/dist/parts/wml/defaultStyles.mjs +500 -0
- package/dist/parts/wml/index.d.mts +102 -0
- package/dist/parts/wml/index.mjs +213 -0
- package/dist/xml/dom.d.mts +22 -0
- package/dist/xml/dom.mjs +92 -0
- package/package.json +75 -0
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import { XmlPart } from './XmlPart.mjs';
|
|
2
|
+
import { setRelationshipsPartFactory } from './Part.mjs';
|
|
3
|
+
import { PartName } from '../opc/PartName.mjs';
|
|
4
|
+
import { ContentTypes } from '../opc/ContentTypes.mjs';
|
|
5
|
+
import { Namespaces } from './Namespaces.mjs';
|
|
6
|
+
import { InvalidFormatException } from '../opc/exceptions.mjs';
|
|
7
|
+
export const RELATIONSHIPS_ROOT = { namespaceURI: Namespaces.RELATIONSHIPS, localPart: 'Relationships' };
|
|
8
|
+
const RELATIONSHIP_TYPE_NAME = 'org_docx4j_relationships.Relationship';
|
|
9
|
+
/**
|
|
10
|
+
* A relationships part (docx4j org.docx4j.openpackaging.parts.relationships.RelationshipsPart):
|
|
11
|
+
* `/_rels/.rels` for the package, `/word/_rels/document.xml.rels` for a part. Always unmarshalled
|
|
12
|
+
* (load walks it), hence always re-marshalled on save.
|
|
13
|
+
*/
|
|
14
|
+
export class RelationshipsPart extends XmlPart {
|
|
15
|
+
constructor(source, partName) {
|
|
16
|
+
super(partName !== null && partName !== void 0 ? partName : (source ? PartName.relsFor(source.partName) : '/_rels/.rels'), ContentTypes.RELATIONSHIPS_PART, '', RELATIONSHIPS_ROOT);
|
|
17
|
+
this.nextId = 1;
|
|
18
|
+
this.sourceP = source;
|
|
19
|
+
if (source)
|
|
20
|
+
this.package = source.package;
|
|
21
|
+
}
|
|
22
|
+
/** The package relationships part, `/_rels/.rels`. */
|
|
23
|
+
static createPackageRels() {
|
|
24
|
+
const rp = new RelationshipsPart(undefined, '/_rels/.rels');
|
|
25
|
+
rp.setContents({ relationship: [] });
|
|
26
|
+
return rp;
|
|
27
|
+
}
|
|
28
|
+
/** A part's own, empty, relationships part. */
|
|
29
|
+
static createRelationshipsPartForPart(source) {
|
|
30
|
+
const rp = new RelationshipsPart(source);
|
|
31
|
+
rp.setContents({ relationship: [] });
|
|
32
|
+
return rp;
|
|
33
|
+
}
|
|
34
|
+
/** The name of the part these relationships belong to; '/' for the package. */
|
|
35
|
+
get sourceName() {
|
|
36
|
+
var _a, _b;
|
|
37
|
+
return (_b = (_a = this.sourceP) === null || _a === void 0 ? void 0 : _a.partName) !== null && _b !== void 0 ? _b : PartName.ROOT;
|
|
38
|
+
}
|
|
39
|
+
get isPackageRelationshipPart() {
|
|
40
|
+
return this.sourceName.name === '/';
|
|
41
|
+
}
|
|
42
|
+
/** The relationships (docx4j getRelationships()); unmarshalled parts only. */
|
|
43
|
+
get relationships() {
|
|
44
|
+
var _a;
|
|
45
|
+
const r = this.contents;
|
|
46
|
+
(_a = r.relationship) !== null && _a !== void 0 ? _a : (r.relationship = []);
|
|
47
|
+
return r;
|
|
48
|
+
}
|
|
49
|
+
/** The list of relationships, the live array. */
|
|
50
|
+
get list() {
|
|
51
|
+
return this.relationships.relationship;
|
|
52
|
+
}
|
|
53
|
+
get size() {
|
|
54
|
+
return this.list.length;
|
|
55
|
+
}
|
|
56
|
+
getRelationshipById(id) {
|
|
57
|
+
return this.list.find((r) => r.id === id);
|
|
58
|
+
}
|
|
59
|
+
getRelationshipByType(type) {
|
|
60
|
+
return this.list.find((r) => r.type === type);
|
|
61
|
+
}
|
|
62
|
+
getRelationshipsByType(type) {
|
|
63
|
+
return this.list.filter((r) => r.type === type);
|
|
64
|
+
}
|
|
65
|
+
/** The part a relationship targets; undefined for external targets and parts not in the package. */
|
|
66
|
+
getPart(rel) {
|
|
67
|
+
var _a;
|
|
68
|
+
const r = typeof rel === 'string' ? this.getRelationshipById(rel) : rel;
|
|
69
|
+
if (!r || isExternal(r))
|
|
70
|
+
return undefined;
|
|
71
|
+
return (_a = this.package) === null || _a === void 0 ? void 0 : _a.getPart(this.resolveTarget(r));
|
|
72
|
+
}
|
|
73
|
+
/** The part name a relationship's target resolves to (internal targets only). */
|
|
74
|
+
resolveTarget(rel) {
|
|
75
|
+
return PartName.resolve(this.sourceName, rel.target);
|
|
76
|
+
}
|
|
77
|
+
/** The (first) relationship targeting a part. */
|
|
78
|
+
getRel(partName) {
|
|
79
|
+
const pn = PartName.of(partName);
|
|
80
|
+
return this.list.find((r) => !isExternal(r) && this.resolveTarget(r).equals(pn));
|
|
81
|
+
}
|
|
82
|
+
isATarget(partName) {
|
|
83
|
+
return this.getRel(partName) !== undefined;
|
|
84
|
+
}
|
|
85
|
+
/** The next free `rIdN`. */
|
|
86
|
+
getNextId() {
|
|
87
|
+
const used = new Set(this.list.map((r) => r.id));
|
|
88
|
+
let id;
|
|
89
|
+
do {
|
|
90
|
+
id = `rId${this.nextId++}`;
|
|
91
|
+
} while (used.has(id));
|
|
92
|
+
return id;
|
|
93
|
+
}
|
|
94
|
+
/** Adds a relationship; allocates an id when it has none or its id is taken. Returns the id. */
|
|
95
|
+
addRelationship(rel) {
|
|
96
|
+
if (!rel.id || this.getRelationshipById(rel.id))
|
|
97
|
+
rel.id = this.getNextId();
|
|
98
|
+
if (!rel.TYPE_NAME)
|
|
99
|
+
rel.TYPE_NAME = RELATIONSHIP_TYPE_NAME;
|
|
100
|
+
this.list.push(rel);
|
|
101
|
+
return rel.id;
|
|
102
|
+
}
|
|
103
|
+
/** An external relationship (a hyperlink, a linked image). */
|
|
104
|
+
addExternalRelationship(type, target, relId) {
|
|
105
|
+
const rel = { TYPE_NAME: RELATIONSHIP_TYPE_NAME, id: relId !== null && relId !== void 0 ? relId : '', type, target, targetMode: 'External' };
|
|
106
|
+
this.addRelationship(rel);
|
|
107
|
+
return rel;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Adds a part as a target (docx4j addPart): registers it in the package and its content type,
|
|
111
|
+
* writes a relationship whose target is relative to the source part, and returns that
|
|
112
|
+
* relationship. `mode` says what to do when the name is taken (default OVERWRITE_IF_NAME_EXISTS).
|
|
113
|
+
*/
|
|
114
|
+
addPart(part, mode = 'OVERWRITE_IF_NAME_EXISTS', relId) {
|
|
115
|
+
const pkg = this.package;
|
|
116
|
+
if (!pkg)
|
|
117
|
+
throw new InvalidFormatException('Relationships part has no package');
|
|
118
|
+
let newPartName = part.partName;
|
|
119
|
+
const existing = pkg.getPart(newPartName);
|
|
120
|
+
if (existing) {
|
|
121
|
+
if (mode === 'REUSE_EXISTING')
|
|
122
|
+
part = existing;
|
|
123
|
+
if (mode === 'RENAME_IF_NAME_EXISTS') {
|
|
124
|
+
newPartName = this.newPartName(part.partName);
|
|
125
|
+
part.partName = newPartName;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
const target = PartName.relativize(this.sourceName, part.partName);
|
|
129
|
+
const existsAlready = this.list.find((r) => r.target === target);
|
|
130
|
+
if (existsAlready && mode === 'REUSE_EXISTING')
|
|
131
|
+
return existsAlready;
|
|
132
|
+
if (existsAlready && mode === 'RENAME_IF_NAME_EXISTS') {
|
|
133
|
+
throw new InvalidFormatException('Found existing rel, and yet constructed part name should be globally unique');
|
|
134
|
+
}
|
|
135
|
+
if (existsAlready && existing && mode === 'OVERWRITE_IF_NAME_EXISTS') {
|
|
136
|
+
existsAlready.type = part.relationshipType;
|
|
137
|
+
this.loadPart(part, existsAlready);
|
|
138
|
+
return existsAlready;
|
|
139
|
+
}
|
|
140
|
+
const rel = { TYPE_NAME: RELATIONSHIP_TYPE_NAME, id: relId !== null && relId !== void 0 ? relId : '', type: part.relationshipType, target };
|
|
141
|
+
this.addRelationship(rel);
|
|
142
|
+
pkg.contentTypeManager.addContentType(part.partName, part.contentType);
|
|
143
|
+
this.loadPart(part, rel);
|
|
144
|
+
return rel;
|
|
145
|
+
}
|
|
146
|
+
/** Links a part into the package as the target of a relationship of this part (docx4j loadPart). */
|
|
147
|
+
loadPart(part, sourceRelationship) {
|
|
148
|
+
const pkg = this.package;
|
|
149
|
+
if (!pkg)
|
|
150
|
+
throw new InvalidFormatException('Relationships part has no package');
|
|
151
|
+
part.owningRelationshipPart = this;
|
|
152
|
+
part.sourceRelationships.push(sourceRelationship);
|
|
153
|
+
part.package = pkg;
|
|
154
|
+
pkg.parts.put(part);
|
|
155
|
+
}
|
|
156
|
+
/** Removes the relationship to a part, the part, and (recursively) the parts only it related to. Returns what was removed. */
|
|
157
|
+
removePart(partName) {
|
|
158
|
+
const pn = PartName.of(partName);
|
|
159
|
+
const removed = [];
|
|
160
|
+
const pkg = this.package;
|
|
161
|
+
const part = pkg === null || pkg === void 0 ? void 0 : pkg.getPart(pn);
|
|
162
|
+
if (!part || !pkg)
|
|
163
|
+
return removed;
|
|
164
|
+
this.removeRelationship(pn);
|
|
165
|
+
if (part.relationshipsPart)
|
|
166
|
+
removed.push(...part.relationshipsPart.removeParts());
|
|
167
|
+
pkg.parts.remove(pn);
|
|
168
|
+
removed.push(pn);
|
|
169
|
+
return removed;
|
|
170
|
+
}
|
|
171
|
+
/** Removes every part these relationships target (docx4j removeParts), recursively. */
|
|
172
|
+
removeParts() {
|
|
173
|
+
var _a;
|
|
174
|
+
const removed = [];
|
|
175
|
+
for (const rel of [...this.list]) {
|
|
176
|
+
if (isExternal(rel))
|
|
177
|
+
continue;
|
|
178
|
+
const pn = this.resolveTarget(rel);
|
|
179
|
+
const part = (_a = this.package) === null || _a === void 0 ? void 0 : _a.getPart(pn);
|
|
180
|
+
// A part targeted by another relationship elsewhere stays; only its link from here goes.
|
|
181
|
+
if (part && part.sourceRelationships.length <= 1)
|
|
182
|
+
removed.push(...this.removePart(pn));
|
|
183
|
+
else
|
|
184
|
+
this.removeRelationship(rel);
|
|
185
|
+
}
|
|
186
|
+
return removed;
|
|
187
|
+
}
|
|
188
|
+
/** Removes a relationship, by object or by the part it targets. */
|
|
189
|
+
removeRelationship(rel) {
|
|
190
|
+
var _a;
|
|
191
|
+
const r = typeof rel === 'object' && !(rel instanceof PartName) ? rel : this.getRel(rel);
|
|
192
|
+
if (!r)
|
|
193
|
+
return;
|
|
194
|
+
const i = this.list.indexOf(r);
|
|
195
|
+
if (i >= 0)
|
|
196
|
+
this.list.splice(i, 1);
|
|
197
|
+
const target = isExternal(r) ? undefined : (_a = this.package) === null || _a === void 0 ? void 0 : _a.getPart(this.resolveTarget(r));
|
|
198
|
+
if (target) {
|
|
199
|
+
const j = target.sourceRelationships.indexOf(r);
|
|
200
|
+
if (j >= 0)
|
|
201
|
+
target.sourceRelationships.splice(j, 1);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
removeRelationshipsByType(type) {
|
|
205
|
+
for (const r of this.getRelationshipsByType(type))
|
|
206
|
+
this.removeRelationship(r);
|
|
207
|
+
}
|
|
208
|
+
newPartName(proposed) {
|
|
209
|
+
const pkg = this.package;
|
|
210
|
+
const name = proposed.name;
|
|
211
|
+
const dot = name.lastIndexOf('.');
|
|
212
|
+
const prefix = dot > name.lastIndexOf('/') ? name.substring(0, dot) : name;
|
|
213
|
+
const suffix = dot > name.lastIndexOf('/') ? name.substring(dot) : '';
|
|
214
|
+
for (let i = 2;; i++) {
|
|
215
|
+
const candidate = PartName.of(`${prefix}${i}${suffix}`);
|
|
216
|
+
if (!pkg.getPart(candidate))
|
|
217
|
+
return candidate;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
export function isExternal(rel) {
|
|
222
|
+
return rel.targetMode === 'External';
|
|
223
|
+
}
|
|
224
|
+
setRelationshipsPartFactory((source) => RelationshipsPart.createRelationshipsPartForPart(source));
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { type Jsonix } from '@docx4j/generated-objects-ts';
|
|
2
|
+
import { Part } from './Part.mjs';
|
|
3
|
+
import { PartName } from '../opc/PartName.mjs';
|
|
4
|
+
/** A qualified name for a part's root element. */
|
|
5
|
+
export interface RootName {
|
|
6
|
+
namespaceURI: string;
|
|
7
|
+
localPart: string;
|
|
8
|
+
}
|
|
9
|
+
/** A hook run over the DOM before unmarshalling (the MCE preprocessor); set by the package on load. */
|
|
10
|
+
export type DomPreprocessor = (doc: Document, part?: XmlPart<unknown>) => void;
|
|
11
|
+
/**
|
|
12
|
+
* A part whose content is a typed element of the object model (docx4j JaxbXmlPart<E>). `T` is the
|
|
13
|
+
* root element's value type (`Document`, `Styles`, ...). Contents are unmarshalled on first
|
|
14
|
+
* `getContents()`; once unmarshalled, `contents` is a plain property. A part that was never
|
|
15
|
+
* unmarshalled is written back from its source bytes on save.
|
|
16
|
+
*/
|
|
17
|
+
export declare class XmlPart<T = unknown> extends Part {
|
|
18
|
+
private element;
|
|
19
|
+
private bytes;
|
|
20
|
+
/** Root element name used when contents are set on a new part; subclasses set it. */
|
|
21
|
+
rootName: RootName | undefined;
|
|
22
|
+
/** Runs over the DOM before unmarshalling; the package sets its MCE preprocessor here. */
|
|
23
|
+
preprocessor: DomPreprocessor | undefined;
|
|
24
|
+
constructor(partName: PartName | string, contentType: string, relationshipType: string, rootName?: RootName);
|
|
25
|
+
/** True once contents were unmarshalled or set; the part is then re-marshalled on save. */
|
|
26
|
+
get isUnmarshalled(): boolean;
|
|
27
|
+
get isLoaded(): boolean;
|
|
28
|
+
/** The unmarshalled contents (docx4j getJaxbElement()); throws when not yet unmarshalled. */
|
|
29
|
+
get contents(): T;
|
|
30
|
+
/** The root element as [name, value]; undefined until unmarshalled. */
|
|
31
|
+
get typedElement(): Jsonix.TypedNamedValue<T> | undefined;
|
|
32
|
+
/** Unmarshals on first call (docx4j getContents()). */
|
|
33
|
+
getContents(): Promise<T>;
|
|
34
|
+
/** Replaces the contents (docx4j setJaxbElement / setContents). The root name defaults to the part's. */
|
|
35
|
+
setContents(value: T, rootName?: RootName): void;
|
|
36
|
+
/** Replaces the contents with raw XML bytes; they are unmarshalled on the next getContents(). */
|
|
37
|
+
setBytes(bytes: Uint8Array): void;
|
|
38
|
+
/** Replaces the contents with XML text (docx4j setContents from a string). */
|
|
39
|
+
setXml(xml: string): void;
|
|
40
|
+
/** The XML as it would be saved (docx4j XmlUtils.marshaltoString on the part). */
|
|
41
|
+
getXml(): Promise<string>;
|
|
42
|
+
/** Marshalled bytes when unmarshalled or set, else the source bytes untouched. */
|
|
43
|
+
getBytes(): Promise<Uint8Array>;
|
|
44
|
+
/** The root element as a DOM element (docx4j XmlUtils.marshaltoW3CDomDocument). */
|
|
45
|
+
marshalToNode(): Promise<Element>;
|
|
46
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { unmarshalNode, marshalNode } from '@docx4j/generated-objects-ts';
|
|
2
|
+
import { Part } from './Part.mjs';
|
|
3
|
+
import { Docx4JException } from '../opc/exceptions.mjs';
|
|
4
|
+
import { parseXml, serializeXml, encodeText, decodeXmlText, XML_DECLARATION } from '../xml/dom.mjs';
|
|
5
|
+
/**
|
|
6
|
+
* A part whose content is a typed element of the object model (docx4j JaxbXmlPart<E>). `T` is the
|
|
7
|
+
* root element's value type (`Document`, `Styles`, ...). Contents are unmarshalled on first
|
|
8
|
+
* `getContents()`; once unmarshalled, `contents` is a plain property. A part that was never
|
|
9
|
+
* unmarshalled is written back from its source bytes on save.
|
|
10
|
+
*/
|
|
11
|
+
export class XmlPart extends Part {
|
|
12
|
+
constructor(partName, contentType, relationshipType, rootName) {
|
|
13
|
+
super(partName, contentType, relationshipType);
|
|
14
|
+
this.rootName = rootName;
|
|
15
|
+
}
|
|
16
|
+
/** True once contents were unmarshalled or set; the part is then re-marshalled on save. */
|
|
17
|
+
get isUnmarshalled() {
|
|
18
|
+
return this.element !== undefined;
|
|
19
|
+
}
|
|
20
|
+
get isLoaded() {
|
|
21
|
+
return this.element !== undefined || this.bytes !== undefined;
|
|
22
|
+
}
|
|
23
|
+
/** The unmarshalled contents (docx4j getJaxbElement()); throws when not yet unmarshalled. */
|
|
24
|
+
get contents() {
|
|
25
|
+
if (this.element === undefined)
|
|
26
|
+
throw new Docx4JException(`Part ${this.partName} is not unmarshalled yet; await getContents() first`);
|
|
27
|
+
return this.element.value;
|
|
28
|
+
}
|
|
29
|
+
/** The root element as [name, value]; undefined until unmarshalled. */
|
|
30
|
+
get typedElement() {
|
|
31
|
+
return this.element;
|
|
32
|
+
}
|
|
33
|
+
/** Unmarshals on first call (docx4j getContents()). */
|
|
34
|
+
async getContents() {
|
|
35
|
+
var _a, _b, _c;
|
|
36
|
+
if (this.element === undefined) {
|
|
37
|
+
const bytes = (_a = this.bytes) !== null && _a !== void 0 ? _a : (await this.loadSourceBytes());
|
|
38
|
+
if (bytes === undefined)
|
|
39
|
+
throw new Docx4JException(`Part ${this.partName} has no content: set contents or load it from a container`);
|
|
40
|
+
const doc = parseXml(decodeXmlText(bytes));
|
|
41
|
+
(_b = this.preprocessor) === null || _b === void 0 ? void 0 : _b.call(this, doc, this);
|
|
42
|
+
this.element = await unmarshalNode(doc);
|
|
43
|
+
(_c = this.rootName) !== null && _c !== void 0 ? _c : (this.rootName = { namespaceURI: this.element.name.namespaceURI, localPart: this.element.name.localPart });
|
|
44
|
+
this.bytes = undefined;
|
|
45
|
+
}
|
|
46
|
+
return this.element.value;
|
|
47
|
+
}
|
|
48
|
+
/** Replaces the contents (docx4j setJaxbElement / setContents). The root name defaults to the part's. */
|
|
49
|
+
setContents(value, rootName) {
|
|
50
|
+
var _a, _b;
|
|
51
|
+
const name = (_b = rootName !== null && rootName !== void 0 ? rootName : (_a = this.element) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : this.rootName;
|
|
52
|
+
if (!name)
|
|
53
|
+
throw new Docx4JException(`Part ${this.partName}: no root element name; pass one`);
|
|
54
|
+
this.element = { name: { namespaceURI: name.namespaceURI, localPart: name.localPart }, value };
|
|
55
|
+
this.bytes = undefined;
|
|
56
|
+
}
|
|
57
|
+
/** Replaces the contents with raw XML bytes; they are unmarshalled on the next getContents(). */
|
|
58
|
+
setBytes(bytes) {
|
|
59
|
+
this.bytes = bytes;
|
|
60
|
+
this.element = undefined;
|
|
61
|
+
}
|
|
62
|
+
/** Replaces the contents with XML text (docx4j setContents from a string). */
|
|
63
|
+
setXml(xml) {
|
|
64
|
+
this.setBytes(encodeText(xml));
|
|
65
|
+
}
|
|
66
|
+
/** The XML as it would be saved (docx4j XmlUtils.marshaltoString on the part). */
|
|
67
|
+
async getXml() {
|
|
68
|
+
return decodeXmlText(await this.getBytes());
|
|
69
|
+
}
|
|
70
|
+
/** Marshalled bytes when unmarshalled or set, else the source bytes untouched. */
|
|
71
|
+
async getBytes() {
|
|
72
|
+
if (this.element !== undefined)
|
|
73
|
+
return encodeText(XML_DECLARATION + serializeXml(await this.marshalToNode()));
|
|
74
|
+
if (this.bytes !== undefined)
|
|
75
|
+
return this.bytes;
|
|
76
|
+
const loaded = await this.loadSourceBytes();
|
|
77
|
+
if (loaded === undefined)
|
|
78
|
+
throw new Docx4JException(`Part ${this.partName} has no content and no source container`);
|
|
79
|
+
return loaded;
|
|
80
|
+
}
|
|
81
|
+
/** The root element as a DOM element (docx4j XmlUtils.marshaltoW3CDomDocument). */
|
|
82
|
+
async marshalToNode() {
|
|
83
|
+
if (this.element === undefined)
|
|
84
|
+
await this.getContents();
|
|
85
|
+
return marshalNode(this.element);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type * as props from '@docx4j/generated-objects-ts/modules/org_docx4j_customXmlProperties';
|
|
2
|
+
import { XmlPart } from '../XmlPart.mjs';
|
|
3
|
+
import { PartName } from '../../opc/PartName.mjs';
|
|
4
|
+
export declare const DS_NS = "http://schemas.openxmlformats.org/officeDocument/2006/customXml";
|
|
5
|
+
/** `/customXml/itemProps1.xml`: the `ds:datastoreItem` with the itemID and schema references. */
|
|
6
|
+
export declare class CustomXmlDataStoragePropertiesPart extends XmlPart<props.DatastoreItem> {
|
|
7
|
+
constructor(partName: PartName | string);
|
|
8
|
+
}
|
|
9
|
+
export { CustomXmlDataStoragePart } from '../DefaultXmlPart.mjs';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { XmlPart } from '../XmlPart.mjs';
|
|
2
|
+
import { ContentTypes } from '../../opc/ContentTypes.mjs';
|
|
3
|
+
import { Namespaces } from '../Namespaces.mjs';
|
|
4
|
+
export const DS_NS = 'http://schemas.openxmlformats.org/officeDocument/2006/customXml';
|
|
5
|
+
/** `/customXml/itemProps1.xml`: the `ds:datastoreItem` with the itemID and schema references. */
|
|
6
|
+
export class CustomXmlDataStoragePropertiesPart extends XmlPart {
|
|
7
|
+
constructor(partName) {
|
|
8
|
+
super(partName, ContentTypes.OFFICEDOCUMENT_CUSTOMXML_DATASTORAGEPROPERTIES, Namespaces.CUSTOM_XML_DATA_STORAGE_PROPERTIES, { namespaceURI: DS_NS, localPart: 'datastoreItem' });
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export { CustomXmlDataStoragePart } from '../DefaultXmlPart.mjs';
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type * as dml from '@docx4j/generated-objects-ts/modules/org_docx4j_dml';
|
|
2
|
+
import type * as chart from '@docx4j/generated-objects-ts/modules/org_docx4j_dml_chart';
|
|
3
|
+
import type * as diagram from '@docx4j/generated-objects-ts/modules/org_docx4j_dml_diagram';
|
|
4
|
+
import type * as chartDrawing from '@docx4j/generated-objects-ts/modules/org_docx4j_dml_chartDrawing';
|
|
5
|
+
import type * as ssDrawing from '@docx4j/generated-objects-ts/modules/org_docx4j_dml_spreadsheetdrawing';
|
|
6
|
+
import { XmlPart } from '../XmlPart.mjs';
|
|
7
|
+
import { DefaultXmlPart } from '../DefaultXmlPart.mjs';
|
|
8
|
+
import { PartName } from '../../opc/PartName.mjs';
|
|
9
|
+
export declare class ThemePart extends XmlPart<dml.Theme> {
|
|
10
|
+
constructor(partName?: PartName | string);
|
|
11
|
+
}
|
|
12
|
+
export declare class ThemeOverridePart extends XmlPart<dml.CTBaseStylesOverride> {
|
|
13
|
+
constructor(partName: PartName | string);
|
|
14
|
+
}
|
|
15
|
+
/** A chart (docx4j org.docx4j.openpackaging.parts.DrawingML.Chart). */
|
|
16
|
+
export declare class ChartPart extends XmlPart<chart.CTChartSpace> {
|
|
17
|
+
constructor(partName: PartName | string);
|
|
18
|
+
}
|
|
19
|
+
/** The user shapes of a chart (docx4j ChartShapePart). */
|
|
20
|
+
export declare class ChartShapePart extends XmlPart<chartDrawing.CTDrawing> {
|
|
21
|
+
constructor(partName: PartName | string);
|
|
22
|
+
}
|
|
23
|
+
/** A spreadsheet drawing (docx4j org.docx4j.openpackaging.parts.DrawingML.Drawing). */
|
|
24
|
+
export declare class DrawingPart extends XmlPart<ssDrawing.CTDrawing> {
|
|
25
|
+
constructor(partName: PartName | string);
|
|
26
|
+
}
|
|
27
|
+
export declare class DiagramDataPart extends XmlPart<diagram.CTDataModel> {
|
|
28
|
+
constructor(partName: PartName | string);
|
|
29
|
+
}
|
|
30
|
+
export declare class DiagramLayoutPart extends XmlPart<diagram.CTDiagramDefinition> {
|
|
31
|
+
constructor(partName: PartName | string);
|
|
32
|
+
}
|
|
33
|
+
export declare class DiagramLayoutHeaderPart extends XmlPart<diagram.CTDiagramDefinitionHeader> {
|
|
34
|
+
constructor(partName: PartName | string);
|
|
35
|
+
}
|
|
36
|
+
export declare class DiagramStylePart extends XmlPart<diagram.CTStyleDefinition> {
|
|
37
|
+
constructor(partName: PartName | string);
|
|
38
|
+
}
|
|
39
|
+
export declare class DiagramColorsPart extends XmlPart<diagram.CTColorTransform> {
|
|
40
|
+
constructor(partName: PartName | string);
|
|
41
|
+
}
|
|
42
|
+
/** Chart style, colour style, chartEx and diagram drawing parts: DOM until typed (later CR). */
|
|
43
|
+
export declare class ChartStylePart extends DefaultXmlPart {
|
|
44
|
+
constructor(partName: PartName | string);
|
|
45
|
+
}
|
|
46
|
+
export declare class ChartColorStylePart extends DefaultXmlPart {
|
|
47
|
+
constructor(partName: PartName | string);
|
|
48
|
+
}
|
|
49
|
+
export declare class ChartExSpacePart extends DefaultXmlPart {
|
|
50
|
+
constructor(partName: PartName | string);
|
|
51
|
+
}
|
|
52
|
+
export declare class DiagramDrawingPart extends DefaultXmlPart {
|
|
53
|
+
constructor(partName: PartName | string);
|
|
54
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { XmlPart } from '../XmlPart.mjs';
|
|
2
|
+
import { DefaultXmlPart } from '../DefaultXmlPart.mjs';
|
|
3
|
+
import { ContentTypes } from '../../opc/ContentTypes.mjs';
|
|
4
|
+
import { Namespaces } from '../Namespaces.mjs';
|
|
5
|
+
const A = 'http://schemas.openxmlformats.org/drawingml/2006/main';
|
|
6
|
+
const C = 'http://schemas.openxmlformats.org/drawingml/2006/chart';
|
|
7
|
+
const DGM = 'http://schemas.openxmlformats.org/drawingml/2006/diagram';
|
|
8
|
+
const CDR = 'http://schemas.openxmlformats.org/drawingml/2006/chartDrawing';
|
|
9
|
+
const XDR = 'http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing';
|
|
10
|
+
export class ThemePart extends XmlPart {
|
|
11
|
+
constructor(partName = '/word/theme/theme1.xml') {
|
|
12
|
+
super(partName, ContentTypes.OFFICEDOCUMENT_THEME, Namespaces.THEME, { namespaceURI: A, localPart: 'theme' });
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export class ThemeOverridePart extends XmlPart {
|
|
16
|
+
constructor(partName) {
|
|
17
|
+
super(partName, ContentTypes.OFFICEDOCUMENT_THEME_OVERRIDE, Namespaces.THEME_OVERRIDE, { namespaceURI: A, localPart: 'themeOverride' });
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
/** A chart (docx4j org.docx4j.openpackaging.parts.DrawingML.Chart). */
|
|
21
|
+
export class ChartPart extends XmlPart {
|
|
22
|
+
constructor(partName) {
|
|
23
|
+
super(partName, ContentTypes.DRAWINGML_CHART, Namespaces.SPREADSHEETML_CHART, { namespaceURI: C, localPart: 'chartSpace' });
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
/** The user shapes of a chart (docx4j ChartShapePart). */
|
|
27
|
+
export class ChartShapePart extends XmlPart {
|
|
28
|
+
constructor(partName) {
|
|
29
|
+
super(partName, ContentTypes.DRAWINGML_CHART_SHAPES, Namespaces.CHART_USER_SHAPES, { namespaceURI: CDR, localPart: 'userShapes' });
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/** A spreadsheet drawing (docx4j org.docx4j.openpackaging.parts.DrawingML.Drawing). */
|
|
33
|
+
export class DrawingPart extends XmlPart {
|
|
34
|
+
constructor(partName) {
|
|
35
|
+
super(partName, ContentTypes.DRAWINGML_DRAWING, Namespaces.SPREADSHEETML_DRAWING, { namespaceURI: XDR, localPart: 'wsDr' });
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
export class DiagramDataPart extends XmlPart {
|
|
39
|
+
constructor(partName) {
|
|
40
|
+
super(partName, ContentTypes.DRAWINGML_DIAGRAM_DATA, Namespaces.DRAWINGML_DIAGRAM_DATA, { namespaceURI: DGM, localPart: 'dataModel' });
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
export class DiagramLayoutPart extends XmlPart {
|
|
44
|
+
constructor(partName) {
|
|
45
|
+
super(partName, ContentTypes.DRAWINGML_DIAGRAM_LAYOUT, Namespaces.DRAWINGML_DIAGRAM_LAYOUT, { namespaceURI: DGM, localPart: 'layoutDef' });
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
export class DiagramLayoutHeaderPart extends XmlPart {
|
|
49
|
+
constructor(partName) {
|
|
50
|
+
super(partName, ContentTypes.DRAWINGML_DIAGRAM_LAYOUT_HEADER, Namespaces.DRAWINGML_DIAGRAM_LAYOUT_HEADER, { namespaceURI: DGM, localPart: 'layoutDefHdr' });
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
export class DiagramStylePart extends XmlPart {
|
|
54
|
+
constructor(partName) {
|
|
55
|
+
super(partName, ContentTypes.DRAWINGML_DIAGRAM_STYLE, Namespaces.DRAWINGML_DIAGRAM_STYLE, { namespaceURI: DGM, localPart: 'styleDef' });
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
export class DiagramColorsPart extends XmlPart {
|
|
59
|
+
constructor(partName) {
|
|
60
|
+
super(partName, ContentTypes.DRAWINGML_DIAGRAM_COLORS, Namespaces.DRAWINGML_DIAGRAM_COLORS, { namespaceURI: DGM, localPart: 'colorsDef' });
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
/** Chart style, colour style, chartEx and diagram drawing parts: DOM until typed (later CR). */
|
|
64
|
+
export class ChartStylePart extends DefaultXmlPart {
|
|
65
|
+
constructor(partName) {
|
|
66
|
+
super(partName, ContentTypes.CHART_STYLE, Namespaces.CHART_STYLE);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
export class ChartColorStylePart extends DefaultXmlPart {
|
|
70
|
+
constructor(partName) {
|
|
71
|
+
super(partName, ContentTypes.CHART_COLOR_STYLE, Namespaces.CHART_COLOR_STYLE);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
export class ChartExSpacePart extends DefaultXmlPart {
|
|
75
|
+
constructor(partName) {
|
|
76
|
+
super(partName, ContentTypes.CHART_EX, Namespaces.CHART_EX);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
export class DiagramDrawingPart extends DefaultXmlPart {
|
|
80
|
+
constructor(partName) {
|
|
81
|
+
super(partName, ContentTypes.DRAWINGML_DIAGRAM_DRAWING, Namespaces.DRAWINGML_DIAGRAM_DRAWING);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type * as core from '@docx4j/generated-objects-ts/modules/org_docx4j_docProps_core';
|
|
2
|
+
import type * as extended from '@docx4j/generated-objects-ts/modules/org_docx4j_docProps_extended';
|
|
3
|
+
import type * as custom from '@docx4j/generated-objects-ts/modules/org_docx4j_docProps_custom';
|
|
4
|
+
import { XmlPart } from '../XmlPart.mjs';
|
|
5
|
+
import { PartName } from '../../opc/PartName.mjs';
|
|
6
|
+
export declare class DocPropsCorePart extends XmlPart<core.CoreProperties> {
|
|
7
|
+
constructor(partName?: PartName | string);
|
|
8
|
+
}
|
|
9
|
+
export declare class DocPropsExtendedPart extends XmlPart<extended.Properties> {
|
|
10
|
+
constructor(partName?: PartName | string);
|
|
11
|
+
}
|
|
12
|
+
export declare class DocPropsCustomPart extends XmlPart<custom.Properties> {
|
|
13
|
+
constructor(partName?: PartName | string);
|
|
14
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { XmlPart } from '../XmlPart.mjs';
|
|
2
|
+
import { ContentTypes } from '../../opc/ContentTypes.mjs';
|
|
3
|
+
import { Namespaces } from '../Namespaces.mjs';
|
|
4
|
+
export class DocPropsCorePart extends XmlPart {
|
|
5
|
+
constructor(partName = '/docProps/core.xml') {
|
|
6
|
+
super(partName, ContentTypes.PACKAGE_COREPROPERTIES, Namespaces.PROPERTIES_CORE, { namespaceURI: 'http://schemas.openxmlformats.org/package/2006/metadata/core-properties', localPart: 'coreProperties' });
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export class DocPropsExtendedPart extends XmlPart {
|
|
10
|
+
constructor(partName = '/docProps/app.xml') {
|
|
11
|
+
super(partName, ContentTypes.OFFICEDOCUMENT_EXTENDEDPROPERTIES, Namespaces.PROPERTIES_EXTENDED, { namespaceURI: 'http://schemas.openxmlformats.org/officeDocument/2006/extended-properties', localPart: 'Properties' });
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export class DocPropsCustomPart extends XmlPart {
|
|
15
|
+
constructor(partName = '/docProps/custom.xml') {
|
|
16
|
+
super(partName, ContentTypes.OFFICEDOCUMENT_CUSTOMPROPERTIES, Namespaces.PROPERTIES_CUSTOM, { namespaceURI: 'http://schemas.openxmlformats.org/officeDocument/2006/custom-properties', localPart: 'Properties' });
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { Part, type RelationshipSource } from './Part.mjs';
|
|
2
|
+
export { Parts } from './Parts.mjs';
|
|
3
|
+
export { BinaryPart, ImagePart, EmbeddedPackagePart, OleObjectBinaryPart, ObfuscatedFontPart, TrueTypeFontPart, AlternativeFormatInputPart } from './BinaryPart.mjs';
|
|
4
|
+
export { XmlPart, type RootName, type DomPreprocessor } from './XmlPart.mjs';
|
|
5
|
+
export { DefaultXmlPart, CustomXmlDataStoragePart } from './DefaultXmlPart.mjs';
|
|
6
|
+
export { RelationshipsPart, type AddPartBehaviour, RELATIONSHIPS_ROOT, isExternal } from './RelationshipsPart.mjs';
|
|
7
|
+
export { Namespaces } from './Namespaces.mjs';
|
|
8
|
+
export { PartRegistry, defaultPartRegistry, type PartFactory } from './PartRegistry.mjs';
|
|
9
|
+
export * from './wml/index.mjs';
|
|
10
|
+
export * from './dml/index.mjs';
|
|
11
|
+
export * from './docProps/index.mjs';
|
|
12
|
+
export { CustomXmlDataStoragePropertiesPart, DS_NS } from './customXml/index.mjs';
|
|
13
|
+
export * from './pml/index.mjs';
|
|
14
|
+
export * from './sml/index.mjs';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Parts: the base classes, relationships, the registry and every typed part.
|
|
2
|
+
export { Part } from './Part.mjs';
|
|
3
|
+
export { Parts } from './Parts.mjs';
|
|
4
|
+
export { BinaryPart, ImagePart, EmbeddedPackagePart, OleObjectBinaryPart, ObfuscatedFontPart, TrueTypeFontPart, AlternativeFormatInputPart } from './BinaryPart.mjs';
|
|
5
|
+
export { XmlPart } from './XmlPart.mjs';
|
|
6
|
+
export { DefaultXmlPart, CustomXmlDataStoragePart } from './DefaultXmlPart.mjs';
|
|
7
|
+
export { RelationshipsPart, RELATIONSHIPS_ROOT, isExternal } from './RelationshipsPart.mjs';
|
|
8
|
+
export { Namespaces } from './Namespaces.mjs';
|
|
9
|
+
export { PartRegistry, defaultPartRegistry } from './PartRegistry.mjs';
|
|
10
|
+
export * from './wml/index.mjs';
|
|
11
|
+
export * from './dml/index.mjs';
|
|
12
|
+
export * from './docProps/index.mjs';
|
|
13
|
+
export { CustomXmlDataStoragePropertiesPart, DS_NS } from './customXml/index.mjs';
|
|
14
|
+
export * from './pml/index.mjs';
|
|
15
|
+
export * from './sml/index.mjs';
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type * as pml from '@docx4j/generated-objects-ts/modules/org_pptx4j_pml';
|
|
2
|
+
import type * as dml from '@docx4j/generated-objects-ts/modules/org_docx4j_dml';
|
|
3
|
+
import { XmlPart } from '../XmlPart.mjs';
|
|
4
|
+
import { BinaryPart } from '../BinaryPart.mjs';
|
|
5
|
+
import { Part } from '../Part.mjs';
|
|
6
|
+
import { PartName } from '../../opc/PartName.mjs';
|
|
7
|
+
import { ThemePart } from '../dml/index.mjs';
|
|
8
|
+
export declare class MainPresentationPart extends XmlPart<pml.Presentation> {
|
|
9
|
+
themePart: ThemePart | undefined;
|
|
10
|
+
constructor(partName?: PartName | string, contentType?: string);
|
|
11
|
+
setPartShortcut(part: Part, relationshipType: string): boolean;
|
|
12
|
+
get slideParts(): SlidePart[];
|
|
13
|
+
}
|
|
14
|
+
export declare class SlidePart extends XmlPart<pml.Sld> {
|
|
15
|
+
constructor(partName: PartName | string);
|
|
16
|
+
}
|
|
17
|
+
export declare class SlideLayoutPart extends XmlPart<pml.SldLayout> {
|
|
18
|
+
constructor(partName: PartName | string);
|
|
19
|
+
}
|
|
20
|
+
export declare class SlideMasterPart extends XmlPart<pml.SldMaster> {
|
|
21
|
+
constructor(partName: PartName | string);
|
|
22
|
+
}
|
|
23
|
+
export declare class NotesSlidePart extends XmlPart<pml.Notes> {
|
|
24
|
+
constructor(partName: PartName | string);
|
|
25
|
+
}
|
|
26
|
+
export declare class NotesMasterPart extends XmlPart<pml.NotesMaster> {
|
|
27
|
+
constructor(partName: PartName | string);
|
|
28
|
+
}
|
|
29
|
+
export declare class HandoutMasterPart extends XmlPart<pml.HandoutMaster> {
|
|
30
|
+
constructor(partName: PartName | string);
|
|
31
|
+
}
|
|
32
|
+
export declare class PresentationPropertiesPart extends XmlPart<pml.PresentationPr> {
|
|
33
|
+
constructor(partName?: PartName | string);
|
|
34
|
+
}
|
|
35
|
+
export declare class ViewPropertiesPart extends XmlPart<pml.ViewPr> {
|
|
36
|
+
constructor(partName?: PartName | string);
|
|
37
|
+
}
|
|
38
|
+
export declare class TableStylesPart extends XmlPart<dml.CTTableStyleList> {
|
|
39
|
+
constructor(partName?: PartName | string);
|
|
40
|
+
}
|
|
41
|
+
/** docx4j PresentationML.CommentsPart, renamed here to avoid the clash with the WordprocessingML one. */
|
|
42
|
+
export declare class PresentationCommentsPart extends XmlPart<pml.CTCommentList> {
|
|
43
|
+
constructor(partName: PartName | string);
|
|
44
|
+
}
|
|
45
|
+
export declare class CommentAuthorsPart extends XmlPart<pml.CTCommentAuthorList> {
|
|
46
|
+
constructor(partName?: PartName | string);
|
|
47
|
+
}
|
|
48
|
+
export declare class TagsPart extends XmlPart<pml.TagLst> {
|
|
49
|
+
constructor(partName: PartName | string);
|
|
50
|
+
}
|
|
51
|
+
export declare class FontDataPart extends BinaryPart {
|
|
52
|
+
constructor(partName: PartName | string);
|
|
53
|
+
}
|