@docx4j/core-ts 0.1.0 → 0.1.2
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/README.md +410 -10
- package/dist/model/content/Body.d.mts +109 -4
- package/dist/model/content/Body.mjs +300 -29
- package/dist/model/content/Comment.d.mts +78 -0
- package/dist/model/content/Comment.mjs +429 -0
- package/dist/model/content/ContentControl.d.mts +173 -0
- package/dist/model/content/ContentControl.mjs +638 -0
- package/dist/model/content/Font.d.mts +48 -8
- package/dist/model/content/Font.mjs +55 -13
- package/dist/model/content/InlinePicture.d.mts +103 -0
- package/dist/model/content/InlinePicture.mjs +361 -0
- package/dist/model/content/List.d.mts +253 -0
- package/dist/model/content/List.mjs +778 -0
- package/dist/model/content/Paragraph.d.mts +213 -16
- package/dist/model/content/Paragraph.mjs +611 -57
- package/dist/model/content/Range.d.mts +48 -4
- package/dist/model/content/Range.mjs +161 -4
- package/dist/model/content/Table.d.mts +130 -0
- package/dist/model/content/Table.mjs +429 -0
- package/dist/model/content/TrackedChange.d.mts +96 -0
- package/dist/model/content/TrackedChange.mjs +352 -0
- package/dist/model/content/comments.d.mts +122 -0
- package/dist/model/content/comments.mjs +248 -0
- package/dist/model/content/index.d.mts +13 -3
- package/dist/model/content/index.mjs +15 -3
- package/dist/model/content/ooxml.d.mts +17 -0
- package/dist/model/content/ooxml.mjs +214 -0
- package/dist/model/content/styles.d.mts +21 -0
- package/dist/model/content/styles.mjs +86 -0
- package/dist/model/content/tracking.d.mts +104 -0
- package/dist/model/content/tracking.mjs +313 -0
- package/dist/model/content/tree.d.mts +56 -9
- package/dist/model/content/tree.mjs +104 -31
- package/dist/model/customxml/CustomXmlPart.d.mts +158 -0
- package/dist/model/customxml/CustomXmlPart.mjs +415 -0
- package/dist/model/customxml/CustomXmlPartCollection.d.mts +68 -0
- package/dist/model/customxml/CustomXmlPartCollection.mjs +183 -0
- package/dist/model/customxml/XmlMapping.d.mts +46 -0
- package/dist/model/customxml/XmlMapping.mjs +98 -0
- package/dist/model/customxml/bindings.d.mts +41 -0
- package/dist/model/customxml/bindings.mjs +230 -0
- package/dist/model/customxml/index.d.mts +7 -0
- package/dist/model/customxml/index.mjs +9 -0
- package/dist/model/customxml/insert.d.mts +20 -0
- package/dist/model/customxml/insert.mjs +22 -0
- package/dist/model/customxml/kinds.d.mts +103 -0
- package/dist/model/customxml/kinds.mjs +267 -0
- package/dist/model/customxml/xpath.d.mts +52 -0
- package/dist/model/customxml/xpath.mjs +205 -0
- package/dist/model/fonts/CJKToEnglish.d.mts +2 -0
- package/dist/model/fonts/CJKToEnglish.mjs +16 -0
- package/dist/model/fonts/FontFallback.d.mts +58 -0
- package/dist/model/fonts/FontFallback.mjs +219 -0
- package/dist/model/fonts/IdentityPlusMapper.d.mts +7 -0
- package/dist/model/fonts/IdentityPlusMapper.mjs +19 -0
- package/dist/model/fonts/LanguageTagToScriptMapping.d.mts +7 -0
- package/dist/model/fonts/LanguageTagToScriptMapping.mjs +67 -0
- package/dist/model/fonts/Mapper.d.mts +190 -0
- package/dist/model/fonts/Mapper.mjs +481 -0
- package/dist/model/fonts/PhysicalFont.d.mts +34 -0
- package/dist/model/fonts/PhysicalFont.mjs +62 -0
- package/dist/model/fonts/RunFontSelector.d.mts +194 -0
- package/dist/model/fonts/RunFontSelector.mjs +441 -0
- package/dist/model/fonts/ThemeFonts.d.mts +17 -0
- package/dist/model/fonts/ThemeFonts.mjs +76 -0
- package/dist/model/fonts/defaultTheme.d.mts +37 -0
- package/dist/model/fonts/defaultTheme.mjs +57 -0
- package/dist/model/fonts/families.generated.d.mts +11 -0
- package/dist/model/fonts/families.generated.mjs +17 -0
- package/dist/model/fonts/fontsInUse.d.mts +39 -0
- package/dist/model/fonts/fontsInUse.mjs +183 -0
- package/dist/model/fonts/index.d.mts +14 -0
- package/dist/model/fonts/index.mjs +29 -0
- package/dist/model/fonts/lookup.d.mts +5 -0
- package/dist/model/fonts/lookup.mjs +12 -0
- package/dist/model/fonts/registry.d.mts +31 -0
- package/dist/model/fonts/registry.mjs +103 -0
- package/dist/model/fonts/scripts.d.mts +2 -0
- package/dist/model/fonts/scripts.mjs +78 -0
- package/dist/model/fonts/substitutions.generated.d.mts +30 -0
- package/dist/model/fonts/substitutions.generated.mjs +12 -0
- package/dist/model/fonts/themes.generated.d.mts +6 -0
- package/dist/model/fonts/themes.generated.mjs +11 -0
- package/dist/model/index.d.mts +5 -0
- package/dist/model/index.mjs +13 -1
- package/dist/model/listnumbering/Emulator.d.mts +187 -0
- package/dist/model/listnumbering/Emulator.mjs +332 -0
- package/dist/model/listnumbering/definitions.d.mts +251 -0
- package/dist/model/listnumbering/definitions.mjs +571 -0
- package/dist/model/listnumbering/formats.d.mts +25 -0
- package/dist/model/listnumbering/formats.mjs +320 -0
- package/dist/model/listnumbering/index.d.mts +4 -0
- package/dist/model/listnumbering/index.mjs +15 -0
- package/dist/model/listnumbering/state.d.mts +97 -0
- package/dist/model/listnumbering/state.mjs +179 -0
- package/dist/model/properties/PropertyResolver.d.mts +216 -0
- package/dist/model/properties/PropertyResolver.mjs +524 -0
- package/dist/model/properties/catalogue.d.mts +179 -0
- package/dist/model/properties/catalogue.mjs +860 -0
- package/dist/model/properties/index.d.mts +4 -0
- package/dist/model/properties/index.mjs +9 -0
- package/dist/model/properties/log.d.mts +7 -0
- package/dist/model/properties/log.mjs +25 -0
- package/dist/model/properties/styleUtil.d.mts +112 -0
- package/dist/model/properties/styleUtil.mjs +359 -0
- package/dist/node/index.d.mts +1 -0
- package/dist/node/index.mjs +12 -0
- package/dist/office-js/document.d.mts +111 -0
- package/dist/office-js/document.mjs +267 -0
- package/dist/office-js/enums.d.mts +187 -0
- package/dist/office-js/enums.mjs +176 -0
- package/dist/office-js/errors.d.mts +29 -0
- package/dist/office-js/errors.mjs +39 -0
- package/dist/office-js/extras.d.mts +5 -0
- package/dist/office-js/extras.mjs +29 -0
- package/dist/office-js/fragment.d.mts +10 -0
- package/dist/office-js/fragment.mjs +23 -0
- package/dist/office-js/index.d.mts +183 -0
- package/dist/office-js/index.mjs +54 -0
- package/dist/office-js/proxy.d.mts +72 -0
- package/dist/office-js/proxy.mjs +279 -0
- package/dist/office-js/run.d.mts +32 -0
- package/dist/office-js/run.mjs +66 -0
- package/dist/office-js/supported.d.mts +7 -0
- package/dist/office-js/supported.generated.d.mts +1 -0
- package/dist/office-js/supported.generated.mjs +235 -0
- package/dist/office-js/supported.mjs +53 -0
- package/dist/office-js/toApiScript.d.mts +25 -0
- package/dist/office-js/toApiScript.mjs +394 -0
- package/dist/opc/ContentTypes.d.mts +11 -0
- package/dist/opc/ContentTypes.mjs +14 -0
- package/dist/opc/DirectoryPartStore.d.mts +47 -0
- package/dist/opc/DirectoryPartStore.mjs +123 -0
- package/dist/opc/exceptions.d.mts +30 -0
- package/dist/opc/exceptions.mjs +38 -0
- package/dist/opc/index.d.mts +1 -1
- package/dist/opc/index.mjs +1 -1
- package/dist/packages/OpcPackage.d.mts +19 -1
- package/dist/packages/OpcPackage.mjs +29 -0
- package/dist/packages/PresentationMLPackage.d.mts +71 -1
- package/dist/packages/PresentationMLPackage.mjs +179 -0
- package/dist/packages/SpreadsheetMLPackage.d.mts +30 -1
- package/dist/packages/SpreadsheetMLPackage.mjs +78 -0
- package/dist/packages/WordprocessingMLPackage.d.mts +124 -2
- package/dist/packages/WordprocessingMLPackage.mjs +309 -2
- package/dist/packages/index.d.mts +1 -1
- package/dist/packages/index.mjs +1 -1
- package/dist/parts/DefaultXmlPart.d.mts +18 -0
- package/dist/parts/DefaultXmlPart.mjs +34 -5
- package/dist/parts/Namespaces.d.mts +18 -0
- package/dist/parts/Namespaces.mjs +20 -0
- package/dist/parts/Part.d.mts +6 -0
- package/dist/parts/Part.mjs +13 -0
- package/dist/parts/PartRegistry.mjs +13 -1
- package/dist/parts/XmlPart.d.mts +33 -0
- package/dist/parts/XmlPart.mjs +105 -2
- package/dist/parts/pml/defaults.d.mts +6 -0
- package/dist/parts/pml/defaults.mjs +53 -0
- package/dist/parts/pml/index.d.mts +66 -3
- package/dist/parts/pml/index.mjs +206 -7
- package/dist/parts/pml/placeholders.d.mts +71 -0
- package/dist/parts/pml/placeholders.mjs +141 -0
- package/dist/parts/sml/index.d.mts +80 -1
- package/dist/parts/sml/index.mjs +154 -1
- package/dist/parts/wml/comments.d.mts +1 -0
- package/dist/parts/wml/comments.mjs +179 -0
- package/dist/parts/wml/defaultNumbering.d.mts +1 -0
- package/dist/parts/wml/defaultNumbering.mjs +216 -0
- package/dist/parts/wml/index.d.mts +121 -0
- package/dist/parts/wml/index.mjs +291 -0
- package/dist/xml/dom.mjs +1 -2
- package/package.json +25 -4
package/dist/parts/pml/index.mjs
CHANGED
|
@@ -1,41 +1,239 @@
|
|
|
1
|
+
import { createPresentationSldIdLstSldId, createPresentationSldMasterIdLstSldMasterId, createSlideLayoutIdListSldLayoutId, } from '@docx4j/generated-objects-ts/factory/org_pptx4j_pml';
|
|
1
2
|
import { XmlPart } from '../XmlPart.mjs';
|
|
2
3
|
import { BinaryPart } from '../BinaryPart.mjs';
|
|
3
4
|
import { ContentTypes } from '../../opc/ContentTypes.mjs';
|
|
4
5
|
import { Namespaces } from '../Namespaces.mjs';
|
|
6
|
+
import { Pptx4jException } from '../../opc/exceptions.mjs';
|
|
5
7
|
const P = 'http://schemas.openxmlformats.org/presentationml/2006/main';
|
|
6
8
|
const A = 'http://schemas.openxmlformats.org/drawingml/2006/main';
|
|
9
|
+
/** The parts an id list's `r:id`s point at, in list order, skipping any that is not of the class. */
|
|
10
|
+
function partsByRelId(entries, rp, cls) {
|
|
11
|
+
const out = [];
|
|
12
|
+
for (const entry of entries) {
|
|
13
|
+
const part = rp.getPart(entry.rid);
|
|
14
|
+
if (part instanceof cls)
|
|
15
|
+
out.push(part);
|
|
16
|
+
}
|
|
17
|
+
return out;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A new `p:sldId/@id` (docx4j `JaxbPmlPart.getSlideId()`, ECMA-376 4.8.17 ST_SlideId: 256 to
|
|
21
|
+
* 2147483647). Random, as docx4j's is: nothing in the package numbers them.
|
|
22
|
+
*/
|
|
23
|
+
export function nextSlideId() {
|
|
24
|
+
return Math.floor(Math.random() * 2147483392) + 256;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* A new `p:sldLayoutId/@id` or `p:sldMasterId/@id` (docx4j
|
|
28
|
+
* `JaxbPmlPart.getSlideLayoutOrMasterId()`, ECMA-376 4.8.18 and 4.8.20: above 2147483648).
|
|
29
|
+
*/
|
|
30
|
+
export function nextSlideLayoutOrMasterId() {
|
|
31
|
+
return Math.floor(Math.random() * 2147483647) + 2147483648;
|
|
32
|
+
}
|
|
7
33
|
export class MainPresentationPart extends XmlPart {
|
|
8
34
|
constructor(partName = '/ppt/presentation.xml', contentType = ContentTypes.PRESENTATIONML_MAIN) {
|
|
9
35
|
super(partName, contentType, Namespaces.PRESENTATIONML_MAIN, { namespaceURI: P, localPart: 'presentation' });
|
|
10
36
|
}
|
|
11
37
|
setPartShortcut(part, relationshipType) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
38
|
+
switch (relationshipType) {
|
|
39
|
+
case Namespaces.THEME:
|
|
40
|
+
this.themePart = part;
|
|
41
|
+
return true;
|
|
42
|
+
case Namespaces.PRESENTATIONML_NOTES_MASTER:
|
|
43
|
+
this.notesMasterPart = part;
|
|
44
|
+
return true;
|
|
45
|
+
case Namespaces.PRESENTATIONML_COMMENT_AUTHORS:
|
|
46
|
+
this.commentAuthorsPart = part;
|
|
47
|
+
return true;
|
|
48
|
+
case Namespaces.PRESENTATIONML_PRES_PROPS:
|
|
49
|
+
this.presentationPropertiesPart = part;
|
|
50
|
+
return true;
|
|
51
|
+
case Namespaces.PRESENTATIONML_VIEW_PROPS:
|
|
52
|
+
this.viewPropertiesPart = part;
|
|
53
|
+
return true;
|
|
54
|
+
case Namespaces.PRESENTATIONML_TABLE_STYLES:
|
|
55
|
+
this.tableStylesPart = part;
|
|
56
|
+
return true;
|
|
57
|
+
default: return false;
|
|
15
58
|
}
|
|
16
|
-
return false;
|
|
17
59
|
}
|
|
60
|
+
/**
|
|
61
|
+
* The slides, in `p:sldIdLst` order (docx4j `getSlideParts()`), once the part is unmarshalled;
|
|
62
|
+
* before that, in relationship order, which is the order they were added in.
|
|
63
|
+
*/
|
|
18
64
|
get slideParts() {
|
|
65
|
+
var _a;
|
|
19
66
|
const rp = this.relationshipsPart;
|
|
20
67
|
if (!rp)
|
|
21
68
|
return [];
|
|
69
|
+
if (this.isUnmarshalled) {
|
|
70
|
+
const entries = (_a = this.contents.sldIdLst) === null || _a === void 0 ? void 0 : _a.sldId;
|
|
71
|
+
if (entries)
|
|
72
|
+
return partsByRelId(entries, rp, SlidePart);
|
|
73
|
+
}
|
|
22
74
|
return rp.getRelationshipsByType(Namespaces.PRESENTATIONML_SLIDE).map((r) => rp.getPart(r)).filter((p) => p instanceof SlidePart);
|
|
23
75
|
}
|
|
76
|
+
/** The slides in `p:sldIdLst` order, unmarshalling the part first (docx4j `getSlideParts()`). */
|
|
77
|
+
async getSlideParts() {
|
|
78
|
+
await this.getContents();
|
|
79
|
+
return this.slideParts;
|
|
80
|
+
}
|
|
81
|
+
/** The slide masters, in `p:sldMasterIdLst` order once the part is unmarshalled. */
|
|
82
|
+
get slideMasterParts() {
|
|
83
|
+
var _a;
|
|
84
|
+
const rp = this.relationshipsPart;
|
|
85
|
+
if (!rp)
|
|
86
|
+
return [];
|
|
87
|
+
if (this.isUnmarshalled) {
|
|
88
|
+
const entries = (_a = this.contents.sldMasterIdLst) === null || _a === void 0 ? void 0 : _a.sldMasterId;
|
|
89
|
+
if (entries)
|
|
90
|
+
return partsByRelId(entries, rp, SlideMasterPart);
|
|
91
|
+
}
|
|
92
|
+
return rp.getRelationshipsByType(Namespaces.PRESENTATIONML_SLIDE_MASTER).map((r) => rp.getPart(r)).filter((p) => p instanceof SlideMasterPart);
|
|
93
|
+
}
|
|
94
|
+
/** The slide at an index of `p:sldIdLst` (docx4j `getSlide(int)`). */
|
|
95
|
+
getSlide(index) {
|
|
96
|
+
const slides = this.slideParts;
|
|
97
|
+
const slide = slides[index];
|
|
98
|
+
if (!slide)
|
|
99
|
+
throw new Pptx4jException(`No slide at index ${index}. (There are ${slides.length} slides)`);
|
|
100
|
+
return slide;
|
|
101
|
+
}
|
|
102
|
+
/** docx4j `getSlideCount()`. */
|
|
103
|
+
get slideCount() {
|
|
104
|
+
var _a, _b, _c;
|
|
105
|
+
return (_c = (_b = (_a = this.contents.sldIdLst) === null || _a === void 0 ? void 0 : _a.sldId) === null || _b === void 0 ? void 0 : _b.length) !== null && _c !== void 0 ? _c : 0;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Adds a slide part as a target and appends a `p:sldId` for it (docx4j
|
|
109
|
+
* `addSlideIdListEntry(SlidePart)`); the part must be unmarshalled.
|
|
110
|
+
*/
|
|
111
|
+
addSlideIdListEntry(slidePart, mode = 'OVERWRITE_IF_NAME_EXISTS') {
|
|
112
|
+
const rel = this.addTargetPart(slidePart, mode);
|
|
113
|
+
const entry = createPresentationSldIdLstSldId({ id: nextSlideId(), rid: rel.id });
|
|
114
|
+
this.sldIdLst().sldId.push(entry);
|
|
115
|
+
return entry;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* docx4j `addSlide(SlidePart)` / `addSlide(int, SlidePart)`: appends the slide, or inserts it
|
|
119
|
+
* at `index`, renaming the part if the name is taken (PowerPoint cannot open a package in which
|
|
120
|
+
* two relationships target the same slide, so a slide is never added twice).
|
|
121
|
+
*
|
|
122
|
+
* `layoutPart`, when given, becomes the slide's layout relationship, as a slide needs one.
|
|
123
|
+
*/
|
|
124
|
+
addSlide(slidePart, index, layoutPart) {
|
|
125
|
+
const sldId = this.sldIdLst().sldId;
|
|
126
|
+
if (index !== undefined && (index < 0 || index > sldId.length)) {
|
|
127
|
+
throw new Pptx4jException(`Can't add slide at index ${index}. (There are ${sldId.length} slides) `);
|
|
128
|
+
}
|
|
129
|
+
const rel = this.addTargetPart(slidePart, 'RENAME_IF_NAME_EXISTS');
|
|
130
|
+
const entry = createPresentationSldIdLstSldId({ id: nextSlideId(), rid: rel.id });
|
|
131
|
+
if (index === undefined)
|
|
132
|
+
sldId.push(entry);
|
|
133
|
+
else
|
|
134
|
+
sldId.splice(index, 0, entry);
|
|
135
|
+
if (layoutPart)
|
|
136
|
+
slidePart.addTargetPart(layoutPart);
|
|
137
|
+
return entry;
|
|
138
|
+
}
|
|
139
|
+
/** docx4j `addSlideMasterIdListEntry(SlideMasterPart)`. */
|
|
140
|
+
addSlideMasterIdListEntry(masterPart) {
|
|
141
|
+
var _a, _b;
|
|
142
|
+
var _c;
|
|
143
|
+
const rel = this.addTargetPart(masterPart);
|
|
144
|
+
const entry = createPresentationSldMasterIdLstSldMasterId({ id: nextSlideLayoutOrMasterId(), rid: rel.id });
|
|
145
|
+
const lst = ((_a = (_c = this.contents).sldMasterIdLst) !== null && _a !== void 0 ? _a : (_c.sldMasterIdLst = { sldMasterId: [] }));
|
|
146
|
+
((_b = lst.sldMasterId) !== null && _b !== void 0 ? _b : (lst.sldMasterId = [])).push(entry);
|
|
147
|
+
return entry;
|
|
148
|
+
}
|
|
149
|
+
/** docx4j `removeSlide(int)`: the `p:sldId`, the relationship and the part. */
|
|
150
|
+
removeSlide(index) {
|
|
151
|
+
const sldId = this.sldIdLst().sldId;
|
|
152
|
+
const entry = sldId[index];
|
|
153
|
+
if (!entry)
|
|
154
|
+
throw new Pptx4jException(`No slide at index ${index}. (There are ${sldId.length} slides) `);
|
|
155
|
+
sldId.splice(index, 1);
|
|
156
|
+
const rp = this.relationshipsPart;
|
|
157
|
+
const part = rp.getPart(entry.rid);
|
|
158
|
+
rp.removePart(part.partName);
|
|
159
|
+
return part;
|
|
160
|
+
}
|
|
161
|
+
sldIdLst() {
|
|
162
|
+
var _a, _b;
|
|
163
|
+
const contents = this.contents;
|
|
164
|
+
const lst = ((_a = contents.sldIdLst) !== null && _a !== void 0 ? _a : (contents.sldIdLst = { sldId: [] }));
|
|
165
|
+
(_b = lst.sldId) !== null && _b !== void 0 ? _b : (lst.sldId = []);
|
|
166
|
+
return lst;
|
|
167
|
+
}
|
|
24
168
|
}
|
|
25
169
|
export class SlidePart extends XmlPart {
|
|
26
|
-
constructor(partName) {
|
|
170
|
+
constructor(partName = '/ppt/slides/slide1.xml') {
|
|
27
171
|
super(partName, ContentTypes.PRESENTATIONML_SLIDE, Namespaces.PRESENTATIONML_SLIDE, { namespaceURI: P, localPart: 'sld' });
|
|
28
172
|
}
|
|
173
|
+
setPartShortcut(part, relationshipType) {
|
|
174
|
+
switch (relationshipType) {
|
|
175
|
+
case Namespaces.PRESENTATIONML_SLIDE_LAYOUT:
|
|
176
|
+
this.slideLayoutPart = part;
|
|
177
|
+
return true;
|
|
178
|
+
case Namespaces.PRESENTATIONML_NOTES_SLIDE:
|
|
179
|
+
this.notesSlidePart = part;
|
|
180
|
+
return true;
|
|
181
|
+
case Namespaces.PRESENTATIONML_COMMENTS:
|
|
182
|
+
this.commentsPart = part;
|
|
183
|
+
return true;
|
|
184
|
+
default: return false;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
29
187
|
}
|
|
30
188
|
export class SlideLayoutPart extends XmlPart {
|
|
31
|
-
constructor(partName) {
|
|
189
|
+
constructor(partName = '/ppt/slideLayouts/slideLayout1.xml') {
|
|
32
190
|
super(partName, ContentTypes.PRESENTATIONML_SLIDE_LAYOUT, Namespaces.PRESENTATIONML_SLIDE_LAYOUT, { namespaceURI: P, localPart: 'sldLayout' });
|
|
33
191
|
}
|
|
192
|
+
setPartShortcut(part, relationshipType) {
|
|
193
|
+
if (relationshipType === Namespaces.PRESENTATIONML_SLIDE_MASTER) {
|
|
194
|
+
this.slideMasterPart = part;
|
|
195
|
+
return true;
|
|
196
|
+
}
|
|
197
|
+
return false;
|
|
198
|
+
}
|
|
34
199
|
}
|
|
35
200
|
export class SlideMasterPart extends XmlPart {
|
|
36
|
-
constructor(partName) {
|
|
201
|
+
constructor(partName = '/ppt/slideMasters/slideMaster1.xml') {
|
|
37
202
|
super(partName, ContentTypes.PRESENTATIONML_SLIDE_MASTER, Namespaces.PRESENTATIONML_SLIDE_MASTER, { namespaceURI: P, localPart: 'sldMaster' });
|
|
38
203
|
}
|
|
204
|
+
setPartShortcut(part, relationshipType) {
|
|
205
|
+
if (relationshipType === Namespaces.THEME) {
|
|
206
|
+
this.themePart = part;
|
|
207
|
+
return true;
|
|
208
|
+
}
|
|
209
|
+
return false;
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Adds a layout part as a target and appends a `p:sldLayoutId` for it (docx4j
|
|
213
|
+
* `addSlideLayoutIdListEntry`); the master must be unmarshalled.
|
|
214
|
+
*/
|
|
215
|
+
addSlideLayoutIdListEntry(slideLayoutPart) {
|
|
216
|
+
var _a, _b;
|
|
217
|
+
var _c;
|
|
218
|
+
const rel = this.addTargetPart(slideLayoutPart);
|
|
219
|
+
const entry = createSlideLayoutIdListSldLayoutId({ id: nextSlideLayoutOrMasterId(), rid: rel.id });
|
|
220
|
+
const lst = ((_a = (_c = this.contents).sldLayoutIdLst) !== null && _a !== void 0 ? _a : (_c.sldLayoutIdLst = { sldLayoutId: [] }));
|
|
221
|
+
((_b = lst.sldLayoutId) !== null && _b !== void 0 ? _b : (lst.sldLayoutId = [])).push(entry);
|
|
222
|
+
return entry;
|
|
223
|
+
}
|
|
224
|
+
/** This master's layouts, in `p:sldLayoutIdLst` order once the master is unmarshalled. */
|
|
225
|
+
get slideLayoutParts() {
|
|
226
|
+
var _a;
|
|
227
|
+
const rp = this.relationshipsPart;
|
|
228
|
+
if (!rp)
|
|
229
|
+
return [];
|
|
230
|
+
if (this.isUnmarshalled) {
|
|
231
|
+
const entries = (_a = this.contents.sldLayoutIdLst) === null || _a === void 0 ? void 0 : _a.sldLayoutId;
|
|
232
|
+
if (entries)
|
|
233
|
+
return partsByRelId(entries, rp, SlideLayoutPart);
|
|
234
|
+
}
|
|
235
|
+
return rp.getRelationshipsByType(Namespaces.PRESENTATIONML_SLIDE_LAYOUT).map((r) => rp.getPart(r)).filter((p) => p instanceof SlideLayoutPart);
|
|
236
|
+
}
|
|
39
237
|
}
|
|
40
238
|
export class NotesSlidePart extends XmlPart {
|
|
41
239
|
constructor(partName) {
|
|
@@ -88,3 +286,4 @@ export class FontDataPart extends BinaryPart {
|
|
|
88
286
|
super(partName, ContentTypes.PRESENTATIONML_FONT_DATA, Namespaces.PRESENTATIONML_FONT_DATA);
|
|
89
287
|
}
|
|
90
288
|
}
|
|
289
|
+
export { placeholderGeometry, placeholderShape, slidePlaceholders, layoutPlaceholders, addShapes, bodyLines, placeholdersOf, slidePlaceholdersFor, } from './placeholders.mjs';
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type * as pml from '@docx4j/generated-objects-ts/modules/org_pptx4j_pml';
|
|
2
|
+
/** The text of a created slide's placeholders; `body` is one paragraph per line, or per entry. */
|
|
3
|
+
export interface SlideTextOptions {
|
|
4
|
+
/** The title placeholder's text; the placeholder is left empty (its prompt) when absent. */
|
|
5
|
+
title?: string;
|
|
6
|
+
/** The body placeholder's text: a string (split on newlines) or one string per paragraph. */
|
|
7
|
+
body?: string | string[];
|
|
8
|
+
}
|
|
9
|
+
/** A rectangle in EMU, as `a:xfrm` carries it. */
|
|
10
|
+
export interface Rect {
|
|
11
|
+
x: number;
|
|
12
|
+
y: number;
|
|
13
|
+
cx: number;
|
|
14
|
+
cy: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Where the title and body placeholders sit, as fractions of the slide: PowerPoint's own
|
|
18
|
+
* Title and Content layout at 4:3 (title 685800, 457200, 7772400 x 1143000; body 685800,
|
|
19
|
+
* 1600200, 7772400 x 4525963 of 9144000 x 6858000), so any slide size is laid out the same way.
|
|
20
|
+
*/
|
|
21
|
+
export declare function placeholderGeometry(sldSz: {
|
|
22
|
+
cx?: number;
|
|
23
|
+
cy?: number;
|
|
24
|
+
} | undefined): {
|
|
25
|
+
title: Rect;
|
|
26
|
+
body: Rect;
|
|
27
|
+
};
|
|
28
|
+
/** The body text as paragraphs: a string is split on newlines, as Office JS's `insertText` does. */
|
|
29
|
+
export declare function bodyLines(body: string | string[] | undefined): string[];
|
|
30
|
+
/**
|
|
31
|
+
* One placeholder shape (docx4j's `SAMPLE_SHAPE` in `PresentationMLPackage`, and the layout
|
|
32
|
+
* markup of its `SlidePlaceholder` sample): `p:sp` with `a:spLocks noGrp`, the `p:ph`, an
|
|
33
|
+
* optional `a:xfrm` and a `p:txBody` of the lines given.
|
|
34
|
+
*/
|
|
35
|
+
export declare function placeholderShape(options: {
|
|
36
|
+
id: number;
|
|
37
|
+
name: string;
|
|
38
|
+
type?: pml.STPlaceholderType;
|
|
39
|
+
idx?: number;
|
|
40
|
+
xfrm?: Rect;
|
|
41
|
+
lines?: string[];
|
|
42
|
+
}): pml.Shape;
|
|
43
|
+
/**
|
|
44
|
+
* The title (`p:ph type="title"`) and body (`p:ph idx="1"`) shapes a created **slide** carries,
|
|
45
|
+
* with no geometry of their own: each inherits the layout's, which is what a placeholder is for.
|
|
46
|
+
*/
|
|
47
|
+
export declare function slidePlaceholders(text?: SlideTextOptions): pml.Shape[];
|
|
48
|
+
/**
|
|
49
|
+
* The same pair for the **layout**, with the geometry the slides inherit and PowerPoint's own
|
|
50
|
+
* prompt text. Without these the slide's placeholders would have nothing to inherit from and
|
|
51
|
+
* PowerPoint would draw them at the origin with no size.
|
|
52
|
+
*/
|
|
53
|
+
export declare function layoutPlaceholders(sldSz: {
|
|
54
|
+
cx?: number;
|
|
55
|
+
cy?: number;
|
|
56
|
+
} | undefined): pml.Shape[];
|
|
57
|
+
/** The placeholder shapes of a slide, layout or master, in shape-tree order. */
|
|
58
|
+
export declare function placeholdersOf(cSld: pml.CommonSlideData | undefined): {
|
|
59
|
+
shape: pml.Shape;
|
|
60
|
+
ph: pml.CTPlaceholder;
|
|
61
|
+
}[];
|
|
62
|
+
/**
|
|
63
|
+
* The placeholders a new slide on this layout carries: one shape per placeholder the layout
|
|
64
|
+
* defines (bar the date, footer and slide-number ones), with the layout's `type` and `idx` so
|
|
65
|
+
* that each inherits that layout shape's position and text style, and with the text given in the
|
|
66
|
+
* first title and the first body one. A layout that defines none - docx4j's own - gets the
|
|
67
|
+
* default title and body pair.
|
|
68
|
+
*/
|
|
69
|
+
export declare function slidePlaceholdersFor(layout: pml.CommonSlideData | undefined, text?: SlideTextOptions): pml.Shape[];
|
|
70
|
+
/** Puts shapes into a slide's or layout's shape tree (docx4j `cSld.getSpTree().getSpOrGrpSpOrGraphicFrame().add(...)`). */
|
|
71
|
+
export declare function addShapes(spTree: pml.GroupShape, shapes: pml.Shape[]): void;
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { createShape, createShapeNvSpPr, createNvPr, createCTPlaceholder, } from '@docx4j/generated-objects-ts/factory/org_pptx4j_pml';
|
|
2
|
+
import { createCTNonVisualDrawingProps, createCTNonVisualDrawingShapeProps, createCTShapeLocking, createCTShapeProperties, createCTTextBody, createCTTextBodyProperties, createCTTextListStyle, createCTTextParagraph, createCTRegularTextRun, createCTTextCharacterProperties, createCTTransform2D, createCTPoint2D, createCTPositiveSize2D, } from '@docx4j/generated-objects-ts/factory/org_docx4j_dml';
|
|
3
|
+
/**
|
|
4
|
+
* Where the title and body placeholders sit, as fractions of the slide: PowerPoint's own
|
|
5
|
+
* Title and Content layout at 4:3 (title 685800, 457200, 7772400 x 1143000; body 685800,
|
|
6
|
+
* 1600200, 7772400 x 4525963 of 9144000 x 6858000), so any slide size is laid out the same way.
|
|
7
|
+
*/
|
|
8
|
+
export function placeholderGeometry(sldSz) {
|
|
9
|
+
var _a, _b;
|
|
10
|
+
const w = (_a = sldSz === null || sldSz === void 0 ? void 0 : sldSz.cx) !== null && _a !== void 0 ? _a : 9144000;
|
|
11
|
+
const h = (_b = sldSz === null || sldSz === void 0 ? void 0 : sldSz.cy) !== null && _b !== void 0 ? _b : 6858000;
|
|
12
|
+
const at = (fx, fy, fcx, fcy) => ({ x: Math.round(w * fx), y: Math.round(h * fy), cx: Math.round(w * fcx), cy: Math.round(h * fcy) });
|
|
13
|
+
return { title: at(0.075, 0.0667, 0.85, 0.1667), body: at(0.075, 0.2333, 0.85, 0.66) };
|
|
14
|
+
}
|
|
15
|
+
/** `a:p/a:r/a:t` paragraphs for a placeholder's `p:txBody`; one empty paragraph when there is no text. */
|
|
16
|
+
function paragraphsOf(lines) {
|
|
17
|
+
if (lines.length === 0)
|
|
18
|
+
return [createCTTextParagraph({ endParaRPr: createCTTextCharacterProperties({ lang: 'en-US' }) })];
|
|
19
|
+
return lines.map((text, i) => createCTTextParagraph({
|
|
20
|
+
egTextRun: [createCTRegularTextRun({ rPr: createCTTextCharacterProperties({ lang: 'en-US' }), t: text })],
|
|
21
|
+
...(i === lines.length - 1 ? { endParaRPr: createCTTextCharacterProperties({ lang: 'en-US' }) } : {}),
|
|
22
|
+
}));
|
|
23
|
+
}
|
|
24
|
+
/** The body text as paragraphs: a string is split on newlines, as Office JS's `insertText` does. */
|
|
25
|
+
export function bodyLines(body) {
|
|
26
|
+
if (body === undefined)
|
|
27
|
+
return [];
|
|
28
|
+
const lines = Array.isArray(body) ? body.slice() : body.split('\n');
|
|
29
|
+
while (lines.length > 0 && lines[lines.length - 1] === '')
|
|
30
|
+
lines.pop();
|
|
31
|
+
return lines;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* One placeholder shape (docx4j's `SAMPLE_SHAPE` in `PresentationMLPackage`, and the layout
|
|
35
|
+
* markup of its `SlidePlaceholder` sample): `p:sp` with `a:spLocks noGrp`, the `p:ph`, an
|
|
36
|
+
* optional `a:xfrm` and a `p:txBody` of the lines given.
|
|
37
|
+
*/
|
|
38
|
+
export function placeholderShape(options) {
|
|
39
|
+
var _a;
|
|
40
|
+
const ph = createCTPlaceholder({
|
|
41
|
+
...(options.type === undefined ? {} : { type: options.type }),
|
|
42
|
+
...(options.idx === undefined ? {} : { idx: options.idx }),
|
|
43
|
+
});
|
|
44
|
+
const spPr = createCTShapeProperties(options.xfrm === undefined ? {} : {
|
|
45
|
+
xfrm: createCTTransform2D({
|
|
46
|
+
off: createCTPoint2D({ x: options.xfrm.x, y: options.xfrm.y }),
|
|
47
|
+
ext: createCTPositiveSize2D({ cx: options.xfrm.cx, cy: options.xfrm.cy }),
|
|
48
|
+
}),
|
|
49
|
+
});
|
|
50
|
+
return createShape({
|
|
51
|
+
nvSpPr: createShapeNvSpPr({
|
|
52
|
+
cNvPr: createCTNonVisualDrawingProps({ id: options.id, name: options.name }),
|
|
53
|
+
cNvSpPr: createCTNonVisualDrawingShapeProps({ spLocks: createCTShapeLocking({ noGrp: true }) }),
|
|
54
|
+
nvPr: createNvPr({ ph }),
|
|
55
|
+
}),
|
|
56
|
+
spPr,
|
|
57
|
+
txBody: createCTTextBody({
|
|
58
|
+
bodyPr: createCTTextBodyProperties(),
|
|
59
|
+
lstStyle: createCTTextListStyle(),
|
|
60
|
+
p: paragraphsOf((_a = options.lines) !== null && _a !== void 0 ? _a : []),
|
|
61
|
+
}),
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* The title (`p:ph type="title"`) and body (`p:ph idx="1"`) shapes a created **slide** carries,
|
|
66
|
+
* with no geometry of their own: each inherits the layout's, which is what a placeholder is for.
|
|
67
|
+
*/
|
|
68
|
+
export function slidePlaceholders(text = {}) {
|
|
69
|
+
return [
|
|
70
|
+
placeholderShape({ id: 2, name: 'Title 1', type: 'title', ...(text.title === undefined ? {} : { lines: [text.title] }) }),
|
|
71
|
+
placeholderShape({ id: 3, name: 'Content Placeholder 2', idx: 1, lines: bodyLines(text.body) }),
|
|
72
|
+
];
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* The same pair for the **layout**, with the geometry the slides inherit and PowerPoint's own
|
|
76
|
+
* prompt text. Without these the slide's placeholders would have nothing to inherit from and
|
|
77
|
+
* PowerPoint would draw them at the origin with no size.
|
|
78
|
+
*/
|
|
79
|
+
export function layoutPlaceholders(sldSz) {
|
|
80
|
+
const geometry = placeholderGeometry(sldSz);
|
|
81
|
+
return [
|
|
82
|
+
placeholderShape({ id: 2, name: 'Title 1', type: 'title', xfrm: geometry.title, lines: ['Click to edit Master title style'] }),
|
|
83
|
+
placeholderShape({ id: 3, name: 'Content Placeholder 2', idx: 1, xfrm: geometry.body, lines: ['Click to edit Master text styles'] }),
|
|
84
|
+
];
|
|
85
|
+
}
|
|
86
|
+
/** The placeholder shapes of a slide, layout or master, in shape-tree order. */
|
|
87
|
+
export function placeholdersOf(cSld) {
|
|
88
|
+
var _a, _b, _c, _d;
|
|
89
|
+
const out = [];
|
|
90
|
+
for (const item of (_b = (_a = cSld === null || cSld === void 0 ? void 0 : cSld.spTree) === null || _a === void 0 ? void 0 : _a.spOrGrpSpOrGraphicFrame) !== null && _b !== void 0 ? _b : []) {
|
|
91
|
+
const shape = item;
|
|
92
|
+
const ph = (_d = (_c = shape === null || shape === void 0 ? void 0 : shape.nvSpPr) === null || _c === void 0 ? void 0 : _c.nvPr) === null || _d === void 0 ? void 0 : _d.ph;
|
|
93
|
+
if (shape.TYPE_NAME === 'org_pptx4j_pml.Shape' && ph)
|
|
94
|
+
out.push({ shape, ph });
|
|
95
|
+
}
|
|
96
|
+
return out;
|
|
97
|
+
}
|
|
98
|
+
/** Date, footer and slide-number placeholders: a layout's, which a new slide does not repeat
|
|
99
|
+
* (docx4j's `SlidePlaceholder` sample deletes exactly these three when it derives a slide). */
|
|
100
|
+
const NOT_ON_A_NEW_SLIDE = new Set(['dt', 'ftr', 'sldNum']);
|
|
101
|
+
/**
|
|
102
|
+
* The placeholders a new slide on this layout carries: one shape per placeholder the layout
|
|
103
|
+
* defines (bar the date, footer and slide-number ones), with the layout's `type` and `idx` so
|
|
104
|
+
* that each inherits that layout shape's position and text style, and with the text given in the
|
|
105
|
+
* first title and the first body one. A layout that defines none - docx4j's own - gets the
|
|
106
|
+
* default title and body pair.
|
|
107
|
+
*/
|
|
108
|
+
export function slidePlaceholdersFor(layout, text = {}) {
|
|
109
|
+
const usable = placeholdersOf(layout).filter(({ ph }) => ph.type === undefined || !NOT_ON_A_NEW_SLIDE.has(ph.type));
|
|
110
|
+
if (usable.length === 0)
|
|
111
|
+
return slidePlaceholders(text);
|
|
112
|
+
let id = 2;
|
|
113
|
+
let titleTaken = false;
|
|
114
|
+
let bodyTaken = false;
|
|
115
|
+
return usable.map(({ shape, ph }) => {
|
|
116
|
+
const isTitle = ph.type === 'title' || ph.type === 'ctrTitle';
|
|
117
|
+
let lines = [];
|
|
118
|
+
if (isTitle && !titleTaken) {
|
|
119
|
+
titleTaken = true;
|
|
120
|
+
lines = text.title === undefined ? [] : [text.title];
|
|
121
|
+
}
|
|
122
|
+
else if (!isTitle && !bodyTaken) {
|
|
123
|
+
bodyTaken = true;
|
|
124
|
+
lines = bodyLines(text.body);
|
|
125
|
+
}
|
|
126
|
+
return placeholderShape({
|
|
127
|
+
id: id++,
|
|
128
|
+
name: shape.nvSpPr.cNvPr.name || (isTitle ? 'Title 1' : 'Content Placeholder 2'),
|
|
129
|
+
...(ph.type === undefined ? {} : { type: ph.type }),
|
|
130
|
+
...(ph.idx === undefined ? {} : { idx: ph.idx }),
|
|
131
|
+
lines,
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
/** Puts shapes into a slide's or layout's shape tree (docx4j `cSld.getSpTree().getSpOrGrpSpOrGraphicFrame().add(...)`). */
|
|
136
|
+
export function addShapes(spTree, shapes) {
|
|
137
|
+
var _a;
|
|
138
|
+
const into = ((_a = spTree.spOrGrpSpOrGraphicFrame) !== null && _a !== void 0 ? _a : (spTree.spOrGrpSpOrGraphicFrame = []));
|
|
139
|
+
for (const shape of shapes)
|
|
140
|
+
into.push(shape);
|
|
141
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type * as sml from '@docx4j/generated-objects-ts/modules/org_xlsx4j_sml';
|
|
2
2
|
import { XmlPart } from '../XmlPart.mjs';
|
|
3
|
+
import { DefaultXmlPart } from '../DefaultXmlPart.mjs';
|
|
3
4
|
import { BinaryPart } from '../BinaryPart.mjs';
|
|
4
5
|
import { Part } from '../Part.mjs';
|
|
5
6
|
import { PartName } from '../../opc/PartName.mjs';
|
|
@@ -9,13 +10,51 @@ export declare class WorkbookPart extends XmlPart<sml.Workbook> {
|
|
|
9
10
|
stylesPart: StylesPart | undefined;
|
|
10
11
|
themePart: ThemePart | undefined;
|
|
11
12
|
calcChainPart: CalcChainPart | undefined;
|
|
13
|
+
/** The workbook's survey part, if it has one (CR-004). */
|
|
14
|
+
surveyPart: SurveyPart | undefined;
|
|
15
|
+
/** The Power Pivot data model (`/xl/model/item.data`), if the workbook has one (CR-004). */
|
|
16
|
+
dataModelPart: DataModelPart | undefined;
|
|
12
17
|
constructor(partName?: PartName | string, contentType?: string);
|
|
13
18
|
setPartShortcut(part: Part, relationshipType: string): boolean;
|
|
14
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* The worksheets, in `sheets` order (the order Excel shows the tabs in) once the workbook is
|
|
21
|
+
* unmarshalled; before that, in relationship order.
|
|
22
|
+
*/
|
|
15
23
|
get worksheetParts(): WorksheetPart[];
|
|
24
|
+
/** The worksheets in `sheets` order, unmarshalling the workbook first. */
|
|
25
|
+
getWorksheetParts(): Promise<WorksheetPart[]>;
|
|
26
|
+
/** The worksheet at an index of `sheets` (docx4j `WorkbookPart.getWorksheet(int)`). */
|
|
27
|
+
getWorksheet(index: number): WorksheetPart;
|
|
28
|
+
/** The workbook's slicer caches (`/xl/slicerCaches/slicerCacheN.xml`), in relationship order. */
|
|
29
|
+
get slicerCacheParts(): SlicerCachePart[];
|
|
30
|
+
/** The workbook's timeline caches (`/xl/timelineCaches/timelineCacheN.xml`), in relationship order. */
|
|
31
|
+
get timelineCacheParts(): TimelineCachePart[];
|
|
32
|
+
/** The workbook's custom data properties parts, in relationship order; each names a `CustomDataPart`. */
|
|
33
|
+
get customDataPropertiesParts(): CustomDataPropertiesPart[];
|
|
34
|
+
/** docx4j `WorkbookPart.isDate1904()`. */
|
|
35
|
+
get isDate1904(): boolean;
|
|
16
36
|
}
|
|
17
37
|
export declare class WorksheetPart extends XmlPart<sml.Worksheet> {
|
|
38
|
+
/** The sheet's drawing part (docx4j's `Drawing`), set from the `drawing` relationship. */
|
|
39
|
+
drawingPart: Part | undefined;
|
|
40
|
+
/** The sheet's legacy comments part. */
|
|
41
|
+
commentsPart: SpreadsheetCommentsPart | undefined;
|
|
18
42
|
constructor(partName: PartName | string);
|
|
43
|
+
setPartShortcut(part: Part, relationshipType: string): boolean;
|
|
44
|
+
/** The sheet's table parts (`xl/tables/tableN.xml`), in relationship order. */
|
|
45
|
+
get tableParts(): TablePart[];
|
|
46
|
+
/** The sheet's slicers parts (`/xl/slicers/slicerN.xml`), in relationship order (CR-004). */
|
|
47
|
+
get slicersParts(): SlicersPart[];
|
|
48
|
+
/** The sheet's timelines parts (`/xl/timelines/timelineN.xml`), in relationship order (CR-004). */
|
|
49
|
+
get timelinesParts(): TimelinesPart[];
|
|
50
|
+
/**
|
|
51
|
+
* The sheet's form-control properties parts (`/xl/ctrlProps/ctrlPropN.xml`), in relationship
|
|
52
|
+
* order: one per `x:control`, whose `r:id` names it from inside the sheet's
|
|
53
|
+
* `mc:AlternateContent` (CR-004).
|
|
54
|
+
*/
|
|
55
|
+
get controlPropertiesParts(): ControlPropertiesPart[];
|
|
56
|
+
/** The workbook this sheet belongs to, through its source relationship. */
|
|
57
|
+
get workbookPart(): WorkbookPart | undefined;
|
|
19
58
|
}
|
|
20
59
|
export declare class ChartsheetPart extends XmlPart<sml.CTChartsheet> {
|
|
21
60
|
constructor(partName: PartName | string);
|
|
@@ -59,3 +98,43 @@ export declare class ExternalLinkPart extends XmlPart<sml.CTExternalLink> {
|
|
|
59
98
|
export declare class PrinterSettingsPart extends BinaryPart {
|
|
60
99
|
constructor(partName: PartName | string);
|
|
61
100
|
}
|
|
101
|
+
/** A slicer cache (`x14:slicerCacheDefinition`), from the workbook. docx4j `SlicerCachePart`. */
|
|
102
|
+
export declare class SlicerCachePart extends DefaultXmlPart {
|
|
103
|
+
constructor(partName?: PartName | string);
|
|
104
|
+
}
|
|
105
|
+
/** A sheet's slicers (`x14:slicers`). docx4j `SlicersPart`. */
|
|
106
|
+
export declare class SlicersPart extends DefaultXmlPart {
|
|
107
|
+
constructor(partName?: PartName | string);
|
|
108
|
+
}
|
|
109
|
+
/** A timeline cache (`x15:timelineCacheDefinition`), from the workbook. docx4j `TimelineCachePart`. */
|
|
110
|
+
export declare class TimelineCachePart extends DefaultXmlPart {
|
|
111
|
+
constructor(partName?: PartName | string);
|
|
112
|
+
}
|
|
113
|
+
/** A sheet's timelines (`x15:timelines`). docx4j `TimelinesPart`. */
|
|
114
|
+
export declare class TimelinesPart extends DefaultXmlPart {
|
|
115
|
+
constructor(partName?: PartName | string);
|
|
116
|
+
}
|
|
117
|
+
/** A form control's properties (`x14:formControlPr`), from a worksheet. docx4j `ControlPropertiesPart`. */
|
|
118
|
+
export declare class ControlPropertiesPart extends DefaultXmlPart {
|
|
119
|
+
constructor(partName?: PartName | string);
|
|
120
|
+
}
|
|
121
|
+
/** The properties of a custom data part (`x14:datastoreItem`). docx4j `CustomDataPropertiesPart`. */
|
|
122
|
+
export declare class CustomDataPropertiesPart extends DefaultXmlPart {
|
|
123
|
+
constructor(partName?: PartName | string);
|
|
124
|
+
}
|
|
125
|
+
/** A survey (`x15:survey`), from the workbook. docx4j `SurveyPart`. */
|
|
126
|
+
export declare class SurveyPart extends DefaultXmlPart {
|
|
127
|
+
constructor(partName?: PartName | string);
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Custom data, whatever an add-in put there (docx4j `CustomDataPart`). Its content type is the
|
|
131
|
+
* generic `application/binary`, so the registry chooses it by relationship type, as it does for
|
|
132
|
+
* altChunk, embedded packages, OLE objects and custom XML (CR-001 section 5.4).
|
|
133
|
+
*/
|
|
134
|
+
export declare class CustomDataPart extends BinaryPart {
|
|
135
|
+
constructor(partName?: PartName | string, contentType?: string);
|
|
136
|
+
}
|
|
137
|
+
/** The Power Pivot data model (`/xl/model/item.data`, [MS-XLDM]). docx4j `DataModelPart`. */
|
|
138
|
+
export declare class DataModelPart extends BinaryPart {
|
|
139
|
+
constructor(partName?: PartName | string);
|
|
140
|
+
}
|