@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 ModelObject

The 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.

MemberTypeSummary
countnumberThe number of adjust values that the preset defines.
getThe adjust value at a zero-based index, after the next `sync()`.
setSet 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 ModelObject

The 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 ModelObject

The 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.

MemberTypeSummary
deleteDelete the binding. The shape stays.
getShapeThe shape the binding names. A binding whose shape is gone refuses with `ItemNotFound`.
idstringThe id of the binding.
type'Shape' | BindingTypeWhat 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 ModelObject

The 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();
});
```
MemberTypeSummary
addBind a shape under `id`. A binding that has that id moves to the shape.
addBind a shape under `id`. A binding that has that id moves to the shape.
addFromSelectionBind the one selected shape under `id`. Needs a runtime over a live editor; any selection other than one shape refuses with `InvalidArgument`.
addFromSelectionBind the one selected shape under `id`. Needs a runtime over a live editor; any selection other than one shape refuses with `InvalidArgument`.
getCountThe number of bindings, after the next `sync()`.
getItemThe binding with this id; `ItemNotFound` at the sync when there is none.
getItemAtThe binding at a zero-based position; `ItemNotFound` at the sync when there is none.
getItemOrNullObjectThe binding with this id, or a null object.
itemsBinding[]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 CellFormatPart

The 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.

MemberTypeSummary
colorstring | undefinedThe line color as `#RRGGBB`. A write also takes a preset color name.
dashStyleShapeLineDashStyle | `${ShapeLineDashStyle}` | undefinedThe dash style.
transparencynumber | undefinedThe transparency, from 0 (opaque) to 1 (clear).
weightnumber | undefinedThe 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
MemberTypeSummary
bottomBorderThe bottom edge.
diagonalDownBorderThe diagonal from the top-left to the bottom-right corner.
diagonalUpBorderThe diagonal from the bottom-left to the top-right corner.
leftBorderThe left edge.
rightBorderThe right edge.
topBorderThe top edge.

BulletFormatclassSource ↗

The bullets of paragraphs (a:buNone, a:buChar, a:buAutoNum).

declare class BulletFormat extends ModelObject

The 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.

MemberTypeSummary
styleBulletStyle | `${BulletStyle}` | nullThe numbering scheme of numbered bullets, or `null` when the paragraphs differ.
typeBulletType | `${BulletType}` | nullThe kind of bullet, or `null` when the paragraphs differ.
visibleboolean | nullWhether 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 RuntimeManagedObject

The 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.

MemberTypeSummary
contextRequestContextThe request context this object currently belongs to.
isNullObjectbooleanWhether 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`.
loadQueue the reads that fill in the selected properties. Returns `this`; the values are readable after the next `sync()`.
toJSONThe 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);
```
MemberTypeSummary
isLoadedbooleanWhether the sync that fills this has happened.
valueTThe value, once a `sync()` has filled it in.

CustomPropertyclassSource ↗

One custom document property: a key, a type, and a value.

declare class CustomProperty extends ModelObject

The 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.

MemberTypeSummary
deleteDelete the property.
keystringThe key. Lookups compare keys without case.
typeDocumentPropertyType | 'Boolean' | 'Date' | 'Number' | 'String'The type of the value.
valueboolean | Date | number | stringThe value. A write of another JavaScript type changes the type too.

CustomPropertyCollectionclassSource ↗

The custom document properties of the presentation.

declare class CustomPropertyCollection extends ModelObject

The 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();
});
```
MemberTypeSummary
addAdd a property, or set the value and type of the property with this key.
deleteAllDelete every listed property. A property of another variant type stays.
getCountThe number of properties, after the next `sync()`.
getItemThe property with this key; `ItemNotFound` at the sync when there is none.
getItemAtThe property at a zero-based position; `ItemNotFound` at the sync when there is none.
getItemOrNullObjectThe property with this key, or a null object.
itemsCustomProperty[]The loaded properties.

CustomXmlPartclassSource ↗

One custom XML part.

declare class CustomXmlPart extends ModelObject

The 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.

MemberTypeSummary
deleteDelete the part from its owner. A part another owner still names stays for that owner.
getXmlThe XML text of the part, after the next `sync()`.
idstringThe id: the part's `ds:itemID` GUID, braced and upper case.
namespaceUristringThe namespace URI of the root element, or an empty string.
setXmlReplace 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 CustomXmlPartList

The 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);
});
```
MemberTypeSummary
addAdd 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.
getByNamespaceThe parts whose root element has this namespace URI.

CustomXmlPartScopedCollectionclassSource ↗

The custom XML parts of one namespace, from CustomXmlPartCollection.getByNamespace.

declare class CustomXmlPartScopedCollection extends CustomXmlPartList

The 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.

MemberTypeSummary
getOnlyItemThe only part; `ItemNotFound` at the sync unless there is exactly one.
getOnlyItemOrNullObjectThe 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 ModelObject

The 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.

MemberTypeSummary
authorstring
categorystring
commentsstring
companystring
creationDateDateWhen 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())`.
customPropertiesCustomPropertyCollectionThe custom document properties (`docProps/custom.xml`).
keywordsstring
lastAuthorstring
managerstring
revisionNumbernumber
subjectstring
titlestring

One hyperlink: on a text range or on a whole shape.

declare class Hyperlink extends ModelObject

The 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.

MemberTypeSummary

HyperlinkCollectionclassSource ↗

The hyperlinks of a slide, in shape order.

declare class HyperlinkCollection extends HyperlinkList

The 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.

MemberTypeSummary
addLink 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 HyperlinkList

The 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
MemberTypeSummary
bottomnumber | undefinedThe bottom margin, in points.
leftnumber | undefinedThe left margin, in points.
rightnumber | undefinedThe right margin, in points.
topnumber | undefinedThe top margin, in points.

PageSetupclassSource ↗

The slide size, in points (p:sldSz, ECMA-376 Part 1, 19.2.1.39).

declare class PageSetup extends ModelObject

The 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.

MemberTypeSummary
slideHeightnumber
slideWidthnumber

ParagraphFormatclassSource ↗

The paragraph formatting of the paragraphs a text range touches. A property reads null when they differ.

declare class ParagraphFormat extends ModelObject

The 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.

MemberTypeSummary
bulletFormatBulletFormatThe bullets of the paragraphs.
horizontalAlignmentParagraphHorizontalAlignment | `${ParagraphHorizontalAlignment}` | nullThe horizontal alignment (`a:pPr/@algn`).
indentLevelnumberThe 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 ModelObject

The 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.

MemberTypeSummary
containedTypeShapeType | `${ShapeType}` | nullThe kind of content the placeholder holds, or null for a shape placeholder.
typePlaceholderType | `${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.
  }
}
```
MemberTypeSummary
(constructor)Constructs a new instance of the `PptxEditorError` class
actualRevision?numberFor `StaleDocument`: the revision the presentation was actually at.
codePptxEditorErrorCodeWhich refusal this is. Stable across versions; the thing to branch on.
debugInfoPptxEditorDebugInfoDebug details, as Office.js `OfficeExtension.Error.debugInfo` has them.
expectedRevision?numberFor `StaleDocument`: the revision the context had last read at.
target?stringConsumer-facing path of the object or property involved, when there is one to name.
traceMessagesreadonly 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 ModelObject

The 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));
});
```
MemberTypeSummary
bindingsBindingCollectionThe 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.
customXmlPartsCustomXmlPartCollectionThe custom XML parts of the presentation.
getSelectedShapesThe selected shapes of the reader. A server runtime refuses with `NotSupported`.
getSelectedSlidesThe selected slides of the reader. A server runtime refuses with `NotSupported`.
getSelectedTextRangeThe selected text. `ItemNotFound` at the sync when no text is selected.
getSelectedTextRangeOrNullObjectThe selected text, or a null object when no text is selected.
idstringThe id of the presentation.
insertSlidesFromBase64Insert 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.
pageSetupPageSetupThe slide size.
propertiesDocumentPropertiesThe document properties (title, author, …).
setSelectedSlidesSelect slides by id. A server runtime refuses with `NotSupported`.
slideMastersSlideMasterCollectionThe slide masters, in order.
slidesSlideCollectionThe slides, in order.
tagsTagCollectionThe tags of the presentation.
titlestringThe 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
MemberTypeSummary
applicationApplicationThe application the presentation is open in. It has no properties or methods.
capabilitiesPresentationCapabilitiesWhat the presentation host behind this context can do.
debugInfoRequestContextDebugInfoWhat the next `sync()` sends, for debugging. See [RequestContextDebugInfo](RequestContextDebugInfo).
loadQueue a load on `object`, as Office.js `context.load(object, option)`.
loadRecursiveQueue 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.
presentationPresentationThe presentation this run is against: the same object for the life of the context.
syncSend 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.
traceQueue 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.
trackedObjectsTrackedObjectsObjects 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 ModelObject

The 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.

MemberTypeSummary
adjustmentsAdjustmentsThe adjust values of the shape's preset geometry (`a:prstGeom/a:avLst`).
altTextDescriptionstringThe alternative text description (`p:cNvPr/@descr`).
altTextTitlestringThe alternative text title (`p:cNvPr/@title`).
creationIdstring | nullThe creation id of the shape. The file format has none, so this reads `null`.
customXmlPartsCustomXmlPartCollectionThe custom XML parts of the shape.
deleteDelete the shape.
fillShapeFillThe fill of the shape.
getImageAsBase64A 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`.
getParentSlideThe slide the shape is on; `ItemNotFound` at the sync for a layout or master shape.
getParentSlideLayoutThe layout the shape is on; `ItemNotFound` at the sync for any other shape.
getParentSlideLayoutOrNullObjectThe layout the shape is on, or a null object.
getParentSlideMasterThe master the shape is on; `ItemNotFound` at the sync for any other shape.
getParentSlideMasterOrNullObjectThe master the shape is on, or a null object.
getParentSlideOrNullObjectThe slide the shape is on, or a null object.
getTableThe table of a table shape. `NotSupported` at the sync for any other shape.
getTextFrameOrNullObjectThe text frame, or a null object for a shape that holds no text.
groupShapeGroupThe group this shape is, for a group shape.
heightnumberThe height, in points.
idstringThe shape id (`p:cNvPr/@id`), unique on its slide.
isDecorativebooleanWhether the shape is decorative, so readers of alternative text skip it.
leftnumberThe distance from the left edge of the slide, in points.
levelnumberHow deep in groups the shape is: 0 at the top level.
lineFormatShapeLineFormatThe outline of the shape.
namestringThe shape name (`p:cNvPr/@name`).
parentGroupShapeThe group that holds this shape. `ItemNotFound` at the sync for a shape at the top level.
placeholderFormatPlaceholderFormatThe placeholder properties, for a placeholder.
rotationnumberThe rotation, in degrees clockwise.
setZOrderMove the shape in the z-order of its parent.
setZOrderMove the shape in the z-order of its parent.
tagsTagCollectionThe tags of the shape.
textFrameTextFrameThe text frame. `NotSupported` at the sync for a shape that holds no text.
topnumberThe distance from the top edge of the slide, in points.
typeShapeType | `${ShapeType}`What kind of shape this is.
visiblebooleanWhether the shape shows (`p:cNvPr/@hidden` is not set).
widthnumberThe width, in points.
zOrderPositionnumberThe 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 ShapeList

The 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.

MemberTypeSummary
addGeometricShapeAdd a preset geometric shape (`a:prstGeom`, ECMA-376 Part 1, 20.1.9.18).
addGeometricShapeAdd a preset geometric shape (`a:prstGeom`, ECMA-376 Part 1, 20.1.9.18).
addGroupGroup shapes of this collection, by shape or by id. Answers the new group.
addLineAdd a line or connector (`p:cxnSp`).
addLineAdd a line or connector (`p:cxnSp`).
addTableAdd a table (`a:tbl` in a graphic frame) of `rowCount` rows and `columnCount` columns.
addTextBoxAdd a text box with `text`.

ShapeFillclassSource ↗

The fill of a shape.

declare class ShapeFill extends ModelObject

The 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.

MemberTypeSummary
clearRemove the fill (`a:noFill`).
foregroundColorstringThe solid fill color as `#RRGGBB`, or an empty string for any other fill.
setImageFill with a picture, stretched (`a:blipFill`): PNG, JPEG, or GIF bytes in base64. A table cell refuses a picture fill with `InvalidArgument`.
setSolidColorFill with a solid color, `#RRGGBB` or a preset color name.
transparencynumberThe transparency of a solid fill, from 0 (opaque) to 1 (clear).
typeShapeFillType | `${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 ModelObject

The 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.

MemberTypeSummary
allCapsboolean | null
boldboolean | null
colorstring | nullThe color as `#RRGGBB`.
doubleStrikethroughboolean | null
italicboolean | null
namestring | nullThe font family name.
sizenumber | nullThe size, in points.
smallCapsboolean | null
strikethroughboolean | null
subscriptboolean | null
superscriptboolean | null
underlineShapeFontUnderlineStyle | `${ShapeFontUnderlineStyle}` | null

ShapeGroupclassSource ↗

A group shape (p:grpSp).

declare class ShapeGroup extends ModelObject

The 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.

MemberTypeSummary
creationIdstring | nullThe creation id. The file format has none, so this reads `null`.
idstringThe id of the group shape.
shapeShapeThe group as a shape.
shapesShapeScopedCollectionThe members of the group, in z-order.
ungroupUngroup: 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 ModelObject

The 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.

MemberTypeSummary
colorstringThe line color as `#RRGGBB`, or an empty string when it has none.
dashStyleShapeLineDashStyle | `${ShapeLineDashStyle}`The dash style.
styleShapeLineStyle | `${ShapeLineStyle}`The compound line style.
transparencynumberThe transparency, from 0 (opaque) to 1 (clear).
visiblebooleanWhether the line shows.
weightnumberThe line weight, in points.

ShapeScopedCollectionclassSource ↗

A set of shapes: the reader's selection, or the members of a group.

declare class ShapeScopedCollection extends ShapeList

The 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.

MemberTypeSummary
groupGroup 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 ModelObject

The 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.

MemberTypeSummary
applyLayoutChange the layout, re-mapping placeholders by type and index.
backgroundSlideBackgroundThe background of the slide.
customXmlPartsCustomXmlPartCollectionThe custom XML parts of the slide.
deleteDelete the slide.
exportAsBase64The slide as a presentation of its own, Base64-encoded PPTX bytes.
getImageAsBase64A 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`.
idstringThe slide id (`p:sldId/@id`). Stable across moves.
indexnumberThe zero-based position of the slide.
layoutSlideLayoutThe layout of the slide.
moveToMove the slide to a zero-based position.
setSelectedShapesSelect shapes of this slide by id. A server runtime refuses with `NotSupported`.
shapesShapeCollectionThe shapes of the slide, in z-order.
slideMasterSlideMasterThe master of the slide.
tagsTagCollectionThe tags of the slide.
themeColorSchemeThemeColorSchemeThe theme colors of the slide: those of the theme of its master.

SlideBackgroundclassSource ↗

The background of a slide.

declare class SlideBackground extends BackgroundPart
MemberTypeSummary
areBackgroundGraphicsHiddenbooleanWhether the shapes of the layout and master are hidden (`p:sld/@showMasterSp="0"`).
fillSlideBackgroundFillThe fill the slide shows.
isMasterBackgroundFollowedbooleanWhether 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.
resetRemove the own background: the slide shows the background of its layout or master.

SlideBackgroundFillclassSource ↗

The fill of a background.

declare class SlideBackgroundFill extends BackgroundPart
MemberTypeSummary
getGradientFillOrNullObjectThe gradient fill, or a null object when the fill is of another kind.
getPatternFillOrNullObjectThe pattern fill, or a null object when the fill is of another kind.
getPictureOrTextureFillOrNullObjectThe picture fill, or a null object when the fill is of another kind.
getSolidFillOrNullObjectThe solid fill, or a null object when the fill is of another kind.
setGradientFillFill with a gradient. The stops of a current gradient stay.
setPatternFillFill with a pattern (`a:pattFill`).
setPictureOrTextureFillFill with a stretched picture. Without `imageBase64`, the current picture stays.
setSolidFillFill with one color.
typeSlideBackgroundFillType | `${SlideBackgroundFillType}`The kind of fill. `Unsupported` for no fill.

SlideBackgroundGradientFillclassSource ↗

A gradient background fill.

declare class SlideBackgroundGradientFill extends BackgroundPart
MemberTypeSummary
typeSlideBackgroundGradientFillType | `${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
MemberTypeSummary
backgroundColorstringThe color behind the pattern, as `#RRGGBB`.
foregroundColorstringThe color of the pattern, as `#RRGGBB`.
patternSlideBackgroundPatternFillType | `${SlideBackgroundPatternFillType}`The pattern (`ST_PresetPatternVal`).

SlideBackgroundPictureOrTextureFillclassSource ↗

A picture background fill (a:blipFill), stretched to the slide.

declare class SlideBackgroundPictureOrTextureFill extends BackgroundPart
MemberTypeSummary
setImageShow other picture bytes: PNG, JPEG, or GIF in base64. The transparency stays.
transparencynumberThe transparency of the picture (`a:alphaModFix`), from 0 (opaque) to 1 (clear).

SlideBackgroundSolidFillclassSource ↗

A solid background fill.

declare class SlideBackgroundSolidFill extends BackgroundPart
MemberTypeSummary
colorstringThe color as `#RRGGBB`.
transparencynumberThe 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.

MemberTypeSummary
addAdd a slide at the end, from a layout and master by id.
exportAsBase64PresentationThe listed slides as a presentation of their own, Base64-encoded PPTX bytes.
getItemA slide by id; `ItemNotFound` at the sync when there is none.
getItemAtA slide by zero-based position; `ItemNotFound` at the sync when there is none.
getItemOrNullObjectA slide by id, or a null object.

SlideLayoutclassSource ↗

A slide layout (p:sldLayout).

declare class SlideLayout extends ModelObject

The 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.

MemberTypeSummary
backgroundSlideLayoutBackgroundThe background of the layout.
customXmlPartsCustomXmlPartCollectionThe custom XML parts of the layout.
idstringThe layout id (`p:sldLayoutId/@id`).
namestringThe layout name (`p:cSld/@name`).
shapesShapeCollectionThe shapes of the layout.
themeColorSchemeThemeColorSchemeThe theme colors of the layout: those of the theme of its master.
typeSlideLayoutType | `${SlideLayoutType}`The layout type (`p:sldLayout/@type`).

SlideLayoutBackgroundclassSource ↗

The background of a slide layout.

declare class SlideLayoutBackground extends BackgroundPart
MemberTypeSummary
areBackgroundGraphicsHiddenbooleanWhether the shapes of the master are hidden (`p:sldLayout/@showMasterSp="0"`).
fillSlideBackgroundFillThe fill the layout shows.
isMasterBackgroundFollowedbooleanWhether the layout shows the background of its master (it has no own `p:bg`). Setting `false` copies the master background into the layout.
resetRemove 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.

MemberTypeSummary
getItemA layout by id; `ItemNotFound` at the sync when there is none.
getItemAtA layout by zero-based position.
getItemOrNullObjectA layout by id, or a null object.

SlideMasterclassSource ↗

A slide master (p:sldMaster).

declare class SlideMaster extends ModelObject

The 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.

MemberTypeSummary
backgroundSlideMasterBackgroundThe background of the master.
customXmlPartsCustomXmlPartCollectionThe custom XML parts of the master.
idstringThe master id (`p:sldMasterId/@id`).
layoutsSlideLayoutCollectionThe layouts of the master.
namestringThe master name (`p:cSld/@name`).
shapesShapeCollectionThe shapes of the master.
themeColorSchemeThemeColorSchemeThe theme colors of the master: those of the theme of its master.

SlideMasterBackgroundclassSource ↗

The background of a slide master.

declare class SlideMasterBackground extends BackgroundPart
MemberTypeSummary
fillSlideBackgroundFillThe 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.

MemberTypeSummary
getItemA master by id; `ItemNotFound` at the sync when there is none.
getItemAtA master by zero-based position.
getItemOrNullObjectA 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.

MemberTypeSummary
exportAsBase64PresentationThe slides as a presentation of their own, Base64-encoded PPTX bytes.
getItemA selected slide by id; `ItemNotFound` at the sync when there is none.
getItemAtA selected slide by position in the selection.
getItemOrNullObjectA selected slide by id, or a null object.

TableclassSource ↗

The table of a table shape.

declare class Table extends ModelObject

The 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.

MemberTypeSummary
clearClear 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.
columnCountnumberThe number of columns.
columnsTableColumnCollectionThe columns.
getCellOrNullObjectA cell by zero-based row and column, or a null object outside the table.
getMergedAreasThe merged areas of the table: one cell for each, its first cell, with its span.
getShapeThe table shape.
mergeCellsMerge a rectangle of cells into its first cell.
rowCountnumberThe number of rows.
rowsTableRowCollectionThe rows.
styleSettingsTableStyleSettingsThe style options and the style of the table (`a:tblPr`).
valuesstring[][]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 ModelObject

The 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.

MemberTypeSummary
bordersBordersThe borders of the cell (`a:tcPr` lines).
columnCountnumberHow many columns the cell spans.
columnIndexnumberThe zero-based column of the cell; the first column of its merged area.
fillShapeFillThe cell's fill (`a:tcPr`).
fontShapeFontThe character format of the cell's text.
horizontalAlignmentParagraphHorizontalAlignment | `${ParagraphHorizontalAlignment}` | nullThe horizontal alignment of the cell's paragraphs (`a:pPr/@algn`).
indentLevelnumber | nullThe indent level of the cell's paragraphs, from 1; null when they differ.
marginsMarginsThe margins of the cell (`a:tcPr/@marL` and the like), in points.
resizeMake the cell span `rowCount` rows and `columnCount` columns from its first grid position.
rowCountnumberHow many rows the cell spans.
rowIndexnumberThe zero-based row of the cell; the first row of its merged area.
splitSplit the cell into `rowCount` rows and `columnCount` columns of cells.
textstringThe text of the cell.
textRunsTextRun[]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.
verticalAlignmentTextVerticalAlignment | `${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 ModelObject

The 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.

MemberTypeSummary
getCountThe number of merged areas, after the next `sync()`.
getItemAtOrNullObjectThe 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.
itemsTableCell[]The loaded cells.

TableColumnclassSource ↗

One column of a table.

declare class TableColumn extends TableLine

The 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.

MemberTypeSummary
columnIndexnumberThe zero-based column index.
widthnumberThe 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.

MemberTypeSummary
deleteColumnsDelete columns.

TableRowclassSource ↗

One row of a table.

declare class TableRow extends TableLine

The 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.

MemberTypeSummary
currentHeightnumberThe height of the row as stored, in points.
heightnumberThe row height, in points (`a:tr/@h`).
rowIndexnumberThe 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.

MemberTypeSummary
deleteRowsDelete 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 ModelObject

The 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.

MemberTypeSummary
areColumnsBandedbooleanWhether the columns show banded formatting (`a:tblPr/@bandCol`).
areRowsBandedbooleanWhether the rows show banded formatting (`a:tblPr/@bandRow`).
isFirstColumnHighlightedbooleanWhether the first column has its own format (`a:tblPr/@firstCol`).
isFirstRowHighlightedbooleanWhether the first row has its own format (`a:tblPr/@firstRow`).
isLastColumnHighlightedbooleanWhether the last column has its own format (`a:tblPr/@lastCol`).
isLastRowHighlightedbooleanWhether the last row has its own format (`a:tblPr/@lastRow`).
styleTableStyle | `${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 ModelObject

The 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.

MemberTypeSummary
keystringThe key, in upper case.
valuestringThe value.

TagCollectionclassSource ↗

The tags of a presentation, slide, or shape.

declare class TagCollection extends ModelObject

The 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.

MemberTypeSummary
addAdd a tag, or set the value of the tag with this key.
deleteDelete the tag with this key. `ItemNotFound` at the sync when there is none.
getCountThe number of tags, after the next `sync()`.
getItemThe tag with this key; `ItemNotFound` at the sync when there is none.
getItemAtThe tag at a zero-based position.
getItemOrNullObjectThe tag with this key, or a null object.
itemsTag[]The loaded tags.

TextFrameclassSource ↗

The text frame of a shape (p:txBody and its a:bodyPr).

declare class TextFrame extends ModelObject

The 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.

MemberTypeSummary
autoSizeSettingShapeAutoSize | `${ShapeAutoSize}`How the text and the shape fit each other.
bottomMarginnumberThe bottom inset, in points.
deleteTextDelete all the text.
getParentShapeThe shape that holds the frame.
hasTextbooleanWhether the frame holds any text.
leftMarginnumberThe left inset, in points.
rightMarginnumberThe right inset, in points.
textRangeTextRangeAll the text of the frame.
topMarginnumberThe top inset, in points.
verticalAlignmentTextVerticalAlignment | `${TextVerticalAlignment}`The vertical anchor of the text.
wordWrapbooleanWhether lines wrap at the frame width.

TextRangeclassSource ↗

A run of text in a text frame.

declare class TextRange extends ModelObject

The 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.

MemberTypeSummary
fontShapeFontThe character formatting of the range.
getParentTextFrameThe text frame that holds the range.
getSubstringA range inside this one, from `start` (relative to this range) for `length` characters, or to the end of this range when `length` is absent.
lengthnumberThe length of the range.
paragraphFormatParagraphFormatThe paragraph formatting of the paragraphs the range touches.
setSelectedSelect the range in the editor. A server runtime refuses with `NotSupported`.
startnumberThe zero-based start of the range in the text of the frame.
textstringThe 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 ModelObject

The 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.

MemberTypeSummary
getThemeColorOne theme color as `#RRGGBB`. `Mixed` and `None` are `InvalidArgument`.
getThemeColorOne theme color as `#RRGGBB`. `Mixed` and `None` are `InvalidArgument`.
setThemeColorSet one theme color: `#RRGGBB` or a preset color name.
setThemeColorSet 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 TrackedObjects

The 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.

MemberTypeSummary
addKeep these objects usable after this run ends.
removeStop keeping them: they are released when this run ends, like any other object.

Interfaces (33)

AddSlideOptionsinterfaceSource ↗

Options for SlideCollection.add.

interface AddSlideOptions
MemberTypeSummary
layoutId?stringThe layout of the new slide, by id. The first layout of the master when absent.
slideMasterId?stringThe 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
MemberTypeSummary
color?string | undefined`#RRGGBB` or a preset color name.
dashStyle?ShapeLineDashStyle | `${ShapeLineDashStyle}` | undefined
transparency?number | undefinedFrom 0 (opaque) to 1 (clear).
weight?number | undefinedPoints.

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
MemberTypeSummary
fonts?FontSource | readonly FontSource[]Faces to measure text with, tried before the presentation's embedded fonts and the metric-compatible substitutes.
rasterize?ImageRasterizerTurns 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?booleanLoad the metric-compatible substitute fonts. Default `true`.

FillPropertiesinterfaceSource ↗

A solid fill, for TableCellProperties.

interface FillProperties
MemberTypeSummary
color?string | undefined`#RRGGBB` or a preset color name.
transparency?number | undefinedFrom 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
MemberTypeSummary
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 | undefinedPoints.
smallCaps?boolean | undefined
strikethrough?boolean | undefined
subscript?boolean | undefined
superscript?boolean | undefined
underline?ShapeFontUnderlineStyle | `${ShapeFontUnderlineStyle}` | undefined

HyperlinkAddOptionsinterfaceSource ↗

Options for a new hyperlink.

interface HyperlinkAddOptions
MemberTypeSummary
address?stringThe address the link opens.
screenTip?stringThe tip that shows over the link.

InsertSlideOptionsinterfaceSource ↗

Options for Presentation.insertSlidesFromBase64.

interface InsertSlideOptions
MemberTypeSummary
formatting?InsertSlideFormatting | `${InsertSlideFormatting}` | undefinedHow the inserted slides are formatted.
sourceSlideIds?string[]The slides of the source presentation to insert, by id.
targetSlideId?stringThe 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
MemberTypeSummary
(member-0)A property: `true` loads it, an object loads a navigation property with what it names.
$all?booleanLoad every scalar property of this object, or of each item of a collection.
$skip?numberFor a collection: skip this many items first.
$top?numberFor 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
MemberTypeSummary
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?numberFor a collection: skip this many items first.
top?numberFor a collection: at most this many items.

PptxEditorDebugInfointerfaceSource ↗

Debug details in the shape of Office.js OfficeExtension.DebugInfo.

interface PptxEditorDebugInfo
MemberTypeSummary
codePptxEditorErrorCodeThe same code as [PptxEditorError.code](PptxEditorError.code).
errorLocation?stringThe consumer-facing path of the object or property involved, when there is one.
innerError?PptxEditorInnerErrorWhy the engine refused, when it knows a specific reason.
messagestringThe same message as the error's own.

PptxEditorErrorInitinterfaceSource ↗

The fields a [PptxEditorError](PptxEditorError) is constructed from.

interface PptxEditorErrorInit
MemberTypeSummary
actualRevision?numberThe revision the presentation was actually at, for `StaleDocument`.
codePptxEditorErrorCodeWhich refusal this is. The stable thing to branch on.
diagnostic?PptxEditorDiagnosticThe public reason, when the engine gave one this API knows.
expectedRevision?numberThe revision the context had read at, for `StaleDocument`.
target?stringThe 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
MemberTypeSummary
codestringA stable public diagnostic code, such as `edit.stale-target`.
messagestringThe 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
MemberTypeSummary
createServerA 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
MemberTypeSummary
capabilitiesPresentationCapabilitiesWhat the presentation host behind this runtime can do.
disposeRelease the host. Idempotent.
runRun one batch of work against the presentation. Answers with the callback's value.
runRun 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
MemberTypeSummary
saveThe current presentation as a fresh, caller-owned PPTX byte array.

PresentationCapabilitiesinterfaceSource ↗

Capabilities of a runtime, frozen for its lifetime.

interface PresentationCapabilities
MemberTypeSummary
autofitbooleanText writes re-fit text bodies by their autofit rules (ECMA-376 Part 1, 21.1.2.1).
documentbooleanThere is a presentation to address at all.
eventsbooleanThe host raises change events.
imagesboolean`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.
saveboolean`save()` is offered: true for a server runtime, false for one borrowing an editor.
selectionbooleanThe host has a reader's selection to read or move.

RequestContextDebugInfointerfaceSource ↗

Debug information about a request context, as Office.js OfficeExtension.RequestContextDebugInfo.

interface RequestContextDebugInfo
MemberTypeSummary
pendingStatementsstring[]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
MemberTypeSummary
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
MemberTypeSummary
format?ShapeGetImageFormatType | `${ShapeGetImageFormatType}` | undefinedThe image format. Only PNG.
height?numberThe height of the box, in pixels.
width?numberThe width of the box, in pixels.

SlideBackgroundGradientFillOptionsinterfaceSource ↗

Options for SlideBackgroundFill.setGradientFill.

interface SlideBackgroundGradientFillOptions
MemberTypeSummary
type?SlideBackgroundGradientFillType | `${SlideBackgroundGradientFillType}` | undefinedThe shading. The current shading, or `Linear`, when absent.

SlideBackgroundPatternFillOptionsinterfaceSource ↗

Options for SlideBackgroundFill.setPatternFill.

interface SlideBackgroundPatternFillOptions
MemberTypeSummary
backgroundColor?string | undefinedThe color behind the pattern. The current one, or white, when absent.
foregroundColor?string | undefinedThe color of the pattern. The current one, or black, when absent.
pattern?SlideBackgroundPatternFillType | `${SlideBackgroundPatternFillType}` | undefinedThe pattern. The current one, or `Percent5`, when absent.

SlideBackgroundPictureOrTextureFillOptionsinterfaceSource ↗

Options for SlideBackgroundFill.setPictureOrTextureFill.

interface SlideBackgroundPictureOrTextureFillOptions
MemberTypeSummary
imageBase64?string | undefinedPNG, JPEG, or GIF bytes in base64. The current picture when absent.
transparencynumberFrom 0 (opaque) to 1 (clear).

SlideBackgroundSolidFillOptionsinterfaceSource ↗

Options for SlideBackgroundFill.setSolidFill.

interface SlideBackgroundSolidFillOptions
MemberTypeSummary
color?string | undefined`#RRGGBB` or a preset color name. The current solid color, or white, when absent.
transparency?number | undefinedFrom 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
MemberTypeSummary
height?numberThe height of the box, in pixels.
width?numberThe 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
MemberTypeSummary
columns?TableColumnProperties[] | undefinedOne entry for each column.
height?number | undefined
left?number | undefined
mergedAreas?TableMergedAreaProperties[] | undefined
rows?TableRowProperties[] | undefinedOne entry for each row.
specificCellProperties?TableCellProperties[][] | undefinedThe properties of each cell, by row then column. Its size must equal the table's.
style?TableStyle | `${TableStyle}` | undefined
top?number | undefined
uniformCellProperties?TableCellProperties | undefinedThe properties of every cell.
values?string[][] | undefinedThe 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
MemberTypeSummary
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
MemberTypeSummary
bottom?number | undefined
left?number | undefined
right?number | undefined
top?number | undefined

TableCellPropertiesinterfaceSource ↗

The format and content of a cell, for TableAddOptions.

interface TableCellProperties
MemberTypeSummary
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
MemberTypeSummary
all?boolean
format?boolean
text?boolean

TableColumnPropertiesinterfaceSource ↗

One column of a new table, for TableAddOptions.

interface TableColumnProperties
MemberTypeSummary
columnWidth?number | undefinedPoints.

TableMergedAreaPropertiesinterfaceSource ↗

One merged area of a new table, for TableAddOptions.

interface TableMergedAreaProperties
MemberTypeSummary
columnCountnumber
columnIndexnumber
rowCountnumber
rowIndexnumber

TableRowPropertiesinterfaceSource ↗

One row of a new table, for TableAddOptions.

interface TableRowProperties
MemberTypeSummary
rowHeight?number | undefinedPoints.

TextRuninterfaceSource ↗

One run of text with its own format, for TableCell.textRuns.

interface TextRun
MemberTypeSummary
font?FontProperties | undefined
textstring

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
MemberTypeSummary
shape

BulletStyleenumSource ↗

declare enum BulletStyle
MemberTypeSummary
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
MemberTypeSummary
none
numbered
unnumbered
unsupported

ConnectorTypeenumSource ↗

declare enum ConnectorType
MemberTypeSummary
curve
elbow
straight

DocumentPropertyTypeenumSource ↗

The type of a custom document property value.

declare enum DocumentPropertyType
MemberTypeSummary
boolean
date
number
string

GeometricShapeTypeenumSource ↗

A preset geometry for ShapeCollection.addGeometricShape.

declare enum GeometricShapeType
MemberTypeSummary
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
MemberTypeSummary
shape
textRange

InsertSlideFormattingenumSource ↗

declare enum InsertSlideFormatting
MemberTypeSummary
keepSourceFormatting
useDestinationTheme

ParagraphHorizontalAlignmentenumSource ↗

declare enum ParagraphHorizontalAlignment
MemberTypeSummary
center
distributed
justify
justifyLow
left
right
thaiDistributed

PlaceholderTypeenumSource ↗

declare enum PlaceholderType
MemberTypeSummary
body
cameo
centerTitle
chart
content
date
header
media
onlinePicture
picture
slideNumber
subtitle
table
title
unsupported
verticalBody
verticalContent
verticalTitle

ShapeAutoSizeenumSource ↗

declare enum ShapeAutoSize
MemberTypeSummary
autoSizeMixed
autoSizeNone
autoSizeShapeToFitText
autoSizeTextToFitShape

ShapeFillTypeenumSource ↗

declare enum ShapeFillType
MemberTypeSummary
gradient
noFill
pattern
pictureAndTexture
slideBackground
solid

ShapeFontUnderlineStyleenumSource ↗

declare enum ShapeFontUnderlineStyle
MemberTypeSummary
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
MemberTypeSummary
png

ShapeLineDashStyleenumSource ↗

declare enum ShapeLineDashStyle
MemberTypeSummary
dash
dashDot
dashDotDot
longDash
longDashDot
longDashDotDot
roundDot
solid
squareDot
systemDash
systemDashDot
systemDot

ShapeLineStyleenumSource ↗

declare enum ShapeLineStyle
MemberTypeSummary
single
thickBetweenThin
thickThin
thinThick
thinThin

ShapeTypeenumSource ↗

declare enum ShapeType
MemberTypeSummary
callout
chart
contentApp
diagram
freeform
geometricShape
graphic
group
image
ink
line
media
model3D
ole
placeholder
table
textBox
unsupported

ShapeZOrderenumSource ↗

declare enum ShapeZOrder
MemberTypeSummary
bringForward
bringToFront
sendBackward
sendToBack

SlideBackgroundFillTypeenumSource ↗

declare enum SlideBackgroundFillType
MemberTypeSummary
gradient
pattern
pictureOrTexture
solid
unsupported

SlideBackgroundGradientFillTypeenumSource ↗

declare enum SlideBackgroundGradientFillType
MemberTypeSummary
linear
path
radial
rectangular
shadeFromTitle
unsupported

SlideBackgroundPatternFillTypeenumSource ↗

declare enum SlideBackgroundPatternFillType
MemberTypeSummary
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
MemberTypeSummary
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
MemberTypeSummary
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
MemberTypeSummary
bottom
bottomCentered
middle
middleCentered
top
topCentered

ThemeColorenumSource ↗

declare enum ThemeColor
MemberTypeSummary
accent1
accent2
accent3
accent4
accent5
accent6
dark1
dark2
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);
});
```