@pptx-editor. dev/ editor-api
v0.3.1 · 2 published subpaths with full TypeScript signatures and JSDoc.
Subpaths
Package root
Presentation automation for PPTX: a batching object model over the PPTX Editor engine.
Work is described against proxy objects, and nothing reaches the presentation until context.sync(), which sends the queued calls as one atomic batch: all of it applies, or none of it. Reading a property that no load asked for is an error, not a silent undefined.
This entry needs no browser. It opens PPTX bytes, drives them, and saves them back, so a server, a worker, or a build script can use the whole API.
Functions (1)
isPptxEditorErrorfunctionSource ↗
Whether a caught value is one of ours. By name as well as by instanceof: a consumer can end up with two copies of this module, and instanceof fails across them.
declare function isPptxEditorError(value: unknown): value is PptxEditorError;Classes (61)
AdjustmentsclassSource ↗
The adjust values of a shape's preset geometry: the handles that change, for example, the corner radius of a rounded rectangle. A length is a fraction of the shape size (0.5 is half); an angle is in degrees. A write is bounded to the range of the preset's adjust handle.
A shape with no preset geometry (a freeform, a group, a table) refuses with NotSupported.
declare class Adjustments extends ModelObjectThe constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the Adjustments class.
| Member | Type | Summary |
|---|---|---|
| count | number | The number of adjust values that the preset defines. |
| get | | The adjust value at a zero-based index, after the next `sync()`. |
| set | | Set the adjust value at a zero-based index. |
ApplicationclassSource ↗
The application the presentation is open in. It has no properties or methods.
declare class Application extends ModelObjectThe constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the Application class.
BindingclassSource ↗
A binding: an id that names one shape for the lifetime of the runtime.
declare class Binding extends ModelObjectThe constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the Binding class.
| Member | Type | Summary |
|---|---|---|
| delete | | Delete the binding. The shape stays. |
| getShape | | The shape the binding names. A binding whose shape is gone refuses with `ItemNotFound`. |
| id | string | The id of the binding. |
| type | 'Shape' | BindingType | What the binding names. Always `Shape`. |
BindingCollectionclassSource ↗
The bindings of the runtime, in the order they were added. They live in memory and are never saved with the presentation.
declare class BindingCollection extends ModelObjectThe constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the BindingCollection class.
```ts
await runtime.run(async (context) => {
const shape = context.presentation.slides.getItemAt(0).shapes.getItemAt(0);
context.presentation.bindings.add(shape, 'Shape', 'title');
await context.sync();
});
```| Member | Type | Summary |
|---|---|---|
| add | | Bind a shape under `id`. A binding that has that id moves to the shape. |
| add | | Bind a shape under `id`. A binding that has that id moves to the shape. |
| addFromSelection | | Bind the one selected shape under `id`. Needs a runtime over a live editor; any selection other than one shape refuses with `InvalidArgument`. |
| addFromSelection | | Bind the one selected shape under `id`. Needs a runtime over a live editor; any selection other than one shape refuses with `InvalidArgument`. |
| getCount | | The number of bindings, after the next `sync()`. |
| getItem | | The binding with this id; `ItemNotFound` at the sync when there is none. |
| getItemAt | | The binding at a zero-based position; `ItemNotFound` at the sync when there is none. |
| getItemOrNullObject | | The binding with this id, or a null object. |
| items | Binding[] | The loaded bindings. |
BorderclassSource ↗
One border of a table cell: an edge or a diagonal. It reads the line the cell shows, its own or the table style's; a cell with no line there reads undefined for each property. A write keeps the properties it does not set, and an outside edge also changes the cell across it.
declare class Border extends CellFormatPartThe constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the Border class.
| Member | Type | Summary |
|---|---|---|
| color | string | undefined | The line color as `#RRGGBB`. A write also takes a preset color name. |
| dashStyle | ShapeLineDashStyle | `${ShapeLineDashStyle}` | undefined | The dash style. |
| transparency | number | undefined | The transparency, from 0 (opaque) to 1 (clear). |
| weight | number | undefined | The line weight, in points. |
BordersclassSource ↗
The borders of a table cell (a:tcPr/a:lnL, a:lnR, a:lnT, a:lnB, a:lnTlToBr, a:lnBlToTr).
declare class Borders extends CellFormatPart| Member | Type | Summary |
|---|---|---|
| bottom | Border | The bottom edge. |
| diagonalDown | Border | The diagonal from the top-left to the bottom-right corner. |
| diagonalUp | Border | The diagonal from the bottom-left to the top-right corner. |
| left | Border | The left edge. |
| right | Border | The right edge. |
| top | Border | The top edge. |
BulletFormatclassSource ↗
The bullets of paragraphs (a:buNone, a:buChar, a:buAutoNum).
declare class BulletFormat extends ModelObjectThe constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the BulletFormat class.
| Member | Type | Summary |
|---|---|---|
| style | BulletStyle | `${BulletStyle}` | null | The numbering scheme of numbered bullets, or `null` when the paragraphs differ. |
| type | BulletType | `${BulletType}` | null | The kind of bullet, or `null` when the paragraphs differ. |
| visible | boolean | null | Whether the paragraphs show bullets, or `null` when they differ. |
ClientObjectclassSource ↗
The base every presentation proxy extends.
A released proxy still answers what it already knew: a property loaded before the run ended is served from memory. Anything that would talk to the presentation (load, a write, a method) refuses with InvalidObjectPath.
declare abstract class ClientObject implements RuntimeManagedObjectThe constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the ClientObject class.
| Member | Type | Summary |
|---|---|---|
| context | RequestContext | The request context this object currently belongs to. |
| isNullObject | boolean | Whether this object turned out not to exist. Only an answer, never a guess: an object from a `getItemOrNullObject` has no verdict until the sync that looked for it, and reading one before then is `PropertyNotLoaded`. |
| load | | Queue the reads that fill in the selected properties. Returns `this`; the values are readable after the next `sync()`. |
| toJSON | | The loaded properties as a plain object, as Office.js `toJSON()` gives them. |
ClientResultclassSource ↗
A value a queued method promised to produce, readable after the next sync().
Not a Promise: a method call inside a batch has not been sent yet, so there is nothing that could resolve on its own. Reading one early is ValueNotLoaded.
declare class ClientResult<T>```ts
const count = context.presentation.slides.getCount();
await context.sync();
console.log(count.value);
```| Member | Type | Summary |
|---|---|---|
| isLoaded | boolean | Whether the sync that fills this has happened. |
| value | T | The value, once a `sync()` has filled it in. |
CustomPropertyclassSource ↗
One custom document property: a key, a type, and a value.
declare class CustomProperty extends ModelObjectThe constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the CustomProperty class.
| Member | Type | Summary |
|---|---|---|
| delete | | Delete the property. |
| key | string | The key. Lookups compare keys without case. |
| type | DocumentPropertyType | 'Boolean' | 'Date' | 'Number' | 'String' | The type of the value. |
| value | boolean | Date | number | string | The value. A write of another JavaScript type changes the type too. |
CustomPropertyCollectionclassSource ↗
The custom document properties of the presentation.
declare class CustomPropertyCollection extends ModelObjectThe constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the CustomPropertyCollection class.
```ts
await runtime.run(async (context) => {
const custom = context.presentation.properties.customProperties;
custom.add('Client', 'Northwind');
custom.add('Reviewed', new Date());
await context.sync();
});
```| Member | Type | Summary |
|---|---|---|
| add | | Add a property, or set the value and type of the property with this key. |
| deleteAll | | Delete every listed property. A property of another variant type stays. |
| getCount | | The number of properties, after the next `sync()`. |
| getItem | | The property with this key; `ItemNotFound` at the sync when there is none. |
| getItemAt | | The property at a zero-based position; `ItemNotFound` at the sync when there is none. |
| getItemOrNullObject | | The property with this key, or a null object. |
| items | CustomProperty[] | The loaded properties. |
CustomXmlPartclassSource ↗
One custom XML part.
declare class CustomXmlPart extends ModelObjectThe constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the CustomXmlPart class.
| Member | Type | Summary |
|---|---|---|
| delete | | Delete the part from its owner. A part another owner still names stays for that owner. |
| getXml | | The XML text of the part, after the next `sync()`. |
| id | string | The id: the part's `ds:itemID` GUID, braced and upper case. |
| namespaceUri | string | The namespace URI of the root element, or an empty string. |
| setXml | | Replace the XML text. Text that is not well-formed XML refuses with `InvalidArgument`. |
CustomXmlPartCollectionclassSource ↗
The custom XML parts of a presentation, slide, layout, master, or shape.
declare class CustomXmlPartCollection extends CustomXmlPartListThe constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the CustomXmlPartCollection class.
```ts
await runtime.run(async (context) => {
const parts = context.presentation.customXmlParts;
const part = parts.add('<review xmlns="urn:example:review"><status>open</status></review>');
part.load('id');
await context.sync();
console.log(part.id);
});
```| Member | Type | Summary |
|---|---|---|
| add | | Add a part with this XML text. Text that is not well-formed XML, or that declares a DTD or an entity, refuses with `InvalidArgument` at the sync. |
| getByNamespace | | The parts whose root element has this namespace URI. |
CustomXmlPartScopedCollectionclassSource ↗
The custom XML parts of one namespace, from CustomXmlPartCollection.getByNamespace.
declare class CustomXmlPartScopedCollection extends CustomXmlPartListThe constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the CustomXmlPartScopedCollection class.
| Member | Type | Summary |
|---|---|---|
| getOnlyItem | | The only part; `ItemNotFound` at the sync unless there is exactly one. |
| getOnlyItemOrNullObject | | The only part, or a null object unless there is exactly one. |
DocumentPropertiesclassSource ↗
The core and extended document properties (docProps/core.xml, docProps/app.xml).
declare class DocumentProperties extends ModelObjectThe constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the DocumentProperties class.
| Member | Type | Summary |
|---|---|---|
| author | string | |
| category | string | |
| comments | string | |
| company | string | |
| creationDate | Date | When the presentation was created, from `dcterms:created`. Without one, or with a value that is not a date, it is an invalid `Date`: check `Number.isNaN(creationDate.getTime())`. |
| customProperties | CustomPropertyCollection | The custom document properties (`docProps/custom.xml`). |
| keywords | string | |
| lastAuthor | string | |
| manager | string | |
| revisionNumber | number | |
| subject | string | |
| title | string |
HyperlinkclassSource ↗
One hyperlink: on a text range or on a whole shape.
declare class Hyperlink extends ModelObjectThe constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the Hyperlink class.
| Member | Type | Summary |
|---|---|---|
| address | string | The address the link opens. |
| delete | | Remove the link. The text or shape stays. |
| getLinkedShapeOrNullObject | | The shape a shape link is on, or a null object for a text link. |
| getLinkedTextRangeOrNullObject | | The text range a text link is on, or a null object for a shape link. |
| screenTip | string | The tip that shows over the link. |
| type | HyperlinkType | `${HyperlinkType}` | Whether the link is on a text range or on a whole shape. |
HyperlinkCollectionclassSource ↗
The hyperlinks of a slide, in shape order.
declare class HyperlinkCollection extends HyperlinkListThe constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the HyperlinkCollection class.
| Member | Type | Summary |
|---|---|---|
| add | | Link a text range or a whole shape. Answers the new hyperlink. |
HyperlinkScopedCollectionclassSource ↗
The hyperlinks of a text range: each text link that overlaps the range, in text order. A link keeps its whole span, so one that starts before the range reads from its own start. An empty range holds the link around its point.
declare class HyperlinkScopedCollection extends HyperlinkListThe constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the HyperlinkScopedCollection class.
MarginsclassSource ↗
The margins of a table cell, in points (a:tcPr/@marL, @marR, @marT, @marB). Writing undefined removes the margin, back to its default (7.2 points left and right, 3.6 points top and bottom).
declare class Margins extends CellFormatPart| Member | Type | Summary |
|---|---|---|
| bottom | number | undefined | The bottom margin, in points. |
| left | number | undefined | The left margin, in points. |
| right | number | undefined | The right margin, in points. |
| top | number | undefined | The top margin, in points. |
PageSetupclassSource ↗
The slide size, in points (p:sldSz, ECMA-376 Part 1, 19.2.1.39).
declare class PageSetup extends ModelObjectThe constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the PageSetup class.
| Member | Type | Summary |
|---|---|---|
| slideHeight | number | |
| slideWidth | number |
ParagraphFormatclassSource ↗
The paragraph formatting of the paragraphs a text range touches. A property reads null when they differ.
declare class ParagraphFormat extends ModelObjectThe constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the ParagraphFormat class.
| Member | Type | Summary |
|---|---|---|
| bulletFormat | BulletFormat | The bullets of the paragraphs. |
| horizontalAlignment | ParagraphHorizontalAlignment | `${ParagraphHorizontalAlignment}` | null | The horizontal alignment (`a:pPr/@algn`). |
| indentLevel | number | The outline level from 1 to 9, as for `TableCell.indentLevel`: one more than `a:pPr/@lvl`, so a paragraph with no `lvl` reads 1. |
PlaceholderFormatclassSource ↗
The placeholder properties of a shape (p:ph, ECMA-376 Part 1, 19.3.1.36).
declare class PlaceholderFormat extends ModelObjectThe constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the PlaceholderFormat class.
| Member | Type | Summary |
|---|---|---|
| containedType | ShapeType | `${ShapeType}` | null | The kind of content the placeholder holds, or null for a shape placeholder. |
| type | PlaceholderType | `${PlaceholderType}` | The placeholder type. A shape that is no placeholder reads `Unsupported`. |
PptxEditorErrorclassSource ↗
Every refusal this runtime throws.
Branch on [PptxEditorError.code](PptxEditorError.code), never on the message. Codes are stable public API. Nothing from the engine or the file appears in the message: a consumer gets a stable code, a fixed sentence, and target, the consumer-facing path they wrote themselves.
declare class PptxEditorError extends Error```ts
try {
await context.sync();
} catch (error) {
if (isPptxEditorError(error) && error.code === 'StaleDocument') {
// Read again: another writer changed the presentation first.
}
}
```| Member | Type | Summary |
|---|---|---|
| (constructor) | | Constructs a new instance of the `PptxEditorError` class |
| actualRevision? | number | For `StaleDocument`: the revision the presentation was actually at. |
| code | PptxEditorErrorCode | Which refusal this is. Stable across versions; the thing to branch on. |
| debugInfo | PptxEditorDebugInfo | Debug details, as Office.js `OfficeExtension.Error.debugInfo` has them. |
| expectedRevision? | number | For `StaleDocument`: the revision the context had last read at. |
| target? | string | Consumer-facing path of the object or property involved, when there is one to name. |
| traceMessages | readonly string[] | The messages of `context.trace` calls queued before the call that failed, in order, as Office.js `OfficeExtension.Error.traceMessages`. Empty when the sync had none. |
PresentationclassSource ↗
The presentation: its slides, masters, tags, properties, and page setup.
declare class Presentation extends ModelObjectThe constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the Presentation class.
```ts
await runtime.run(async (context) => {
const slides = context.presentation.slides;
slides.load('items/id');
await context.sync();
console.log(slides.items.map((slide) => slide.id));
});
```| Member | Type | Summary |
|---|---|---|
| bindings | BindingCollection | The bindings of this runtime: ids that name shapes. They live in memory for the lifetime of the runtime and are never saved with the presentation. |
| customXmlParts | CustomXmlPartCollection | The custom XML parts of the presentation. |
| getSelectedShapes | | The selected shapes of the reader. A server runtime refuses with `NotSupported`. |
| getSelectedSlides | | The selected slides of the reader. A server runtime refuses with `NotSupported`. |
| getSelectedTextRange | | The selected text. `ItemNotFound` at the sync when no text is selected. |
| getSelectedTextRangeOrNullObject | | The selected text, or a null object when no text is selected. |
| id | string | The id of the presentation. |
| insertSlidesFromBase64 | | Insert the slides of another presentation, given as Base64-encoded PPTX bytes. Each slide comes with its notes, pictures, media, charts, and other parts. With `KeepSourceFormatting` (the default), its layout, master, and theme come too; with `UseDestinationTheme`, it goes on the layout of this presentation with the same type. Without `targetSlideId`, the slides go first. Comments come along, with their authors merged by name and initials. An unknown slide id refuses with `ItemNotFound`; a slide with threaded comments or an embedded control refuses with `NotSupported`, naming the slide ids. Nothing changes when the call is refused. |
| pageSetup | PageSetup | The slide size. |
| properties | DocumentProperties | The document properties (title, author, …). |
| setSelectedSlides | | Select slides by id. A server runtime refuses with `NotSupported`. |
| slideMasters | SlideMasterCollection | The slide masters, in order. |
| slides | SlideCollection | The slides, in order. |
| tags | TagCollection | The tags of the presentation. |
| title | string | The title of the presentation, from the core properties. |
RequestContextclassSource ↗
What a run hands its callback: one queue, one presentation, one sync at a time.
sync() sends every queued call as one atomic batch: all of it applies, or none of it. A context that has READ remembers the revision it read at, and a later sync that writes is conditional on it, failing StaleDocument if another writer moved the presentation. A context that has read nothing writes unconditionally.
declare class RequestContext| Member | Type | Summary |
|---|---|---|
| application | Application | The application the presentation is open in. It has no properties or methods. |
| capabilities | PresentationCapabilities | What the presentation host behind this context can do. |
| debugInfo | RequestContextDebugInfo | What the next `sync()` sends, for debugging. See [RequestContextDebugInfo](RequestContextDebugInfo). |
| load | | Queue a load on `object`, as Office.js `context.load(object, option)`. |
| loadRecursive | | Queue loads on `object` and on the objects its loads reach, by type: each object whose Office.js type name is a key of `options` loads that option, and the objects its load fills in (navigation properties and collection items) go on, down to `maxDepth` levels below `object` (at most 32, which is also the default). An object whose type is not a key loads nothing and stops the walk there. Everything loads in the next `sync()`; each level costs one more host batch. |
| presentation | Presentation | The presentation this run is against: the same object for the life of the context. |
| sync | | Send everything queued as one atomic batch, then hydrate the answers. An empty queue is not a round trip, so a defensive `sync()` at the end of a run costs nothing. |
| trace | | Queue a trace message. A sync that fails gives the messages queued before the failed call in `error.traceMessages`, as Office.js does. The message goes nowhere else. |
| trackedObjects | TrackedObjects | Objects kept addressable past the run that created them. See [TrackedObjects](TrackedObjects). |
ShapeclassSource ↗
A shape on a slide, layout, or master: a geometric shape, a text box, a picture, a line, a group, a table, or another graphic frame.
declare class Shape extends ModelObjectThe constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the Shape class.
| Member | Type | Summary |
|---|---|---|
| adjustments | Adjustments | The adjust values of the shape's preset geometry (`a:prstGeom/a:avLst`). |
| altTextDescription | string | The alternative text description (`p:cNvPr/@descr`). |
| altTextTitle | string | The alternative text title (`p:cNvPr/@title`). |
| creationId | string | null | The creation id of the shape. The file format has none, so this reads `null`. |
| customXmlParts | CustomXmlPartCollection | The custom XML parts of the shape. |
| delete | | Delete the shape. |
| fill | ShapeFill | The fill of the shape. |
| getImageAsBase64 | | A PNG picture of the shape, without the slide behind it, as base64, drawn by the editor's own renderer. A runtime over a live editor in a browser draws pictures, and so does a server runtime created with a `rasterize` option; any other runtime refuses with `NotSupported`. |
| getParentSlide | | The slide the shape is on; `ItemNotFound` at the sync for a layout or master shape. |
| getParentSlideLayout | | The layout the shape is on; `ItemNotFound` at the sync for any other shape. |
| getParentSlideLayoutOrNullObject | | The layout the shape is on, or a null object. |
| getParentSlideMaster | | The master the shape is on; `ItemNotFound` at the sync for any other shape. |
| getParentSlideMasterOrNullObject | | The master the shape is on, or a null object. |
| getParentSlideOrNullObject | | The slide the shape is on, or a null object. |
| getTable | | The table of a table shape. `NotSupported` at the sync for any other shape. |
| getTextFrameOrNullObject | | The text frame, or a null object for a shape that holds no text. |
| group | ShapeGroup | The group this shape is, for a group shape. |
| height | number | The height, in points. |
| id | string | The shape id (`p:cNvPr/@id`), unique on its slide. |
| isDecorative | boolean | Whether the shape is decorative, so readers of alternative text skip it. |
| left | number | The distance from the left edge of the slide, in points. |
| level | number | How deep in groups the shape is: 0 at the top level. |
| lineFormat | ShapeLineFormat | The outline of the shape. |
| name | string | The shape name (`p:cNvPr/@name`). |
| parentGroup | Shape | The group that holds this shape. `ItemNotFound` at the sync for a shape at the top level. |
| placeholderFormat | PlaceholderFormat | The placeholder properties, for a placeholder. |
| rotation | number | The rotation, in degrees clockwise. |
| setHyperlink | | Set the click link of the whole shape. |
| setZOrder | | Move the shape in the z-order of its parent. |
| setZOrder | | Move the shape in the z-order of its parent. |
| tags | TagCollection | The tags of the shape. |
| textFrame | TextFrame | The text frame. `NotSupported` at the sync for a shape that holds no text. |
| top | number | The distance from the top edge of the slide, in points. |
| type | ShapeType | `${ShapeType}` | What kind of shape this is. |
| visible | boolean | Whether the shape shows (`p:cNvPr/@hidden` is not set). |
| width | number | The width, in points. |
| zOrderPosition | number | The zero-based position in the z-order of its parent. |
ShapeCollectionclassSource ↗
The shapes of a slide, layout, master, or group, in z-order.
declare class ShapeCollection extends ShapeListThe constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the ShapeCollection class.
| Member | Type | Summary |
|---|---|---|
| addGeometricShape | | Add a preset geometric shape (`a:prstGeom`, ECMA-376 Part 1, 20.1.9.18). |
| addGeometricShape | | Add a preset geometric shape (`a:prstGeom`, ECMA-376 Part 1, 20.1.9.18). |
| addGroup | | Group shapes of this collection, by shape or by id. Answers the new group. |
| addLine | | Add a line or connector (`p:cxnSp`). |
| addLine | | Add a line or connector (`p:cxnSp`). |
| addTable | | Add a table (`a:tbl` in a graphic frame) of `rowCount` rows and `columnCount` columns. |
| addTextBox | | Add a text box with `text`. |
ShapeFillclassSource ↗
The fill of a shape.
declare class ShapeFill extends ModelObjectThe constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the ShapeFill class.
| Member | Type | Summary |
|---|---|---|
| clear | | Remove the fill (`a:noFill`). |
| foregroundColor | string | The solid fill color as `#RRGGBB`, or an empty string for any other fill. |
| setImage | | Fill with a picture, stretched (`a:blipFill`): PNG, JPEG, or GIF bytes in base64. A table cell refuses a picture fill with `InvalidArgument`. |
| setSolidColor | | Fill with a solid color, `#RRGGBB` or a preset color name. |
| transparency | number | The transparency of a solid fill, from 0 (opaque) to 1 (clear). |
| type | ShapeFillType | `${ShapeFillType}` | The kind of fill. |
ShapeFontclassSource ↗
The character formatting of a text range. A property reads null when the range mixes values.
declare class ShapeFont extends ModelObjectThe constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the ShapeFont class.
| Member | Type | Summary |
|---|---|---|
| allCaps | boolean | null | |
| bold | boolean | null | |
| color | string | null | The color as `#RRGGBB`. |
| doubleStrikethrough | boolean | null | |
| italic | boolean | null | |
| name | string | null | The font family name. |
| size | number | null | The size, in points. |
| smallCaps | boolean | null | |
| strikethrough | boolean | null | |
| subscript | boolean | null | |
| superscript | boolean | null | |
| underline | ShapeFontUnderlineStyle | `${ShapeFontUnderlineStyle}` | null |
ShapeGroupclassSource ↗
A group shape (p:grpSp).
declare class ShapeGroup extends ModelObjectThe constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the ShapeGroup class.
| Member | Type | Summary |
|---|---|---|
| creationId | string | null | The creation id. The file format has none, so this reads `null`. |
| id | string | The id of the group shape. |
| shape | Shape | The group as a shape. |
| shapes | ShapeScopedCollection | The members of the group, in z-order. |
| ungroup | | Ungroup: the members move to the group's parent, and the group is deleted. |
ShapeLineFormatclassSource ↗
The outline of a shape, or a line.
declare class ShapeLineFormat extends ModelObjectThe constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the ShapeLineFormat class.
| Member | Type | Summary |
|---|---|---|
| color | string | The line color as `#RRGGBB`, or an empty string when it has none. |
| dashStyle | ShapeLineDashStyle | `${ShapeLineDashStyle}` | The dash style. |
| style | ShapeLineStyle | `${ShapeLineStyle}` | The compound line style. |
| transparency | number | The transparency, from 0 (opaque) to 1 (clear). |
| visible | boolean | Whether the line shows. |
| weight | number | The line weight, in points. |
ShapeScopedCollectionclassSource ↗
A set of shapes: the reader's selection, or the members of a group.
declare class ShapeScopedCollection extends ShapeListThe constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the ShapeScopedCollection class.
| Member | Type | Summary |
|---|---|---|
| group | | Group the shapes of this collection and answer the new group. The items need no load: when a completed load has not filled them in, the sync reads them first, in an earlier round at the same revision, and then groups them. |
SlideclassSource ↗
A slide.
declare class Slide extends ModelObjectThe constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the Slide class.
| Member | Type | Summary |
|---|---|---|
| applyLayout | | Change the layout, re-mapping placeholders by type and index. |
| background | SlideBackground | The background of the slide. |
| customXmlParts | CustomXmlPartCollection | The custom XML parts of the slide. |
| delete | | Delete the slide. |
| exportAsBase64 | | The slide as a presentation of its own, Base64-encoded PPTX bytes. |
| getImageAsBase64 | | A PNG picture of the slide as base64, drawn by the editor's own renderer. A runtime over a live editor in a browser draws pictures, and so does a server runtime created with a `rasterize` option; any other runtime refuses with `NotSupported`. |
| hyperlinks | HyperlinkCollection | The hyperlinks of the slide: text links and shape click links. |
| id | string | The slide id (`p:sldId/@id`). Stable across moves. |
| index | number | The zero-based position of the slide. |
| layout | SlideLayout | The layout of the slide. |
| moveTo | | Move the slide to a zero-based position. |
| setSelectedShapes | | Select shapes of this slide by id. A server runtime refuses with `NotSupported`. |
| shapes | ShapeCollection | The shapes of the slide, in z-order. |
| slideMaster | SlideMaster | The master of the slide. |
| tags | TagCollection | The tags of the slide. |
| themeColorScheme | ThemeColorScheme | The theme colors of the slide: those of the theme of its master. |
SlideBackgroundclassSource ↗
The background of a slide.
declare class SlideBackground extends BackgroundPart| Member | Type | Summary |
|---|---|---|
| fill | SlideBackgroundFill | The fill the slide shows. |
| isMasterBackgroundFollowed | boolean | Whether the slide shows the background of its layout or master (it has no own `p:bg`). Setting `false` copies the shown background into the slide. |
| reset | | Remove the own background: the slide shows the background of its layout or master. |
SlideBackgroundFillclassSource ↗
The fill of a background.
declare class SlideBackgroundFill extends BackgroundPart| Member | Type | Summary |
|---|---|---|
| getGradientFillOrNullObject | | The gradient fill, or a null object when the fill is of another kind. |
| getPatternFillOrNullObject | | The pattern fill, or a null object when the fill is of another kind. |
| getPictureOrTextureFillOrNullObject | | The picture fill, or a null object when the fill is of another kind. |
| getSolidFillOrNullObject | | The solid fill, or a null object when the fill is of another kind. |
| setGradientFill | | Fill with a gradient. The stops of a current gradient stay. |
| setPatternFill | | Fill with a pattern (`a:pattFill`). |
| setPictureOrTextureFill | | Fill with a stretched picture. Without `imageBase64`, the current picture stays. |
| setSolidFill | | Fill with one color. |
| type | SlideBackgroundFillType | `${SlideBackgroundFillType}` | The kind of fill. `Unsupported` for no fill. |
SlideBackgroundGradientFillclassSource ↗
A gradient background fill.
declare class SlideBackgroundGradientFill extends BackgroundPart| Member | Type | Summary |
|---|---|---|
| type | SlideBackgroundGradientFillType | `${SlideBackgroundGradientFillType}` | The shading: `a:lin`, or an `a:path` of `circle` (Radial), `rect`, or `shape` (Path). |
SlideBackgroundPatternFillclassSource ↗
A pattern background fill (a:pattFill).
declare class SlideBackgroundPatternFill extends BackgroundPart| Member | Type | Summary |
|---|---|---|
| backgroundColor | string | The color behind the pattern, as `#RRGGBB`. |
| foregroundColor | string | The color of the pattern, as `#RRGGBB`. |
| pattern | SlideBackgroundPatternFillType | `${SlideBackgroundPatternFillType}` | The pattern (`ST_PresetPatternVal`). |
SlideBackgroundPictureOrTextureFillclassSource ↗
A picture background fill (a:blipFill), stretched to the slide.
declare class SlideBackgroundPictureOrTextureFill extends BackgroundPart| Member | Type | Summary |
|---|---|---|
| setImage | | Show other picture bytes: PNG, JPEG, or GIF in base64. The transparency stays. |
| transparency | number | The transparency of the picture (`a:alphaModFix`), from 0 (opaque) to 1 (clear). |
SlideBackgroundSolidFillclassSource ↗
A solid background fill.
declare class SlideBackgroundSolidFill extends BackgroundPart| Member | Type | Summary |
|---|---|---|
| color | string | The color as `#RRGGBB`. |
| transparency | number | The transparency, from 0 (opaque) to 1 (clear). |
SlideCollectionclassSource ↗
The slides of the presentation, in order.
declare class SlideCollection extends ItemCollection<Slide>The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the SlideCollection class.
| Member | Type | Summary |
|---|---|---|
| add | | Add a slide at the end, from a layout and master by id. |
| exportAsBase64Presentation | | The listed slides as a presentation of their own, Base64-encoded PPTX bytes. |
| getItem | | A slide by id; `ItemNotFound` at the sync when there is none. |
| getItemAt | | A slide by zero-based position; `ItemNotFound` at the sync when there is none. |
| getItemOrNullObject | | A slide by id, or a null object. |
SlideLayoutclassSource ↗
A slide layout (p:sldLayout).
declare class SlideLayout extends ModelObjectThe constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the SlideLayout class.
| Member | Type | Summary |
|---|---|---|
| background | SlideLayoutBackground | The background of the layout. |
| customXmlParts | CustomXmlPartCollection | The custom XML parts of the layout. |
| id | string | The layout id (`p:sldLayoutId/@id`). |
| name | string | The layout name (`p:cSld/@name`). |
| shapes | ShapeCollection | The shapes of the layout. |
| themeColorScheme | ThemeColorScheme | The theme colors of the layout: those of the theme of its master. |
| type | SlideLayoutType | `${SlideLayoutType}` | The layout type (`p:sldLayout/@type`). |
SlideLayoutBackgroundclassSource ↗
The background of a slide layout.
declare class SlideLayoutBackground extends BackgroundPart| Member | Type | Summary |
|---|---|---|
| fill | SlideBackgroundFill | The fill the layout shows. |
| isMasterBackgroundFollowed | boolean | Whether the layout shows the background of its master (it has no own `p:bg`). Setting `false` copies the master background into the layout. |
| reset | | Remove the own background: the layout shows the background of its master. |
SlideLayoutCollectionclassSource ↗
The layouts of a slide master, in p:sldLayoutIdLst order.
declare class SlideLayoutCollection extends ItemCollection<SlideLayout>The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the SlideLayoutCollection class.
| Member | Type | Summary |
|---|---|---|
| getItem | | A layout by id; `ItemNotFound` at the sync when there is none. |
| getItemAt | | A layout by zero-based position. |
| getItemOrNullObject | | A layout by id, or a null object. |
SlideMasterclassSource ↗
A slide master (p:sldMaster).
declare class SlideMaster extends ModelObjectThe constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the SlideMaster class.
| Member | Type | Summary |
|---|---|---|
| background | SlideMasterBackground | The background of the master. |
| customXmlParts | CustomXmlPartCollection | The custom XML parts of the master. |
| id | string | The master id (`p:sldMasterId/@id`). |
| layouts | SlideLayoutCollection | The layouts of the master. |
| name | string | The master name (`p:cSld/@name`). |
| shapes | ShapeCollection | The shapes of the master. |
| themeColorScheme | ThemeColorScheme | The theme colors of the master: those of the theme of its master. |
SlideMasterBackgroundclassSource ↗
The background of a slide master.
declare class SlideMasterBackground extends BackgroundPart| Member | Type | Summary |
|---|---|---|
| fill | SlideBackgroundFill | The fill of the master background. |
SlideMasterCollectionclassSource ↗
The slide masters of the presentation, in p:sldMasterIdLst order.
declare class SlideMasterCollection extends ItemCollection<SlideMaster>The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the SlideMasterCollection class.
| Member | Type | Summary |
|---|---|---|
| getItem | | A master by id; `ItemNotFound` at the sync when there is none. |
| getItemAt | | A master by zero-based position. |
| getItemOrNullObject | | A master by id, or a null object. |
SlideScopedCollectionclassSource ↗
A set of slides: the reader's selection.
declare class SlideScopedCollection extends ItemCollection<Slide>The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the SlideScopedCollection class.
| Member | Type | Summary |
|---|---|---|
| exportAsBase64Presentation | | The slides as a presentation of their own, Base64-encoded PPTX bytes. |
| getItem | | A selected slide by id; `ItemNotFound` at the sync when there is none. |
| getItemAt | | A selected slide by position in the selection. |
| getItemOrNullObject | | A selected slide by id, or a null object. |
TableclassSource ↗
The table of a table shape.
declare class Table extends ModelObjectThe constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the Table class.
| Member | Type | Summary |
|---|---|---|
| clear | | Clear the text, the direct format, or both, of every cell. With no options, or `all`, both go. The direct format is each cell's `a:tcPr` and its paragraph and run properties; hyperlinks and the table style stay. |
| columnCount | number | The number of columns. |
| columns | TableColumnCollection | The columns. |
| getCellOrNullObject | | A cell by zero-based row and column, or a null object outside the table. |
| getMergedAreas | | The merged areas of the table: one cell for each, its first cell, with its span. |
| getShape | | The table shape. |
| mergeCells | | Merge a rectangle of cells into its first cell. |
| rowCount | number | The number of rows. |
| rows | TableRowCollection | The rows. |
| styleSettings | TableStyleSettings | The style options and the style of the table (`a:tblPr`). |
| values | string[][] | The text of each cell, by row then column. A merged area's text is in its first cell. |
TableCellclassSource ↗
One cell of a table.
declare class TableCell extends ModelObjectThe constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the TableCell class.
| Member | Type | Summary |
|---|---|---|
| borders | Borders | The borders of the cell (`a:tcPr` lines). |
| columnCount | number | How many columns the cell spans. |
| columnIndex | number | The zero-based column of the cell; the first column of its merged area. |
| fill | ShapeFill | The cell's fill (`a:tcPr`). |
| font | ShapeFont | The character format of the cell's text. |
| horizontalAlignment | ParagraphHorizontalAlignment | `${ParagraphHorizontalAlignment}` | null | The horizontal alignment of the cell's paragraphs (`a:pPr/@algn`). |
| indentLevel | number | null | The indent level of the cell's paragraphs, from 1; null when they differ. |
| margins | Margins | The margins of the cell (`a:tcPr/@marL` and the like), in points. |
| resize | | Make the cell span `rowCount` rows and `columnCount` columns from its first grid position. |
| rowCount | number | How many rows the cell spans. |
| rowIndex | number | The zero-based row of the cell; the first row of its merged area. |
| split | | Split the cell into `rowCount` rows and `columnCount` columns of cells. |
| text | string | The text of the cell. |
| textRuns | TextRun[] | The cell's text as runs, each with its own character format. Neighbouring text with the same format reads as one run, and the run texts join to `text`. A write replaces the text with the runs in one sync. |
| verticalAlignment | TextVerticalAlignment | `${TextVerticalAlignment}` | The vertical alignment of the cell's text (`a:tcPr/@anchor`); the `…Centered` values also set `@anchorCtr` (ECMA-376 Part 1, 21.1.3.17). |
TableCellCollectionclassSource ↗
The merged areas of a table, from Table.getMergedAreas. Each item is the first cell of one area, and its rowCount and columnCount give the span.
declare class TableCellCollection extends ModelObjectThe constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the TableCellCollection class.
| Member | Type | Summary |
|---|---|---|
| getCount | | The number of merged areas, after the next `sync()`. |
| getItemAtOrNullObject | | The merged area that holds the cell at a zero-based row and column of the table, as its first cell, or a null object when no merged area holds that cell. |
| items | TableCell[] | The loaded cells. |
TableColumnclassSource ↗
One column of a table.
declare class TableColumn extends TableLineThe constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the TableColumn class.
| Member | Type | Summary |
|---|---|---|
| columnIndex | number | The zero-based column index. |
| width | number | The column width, in points (`a:gridCol/@w`). |
TableColumnCollectionclassSource ↗
The columns of a table.
declare class TableColumnCollection extends TableLines<TableColumn>The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the TableColumnCollection class.
| Member | Type | Summary |
|---|---|---|
| deleteColumns | | Delete columns. |
TableRowclassSource ↗
One row of a table.
declare class TableRow extends TableLineThe constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the TableRow class.
| Member | Type | Summary |
|---|---|---|
| currentHeight | number | The height of the row as stored, in points. |
| height | number | The row height, in points (`a:tr/@h`). |
| rowIndex | number | The zero-based row index. |
TableRowCollectionclassSource ↗
The rows of a table.
declare class TableRowCollection extends TableLines<TableRow>The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the TableRowCollection class.
| Member | Type | Summary |
|---|---|---|
| deleteRows | | Delete rows. |
TableStyleSettingsclassSource ↗
The style options and the style of a table (a:tblPr). A style is found by its name in the presentation's ppt/tableStyles.xml: MediumStyle2Accent1 is "Medium Style 2 - Accent 1". The presentation must define the style, except MediumStyle2Accent1, which is built in, and NoStyleNoGrid, which removes the style choice.
declare class TableStyleSettings extends ModelObjectThe constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the TableStyleSettings class.
| Member | Type | Summary |
|---|---|---|
| areColumnsBanded | boolean | Whether the columns show banded formatting (`a:tblPr/@bandCol`). |
| areRowsBanded | boolean | Whether the rows show banded formatting (`a:tblPr/@bandRow`). |
| isFirstColumnHighlighted | boolean | Whether the first column has its own format (`a:tblPr/@firstCol`). |
| isFirstRowHighlighted | boolean | Whether the first row has its own format (`a:tblPr/@firstRow`). |
| isLastColumnHighlighted | boolean | Whether the last column has its own format (`a:tblPr/@lastCol`). |
| isLastRowHighlighted | boolean | Whether the last row has its own format (`a:tblPr/@lastRow`). |
| style | TableStyle | `${TableStyle}` | The table style. A table with no style reads `NoStyleNoGrid`. A style whose name has no `TableStyle` value refuses the read with `NotImplemented`. |
TagclassSource ↗
One tag: a key and a value.
declare class Tag extends ModelObjectThe constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the Tag class.
| Member | Type | Summary |
|---|---|---|
| key | string | The key, in upper case. |
| value | string | The value. |
TagCollectionclassSource ↗
The tags of a presentation, slide, or shape.
declare class TagCollection extends ModelObjectThe constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the TagCollection class.
| Member | Type | Summary |
|---|---|---|
| add | | Add a tag, or set the value of the tag with this key. |
| delete | | Delete the tag with this key. `ItemNotFound` at the sync when there is none. |
| getCount | | The number of tags, after the next `sync()`. |
| getItem | | The tag with this key; `ItemNotFound` at the sync when there is none. |
| getItemAt | | The tag at a zero-based position. |
| getItemOrNullObject | | The tag with this key, or a null object. |
| items | Tag[] | The loaded tags. |
TextFrameclassSource ↗
The text frame of a shape (p:txBody and its a:bodyPr).
declare class TextFrame extends ModelObjectThe constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the TextFrame class.
| Member | Type | Summary |
|---|---|---|
| autoSizeSetting | ShapeAutoSize | `${ShapeAutoSize}` | How the text and the shape fit each other. |
| bottomMargin | number | The bottom inset, in points. |
| deleteText | | Delete all the text. |
| getParentShape | | The shape that holds the frame. |
| hasText | boolean | Whether the frame holds any text. |
| leftMargin | number | The left inset, in points. |
| rightMargin | number | The right inset, in points. |
| textRange | TextRange | All the text of the frame. |
| topMargin | number | The top inset, in points. |
| verticalAlignment | TextVerticalAlignment | `${TextVerticalAlignment}` | The vertical anchor of the text. |
| wordWrap | boolean | Whether lines wrap at the frame width. |
TextRangeclassSource ↗
A run of text in a text frame.
declare class TextRange extends ModelObjectThe constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the TextRange class.
| Member | Type | Summary |
|---|---|---|
| font | ShapeFont | The character formatting of the range. |
| getParentTextFrame | | The text frame that holds the range. |
| getSubstring | | A range inside this one, from `start` (relative to this range) for `length` characters, or to the end of this range when `length` is absent. |
| hyperlinks | HyperlinkScopedCollection | The text links that overlap the range, in text order. |
| length | number | The length of the range. |
| paragraphFormat | ParagraphFormat | The paragraph formatting of the paragraphs the range touches. |
| setHyperlink | | Link the range to an address. Answers the hyperlink. |
| setSelected | | Select the range in the editor. A server runtime refuses with `NotSupported`. |
| start | number | The zero-based start of the range in the text of the frame. |
| text | string | The text. Paragraphs are separated by `\r`, and a line break reads as `\v`. |
ThemeColorSchemeclassSource ↗
The theme colors of a slide, a layout, or a master. Every slide, layout, and master that uses the same theme shares them, so a write changes all of them.
declare class ThemeColorScheme extends ModelObjectThe constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the ThemeColorScheme class.
| Member | Type | Summary |
|---|---|---|
| getThemeColor | | One theme color as `#RRGGBB`. `Mixed` and `None` are `InvalidArgument`. |
| getThemeColor | | One theme color as `#RRGGBB`. `Mixed` and `None` are `InvalidArgument`. |
| setThemeColor | | Set one theme color: `#RRGGBB` or a preset color name. |
| setThemeColor | | Set one theme color: `#RRGGBB` or a preset color name. |
TrackedObjectsclassSource ↗
The objects a context keeps addressable beyond the run that created them.
An ordinary proxy stops being usable when its run ends. Tracking one keeps its address alive so a later run(object, callback) can adopt it, and untracking releases it — which matters for long-lived callers, since a tracked object is a presentation reference that will not be collected on its own.
declare class TrackedObjectsThe constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the TrackedObjects class.
| Member | Type | Summary |
|---|---|---|
| add | | Keep these objects usable after this run ends. |
| remove | | Stop keeping them: they are released when this run ends, like any other object. |
Interfaces (33)
AddSlideOptionsinterfaceSource ↗
Options for SlideCollection.add.
interface AddSlideOptions| Member | Type | Summary |
|---|---|---|
| layoutId? | string | The layout of the new slide, by id. The first layout of the master when absent. |
| slideMasterId? | string | The master of the new slide, by id. The master of the last slide when absent. |
BorderPropertiesinterfaceSource ↗
One line of a cell, for TableCellBorders.
interface BorderProperties| Member | Type | Summary |
|---|---|---|
| color? | string | undefined | `#RRGGBB` or a preset color name. |
| dashStyle? | ShapeLineDashStyle | `${ShapeLineDashStyle}` | undefined | |
| transparency? | number | undefined | From 0 (opaque) to 1 (clear). |
| weight? | number | undefined | Points. |
CreateServerOptionsinterfaceSource ↗
How PptxEditor.createServer opens a presentation.
Opening PPTX bytes is a bounded parse: zip entry, size, and ratio caps, part name checks, and XML with no DTD. Malformed input refuses with InvalidArgument; a zip over a cap refuses with ResourceLimitExceeded. No message carries file content.
interface CreateServerOptions| Member | Type | Summary |
|---|---|---|
| fonts? | FontSource | readonly FontSource[] | Faces to measure text with, tried before the presentation's embedded fonts and the metric-compatible substitutes. |
| rasterize? | ImageRasterizer | Turns the SVG of a slide or shape picture into PNG bytes, so `getImageAsBase64` works on a server. The engine paints the picture with the editor's own renderer into a standalone SVG document, with its pictures and fonts inline, and the rasterizer only draws that SVG, for example with an SVG rasterizer library or a headless browser. It must answer a PNG of exactly `width` by `height` pixels; any other answer refuses with `GeneralException`. Without it, `capabilities.images` is false and `getImageAsBase64` refuses with `NotSupported`. |
| substitutes? | boolean | Load the metric-compatible substitute fonts. Default `true`. |
FillPropertiesinterfaceSource ↗
A solid fill, for TableCellProperties.
interface FillProperties| Member | Type | Summary |
|---|---|---|
| color? | string | undefined | `#RRGGBB` or a preset color name. |
| transparency? | number | undefined | From 0 (opaque) to 1 (clear). |
FontPropertiesinterfaceSource ↗
Character formatting for one run of TableCell.textRuns. In a write, an absent property keeps the cell's format. A read gives every property, except color when the text has no solid fill.
interface FontProperties| Member | Type | Summary |
|---|---|---|
| allCaps? | boolean | undefined | |
| bold? | boolean | undefined | |
| color? | string | undefined | `#RRGGBB` or a preset color name. |
| doubleStrikethrough? | boolean | undefined | |
| italic? | boolean | undefined | |
| name? | string | undefined | |
| size? | number | undefined | Points. |
| smallCaps? | boolean | undefined | |
| strikethrough? | boolean | undefined | |
| subscript? | boolean | undefined | |
| superscript? | boolean | undefined | |
| underline? | ShapeFontUnderlineStyle | `${ShapeFontUnderlineStyle}` | undefined |
HyperlinkAddOptionsinterfaceSource ↗
Options for a new hyperlink.
interface HyperlinkAddOptions| Member | Type | Summary |
|---|---|---|
| address? | string | The address the link opens. |
| screenTip? | string | The tip that shows over the link. |
InsertSlideOptionsinterfaceSource ↗
Options for Presentation.insertSlidesFromBase64.
interface InsertSlideOptions| Member | Type | Summary |
|---|---|---|
| formatting? | InsertSlideFormatting | `${InsertSlideFormatting}` | undefined | How the inserted slides are formatted. |
| sourceSlideIds? | string[] | The slides of the source presentation to insert, by id. |
| targetSlideId? | string | The slide the new slides follow, by id. |
LoadPropertyOptionsinterfaceSource ↗
The property-tree form of load(...), as the Office.js *LoadOptions interfaces give it.
true loads a property. An object loads a navigation property with the properties it names; an empty object loads its default set. $all: true loads every scalar property of that object. On a collection, the keys name properties of each item, and $top and $skip limit the items. items is accepted as a key too, so { shapes: { items: { name: true } } } and { shapes: { name: true } } load the same thing.
interface LoadPropertyOptions| Member | Type | Summary |
|---|---|---|
| (member-0) | | A property: `true` loads it, an object loads a navigation property with what it names. |
| $all? | boolean | Load every scalar property of this object, or of each item of a collection. |
| $skip? | number | For a collection: skip this many items first. |
| $top? | number | For a collection: at most this many items. |
LoadQueryOptionsinterfaceSource ↗
The object form of load(...): which properties, and how much of a collection.
An unknown key, a non-integer top, a property name that is not an identifier, or a value of the wrong type is refused as InvalidArgument here, naming the option — a misspelled key is the difference between "load selected properties" and "load nothing", which would otherwise surface as a PropertyNotLoaded much later at a call that looks correct.
interface LoadQueryOptions| Member | Type | Summary |
|---|---|---|
| expand? | string | readonly string[] | Navigation properties to load with their default set, as names or paths such as `items/fill`. A path that `select` also names deeper loads only what `select` names. |
| select? | string | readonly string[] | Which properties to load, as names or paths such as `items/fill/type`. |
| skip? | number | For a collection: skip this many items first. |
| top? | number | For a collection: at most this many items. |
PptxEditorDebugInfointerfaceSource ↗
Debug details in the shape of Office.js OfficeExtension.DebugInfo.
interface PptxEditorDebugInfo| Member | Type | Summary |
|---|---|---|
| code | PptxEditorErrorCode | The same code as [PptxEditorError.code](PptxEditorError.code). |
| errorLocation? | string | The consumer-facing path of the object or property involved, when there is one. |
| innerError? | PptxEditorInnerError | Why the engine refused, when it knows a specific reason. |
| message | string | The same message as the error's own. |
PptxEditorErrorInitinterfaceSource ↗
The fields a [PptxEditorError](PptxEditorError) is constructed from.
interface PptxEditorErrorInit| Member | Type | Summary |
|---|---|---|
| actualRevision? | number | The revision the presentation was actually at, for `StaleDocument`. |
| code | PptxEditorErrorCode | Which refusal this is. The stable thing to branch on. |
| diagnostic? | PptxEditorDiagnostic | The public reason, when the engine gave one this API knows. |
| expectedRevision? | number | The revision the context had read at, for `StaleDocument`. |
| target? | string | The consumer-facing path of the object or property involved, never a handle. |
| traceMessages? | readonly string[] | The `context.trace` messages queued before the call that failed. |
PptxEditorInnerErrorinterfaceSource ↗
Why the engine refused, as a public diagnostic code with its fixed hint.
interface PptxEditorInnerError| Member | Type | Summary |
|---|---|---|
| code | string | A stable public diagnostic code, such as `edit.stale-target`. |
| message | string | The fixed hint for the code: the cause, then the action. Never presentation content. |
PptxEditorNamespaceinterfaceSource ↗
The entry point, as much of it as works without an editor. Import from @pptx-editor.dev/editor-api/browser for the same object plus createBrowser.
interface PptxEditorNamespace| Member | Type | Summary |
|---|---|---|
| createServer | | A runtime over PPTX bytes. It also offers `save()`. |
PptxEditorRuntimeinterfaceSource ↗
A runtime: one presentation host, many runs.
Disposal is final: [PptxEditorRuntime.dispose](PptxEditorRuntime.dispose) releases the host once and is safe to call again, and every later run fails with RuntimeDisposed.
interface PptxEditorRuntime| Member | Type | Summary |
|---|---|---|
| capabilities | PresentationCapabilities | What the presentation host behind this runtime can do. |
| dispose | | Release the host. Idempotent. |
| run | | Run one batch of work against the presentation. Answers with the callback's value. |
| run | | Run one batch of work, adopting objects a previous run tracked. |
PptxEditorServerRuntimeinterfaceSource ↗
A runtime over PPTX bytes rather than a live editor: what PptxEditor.createServer answers.
interface PptxEditorServerRuntime extends PptxEditorRuntime| Member | Type | Summary |
|---|---|---|
| save | | The current presentation as a fresh, caller-owned PPTX byte array. |
PresentationCapabilitiesinterfaceSource ↗
Capabilities of a runtime, frozen for its lifetime.
interface PresentationCapabilities| Member | Type | Summary |
|---|---|---|
| autofit | boolean | Text writes re-fit text bodies by their autofit rules (ECMA-376 Part 1, 21.1.2.1). |
| document | boolean | There is a presentation to address at all. |
| events | boolean | The host raises change events. |
| images | boolean | `getImageAsBase64` draws pictures of slides and shapes: true for a runtime over a live editor in a browser and for a server runtime created with a `rasterize` option, false otherwise. |
| save | boolean | `save()` is offered: true for a server runtime, false for one borrowing an editor. |
| selection | boolean | The host has a reader's selection to read or move. |
RequestContextDebugInfointerfaceSource ↗
Debug information about a request context, as Office.js OfficeExtension.RequestContextDebugInfo.
interface RequestContextDebugInfo| Member | Type | Summary |
|---|---|---|
| pendingStatements | string[] | What the next `sync()` sends, in order: the consumer-facing path of each queued call, such as `presentation.slides.getItemAt(0).load`, and the message of each `trace` call. Never a handle or presentation content. |
ShapeAddOptionsinterfaceSource ↗
Where a new shape goes, in points from the top left of the slide.
interface ShapeAddOptions| Member | Type | Summary |
|---|---|---|
| height? | number | |
| left? | number | |
| top? | number | |
| width? | number |
ShapeGetImageOptionsinterfaceSource ↗
Options for Shape.getImageAsBase64. The picture keeps the shape's aspect ratio and fits into the box, as for a slide.
interface ShapeGetImageOptions| Member | Type | Summary |
|---|---|---|
| format? | ShapeGetImageFormatType | `${ShapeGetImageFormatType}` | undefined | The image format. Only PNG. |
| height? | number | The height of the box, in pixels. |
| width? | number | The width of the box, in pixels. |
SlideBackgroundGradientFillOptionsinterfaceSource ↗
Options for SlideBackgroundFill.setGradientFill.
interface SlideBackgroundGradientFillOptions| Member | Type | Summary |
|---|---|---|
| type? | SlideBackgroundGradientFillType | `${SlideBackgroundGradientFillType}` | undefined | The shading. The current shading, or `Linear`, when absent. |
SlideBackgroundPatternFillOptionsinterfaceSource ↗
Options for SlideBackgroundFill.setPatternFill.
interface SlideBackgroundPatternFillOptions| Member | Type | Summary |
|---|---|---|
| backgroundColor? | string | undefined | The color behind the pattern. The current one, or white, when absent. |
| foregroundColor? | string | undefined | The color of the pattern. The current one, or black, when absent. |
| pattern? | SlideBackgroundPatternFillType | `${SlideBackgroundPatternFillType}` | undefined | The pattern. The current one, or `Percent5`, when absent. |
SlideBackgroundPictureOrTextureFillOptionsinterfaceSource ↗
Options for SlideBackgroundFill.setPictureOrTextureFill.
interface SlideBackgroundPictureOrTextureFillOptions| Member | Type | Summary |
|---|---|---|
| imageBase64? | string | undefined | PNG, JPEG, or GIF bytes in base64. The current picture when absent. |
| transparency | number | From 0 (opaque) to 1 (clear). |
SlideBackgroundSolidFillOptionsinterfaceSource ↗
Options for SlideBackgroundFill.setSolidFill.
interface SlideBackgroundSolidFillOptions| Member | Type | Summary |
|---|---|---|
| color? | string | undefined | `#RRGGBB` or a preset color name. The current solid color, or white, when absent. |
| transparency? | number | undefined | From 0 (opaque) to 1 (clear). The current transparency, or 0, when absent. |
SlideGetImageOptionsinterfaceSource ↗
Options for Slide.getImageAsBase64. The picture keeps the slide's aspect ratio and fits into the box: with both sizes it fits into both, with one size it takes that size, and with neither it has the slide's own size at 96 pixels per inch.
interface SlideGetImageOptions| Member | Type | Summary |
|---|---|---|
| height? | number | The height of the box, in pixels. |
| width? | number | The width of the box, in pixels. |
TableAddOptionsinterfaceSource ↗
Options for ShapeCollection.addTable. They apply in this order: values, style, the column widths and row heights, mergedAreas, uniformCellProperties, then specificCellProperties.
interface TableAddOptions| Member | Type | Summary |
|---|---|---|
| columns? | TableColumnProperties[] | undefined | One entry for each column. |
| height? | number | undefined | |
| left? | number | undefined | |
| mergedAreas? | TableMergedAreaProperties[] | undefined | |
| rows? | TableRowProperties[] | undefined | One entry for each row. |
| specificCellProperties? | TableCellProperties[][] | undefined | The properties of each cell, by row then column. Its size must equal the table's. |
| style? | TableStyle | `${TableStyle}` | undefined | |
| top? | number | undefined | |
| uniformCellProperties? | TableCellProperties | undefined | The properties of every cell. |
| values? | string[][] | undefined | The text of each cell, by row then column. Its size must equal the table's. |
| width? | number | undefined |
TableCellBordersinterfaceSource ↗
The lines of a cell, for TableCellProperties.
interface TableCellBorders| Member | Type | Summary |
|---|---|---|
| bottom? | BorderProperties | undefined | |
| diagonalDown? | BorderProperties | undefined | |
| diagonalUp? | BorderProperties | undefined | |
| left? | BorderProperties | undefined | |
| right? | BorderProperties | undefined | |
| top? | BorderProperties | undefined |
TableCellMarginsinterfaceSource ↗
The margins of a cell in points, for TableCellProperties.
interface TableCellMargins| Member | Type | Summary |
|---|---|---|
| bottom? | number | undefined | |
| left? | number | undefined | |
| right? | number | undefined | |
| top? | number | undefined |
TableCellPropertiesinterfaceSource ↗
The format and content of a cell, for TableAddOptions.
interface TableCellProperties| Member | Type | Summary |
|---|---|---|
| borders? | TableCellBorders | undefined | |
| fill? | FillProperties | undefined | |
| font? | FontProperties | undefined | |
| horizontalAlignment? | ParagraphHorizontalAlignment | `${ParagraphHorizontalAlignment}` | undefined | |
| indentLevel? | number | undefined | |
| margins? | TableCellMargins | undefined | |
| text? | string | undefined | |
| textRuns? | TextRun[] | undefined | |
| verticalAlignment? | TextVerticalAlignment | `${TextVerticalAlignment}` | undefined |
TableClearOptionsinterfaceSource ↗
Options for Table.clear.
interface TableClearOptions| Member | Type | Summary |
|---|---|---|
| all? | boolean | |
| format? | boolean | |
| text? | boolean |
TableColumnPropertiesinterfaceSource ↗
One column of a new table, for TableAddOptions.
interface TableColumnProperties| Member | Type | Summary |
|---|---|---|
| columnWidth? | number | undefined | Points. |
TableMergedAreaPropertiesinterfaceSource ↗
One merged area of a new table, for TableAddOptions.
interface TableMergedAreaProperties| Member | Type | Summary |
|---|---|---|
| columnCount | number | |
| columnIndex | number | |
| rowCount | number | |
| rowIndex | number |
TableRowPropertiesinterfaceSource ↗
One row of a new table, for TableAddOptions.
interface TableRowProperties| Member | Type | Summary |
|---|---|---|
| rowHeight? | number | undefined | Points. |
TextRuninterfaceSource ↗
One run of text with its own format, for TableCell.textRuns.
interface TextRun| Member | Type | Summary |
|---|---|---|
| font? | FontProperties | undefined | |
| text | string |
Type aliases (4)
ClientRequestContexttypeSource ↗
The Office.js OfficeExtension.ClientRequestContext: here the same class as [RequestContext](RequestContext), under the name that code written for Office.js uses for the base of every request context.
type ClientRequestContext = RequestContext;LoadOptiontypeSource ↗
Everything load(...) accepts: one property name or path, several, a [LoadQueryOptions](LoadQueryOptions) object, or a [LoadPropertyOptions](LoadPropertyOptions) tree.
type LoadOption = string | readonly string[] | LoadQueryOptions | LoadPropertyOptions;```ts
shape.load('name');
shape.load(['name', 'left', 'fill/foregroundColor']);
slide.load('shapes/items/textFrame/textRange/text');
slide.load({ shapes: { items: { name: true, fill: { type: true } } } });
shapes.load({ select: 'items/name', top: 5 });
shapes.load('$all');
```
A path names a property through navigation properties, for example `fill/type` on a shape. On a collection, `items/<path>` loads `items` and that path on each item in the same `context.sync()`. A path without the `items/` prefix means the same thing on a collection, so `shapes.load('name')` equals `shapes.load('items/name')`. `$all` loads every scalar property of the object it ends on, and `items/$all` of each item. `load()` and `load('items')` on a collection load every scalar property of each item, in one more round trip.
A name that is not a property of the object it reaches is refused as `InvalidArgument`, with the object and the name as the error's `target`.PptxEditorErrorCodetypeSource ↗
What went wrong, as a value a consumer may branch on.
type PptxEditorErrorCode =
/** A property was read before a `load(...)` for it completed in a `sync()`. */
'PropertyNotLoaded'
/** A `ClientResult` value was read before the sync that fills it. */
| 'ValueNotLoaded'
/**
* The object cannot be addressed: its run ended and nothing tracked it, the call that would
* have created it was in a refused sync, or the presentation no longer holds it (an edit
* removed it). A lookup from a refused sync is sent again, so its proxy stays usable.
*/
| 'InvalidObjectPath'
/** The object still belongs to a run that has not finished, so it cannot be handed over. */
| 'ObjectInUse'
/** An argument or load option this API does not accept. */
| 'InvalidArgument'
/** Opening the presentation exceeded a bounded reader limit. */
| 'ResourceLimitExceeded'
/** The collection has no such item: `getItem` with an unknown id, `getItemAt` out of range. */
| 'ItemNotFound'
/**
* The call is outside the supported subset for this host or content, and nothing changed.
* Examples: a server runtime has no selection; a shape has no text frame.
*/
| 'NotSupported'
/** The member is one this API does not implement, and nothing changed. */
| 'NotImplemented'
/** The request context's `run` has finished, so it can no longer be used. */
| 'InvalidRequestContext'
/** The runtime was disposed. Every later operation fails this way. */
| 'RuntimeDisposed'
/**
* The batch was built from an older read, so nothing was applied: another writer changed the
* presentation after this context read it. Read again before retrying.
*/
| 'StaleDocument'
/** The host is live but holds no presentation right now: an editor between documents. */
| 'DocumentUnavailable'
/** The presentation refused the change, or answered something this runtime cannot use. */
| 'GeneralException';RunCallbacktypeSource ↗
What a run callback is given, and what it may answer with.
type RunCallback<T> = (context: RequestContext) => Promise<T>;Enums (25)
BindingTypeenumSource ↗
declare enum BindingType| Member | Type | Summary |
|---|---|---|
| shape | |
BulletStyleenumSource ↗
declare enum BulletStyle| Member | Type | Summary |
|---|---|---|
| alphabetLowercaseParenthesesBoth | | |
| alphabetLowercaseParenthesisRight | | |
| alphabetLowercasePeriod | | |
| alphabetUppercaseParenthesesBoth | | |
| alphabetUppercaseParenthesisRight | | |
| alphabetUppercasePeriod | | |
| arabicAbjadDash | | |
| arabicAlphabetDash | | |
| arabicDoubleBytePeriod | | |
| arabicDoubleBytePlain | | |
| arabicNumeralParenthesesBoth | | |
| arabicNumeralParenthesisRight | | |
| arabicNumeralPeriod | | |
| arabicNumeralPlain | | |
| circleNumberDoubleBytePlain | | |
| circleNumberWideDoubleByteBlackPlain | | |
| circleNumberWideDoubleByteWhitePlain | | |
| hebrewAlphabetDash | | |
| hindiAlphabet1Period | | |
| hindiAlphabetPeriod | | |
| hindiNumeralParenthesisRight | | |
| hindiNumeralPeriod | | |
| kanjiKoreanPeriod | | |
| kanjiKoreanPlain | | |
| kanjiSimplifiedChineseDoubleBytePeriod | | |
| romanLowercaseParenthesesBoth | | |
| romanLowercaseParenthesisRight | | |
| romanLowercasePeriod | | |
| romanUppercaseParenthesesBoth | | |
| romanUppercaseParenthesisRight | | |
| romanUppercasePeriod | | |
| simplifiedChinesePeriod | | |
| simplifiedChinesePlain | | |
| thaiAlphabetParenthesesBoth | | |
| thaiAlphabetParenthesisRight | | |
| thaiAlphabetPeriod | | |
| thaiNumeralParenthesesBoth | | |
| thaiNumeralParenthesisRight | | |
| thaiNumeralPeriod | | |
| traditionalChinesePeriod | | |
| traditionalChinesePlain | | |
| unsupported | |
BulletTypeenumSource ↗
declare enum BulletType| Member | Type | Summary |
|---|---|---|
| none | | |
| numbered | | |
| unnumbered | | |
| unsupported | |
ConnectorTypeenumSource ↗
declare enum ConnectorType| Member | Type | Summary |
|---|---|---|
| curve | | |
| elbow | | |
| straight | |
DocumentPropertyTypeenumSource ↗
The type of a custom document property value.
declare enum DocumentPropertyType| Member | Type | Summary |
|---|---|---|
| boolean | | |
| date | | |
| number | | |
| string | |
GeometricShapeTypeenumSource ↗
A preset geometry for ShapeCollection.addGeometricShape.
declare enum GeometricShapeType| Member | Type | Summary |
|---|---|---|
| accentBorderCallout1 | | |
| accentBorderCallout2 | | |
| accentBorderCallout3 | | |
| accentCallout1 | | |
| accentCallout2 | | |
| accentCallout3 | | |
| actionButtonBackPrevious | | |
| actionButtonBeginning | | |
| actionButtonBlank | | |
| actionButtonDocument | | |
| actionButtonEnd | | |
| actionButtonForwardNext | | |
| actionButtonHelp | | |
| actionButtonHome | | |
| actionButtonInformation | | |
| actionButtonMovie | | |
| actionButtonReturn | | |
| actionButtonSound | | |
| arc | | |
| bentArrow | | |
| bentUpArrow | | |
| bevel | | |
| blockArc | | |
| borderCallout1 | | |
| borderCallout2 | | |
| borderCallout3 | | |
| bracePair | | |
| bracketPair | | |
| callout1 | | |
| callout2 | | |
| callout3 | | |
| can | | |
| chartPlus | | |
| chartStar | | |
| chartX | | |
| chevron | | |
| chord | | |
| circularArrow | | |
| cloud | | |
| cloudCallout | | |
| corner | | |
| cornerTabs | | |
| cube | | |
| curvedDownArrow | | |
| curvedLeftArrow | | |
| curvedRightArrow | | |
| curvedUpArrow | | |
| decagon | | |
| diagonalStripe | | |
| diamond | | |
| dodecagon | | |
| donut | | |
| doubleWave | | |
| downArrow | | |
| downArrowCallout | | |
| ellipse | | |
| ellipseRibbon | | |
| ellipseRibbon2 | | |
| flowChartAlternateProcess | | |
| flowChartCollate | | |
| flowChartConnector | | |
| flowChartDecision | | |
| flowChartDelay | | |
| flowChartDisplay | | |
| flowChartDocument | | |
| flowChartExtract | | |
| flowChartInputOutput | | |
| flowChartInternalStorage | | |
| flowChartMagneticDisk | | |
| flowChartMagneticDrum | | |
| flowChartMagneticTape | | |
| flowChartManualInput | | |
| flowChartManualOperation | | |
| flowChartMerge | | |
| flowChartMultidocument | | |
| flowChartOfflineStorage | | |
| flowChartOffpageConnector | | |
| flowChartOnlineStorage | | |
| flowChartOr | | |
| flowChartPredefinedProcess | | |
| flowChartPreparation | | |
| flowChartProcess | | |
| flowChartPunchedCard | | |
| flowChartPunchedTape | | |
| flowChartSort | | |
| flowChartSummingJunction | | |
| flowChartTerminator | | |
| foldedCorner | | |
| frame | | |
| funnel | | |
| gear6 | | |
| gear9 | | |
| halfFrame | | |
| heart | | |
| heptagon | | |
| hexagon | | |
| homePlate | | |
| horizontalScroll | | |
| irregularSeal1 | | |
| irregularSeal2 | | |
| leftArrow | | |
| leftArrowCallout | | |
| leftBrace | | |
| leftBracket | | |
| leftCircularArrow | | |
| leftRightArrow | | |
| leftRightArrowCallout | | |
| leftRightCircularArrow | | |
| leftRightRibbon | | |
| leftRightUpArrow | | |
| leftUpArrow | | |
| lightningBolt | | |
| lineInverse | | |
| mathDivide | | |
| mathEqual | | |
| mathMinus | | |
| mathMultiply | | |
| mathNotEqual | | |
| mathPlus | | |
| moon | | |
| nonIsoscelesTrapezoid | | |
| noSmoking | | |
| notchedRightArrow | | |
| octagon | | |
| parallelogram | | |
| pentagon | | |
| pie | | |
| pieWedge | | |
| plaque | | |
| plaqueTabs | | |
| plus | | |
| quadArrow | | |
| quadArrowCallout | | |
| rectangle | | |
| ribbon | | |
| ribbon2 | | |
| rightArrow | | |
| rightArrowCallout | | |
| rightBrace | | |
| rightBracket | | |
| rightTriangle | | |
| round1Rectangle | | |
| round2DiagonalRectangle | | |
| round2SameRectangle | | |
| roundRectangle | | |
| smileyFace | | |
| snip1Rectangle | | |
| snip2DiagonalRectangle | | |
| snip2SameRectangle | | |
| snipRoundRectangle | | |
| squareTabs | | |
| star10 | | |
| star12 | | |
| star16 | | |
| star24 | | |
| star32 | | |
| star4 | | |
| star5 | | |
| star6 | | |
| star7 | | |
| star8 | | |
| stripedRightArrow | | |
| sun | | |
| swooshArrow | | |
| teardrop | | |
| trapezoid | | |
| triangle | | |
| upArrow | | |
| upArrowCallout | | |
| upDownArrow | | |
| upDownArrowCallout | | |
| uturnArrow | | |
| verticalScroll | | |
| wave | | |
| wedgeEllipseCallout | | |
| wedgeRectCallout | | |
| wedgeRRectCallout | |
HyperlinkTypeenumSource ↗
declare enum HyperlinkType| Member | Type | Summary |
|---|---|---|
| shape | | |
| textRange | |
InsertSlideFormattingenumSource ↗
declare enum InsertSlideFormatting| Member | Type | Summary |
|---|---|---|
| keepSourceFormatting | | |
| useDestinationTheme | |
ParagraphHorizontalAlignmentenumSource ↗
declare enum ParagraphHorizontalAlignment| Member | Type | Summary |
|---|---|---|
| center | | |
| distributed | | |
| justify | | |
| justifyLow | | |
| left | | |
| right | | |
| thaiDistributed | |
PlaceholderTypeenumSource ↗
declare enum PlaceholderType| Member | Type | Summary |
|---|---|---|
| body | | |
| cameo | | |
| centerTitle | | |
| chart | | |
| content | | |
| date | | |
| footer | | |
| header | | |
| media | | |
| onlinePicture | | |
| picture | | |
| slideNumber | | |
| subtitle | | |
| table | | |
| title | | |
| unsupported | | |
| verticalBody | | |
| verticalContent | | |
| verticalTitle | |
ShapeAutoSizeenumSource ↗
declare enum ShapeAutoSize| Member | Type | Summary |
|---|---|---|
| autoSizeMixed | | |
| autoSizeNone | | |
| autoSizeShapeToFitText | | |
| autoSizeTextToFitShape | |
ShapeFillTypeenumSource ↗
declare enum ShapeFillType| Member | Type | Summary |
|---|---|---|
| gradient | | |
| noFill | | |
| pattern | | |
| pictureAndTexture | | |
| slideBackground | | |
| solid | |
ShapeFontUnderlineStyleenumSource ↗
declare enum ShapeFontUnderlineStyle| Member | Type | Summary |
|---|---|---|
| dash | | |
| dashHeavy | | |
| dashLong | | |
| dashLongHeavy | | |
| dotDash | | |
| dotDashHeavy | | |
| dotDotDash | | |
| dotDotDashHeavy | | |
| dotted | | |
| dottedHeavy | | |
| double | | |
| heavy | | |
| none | | |
| single | | |
| wavy | | |
| wavyDouble | | |
| wavyHeavy | |
ShapeGetImageFormatTypeenumSource ↗
The format of a shape picture from Shape.getImageAsBase64.
declare enum ShapeGetImageFormatType| Member | Type | Summary |
|---|---|---|
| png | |
ShapeLineDashStyleenumSource ↗
declare enum ShapeLineDashStyle| Member | Type | Summary |
|---|---|---|
| dash | | |
| dashDot | | |
| dashDotDot | | |
| longDash | | |
| longDashDot | | |
| longDashDotDot | | |
| roundDot | | |
| solid | | |
| squareDot | | |
| systemDash | | |
| systemDashDot | | |
| systemDot | |
ShapeLineStyleenumSource ↗
declare enum ShapeLineStyle| Member | Type | Summary |
|---|---|---|
| single | | |
| thickBetweenThin | | |
| thickThin | | |
| thinThick | | |
| thinThin | |
ShapeTypeenumSource ↗
declare enum ShapeType| Member | Type | Summary |
|---|---|---|
| callout | | |
| chart | | |
| contentApp | | |
| diagram | | |
| freeform | | |
| geometricShape | | |
| graphic | | |
| group | | |
| image | | |
| ink | | |
| line | | |
| media | | |
| model3D | | |
| ole | | |
| placeholder | | |
| table | | |
| textBox | | |
| unsupported | |
ShapeZOrderenumSource ↗
declare enum ShapeZOrder| Member | Type | Summary |
|---|---|---|
| bringForward | | |
| bringToFront | | |
| sendBackward | | |
| sendToBack | |
SlideBackgroundFillTypeenumSource ↗
declare enum SlideBackgroundFillType| Member | Type | Summary |
|---|---|---|
| gradient | | |
| pattern | | |
| pictureOrTexture | | |
| solid | | |
| unsupported | |
SlideBackgroundGradientFillTypeenumSource ↗
declare enum SlideBackgroundGradientFillType| Member | Type | Summary |
|---|---|---|
| linear | | |
| path | | |
| radial | | |
| rectangular | | |
| shadeFromTitle | | |
| unsupported | |
SlideBackgroundPatternFillTypeenumSource ↗
declare enum SlideBackgroundPatternFillType| Member | Type | Summary |
|---|---|---|
| cross | | |
| darkDownwardDiagonal | | |
| darkHorizontal | | |
| darkUpwardDiagonal | | |
| darkVertical | | |
| dashedDownwardDiagonal | | |
| dashedHorizontal | | |
| dashedUpwardDiagonal | | |
| dashedVertical | | |
| diagonalBrick | | |
| diagonalCross | | |
| divot | | |
| dottedDiamond | | |
| dottedGrid | | |
| downwardDiagonal | | |
| horizontal | | |
| horizontalBrick | | |
| largeCheckerBoard | | |
| largeConfetti | | |
| largeGrid | | |
| lightDownwardDiagonal | | |
| lightHorizontal | | |
| lightUpwardDiagonal | | |
| lightVertical | | |
| narrowHorizontal | | |
| narrowVertical | | |
| outlinedDiamond | | |
| percent10 | | |
| percent20 | | |
| percent25 | | |
| percent30 | | |
| percent40 | | |
| percent5 | | |
| percent50 | | |
| percent60 | | |
| percent70 | | |
| percent75 | | |
| percent80 | | |
| percent90 | | |
| plaid | | |
| shingle | | |
| smallCheckerBoard | | |
| smallConfetti | | |
| smallGrid | | |
| solidDiamond | | |
| sphere | | |
| trellis | | |
| unsupported | | |
| upwardDiagonal | | |
| vertical | | |
| wave | | |
| weave | | |
| wideDownwardDiagonal | | |
| wideUpwardDiagonal | | |
| zigZag | |
SlideLayoutTypeenumSource ↗
declare enum SlideLayoutType| Member | Type | Summary |
|---|---|---|
| blank | | |
| chart | | |
| chartAndText | | |
| clipArtAndText | | |
| clipArtAndVerticalText | | |
| comparison | | |
| contentWithCaption | | |
| custom | | |
| fourObjects | | |
| largeObject | | |
| mediaClipAndText | | |
| mixed | | |
| object | | |
| objectAndText | | |
| objectAndTwoObjects | | |
| objectOverText | | |
| organizationChart | | |
| pictureWithCaption | | |
| sectionHeader | | |
| table | | |
| text | | |
| textAndChart | | |
| textAndClipArt | | |
| textAndMediaClip | | |
| textAndObject | | |
| textAndTwoObjects | | |
| textOverObject | | |
| title | | |
| titleOnly | | |
| twoColumnText | | |
| twoObjects | | |
| twoObjectsAndObject | | |
| twoObjectsAndText | | |
| twoObjectsOverText | | |
| verticalText | | |
| verticalTitleAndText | | |
| verticalTitleAndTextOverChart | |
TableStyleenumSource ↗
declare enum TableStyle| Member | Type | Summary |
|---|---|---|
| darkStyle1 | | |
| darkStyle1Accent1 | | |
| darkStyle1Accent2 | | |
| darkStyle1Accent3 | | |
| darkStyle1Accent4 | | |
| darkStyle1Accent5 | | |
| darkStyle1Accent6 | | |
| darkStyle2 | | |
| darkStyle2Accent1 | | |
| darkStyle2Accent2 | | |
| darkStyle2Accent3 | | |
| lightStyle1 | | |
| lightStyle1Accent1 | | |
| lightStyle1Accent2 | | |
| lightStyle1Accent3 | | |
| lightStyle1Accent4 | | |
| lightStyle1Accent5 | | |
| lightStyle1Accent6 | | |
| lightStyle2 | | |
| lightStyle2Accent1 | | |
| lightStyle2Accent2 | | |
| lightStyle2Accent3 | | |
| lightStyle2Accent4 | | |
| lightStyle2Accent5 | | |
| lightStyle2Accent6 | | |
| lightStyle3 | | |
| lightStyle3Accent1 | | |
| lightStyle3Accent2 | | |
| lightStyle3Accent3 | | |
| lightStyle3Accent4 | | |
| lightStyle3Accent5 | | |
| lightStyle3Accent6 | | |
| mediumStyle1 | | |
| mediumStyle1Accent1 | | |
| mediumStyle1Accent2 | | |
| mediumStyle1Accent3 | | |
| mediumStyle1Accent4 | | |
| mediumStyle1Accent5 | | |
| mediumStyle1Accent6 | | |
| mediumStyle2 | | |
| mediumStyle2Accent1 | | |
| mediumStyle2Accent2 | | |
| mediumStyle2Accent3 | | |
| mediumStyle2Accent4 | | |
| mediumStyle2Accent5 | | |
| mediumStyle2Accent6 | | |
| mediumStyle3 | | |
| mediumStyle3Accent1 | | |
| mediumStyle3Accent2 | | |
| mediumStyle3Accent3 | | |
| mediumStyle3Accent4 | | |
| mediumStyle3Accent5 | | |
| mediumStyle3Accent6 | | |
| mediumStyle4 | | |
| mediumStyle4Accent1 | | |
| mediumStyle4Accent2 | | |
| mediumStyle4Accent3 | | |
| mediumStyle4Accent4 | | |
| mediumStyle4Accent5 | | |
| mediumStyle4Accent6 | | |
| noStyleNoGrid | | |
| noStyleTableGrid | | |
| themedStyle1Accent1 | | |
| themedStyle1Accent2 | | |
| themedStyle1Accent3 | | |
| themedStyle1Accent4 | | |
| themedStyle1Accent5 | | |
| themedStyle1Accent6 | | |
| themedStyle2Accent1 | | |
| themedStyle2Accent2 | | |
| themedStyle2Accent3 | | |
| themedStyle2Accent4 | | |
| themedStyle2Accent5 | | |
| themedStyle2Accent6 | |
TextVerticalAlignmentenumSource ↗
declare enum TextVerticalAlignment| Member | Type | Summary |
|---|---|---|
| bottom | | |
| bottomCentered | | |
| middle | | |
| middleCentered | | |
| top | | |
| topCentered | |
ThemeColorenumSource ↗
declare enum ThemeColor| Member | Type | Summary |
|---|---|---|
| accent1 | | |
| accent2 | | |
| accent3 | | |
| accent4 | | |
| accent5 | | |
| accent6 | | |
| dark1 | | |
| dark2 | | |
| followedHyperlink | | |
| hyperlink | | |
| light1 | | |
| light2 | | |
| mixed | | |
| none | |
Variables (1)
PptxEditorconstSource ↗
The entry point: open a presentation and get a runtime to work against.
PptxEditor: PptxEditorNamespace```ts
const runtime = await PptxEditor.createServer(bytes);
const titles = await runtime.run(async (context) => {
const slides = context.presentation.slides;
slides.load('items');
await context.sync();
const shapes = slides.items.map((slide) => slide.shapes.getItemAt(0).load('name'));
await context.sync();
return shapes.map((shape) => shape.name);
});
```