---
title: "Types: editor: Editor"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.reducto.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Types: editor: Editor

## `ComponentCommand`

Commands the custom-components layer sends; each is one undo step.

Import from `@reductoai/pptx/editor`.

```ts
type ComponentCommand = { componentType: string; fallback: ComponentFallback; id: string; placement?: ComponentPlacement; slide?: number; state: unknown; type: "insertComponent" } | { fallback?: ComponentFallback; key: string; state: unknown; type: "setComponent" }
```


## `EditorComponent`

A component definition with an optional live view; the return of `mount` unmounts it.

Import from `@reductoai/pptx-editor`.

| Name | Type | Description |
| --- | --- | --- |
| <a id="editorcomponent-type" data-search="EditorComponent.type"></a>`type` | <code>string</code> | Names the kind, such as "acme.kpi": letters, digits, '.', '_' and '-'. |
| <a id="editorcomponent-fallback" data-search="EditorComponent.fallback"></a>`fallback()` | <code>(state: S) =&gt; <a href="/office/pptx/api/types-editor-other#componentfallback">ComponentFallback</a> &#124; Promise&lt;<a href="/office/pptx/api/types-editor-other#componentfallback">ComponentFallback</a>&gt;</code> | What PowerPoint shows. Pure: same state, same fallback. Runs on every state change. |
| <a id="editorcomponent-mount" data-search="EditorComponent.mount"></a>`mount()?` | <code>(el: HTMLElement, ctx: <a href="/office/pptx/api/types-editor-other#componentcontext">ComponentContext</a>&lt;S&gt;) =&gt; void &#124; (() =&gt; void)</code> |  |
| <a id="editorcomponent-read" data-search="EditorComponent.read"></a>`read()?` | <code>(rows: string[][], stored: S) =&gt; S</code> | A table component's data lives in its cells, which a PowerPoint user may edit. `read` folds the cells back into the state; without it the stored state is taken as is. |


## `EditorMode`

Normal view edits slides; Slide Master view edits each master and its layouts.

Import from `@reductoai/pptx/editor`.

```ts
type EditorMode = "slides" | "masters"
```


## `EditorSelection`

What the editor has selected on its current slide.

Import from `@reductoai/pptx/editor`.

```ts
type EditorSelection = { kind: "none" } | { keys: string[]; kind: "objects" } | { anchor: Position; focus: Position; key: string; kind: "text"; story: string } | { anchor: GridCell; focus: GridCell; key: string; kind: "cells" }
```


## `EditorView`

Import from `@reductoai/pptx/editor`.

| Name | Type | Description |
| --- | --- | --- |
| <a id="editorview-align" data-search="EditorView.align"></a>`align?` | <code><a href="/office/pptx/api/types-editor-text-and-fonts#paragraphalign">ParagraphAlign</a></code> | The alignment the selected paragraphs share. |
| <a id="editorview-alttext" data-search="EditorView.altText"></a>`altText?` | <code><a href="/office/pptx/api/types-editor-text-and-fonts#alttextview">AltTextView</a></code> | The one selected object's alt text. |
| <a id="editorview-animation" data-search="EditorView.animation"></a>`animation?` | <code><a href="/office/pptx/api/types-editor-other#animationstate">AnimationState</a></code> | The selected shapes' animation, as the Animations tab shows it. |
| <a id="editorview-animations" data-search="EditorView.animations"></a>`animations?` | <code><a href="/office/pptx/api/types-editor-other#animationitem">AnimationItem</a>[]</code> | The current slide's main sequence in play order, as the Animation Pane lists it. |
| <a id="editorview-background" data-search="EditorView.background"></a>`background?` | <code><a href="/office/pptx/api/types-editor-slides-and-shows#backgroundview">BackgroundView</a></code> | The current page's background, as Format Background shows it. |
| <a id="editorview-cangroup" data-search="EditorView.canGroup"></a>`canGroup` | <code>boolean</code> |  |
| <a id="editorview-canpaste" data-search="EditorView.canPaste"></a>`canPaste` | <code>boolean</code> | Whether `paste` has shapes to add. |
| <a id="editorview-canredo" data-search="EditorView.canRedo"></a>`canRedo` | <code>boolean</code> |  |
| <a id="editorview-canundo" data-search="EditorView.canUndo"></a>`canUndo` | <code>boolean</code> |  |
| <a id="editorview-canungroup" data-search="EditorView.canUngroup"></a>`canUngroup` | <code>boolean</code> |  |
| <a id="editorview-caret" data-search="EditorView.caret"></a>`caret?` | <code><a href="/office/pptx/api/types-layout#rect">Rect</a></code> | Text mode: the caret, in its line's upright frame (`rot` turns it). |
| <a id="editorview-chart" data-search="EditorView.chart"></a>`chart?` | <code><a href="/office/pptx/api/types-editor-shapes-and-charts#chartview">ChartView</a></code> | The selected chart. |
| <a id="editorview-columns" data-search="EditorView.columns"></a>`columns?` | <code><a href="/office/pptx/api/types-editor-text-and-fonts#textcolumns">TextColumns</a></code> | The text columns and their spacing the selected shapes share. |
| <a id="editorview-comments" data-search="EditorView.comments"></a>`comments` | <code><a href="/office/pptx/api/types-editor-slides-and-shows#slidecomment">SlideComment</a>[]</code> | The current slide's comment threads, oldest first. |
| <a id="editorview-components" data-search="EditorView.components"></a>`components` | <code><a href="/office/pptx/api/types-editor-other#componentinfo">ComponentInfo</a>[]</code> | Custom components across the presentation, in slide and shape-tree order. |
| <a id="editorview-design" data-search="EditorView.design"></a>`design?` | <code>string</code> | The id of the master the current slide follows. |
| <a id="editorview-designs" data-search="EditorView.designs"></a>`designs` | <code><a href="/office/pptx/api/types-editor-other#designview">DesignView</a>[]</code> | Design > Themes, This Presentation: each master with its theme's name. |
| <a id="editorview-direction" data-search="EditorView.direction"></a>`direction?` | <code><a href="/office/pptx/api/types-editor-text-and-fonts#textdirection">TextDirection</a></code> | The Text Direction the selected shapes share. |
| <a id="editorview-gridspacing" data-search="EditorView.gridSpacing"></a>`gridSpacing` | <code>number</code> | The grid's spacing in points, from the view properties. |
| <a id="editorview-guides" data-search="EditorView.guides"></a>`guides` | <code><a href="/office/pptx/api/types-editor-slides-and-shows#guideview">GuideView</a>[]</code> | The page's drawing guides, in points from the top or left edge; its layout's and master's are `locked`. |
| <a id="editorview-ir" data-search="EditorView.ir"></a>`ir` | <code><a href="/office/pptx/api/types-layout#layoutdocument">LayoutDocument</a></code> | Every slide, one page each; a page is replaced when its slide changes. |
| <a id="editorview-layouts" data-search="EditorView.layouts"></a>`layouts` | <code><a href="/office/pptx/api/types-editor-slides-and-shows#layoutchoice">LayoutChoice</a>[]</code> | Every slide layout, master by master. |
| <a id="editorview-list" data-search="EditorView.list"></a>`list?` | <code><a href="/office/pptx/api/types-editor-other#liststate">ListState</a></code> | The bullet or number the selected paragraphs show, and whether their level can move. |
| <a id="editorview-markers" data-search="EditorView.markers"></a>`markers` | <code><a href="/office/pptx/api/types-layout#layoutline">LayoutLine</a>[]</code> | Bullets of the edited story's empty paragraphs; PowerPoint shows them only in edit mode. Painted like prompts. |
| <a id="editorview-masterpages" data-search="EditorView.masterPages"></a>`masterPages?` | <code><a href="/office/pptx/api/types-editor-slides-and-shows#masterpage">MasterPage</a>[]</code> | Slide Master view: what each page is. |
| <a id="editorview-mode" data-search="EditorView.mode"></a>`mode` | <code><a href="/office/pptx/api/types-editor-editor#editormode">EditorMode</a></code> |  |
| <a id="editorview-notes" data-search="EditorView.notes"></a>`notes` | <code>string</code> | The current slide's speaker notes; "" in Slide Master view. |
| <a id="editorview-objects" data-search="EditorView.objects"></a>`objects` | <code><a href="/office/pptx/api/types-layout#slideobject">SlideObject</a>[]</code> | The current slide's shapes, back to front. |
| <a id="editorview-painter" data-search="EditorView.painter"></a>`painter?` | <code><a href="/office/pptx/api/types-editor-other#painterstate">PainterState</a></code> | Format Painter holds a format; the host paints it on the next selection. Esc drops it. |
| <a id="editorview-picture" data-search="EditorView.picture"></a>`picture?` | <code><a href="/office/pptx/api/types-editor-shapes-and-charts#pictureview">PictureView</a></code> | The one selected picture's crop and transparency. |
| <a id="editorview-presenting" data-search="EditorView.presenting"></a>`presenting` | <code>boolean</code> | A slide show is running (`present`). |
| <a id="editorview-prompts" data-search="EditorView.prompts"></a>`prompts` | <code><a href="/office/pptx/api/types-layout#layoutline">LayoutLine</a>[]</code> | The prompts of the slide's empty placeholders ("Click to add title"), laid out like their text. A host paints them over the slide; they are not part of it, so thumbnails leave them out. |
| <a id="editorview-revision" data-search="EditorView.revision"></a>`revision` | <code>number</code> | Bumped on every change to the document. |
| <a id="editorview-sections" data-search="EditorView.sections"></a>`sections` | <code><a href="/office/pptx/api/types-editor-slides-and-shows#sectionview">SectionView</a>[]</code> | The deck's sections in order; empty when it has none or in Slide Master view. |
| <a id="editorview-selection" data-search="EditorView.selection"></a>`selection` | <code><a href="/office/pptx/api/types-editor-editor#editorselection">EditorSelection</a></code> |  |
| <a id="editorview-selectionrects" data-search="EditorView.selectionRects"></a>`selectionRects` | <code><a href="/office/pptx/api/types-layout#rect">Rect</a>[]</code> |  |
| <a id="editorview-shapestyle" data-search="EditorView.shapeStyle"></a>`shapeStyle?` | <code><a href="/office/pptx/api/types-editor-shapes-and-charts#shapestylestate">ShapeStyleState</a></code> | The fill and outline the selected shapes share, resolved through their style and theme. |
| <a id="editorview-slide" data-search="EditorView.slide"></a>`slide` | <code>number</code> |  |
| <a id="editorview-slides" data-search="EditorView.slides"></a>`slides` | <code><a href="/office/pptx/api/types-editor-slides-and-shows#slidemeta">SlideMeta</a>[]</code> | Per slide, in deck order; empty in Slide Master view. |
| <a id="editorview-slidesize" data-search="EditorView.slideSize"></a>`slideSize` | <code>&#123; height: number; width: number &#125;</code> | The slide size in points. |
| <a id="editorview-snaptogrid" data-search="EditorView.snapToGrid"></a>`snapToGrid` | <code>boolean</code> | Grid and Guides > Snap objects to grid. |
| <a id="editorview-spacing" data-search="EditorView.spacing"></a>`spacing?` | <code><a href="/office/pptx/api/types-editor-text-and-fonts#paragraphspacing">ParagraphSpacing</a></code> | The line spacing and space before and after the selected paragraphs share. |
| <a id="editorview-table" data-search="EditorView.table"></a>`table?` | <code><a href="/office/pptx/api/types-editor-tables#tableview">TableView</a></code> | The table the selection is in. |
| <a id="editorview-textbox" data-search="EditorView.textBox"></a>`textBox?` | <code>Partial&lt;<a href="/office/pptx/api/types-editor-text-and-fonts#textboxoptions">TextBoxOptions</a>&gt;</code> | The Format Shape > Text Box options the selected shapes share; one they differ on is absent. |
| <a id="editorview-theme" data-search="EditorView.theme"></a>`theme` | <code><a href="/office/pptx/api/types-editor-other#themeview">ThemeView</a></code> | The colour and font schemes of the current page's master theme, as Design > Colors and Fonts mark them. |
| <a id="editorview-themecolors" data-search="EditorView.themeColors"></a>`themeColors` | <code>string[]</code> | The current slide's theme as `#RRGGBB`, one per `THEME_PALETTE` column: what a `ShapeColor` theme colour paints. |
| <a id="editorview-transition" data-search="EditorView.transition"></a>`transition?` | <code><a href="/office/pptx/api/types-editor-other#transitionstate">TransitionState</a></code> | The current slide's transition, as the Transitions tab shows it; absent in Slide Master view. |
| <a id="editorview-verticalalign" data-search="EditorView.verticalAlign"></a>`verticalAlign?` | <code><a href="/office/pptx/api/types-editor-text-and-fonts#textanchor">TextAnchor</a></code> | Where the text sits in the selected shapes or cells, when they share it. |


## `Keybinding`

Import from `@reductoai/pptx-editor`.

| Name | Type | Description |
| --- | --- | --- |
| <a id="keybinding-args" data-search="Keybinding.args"></a>`args?` | <code>unknown</code> |  |
| <a id="keybinding-command" data-search="Keybinding.command"></a>`command` | <code>string</code> | "-format.bold" removes the earlier bindings of that command (of `key` only, when given). |
| <a id="keybinding-hidden" data-search="Keybinding.hidden"></a>`hidden?` | <code>boolean</code> | Works, but is not shown or offered as the command's key. |
| <a id="keybinding-key" data-search="Keybinding.key"></a>`key?` | <code>string</code> | "mod+shift+k"; a chord is two presses: "mod+k mod+c". |
| <a id="keybinding-platform" data-search="Keybinding.platform"></a>`platform?` | <code><a href="/office/pptx/api/types-editor-other#platform">Platform</a></code> |  |
| <a id="keybinding-when" data-search="Keybinding.when"></a>`when?` | <code>string</code> |  |


## `KeybindingStore`

Not exported by name. You get it from the API.

| Name | Type | Description |
| --- | --- | --- |
| <a id="keybindingstore-load" data-search="KeybindingStore.load"></a>`load()` | <code>() =&gt; <a href="/office/pptx/api/types-editor-editor#userkeybindings">UserKeybindings</a> &#124; Promise&lt;<a href="/office/pptx/api/types-editor-editor#userkeybindings">UserKeybindings</a> &#124; null&gt; &#124; null</code> |  |
| <a id="keybindingstore-save" data-search="KeybindingStore.save"></a>`save()` | <code>(value: <a href="/office/pptx/api/types-editor-editor#userkeybindings">UserKeybindings</a>) =&gt; void &#124; Promise&lt;void&gt;</code> |  |
| <a id="keybindingstore-subscribe" data-search="KeybindingStore.subscribe"></a>`subscribe()?` | <code>(listener: (value: <a href="/office/pptx/api/types-editor-editor#userkeybindings">UserKeybindings</a> &#124; null) =&gt; void) =&gt; () =&gt; void</code> | Changes made elsewhere: another tab, another device. |


## `PptxCommand`

Every edit is one of these, so a test, a script and the UI drive the editor the same way.
Points are page hmm on the current slide.

Import from `@reductoai/pptx/editor`.

```ts
type PptxCommand = { slide: number; type: "goToSlide" } | { keys: string[]; type: "select" } | { extend?: boolean; type: "click"; x: number; y: number } | { type: "doubleClick"; x: number; y: number } | { at?: "start" | "end" | { x: number; y: number }; key: string; story?: string; type: "editText" } | { type: "escape" } | { frames: ({ key: string } & Frame)[]; type: "setFrames" } | { dx: number; dy: number; type: "nudge" } | { type: "deleteObjects" } | { frame: Frame; shape: GeometricShapeType; type: "addShape" } | { frame: Frame; type: "addLine" } & LineSpec | { type: "addFreeform" } & FreeformSpec | { frame: Frame; text?: string; type: "addTextBox" } | { at?: { x: number; y: number }; bytes: Uint8Array; size?: { height: number; width: number }; svg?: Uint8Array; type: "addPicture" } | { at?: { x: number; y: number }; bytes: Uint8Array; file?: Blob; poster: Uint8Array; size?: { height: number; width: number }; type: "addMedia" } | { type: "group" } | { type: "ungroup" } | { position: "BringToFront" | "SendToBack" | "BringForward" | "SendBackward"; type: "zOrder" } | { edge: AlignEdge; to?: ArrangeScope; type: "alignObjects" } | { by: number; type: "rotateObjects" } | { axis: DistributeAxis; type: "flipObjects" } | { color: ShapeColor | null; type: "shapeFill" } | { direction: GradientDirection; type: "shapeGradient"; variation: GradientVariation } | { type: "shapeGradient"; variation: null } | { edit?: GradientEdit; type: "shapeGradientFill" } | { bytes: Uint8Array; type: "shapePictureFill" } | { set: OutlinePatch; type: "shapeOutline" } | { axis: DistributeAxis; to?: ArrangeScope; type: "distributeObjects" } | { text: string; type: "insertText" } | { runs: PastedRun[]; type: "insertRuns" } | { code: number; font: string; type: "insertSymbol" } | { by?: DeleteUnit; type: "deleteBackward" } | { by?: DeleteUnit; type: "deleteForward" } | { extend?: boolean; move: CaretMove; type: "moveCaret" } | { extend?: boolean; type: "setCaret"; x: number; y: number } | { type: "selectAll" } | { end: number; start: number; story: string; type: "selectText" } | { format: TextFormat; type: "format" } | { type: "clearFormatting" } | { case: TextCase; type: "changeCase" } | { align: ParagraphAlign; type: "align" } | { kind: ListKind; type: "toggleList" } | { marker: ListMarker | null; type: "setList" } | { crop: CropInsets; type: "cropPicture" } | { aspect: PictureAspect; type: "pictureAspect" } | { mode: "fill" | "fit"; type: "pictureFit" } | { shape: GeometricShapeType; type: "changeShape" } | { type: "pictureTransparency"; value: number } | { recolor: PictureRecolor; type: "pictureRecolor" } | { bytes: Uint8Array; type: "changePicture" } | { set: ListFormat; type: "listFormat" } | { image: Uint8Array; type: "listPicture" } | { by: 1 | -1; type: "listLevel" } | { spacing: ParagraphSpacing; type: "paragraphSpacing" } | { anchor: TextAnchor; type: "verticalAlign" } | { direction: TextDirection; type: "textDirection" } | { count: number; spacing?: number; type: "textColumns" } | { options: Partial<TextBoxOptions>; type: "textBox" } | { type: "copy" } | { type: "cut" } | { type: "paste" } | { type: "duplicate" } | { after?: number; layout?: string; type: "addSlide" } | { layout: string; slides?: number[]; type: "setLayout" } | { slides?: number[]; type: "resetSlide" } | { slide?: number; type: "duplicateSlide" } | { slide?: number; type: "deleteSlide" } | { from: number; to: number; type: "moveSlide" } | { anchor: GridCell; focus: GridCell; key: string; type: "selectCells" } | { back?: boolean; type: "tab" } | { cols: number; frame?: Frame; rows: number; type: "addTable" } | { type: "tableInsert"; where: "above" | "below" | "left" | "right" } | { type: "tableDelete"; what: "rows" | "columns" | "table" } | { type: "mergeCells" } | { cols: number; rows: number; type: "splitCell" } | { color: string | null; type: "cellFill" } | { preset: BorderPreset; type: "cellBorders" } | { options: Partial<TableOptions>; type: "tableOptions" } | { id: string | null; type: "tableStyle" } | { margins: Partial<CellMargins>; type: "cellMargins" } | { settings: LinkSettings; type: "link" } | { type: "removeLink" } | { hidden: boolean; keys?: string[]; type: "hideObjects" } | { key: string; name: string; type: "renameObject" } | { end: ConnectorEnd; key: string; to: { key: string; site: number }; type: "glueConnector" } | { all?: boolean; settings: HeaderFooterSettings; slides?: number[]; type: "headerFooter" } | { height: number; scale?: SlideSizeScale; type: "slideSize"; width: number } | { scheme: ThemeColorSet; type: "themeColors" } | { scheme: ThemeFontSet; type: "themeFonts" } | { from: string; to: string; type: "replaceFont" } | { name?: string; slides?: number[]; template: Uint8Array | typeof OFFICE_THEME; type: "applyTemplate" } | { design: string; slides?: number[]; type: "applyDesign" } | { all?: boolean; fill: BackgroundFill; slides?: number[]; type: "slideBackground" } | { hidden: boolean; slides?: number[]; type: "backgroundGraphics" } | { preset: number | null; type: "shapeShadow" } | { orientation: GuideOrientation; position?: number; type: "addGuide" } | { id: number; position: number; type: "moveGuide" } | { id: number; type: "deleteGuide" } | { type: "centerGuides" } | { color: string; id: number; type: "guideColor" } | { snapToGrid?: boolean; spacing?: number; type: "gridSettings" } | { kind: EffectKind; preset: number | null; type: "shapeEffect" } | { type: "altText" } & AltTextPatch | { pen: Partial<TablePen>; type: "tablePen" } | { brush?: boolean; sticky?: boolean; type: "formatPainter" } | { type: "paintFormat" } | { type: "cancelFormatPainter" } | { axis: "col" | "row"; delta: number; edge: number; key: string; type: "resizeTrack" } | { axis: "col" | "row"; type: "distributeTracks" } | { axis: "col" | "row"; size: number; type: "trackSize" } | { mode: EditorMode; type: "setMode" } | { group?: string; slide?: number; text: string; type: "setNotes" } | { on: boolean; slide?: number; type: "present" } | { hidden: boolean; slide?: number; type: "hideSlide" } | { effect: TransitionEffect | "none"; option?: string; slides?: number[]; type: "transition" } | { slides?: number[]; type: "transitionTiming" } & TransitionTiming | { type: "applyTransitionToAll" } | { add?: boolean; effect: AnimationEffect | "none"; type: "animation" } | { option: string; type: "animationOption" } | { build: AnimationBuild; type: "animationBuild" } | { type: "animationTiming" } & AnimationTiming | { by: -1 | 1; type: "moveAnimation" } | { before?: number; name: string; type: "addSection" } | { index: number; name: string; type: "renameSection" } | { index: number; type: "removeSection"; withSlides?: boolean } | { from: number; to: number; type: "moveSection" } | { author: CommentAuthor; cell?: GridCell; key?: string; range?: CommentSpanRange; slide?: number; text: string; type: "addComment" } | { author: CommentAuthor; id: string; slide?: number; text: string; type: "replyComment" } | { id: string; slide?: number; text: string; type: "editComment" } | { id: string; slide?: number; type: "deleteComment" } | { id: string; resolved: boolean; slide?: number; type: "resolveComment" } | { scope: "slide" | "deck"; slide?: number; type: "deleteComments" } | { chartType: string; frame?: Frame; type: "addChart" } | { categories: string[]; group?: string; series: ChartSeriesData[]; type: "chartData" } | { chartType: string; type: "chartType" } | { group?: string; title: string | null; type: "chartTitle" } | { caches: ChartRefCache[]; group?: string; source?: ChartSource; type: "chartWorkbook"; visibleOnly?: boolean; workbook: Uint8Array } | { empty: ChartEmptyCells; type: "chartEmptyCells" } | { position: ChartLegend; type: "chartLegend" } | { on: boolean; type: "chartLabels" } | { group?: string; set: ChartDesignPatch; type: "chartDesign" } | { edit: ChartSeriesEdit; type: "chartSeries" } | { part: string; type: "chartPart" } | { group?: string; part?: string; set: ChartFormatPatch; type: "chartFormat" } | { type: "undo" } | { type: "redo" } | ComponentCommand
```


## `UserKeybindings`

Not exported by name. You get it from the API.

| Name | Type | Description |
| --- | --- | --- |
| <a id="userkeybindings-bindings" data-search="UserKeybindings.bindings"></a>`bindings` | <code><a href="/office/pptx/api/types-editor-editor#keybinding">Keybinding</a>[]</code> |  |
| <a id="userkeybindings-version" data-search="UserKeybindings.version"></a>`version` | <code>1</code> |  |

Source: https://docs.reducto.ai/office/pptx/api/types-editor-editor/index.mdx
