API reference

Every public export of @office-kit/pptx and @office-kit/pptx/node, by category. The library is functions only, with no classes. This page covers the 277 exports people reach for most, in 18 groups; the package's type declarations list every one.

For the conceptual map see the API overview. For code you can paste, see the cheatsheet and recipes.

Load / save

Open and persist a .pptx, plus the Node fs convenience subpath.

Units

Branded Emu constructors. Internal code only sees Emu — every numeric position is type-checked at the boundary.

  • inches (n: number) => Emu
  • cm (n: number) => Emu
  • mm (n: number) => Emu
  • pt (n: number) => Emu
  • emu (n: number) => Emu — escape hatch

Slides

Enumerate, add, remove, reorder. Layouts come from the loaded template.

Slide layouts

Inspect and switch slides between the layouts shipped by the deck's masters.

Slide metadata

Title, size, visibility, sections, background, transitions, speaker notes.

Placeholders & text

Find placeholders by type, replace tokens, set per-run / per-paragraph formatting.

Shapes

Add, find, mutate, remove shapes. 180+ preset geometries.

Shape geometry

Position, size, rotation, flip, z-order.

Fill, stroke, effects

Solid / gradient / pattern / image fill + stroke + shadow / glow.

Images

Embedded picture shapes — bytes, crop, opacity, brightness, contrast.

Media

Embedded video / audio and online (URL) video — add and read back.

Tables

Per-cell text / fill / alignment, structural insert / remove, sizing.

Charts

Embedded charts with auto-generated xlsx. Kinds: bar, column, line, pie, doughnut, area.

Animations

Entrance / exit / emphasis presets. Complex timing-tree authoring is post-1.0.

Comments

Per-slide review comments with author metadata and EMU position.

Document properties

Title, Author, Subject, Keywords, App, Company, thumbnail.

Diagnostics

Validation, raw OPC introspection, media accounting.