Skip to Content

Class: PptxEditorSession

Headless read/edit/render/write session using the browser renderer.

Extends

  • PptxEditorSession

Accessors

document

Get Signature

get document(): PptxSourceModel;

Current immutable PPTX source model after all applied history entries.

Returns

PptxSourceModel

Inherited from

BasePptxEditorSession.document

history

Get Signature

get history(): PptxEditorHistoryState;

Current undo/redo availability and stack depths.

Returns

PptxEditorHistoryState

Inherited from

BasePptxEditorSession.history

layoutCatalog

Get Signature

get layoutCatalog(): readonly PptxEditorSlideMasterCatalogEntry[];

Slide masters and their layouts in PowerPoint authoring order.

The outer array follows p:sldMasterIdLst; each nested array follows the corresponding p:sldLayoutIdLst. Only resolved catalog entries are returned. Inspect document.diagnostics for unresolved relationships.

Returns

readonly PptxEditorSlideMasterCatalogEntry[]

Inherited from

BasePptxEditorSession.layoutCatalog

selection

Get Signature

get selection(): | PptxEditorSelectionInfo | undefined;

Currently selected shape, or undefined when no shape is selected.

Returns

| PptxEditorSelectionInfo | undefined

Inherited from

BasePptxEditorSession.selection

slides

Get Signature

get slides(): readonly PptxEditorSlideSvg[];

Latest rendered SVG result for every slide.

Returns

readonly PptxEditorSlideSvg[]

Inherited from

BasePptxEditorSession.slides

Methods

addConnector()

addConnector(slideNumber?: number, options?: PptxEditorAddConnectorOptions): Promise<PptxEditorSlidesResponse>;

Add and select a straight connector on one slide.

Parameters

slideNumber?

number = 1

PowerPoint-style 1-based slide number.

options?

PptxEditorAddConnectorOptions = {}

Pixel bounds and optional shape name.

Returns

Promise<PptxEditorSlidesResponse>

Updated editor state.

Throws

PptxEditorError with invalid-command or render-failed.

Inherited from

BasePptxEditorSession.addConnector

addTextBox()

addTextBox(slideNumber?: number, options?: PptxEditorAddTextBoxOptions): Promise<PptxEditorSlidesResponse>;

Add and select a text box on one slide.

Parameters

slideNumber?

number = 1

PowerPoint-style 1-based slide number.

options?

PptxEditorAddTextBoxOptions = {}

Pixel bounds, initial text, and optional shape name.

Returns

Promise<PptxEditorSlidesResponse>

Updated editor state.

Throws

PptxEditorError with invalid-command or render-failed.

Inherited from

BasePptxEditorSession.addTextBox

apply()

apply(command: EditorCommand): Promise<PptxEditorSlidesResponse>;

Apply one EditorCommand as one atomic history entry.

Parameters

command

EditorCommand

Discriminated command containing its kind and payload.

Returns

Promise<PptxEditorSlidesResponse>

Updated slides, history, selection, and any non-fatal warnings.

Throws

PptxEditorError with invalid-command or render-failed.

Inherited from

BasePptxEditorSession.apply

applyAll()

applyAll(commands: readonly EditorCommand[]): Promise<PptxEditorSlidesResponse>;

Apply commands atomically as one history entry and rerender affected slides.

Parameters

commands

readonly EditorCommand[]

Ordered editor commands. An empty array returns the current state unchanged.

Returns

Promise<PptxEditorSlidesResponse>

Updated slides, history, selection, and any non-fatal warnings.

Throws

PptxEditorError with invalid-command or render-failed.

Inherited from

BasePptxEditorSession.applyAll

deleteSelectedShape()

deleteSelectedShape(): Promise<PptxEditorSlidesResponse>;

Delete the currently selected supported root or nested drawing.

Returns

Promise<PptxEditorSlidesResponse>

Updated editor state.

Throws

PptxEditorError with invalid-selection, invalid-command, or render-failed.

Inherited from

BasePptxEditorSession.deleteSelectedShape

deleteShape()

deleteShape(handle: SourceHandle): Promise<PptxEditorSlidesResponse>;

Delete a supported root or nested drawing by stable source handle.

Parameters

handle

SourceHandle

Handle returned by shapes.

Returns

Promise<PptxEditorSlidesResponse>

Updated editor state.

Throws

PptxEditorError with invalid-command or render-failed.

Inherited from

BasePptxEditorSession.deleteShape

groupShapes()

groupShapes(shapeHandles: readonly SourceHandle[]): Promise<PptxEditorSlidesResponse>;

Group consecutive sibling drawings and select the new native group.

Parameters

shapeHandles

readonly SourceHandle[]

Stable handles in any order; document order determines group child order.

Returns

Promise<PptxEditorSlidesResponse>

Updated editor state with the new group selected.

Throws

PptxEditorError with invalid-command or render-failed.

Inherited from

BasePptxEditorSession.groupShapes

moveShapes()

moveShapes( shapeHandles: readonly SourceHandle[], destinationHandle: SourceHandle, options?: { beforeShapeHandle?: SourceHandle; }): Promise<PptxEditorSlidesResponse>;

Move consecutive sibling drawings to a root/native-group destination in the same part. Identity-mapped ancestor chains preserve each moved drawing’s rendered transform.

Parameters

shapeHandles

readonly SourceHandle[]

destinationHandle

SourceHandle

options?
beforeShapeHandle?

SourceHandle

Returns

Promise<PptxEditorSlidesResponse>

Inherited from

BasePptxEditorSession.moveShapes

moveShapesAcrossSlides()

moveShapesAcrossSlides( shapeHandles: readonly SourceHandle[], destinationSlideHandle: SourceHandle, options?: { beforeShapeHandle?: SourceHandle; }): Promise<PptxEditorSlidesResponse>;

Move consecutive non-placeholder shape/picture/connector roots to another slide.

Parameters

shapeHandles

readonly SourceHandle[]

destinationSlideHandle

SourceHandle

options?
beforeShapeHandle?

SourceHandle

Returns

Promise<PptxEditorSlidesResponse>

Inherited from

BasePptxEditorSession.moveShapesAcrossSlides

previewLayoutCatalogTarget()

previewLayoutCatalogTarget(handle: SourceHandle): Promise<PptxEditorTemplatePreviewResult>;

Render exactly one ordered-catalog master or layout without modifying editor state.

Missing and ambiguous handles are returned as stable failures. Unsupported render content is skipped and reported through stable conversion diagnostics. Runtime renderer failures use the existing PptxEditorError render-failed integration contract.

Parameters

handle

SourceHandle

Returns

Promise<PptxEditorTemplatePreviewResult>

Inherited from

BasePptxEditorSession.previewLayoutCatalogTarget

redo()

redo(): Promise<PptxEditorSlidesResponse>;

Reapply the latest undone history entry.

Returns

Promise<PptxEditorSlidesResponse>

Updated editor state.

Throws

PptxEditorError with empty-redo-stack or render-failed.

Inherited from

BasePptxEditorSession.redo

renderCurrentSlides()

renderCurrentSlides(): Promise<readonly PptxEditorSlideSvg[]>;

Rerender all current slides using the session render options.

Returns

Promise<readonly PptxEditorSlideSvg[]>

The updated SVG slide cache.

Throws

PptxEditorError with render-failed.

Inherited from

BasePptxEditorSession.renderCurrentSlides

response()

response(warnings?: readonly EditorCommandWarning[]): PptxEditorSlidesResponse;

Build a snapshot of the current rendered, history, selection, and warning state.

Parameters

warnings?

readonly EditorCommandWarning[]

Optional warnings emitted by the operation that produced the state.

Returns

PptxEditorSlidesResponse

The current public editor response.

Inherited from

BasePptxEditorSession.response

save()

save(): PptxEditorSaveResponse;

Serialize and validate the current document as PPTX bytes.

Returns

PptxEditorSaveResponse

Serialized bytes and current history state.

Throws

PptxEditorError with write-failed.

Inherited from

BasePptxEditorSession.save

selectShape()

selectShape(handle: SourceHandle): PptxEditorSlidesResponse;

Select a shape without changing the document or history.

Parameters

handle

SourceHandle

Handle returned by shapes.

Returns

PptxEditorSlidesResponse

Updated editor state.

Throws

PptxEditorError with invalid-selection.

Inherited from

BasePptxEditorSession.selectShape

shapes()

shapes(slideNumber: number): readonly PptxEditorShapeInfo[];

Inspect editable shape capabilities for one slide.

Parameters

slideNumber

number

PowerPoint-style 1-based slide number.

Returns

readonly PptxEditorShapeInfo[]

Shape information, or an empty array when the slide does not exist.

Inherited from

BasePptxEditorSession.shapes

undo()

undo(): Promise<PptxEditorSlidesResponse>;

Restore the document before the latest history entry.

Returns

Promise<PptxEditorSlidesResponse>

Updated editor state.

Throws

PptxEditorError with empty-undo-stack or render-failed.

Inherited from

BasePptxEditorSession.undo

ungroupShape()

ungroupShape(groupHandle: SourceHandle): Promise<PptxEditorSlidesResponse>;

Expand one losslessly ungroupable native group and select its first child in document order.

Parameters

groupHandle

SourceHandle

Stable handle of the native group.

Returns

Promise<PptxEditorSlidesResponse>

Updated editor state with the first expanded child selected.

Throws

PptxEditorError with invalid-command or render-failed.

Inherited from

BasePptxEditorSession.ungroupShape

updateThemeScheme()

updateThemeScheme(themeHandle: SourceHandle, input: UpdateThemeSchemeInput): Promise<PptxEditorSlidesResponse>;

Update selected color/font fields on one existing theme and rerender its master slides.

Parameters

themeHandle

SourceHandle

input

UpdateThemeSchemeInput

Returns

Promise<PptxEditorSlidesResponse>

Inherited from

BasePptxEditorSession.updateThemeScheme

create()

static create(input: Uint8Array, renderOptions?: PptxEditorRenderOptions): Promise<PptxEditorSession>;

Parse PPTX bytes, create a session, and render its initial slides.

Parameters

input

Uint8Array

PPTX binary data.

renderOptions?

PptxEditorRenderOptions = {}

Options reused for editor SVG rendering.

Returns

Promise<PptxEditorSession>

An initialized editor session.

Throws

PptxEditorError with read-failed or render-failed.

Overrides

BasePptxEditorSession.create