@pptx-editor.dev/core/editor

Functions (92)

animationEffectLabelKeyfunctionSource ↗

The i18n key of an effect's name: its preset, else its class.

declare function animationEffectLabelKey(effect: Pick<AnimationEffect, 'preset' | 'effectClass'>): `panel.animations.presets.${AnimationPreset}` | `panel.animations.classes.${AnimationEffect['effectClass']}`;

animationListPartsfunctionSource ↗

The effects that the pane lists as the main sequence, and the others.

declare function animationListParts(effects: readonly AnimationEffect[]): {
    readonly main: readonly AnimationEffect[];
    readonly other: readonly AnimationEffect[];
};

animationStartLabelfunctionSource ↗

When an effect starts, for its row (see [AnimationStartLabel](AnimationStartLabel)).

declare function animationStartLabel(effect: Pick<AnimationEffect, 'sequence' | 'step' | 'trigger' | 'triggerShapeName'>): AnimationStartLabel;

bindHistoryGroupfunctionSource ↗

Bind the native gesture events of element. A native color change commits the value. Range and repeat controls end on pointer release or cancel, or on key release, also outside the element. A control with no terminal event ends on the next activation, Escape, blur, or disposal. A terminal event closes the group after it propagates, so the final value joins the same group.

declare function bindHistoryGroup(editor: HistoryGroupHost, element: HTMLElement, config: HistoryGroupBindingOptions): HistoryGroupBinding;

canQueryLocalFontsfunctionSource ↗

Whether the browser offers the Local Font Access API.

declare function canQueryLocalFonts(): boolean;

chartAxisTitleLabelsfunctionSource ↗

The labels of the two axis title fields: category and value, or X and Y.

declare function chartAxisTitleLabels(format: ChartFormat): {
    readonly category: 'chartFormat.categoryAxisTitle' | 'chartFormat.xAxisTitle';
    readonly value: 'chartFormat.valueAxisTitle' | 'chartFormat.yAxisTitle';
};

chartColorCommandfunctionSource ↗

The setChartColor command of a pick in the color field of series or point index.

declare function chartColorCommand(index: number, pick: ColorPick): EditorCommand | null;

chartColorPickfunctionSource ↗

The pick of a color field for one series or point: auto for its automatic color.

chartColorPick: (entry: ChartColorEntry) => ColorPick

chartPaneCommandfunctionSource ↗

The setChartData command of one change to the chart's current data, or why the typed text is refused. Every series and category keeps its source, so formatting stays with it. A value that is the same as before still gives a command; the pane skips unchanged fields.

declare function chartPaneCommand(data: ChartData, change: ChartPaneChange): ChartPaneResult;

chartPaneNumericXfunctionSource ↗

Whether the categories of data are numbers that the tab checks: the X values of a scatter chart, unless the chart names them as text.

declare function chartPaneNumericX(data: Pick<ChartData, 'kind' | 'categories'>): boolean;

chartSeriesNotefunctionSource ↗

The note of a pie chart with more than one series: it draws the first one only.

declare function chartSeriesNote(format: ChartFormat, seriesCount: number): 'chartFormat.pieFirstSeries' | null;

chartTitleCommandfunctionSource ↗

The setChartFormat command of a typed title: an empty or blank title turns the title (or the axis title) off. Null when the text is what the chart shows already.

declare function chartTitleCommand(format: ChartFormat, field: 'title' | 'categoryAxisTitle' | 'valueAxisTitle', text: string): EditorCommand | null;

chartTypeChangeNotefunctionSource ↗

The note after a type change, when the new type drops what the user set: the colors move between series and points, or the axes and their titles go. Undo restores them. Null when the new type keeps everything.

declare function chartTypeChangeNote(before: ChartFormat, after: ChartFormat): 'chartFormat.typeChangeRemoved' | null;

chartTypeHintfunctionSource ↗

The hint before a type change: the chart has colors or axis titles that some types cannot keep. Null when it has none.

declare function chartTypeHint(format: ChartFormat): 'chartFormat.typeChangeHint' | null;

chartValueTextfunctionSource ↗

A value as its field shows it: empty for no value.

chartValueText: (v: number | null | undefined) => string

chromeControlForSlotfunctionSource ↗

The registry entry behind a slot, or null for an id the registry does not hold.

declare function chromeControlForSlot(slot: ChromeSlotId): ChromeControl | null;

chromeOfferedControlfunctionSource ↗

The control a slot shows in this build: its registry entry without the options whose result does not paint, and without an option group that has no option left. Pass editor to keep the rows that remove an effect the selection has (No Reflection, No Glow, No Soft Edges): removing an effect needs no renderer, so a community build can remove an effect that is in the file. No Shadow always stays, and it also removes an inner shadow. With the @pptx-editor.dev/pro/drawing module installed, or for a slot with no such option, it is the control itself. The same choices give the same object. The adapters read it again on each editor change and after each install (subscribeDrawingRenderers), so their menus follow the selection. A custom control does the same.

declare function chromeOfferedControl(slot: ChromeSlotId, control: ChromeControl, editor?: Pick<Editor, 'can'> | null): ChromeControl;

chromeOptionCheckedfunctionSource ↗

Whether a dropdown option is checked: the slot's value is the option, or, for a slot whose options have groups (Shape Effects), one of its space-separated choices. Use it in a host's own menu: chromeOptionChecked(cmd.value, 'shadow.outerTop').

declare function chromeOptionChecked(value: unknown, option: string): boolean;

chromeSlotIdsfunctionSource ↗

Every slot id, derived from the registry.

declare function chromeSlotIds(): ChromeSlotId[];

chromeSlotIsTogglefunctionSource ↗

Whether a slot's control is a two-state toggle that carries aria-pressed. It reads the registry's toggle flag, so an adapter never hand-lists the toggle slots.

declare function chromeSlotIsToggle(slot: ChromeSlotId): boolean;

collaborationPortfunctionSource ↗

The port over one store. Exported for the pro package's tests and for headless hosts.

declare function collaborationPort(store: PptxDocumentStore): CollaborationDocumentPort;

commandForSlotfunctionSource ↗

The fixed command behind a command slot, or null.

declare function commandForSlot(slot: ChromeSlotId): EditorCommand | null;

commandForSlotValuefunctionSource ↗

The command a value slot dispatches for a picked value, or null when the value is invalid. Most slots take the value of one of their options. font.size takes a number of points, or { step: 1 } / { step: -1 } for Increase and Decrease Font Size (the size list). The table border slots draw with the border pen of editor (tableBorderPen), or with the default pen when no editor is given.

declare function commandForSlotValue(slot: ChromeSlotId, value: unknown, editor?: Editor | null): EditorCommand | null;

commentInitialsfunctionSource ↗

The avatar text of a comment: its own initials (up to three characters), else the first letters of the first two words of the author's name, else "?".

declare function commentInitials(comment: {
    readonly initials: string;
    readonly author: string;
}): string;

compilefunctionSource ↗

Compile a command against a fresh batch over the store's package (or ctx.base). Throws CommandRefusal. A batch marked armedCaret holds a format armed at a caret for the text typed next: the editor keeps it as session state (caret-arm.ts) and commits it only with that text, so a host that compiles commands itself must not commit such a batch alone.

declare function compile(ctx: CommandContext, command: EditorCommand): {
    batch: OpBatch;
    effect: CommandEffect;
};

composeFontConfigurationfunctionSource ↗

Merge a base and any number of fragments into one frozen FontConfiguration.

A bare fragment IS a valid base, so the single-origin case is one argument: composeFontConfiguration(await loadDefaultFonts()). Pass extra fragments to layer origins, and set epoch/maxFontBytes/defaultFont on the base only when you need something other than the documented defaults.

- Sources dedupe first-wins by (family, weight, style), in argument order — base before fragments, earlier fragments before later ones. - Substitutions dedupe first-wins by their from face, in the same order, and every substitution whose from face has a direct source anywhere in the composition is dropped: a real face always beats a stand-in. - The result is frozen (arrays included); the byte arrays themselves are the callers' and are not copied here — the resource snapshot takes its own defensive copy.

declare function composeFontConfiguration(base: FontConfigurationBase, ...fragments: readonly FontConfigurationFragment[]): FontConfiguration;

composeFontOriginsfunctionSource ↗

Resolve a list of [FontOrigin](FontOrigin)s against one document's needs and merge them, first-wins in list order.

Origins resolve IN ORDER, one after another, and each is told which faces the ones before it can already paint ([FontResolutionRequest.resolvedFaces](FontResolutionRequest.resolvedFaces)). Sequential rather than a Promise.all, and that is a real cost — one extra origin's latency on the critical path — bought deliberately: composition is first-wins, so a later origin's copy of a face an earlier one supplied can never be used, and fetching it anyway spends the bytes twice and tells a font host which families the document uses for a result that gets thrown away. Order origins cheapest-first.

A resolver that ignores resolvedFaces still composes correctly; it just spends more.

ONE ORIGIN CANNOT SINK THE REST. An origin that throws, answers null, or answers something malformed is reported and skipped whole, and the origins around it still compose — an app that listed a flaky network origin behind a bundled one keeps the bundled faces. Skipped WHOLE: an answer is read completely before any of it is committed, so a half-ingested origin can never reach composition.

The result carries NO epoch: it is a fragment for the engine to stamp with the load sequence. A fixed epoch from here would label every document's byte set as the same one. undefined means no origin contributed anything, which is a normal answer — the document stays on the fixed measurer.

declare function composeFontOrigins(origins: readonly FontOrigin[], request: FontResolutionRequest, options?: ComposeFontOriginsOptions): Promise<FontConfigurationFragment | undefined>;

configuredDefaultFontFamilyfunctionSource ↗

The face a run with no authored font is measured and reported as: the configured default when it names a valid family, Calibri otherwise.

declare function configuredDefaultFontFamily(configuration?: FontCatalogConfiguration): string;

createBrowserAutomationHostfunctionSource ↗

An automation host over a live editor. Each batch writes to the editor's store as one undo step; selection operations read and move the reader's selection. The host does not save: the editor owns its document.

declare function createBrowserAutomationHost(editor: PptxEditorInstance): AutomationHost;

createCollaborationStatusTrackerfunctionSource ↗

Create a status tracker.

declare function createCollaborationStatusTracker(initial?: CollaborationStatus): CollaborationStatusTracker;

createFontSourcefunctionSource ↗

Turn font bytes you ALREADY hold into a FontSource — a file input, IndexedDB, a bundler import. loadFonts covers URLs; this covers everything else, so no caller has to hand-assemble the record or reach for a hashing helper.

Returns a typed failure instead of throwing when the descriptor or the bytes are unusable, matching loadFonts: one bad face degrades itself, never its neighbours.

declare function createFontSource(bytes: Uint8Array, request: FontFaceRequest & {
    readonly faceIndex?: number;
}, options?: {
    readonly id?: string;
    readonly maxFontBytes?: number;
}): {
    readonly source: FontSource$1;
} | {
    readonly failure: FontLoadFailure;
};

createPptxEditorfunctionSource ↗

Create an editor. Load a document with options.document or load(bytes).

declare function createPptxEditor(options?: PptxEditorOptions): PptxEditorInstance;

currentSlideSummaryfunctionSource ↗

The slides entry of the slide or template on the canvas. In the slide master view, currentSlide is a template index, not a position in slides, so slides[currentSlide] is undefined there: read the current entry with this function.

declare function currentSlideSummary(snapshot: Pick<EditorSnapshot, 'currentSlide' | 'slides'>): SlideSummary | undefined;

customFontsfunctionSource ↗

Supply application fonts without manual resolver wiring.

Loads all listed faces when the editor resolves fonts, including families the document does not use yet. This makes company fonts available in the font picker for new documents. Faces supplied by earlier origins are skipped by family, weight, and style; family matching ignores case. URLs always come from sources, never from document text.

Uses [loadFonts](loadFonts) for validation, optional hash checks, and browser caching. The editor registers the returned bytes under private aliases. This function does not change the document's selected fonts or register page-wide family names.

Constructing the resolver does not fetch. Cancellation of the document load rejects with signal.reason, without warnings or onFailure calls. Other face failures are reported once per resolution, and successful faces remain available to the editor.

ts const fonts = useFonts( customFonts({ sources: companyFontFiles, onFailure: reportFontFailure }), packagedFonts(), googleFonts(), );

Use [loadFonts](loadFonts) directly to load every listed face eagerly.

declare function customFonts(options: CustomFontsOptions): CustomFontsResolver;

deferFontsfunctionSource ↗

Load an origin's faces after the document first paints, instead of before.

The editor opens the document with the faces the other origins supply, then lays it out again when these arrive. Use it for faces that are large or slow to fetch. Leave an origin unwrapped to install its faces with the document's other waiting fonts: a large document (over about 512 KB of uncompressed content) waits up to 2 seconds for them before its first paint.

ts const fonts = [packagedFonts(), deferFonts(myBrandFonts())];

A document export that receives this origin waits for its faces, so exported pages use them. The faces never change the configuration settings, such as defaultFont or maxFontBytes: those come from the origins that answer at once, so the document does not change its default font after it paints.

declare function deferFonts(origin: FontOrigin): MarkedFontResolver;

defineFontResolverfunctionSource ↗

Mark a function as an on-demand [FontResolver](FontResolver).

Wrap every resolver you put in a fonts list — useFonts(...), useDocxSource's fonts option, composeFontOrigins. The fonts PROP needs no marking, because a function there is always a resolver; a list also accepts the older zero-argument loader form ({ fonts: defaultFonts }), and this is what keeps the two apart.

Returns the same function object, mutated, so the mark survives being passed around and a marked resolver stays === to itself. It does NOT survive .bind() or being wrapped: both make a new function object. Re-mark the result.

ts const brandFonts = defineFontResolver(async ({ families }) => ({ sources: await loadMine(families), }));

Throws a TypeError on a frozen or sealed function, which cannot take the mark. That is deliberate: returning it unmarked would compile — the return TYPE says marked — and then lose every font at runtime.

declare function defineFontResolver<T extends FontResolver>(resolve: T): MarkedFontResolver<T>;

drawingClipboardPayloadfunctionSource ↗

Turn a DrawingML clipboard package into this editor's shape clipboard payload, to paste with the paste command. The package is the bytes of the system clipboard type in [DRAWING_CLIPBOARD_TYPES](DRAWING_CLIPBOARD_TYPES), which presentation applications write for copied shapes. Shapes, pictures, connectors, groups, and tables convert; charts, diagrams, and embedded objects need parts that do not travel and stay behind. Returns null when the bytes are not such a package, hold no shape that converts, or exceed the limits of a paste. The bytes are untrusted: the package reads within size limits, and the paste validates the payload again.

declare function drawingClipboardPayload(bytes: Uint8Array): ClipboardPayload | null;

editorHostDocumentfunctionSource ↗

The document that editor's slide is mounted in: an iframe's when the host mounted the editor there, else the page's own. Before the slide mounts, the page's document. Null with no DOM, as during server rendering.

declare function editorHostDocument(editor: object): Document | null;

embeddedFontSourcesfunctionSource ↗

Decode the presentation's embedded fonts in memory, honoring embedding permissions.

declare function embeddedFontSources(pkg: PptxPackage): {
    sources: FontSource[];
    refused: string[];
};

exportSlidePngfunctionSource ↗

Slide index as a PNG of options.width pixels (default 1920), drawn from the editor's own paint. It waits for the slide's EMF and WMF pictures (session.picturesReady); one that is not ready after options.picturesTimeoutMs (default 30 seconds) draws as the placeholder. To know whether every picture draws, await picturesReady first. Rejects with a CommandRefusal (errors.exportSize, errors.exportFailed).

declare function exportSlidePng(session: DocumentSession, index: number, options?: SlideImageOptions): Promise<Blob>;

exportSlidesPngZipfunctionSource ↗

Every slide as a PNG in one ZIP archive (slide-01.png, slide-02.png, …), written by the package's bounded ZIP writer.

declare function exportSlidesPngZip(session: DocumentSession, options?: SlideImageOptions): Promise<Uint8Array>;

exportSlideSvgfunctionSource ↗

Slide index as a standalone SVG document. See the file comment for the fonts it holds. An EMF or WMF picture exports as the placeholder until it has converted: await session.picturesReady(index) first.

declare function exportSlideSvg(session: DocumentSession, index: number, options?: SlideImageOptions): string;

fitSlideToScreenfunctionSource ↗

Fit a slide into a screen, keeping its aspect ratio, centered. The box edges fall on whole device pixels (dpr), so the slide is sharp and the bars do not bleed.

declare function fitSlideToScreen(screenWidth: number, screenHeight: number, slideWidth: number, slideHeight: number, dpr?: number): SlideshowFit;

formattingBarChromeGroupsfunctionSource ↗

The groups the formatting bar shows: every group that is not contextual, without the controls marked defaultToolbar: false, and the contextual image group while every selected element is a picture (EditorSnapshot.image), as DOCX Editor's bar adds its image group for a selected drawing. The same array comes back for the same answer.

declare function formattingBarChromeGroups(image?: SelectedImageState | null): readonly ChromeGroup[];

galleryFormatfunctionSource ↗

The bullet format of a gallery key, or undefined for a key the gallery does not have.

declare function galleryFormat(gallery: readonly ListGalleryItem[], key: unknown): BulletFormat | null | undefined;

galleryKeyOffunctionSource ↗

The gallery key of a bullet format: none for no list, undefined when the gallery has no such item.

declare function galleryKeyOf(gallery: readonly ListGalleryItem[], state: BulletFormatRead | null | undefined): string | undefined;

imageMimefunctionSource ↗

The image MIME type a part name maps to, or undefined when the browser cannot draw it.

declare function imageMime(partName: string): string | undefined;

isCollaborationFailureCodefunctionSource ↗

True when value is a [CollaborationFailureCode](CollaborationFailureCode) member.

declare function isCollaborationFailureCode(value: string): value is CollaborationFailureCode;

isFontResolverfunctionSource ↗

Whether a value is a function marked by [defineFontResolver](defineFontResolver).

False for an unmarked function, which callers read as a zero-argument loader. Calling a resolver that way reads request.defaultFamily off undefined and throws, so the callers that make this choice say so rather than swallowing it — and the type-level mark on [MarkedFontResolver](MarkedFontResolver) is there to stop it reaching runtime at all.

declare function isFontResolver(value: unknown): value is MarkedFontResolver;

isTableChromeSlotfunctionSource ↗

Whether a slot is one of the table-only ones, as DOCX Editor's isTableChromeSlot.

declare function isTableChromeSlot(slot: ChromeSlotId): slot is TableChromeSlotId;

linkKindOffunctionSource ↗

The kind of a link draft: mailto: is email, #custom-show- a custom show, any other # form a slide, ./ and ../ a file, else a web address.

declare function linkKindOf(url: string): LinkKind;

listenPaneRequestsfunctionSource ↗

Listen for requests to show a side panel tab for editor. A mounted side panel listens and turns to the tab. Listen in your host too, to show the side panel when it is closed. While at least one listener is registered, the toolbar's Selection pane and Format shape controls are on. Returns the function that stops listening.

declare function listenPaneRequests(editor: object, open: (pane: SidePanelTab, request: PaneRequest) => void): () => void;

loadFontsfunctionSource ↗

Fetch app-specified font URLs into verified, cache-backed FontSources.

Fetches ONLY the URLs listed — never a default host or engine-chosen CDN — and never rejects for a per-source failure: the result carries every admitted source and a typed entry for every drop. Cancellation instead rejects with signal.reason. Compose the result with composeFontConfiguration.

declare function loadFonts(request: LoadFontsRequest): Promise<LoadFontsResult>;

mailtoPartsfunctionSource ↗

The address, subject, and other fields of a mailto: draft; any other draft gives none.

declare function mailtoParts(url: string): MailtoParts;

mailtoUrlfunctionSource ↗

The mailto: draft of an address, a subject, and the other fields of the link. The address and the subject are percent-encoded where needed, so their text cannot add other fields. An empty address gives an empty draft, which Apply cannot send.

declare function mailtoUrl(address: string, subject: string, rest?: string): string;

namedFamiliesfunctionSource ↗

Every family the deck names for measured text: run fonts, symbol fonts, bullet fonts, and the theme's font scheme. Cached per part identity, so an edit rescans only the parts it changed. After an edit that keeps the slide list, the count of the last package changes by the changed parts only, so a keystroke walks no other part. The result is the one a full pass gives.

declare function namedFamilies(pkg: PptxPackage): string[];

nextChartCategoryLabelfunctionSource ↗

The label of a new category: the next X value of a scatter chart with number X values, else fallback.

declare function nextChartCategoryLabel(data: Pick<ChartData, 'kind' | 'categories'>, fallback: string): string;

normalizeFontResolverResultfunctionSource ↗

Normalize an on-demand resolver answer that covers none of the requested families.

declare function normalizeFontResolverResult(result: FontConfigurationBase | null | undefined): FontConfigurationBase | undefined;

notesTextfunctionSource ↗

Speaker notes of slide index as plain text (paragraphs and line breaks as newlines).

declare function notesText(pkg: PptxPackage, index: number): string;

onEditorEventfunctionSource ↗

Call handler each time event happens on editor. Returns the unsubscribe function. The adapters' useEditorEvent hooks use it; a host without an adapter can call it too.

declare function onEditorEvent<E extends keyof PptxEditorEvents>(editor: EventSource, event: E, handler: PptxEditorEvents[E]): () => void;
```ts
const off = onEditorEvent(editor, 'rejection', (rejection) => console.warn(rejection.reason));
```

onEditorHostChangefunctionSource ↗

Call listener each time editor's slide moves to another document, as DOCX Editor's hostChange event. Returns the function that stops.

declare function onEditorHostChange(editor: object, listener: () => void): () => void;

openFailureReportfunctionSource ↗

Plain text that describes a refused open, for a person to copy and send with a support request: the code, the reason, the editor version, the browser, and the time. It holds no file content and no file name. The text is in English, for the support team that reads it, whatever the editor's locale. **Copy details** in PptxEditor.OpenFailure copies it.

declare function openFailureReport(failure: DocumentOpenFailure, context?: OpenFailureReportContext): string;

openPresentationfunctionSource ↗

Open .pptx bytes. Never throws for a malformed file: it returns the typed reason.

declare function openPresentation(bytes: Uint8Array, options?: OpenOptions): Promise<{
    ok: true;
    session: DocumentSession;
} | {
    ok: false;
    error: OpenError;
}>;

paintSlideshowSlidefunctionSource ↗

Paint slide index of a session for the show: an <svg> without editing hooks, with its text and the alt text of its pictures for assistive technology. The caller sizes it (see fitSlideToScreen). Returns null for a slide that does not exist.

declare function paintSlideshowSlide(doc: Document, session: DocumentSession, index: number, options?: SlideshowPaintOptions): SVGSVGElement | null;

parseChartValuefunctionSource ↗

The number a value field holds, null when it is empty, or undefined for other text.

declare function parseChartValue(text: string): number | null | undefined;

parseSecondsfunctionSource ↗

Seconds typed in a field, as milliseconds, or null when the text is not a number of seconds from 0 to 3,600. A comma is a decimal separator.

declare function parseSeconds(text: string): number | null;

queryLocalFontSourcesfunctionSource ↗

Read the regular, bold, italic, and bold italic faces of families from the computer. Must be called from a user gesture (a click). Font collections (.ttc) are skipped.

declare function queryLocalFontSources(families: readonly string[]): Promise<LocalFontsOutcome>;

readCommentThreadsfunctionSource ↗

The comment threads of a slide part, in file order: its legacy comments (ECMA-376 Part 1, 19.4), then its threaded comments. For hosts and modules that read a package without an editor. Text and names come from the file: show them as text.

declare function readCommentThreads(pkg: PptxPackage, slidePart: string): readonly CommentThread[];

registerCommentDraftfunctionSource ↗

Register the function that opens a new comment draft for editor. A mounted comments pane registers one; the New comment row of the canvas context menus calls the latest. A request made at most a second before, while no pane was mounted, reaches the opener now: the host showed the pane for it. Returns the function that unregisters.

declare function registerCommentDraft(editor: object, open: () => void): () => void;

requestCommentDraftfunctionSource ↗

Ask for a new comment draft. A mounted comments pane opens it. Otherwise the request asks for the **Comments** tab (requestPane), and the pane that mounts within a second opens it. Returns false when nothing can answer.

declare function requestCommentDraft(editor: object): boolean;

requestPanefunctionSource ↗

Ask to show the side panel tab pane for editor. Every listener hears it; the host decides what an answer means. Returns false when nothing listens. A listener that throws does not stop the others; the first error is thrown after all of them ran.

declare function requestPane(editor: object, pane: SidePanelTab, options?: {
    readonly focus?: boolean;
}): boolean;

resolveEditorModulesfunctionSource ↗

Resolve construction-time modules. The first module of each kind wins: two review or two collaboration modules is a configuration mistake, and merging them would leave neither author able to say which one runs. The second is ignored, not thrown, as in DOCX Editor.

declare function resolveEditorModules(modules: readonly EditorModule[] | undefined): EditorModuleRegistry;

reviewAuthorSlotColorfunctionSource ↗

The slot's color, as the token reference that every surface resolves through CSS.

declare function reviewAuthorSlotColor(slot: number): string;

ribbonContextActivefunctionSource ↗

Whether a contextual tab's context holds for snapshot.

declare function ribbonContextActive(snapshot: RibbonSelection, context: RibbonContext): boolean;

ribbonTabGroupsfunctionSource ↗

The groups of tab that the registry holds, in the tab's order. A picked group keeps only the picked controls. An id or a control the registry does not hold is skipped.

declare function ribbonTabGroups(tab: RibbonTab, groups?: readonly ChromeGroup[]): ChromeGroup[];

ribbonTabsfunctionSource ↗

The tabs to show for snapshot, with their groups: every tab with groups, and a contextual tab only while its context holds. The Quick Access Toolbar comes first.

declare function ribbonTabs(snapshot: RibbonSelection, groups?: readonly ChromeGroup[]): RibbonTabLayout[];

runToolbarCommandfunctionSource ↗

Run a slot's command (or its value command). Options come last, as in DOCX Editor: pass { historyGroup } to make the steps of one gesture (a slider drag) one undo step. A slot without a value takes undefined as its value.

declare function runToolbarCommand<K extends ChromeSlotId>(editor: Editor | null, id: K, value?: ToolbarSlotValue<K>, options?: EditorExecOptions): CommandResult;
```ts
const drag = editor.beginHistoryGroup();
runToolbarCommand(editor, 'font.size', 20, { historyGroup: drag });
runToolbarCommand(editor, 'font.size', 24, { historyGroup: drag });
drag.end(); // one undo step
```

safeParticipantColorfunctionSource ↗

The participant color if it is a plain hex color; anything else falls back to CSS.

declare function safeParticipantColor(value: string | undefined): string | undefined;

secondsTextfunctionSource ↗

Milliseconds as seconds for a field: two decimals at most, no trailing zeros.

declare function secondsText(ms: number): string;

shapePreviewfunctionSource ↗

The preview of a preset, from its spec geometry. Null for an unknown preset.

declare function shapePreview(preset: string): ShapePreview | null;

slideLinkChoicesfunctionSource ↗

The slide targets the form lists: the four jumps, then each slide by number.

declare function slideLinkChoices(slideCount: number): readonly string[];

slideLinkLabelfunctionSource ↗

The words for a slide link, such as "Slide 3" or "Next slide"; '' for any other draft.

declare function slideLinkLabel(t: Translate, url: string): string;

slideshowLinkAtfunctionSource ↗

The hyperlink under a slide point (EMU), as a URL safe to open, or null. Only text links (a:hlinkClick on a run) count. An external target passes sanitizeHref, which withholds any scheme other than http(s), mailto, tel, and ftp; a relative path (a link to another file) and a program link give null. A custom show link gives null: the show does not run it. A link to a slide of the deck comes back in its # form (#slide-3, #next-slide), for followSlideshowLink.

declare function slideshowLinkAt(session: DocumentSession, index: number, x: number, y: number): string | null;

slideshowShortcutfunctionSource ↗

The show a key starts, by the slide show shortcuts: F5 and Ctrl/Cmd+Shift+Enter from the start; Shift+F5 and Ctrl/Cmd+Enter from the current slide. Null for any other key.

declare function slideshowShortcut(event: SlideshowKey): 'start' | 'current' | null;

substituteFamiliesForfunctionSource ↗

The substitute families a deck needs: every typeface it names, plus the Arial fallback.

declare function substituteFamiliesFor(pkg: PptxPackage): DefaultFamily[];

tableBorderPenfunctionSource ↗

The border pen of editor (snapshot.tableBorderPen), or the default pen.

declare function tableBorderPen(editor: Editor | null | undefined): TableBorderPen;

tableChromeVisiblefunctionSource ↗

Contextual table chrome shows while the engine reports a table, as DOCX Editor's.

declare function tableChromeVisible(table: TableContext | null | undefined): boolean;

textClipboardParagraphsfunctionSource ↗

DrawingML paragraphs for the pasteText command, from clipboard HTML or plain text: HTML keeps its formatting as a paste from another application does. Use it to paste text from your own code. HTML is read up to 4 MB and 5,000 paragraphs; nothing in it runs or loads. Returns an empty array when there is no text.

declare function textClipboardParagraphs(source: {
    readonly html?: string;
    readonly text?: string;
}): ClipboardNode[];

toolbarCommandStatefunctionSource ↗

Enabled and active state of a slot: the ONE source of truth for both.

declare function toolbarCommandState(editor: Editor | null, id: ChromeSlotId): ToolbarCommandState;

transitionKindLabelKeyfunctionSource ↗

The i18n key of a transition kind.

transitionKindLabelKey: (kind: SlideTransitionState["kind"]) => `panel.animations.kinds.${SlideTransitionState["kind"]}`

translateKeyOrTextfunctionSource ↗

Translate a key that arrives as a plain string, such as an engine refusal reason. A string that is not a catalog key shows as itself, as the translator shows any gap. Use it to show useEditorCommand(slotId).disabledReason in your own chrome.

declare function translateKeyOrText(t: Translate, key: string, params?: TranslationParams): string;

withFontOriginfunctionSource ↗

Add a font origin after the host's current fonts, as the next origin in first-wins order. The host's faces keep precedence; the added origin answers only for what they leave open. Pass the result to setFonts, for example editor.setFonts(withFontOrigin(editor.fonts, sources )).

declare function withFontOrigin(current: EditorFontsOption | undefined, added: FontOrigin): EditorFontsOption;

Classes (5)

CommandRefusalclassSource ↗

Thrown inside a command builder to abort the whole transaction with a reason.

declare class CommandRefusal extends Error
MemberTypeSummary
(constructor)Constructs a new instance of the `CommandRefusal` class
detail?string | undefined
reasonstring

DocumentSessionclassSource ↗

declare class DocumentSession
MemberTypeSummary
(constructor)Constructs a new instance of the `DocumentSession` class
batchA batch over the store's package, or over `base` (a preview the store has not committed), that keeps new part names unique in this session.
disposeRelease blob URLs.
facesreadonly RegisteredFace[]Registered faces, for paint registration. Replaced when the host faces change.
fontGenerationnumberBumped every time the face set changes.
fontReportFontReport
idstringIdentifies this open document (clipboard payloads carry it).
imageSize(sourcePart: string, rId: string) => { cx: number; cy: number; } | undefinedThe natural size of an image relationship in EMU, from its header and resolution, at 72 DPI when it states none: the size of a tiled picture. The stored pixels count, not a JPEG's EXIF orientation. An EMF or WMF picture has the size of its frame. Paint uses it for tiled pictures, and Crop Fill and Fit for the aspect ratio. Undefined for an external target or an unreadable header.
imageUrl(sourcePart: string, rId: string) => string | undefinedA URL for an image relationship. Internal parts only: an external target is never fetched. Blob URLs are created lazily and revoked by `dispose()`.
infoPresentationInfo
layoutLayout of slide `index` at the current revision, or of a template index in the slide master view (`slideRefAt`). A slide whose part, layout, master, theme, and the other parts it reads are unchanged keeps its layout object across edits elsewhere (`slideDependencies`), so its thumbnail and its paint are reused too.
layoutOfLayout of slide `index` over a package that is not committed (a preview); not cached.
measurerTextMeasurerThe measurer in force. Replaced when the host faces change.
picturesReadyWaits until the EMF and WMF pictures of slide `index`, or of every slide when you omit it, have converted. Resolves `true` when all draw, also as a PNG from before a font change, and `false` when one cannot convert, for a slide that does not exist, or after the wait.
pictureStatusThe EMF and WMF pictures of slide `index`, or of every slide, each with its state.
storePptxDocumentStore
substitutedFamiliesFamilies the deck names that measure with a different family. Fixed-measurer sessions report none (they model no fonts).
substituteFamiliesreadonly DefaultFamily[] | nullThe families whose packaged substitutes the session loads; null when it loads none.
usedPartNamesReadonlySet<string>Every part name this session has held, case-folded the OPC way. New parts never take one, so a part name in the history, the clipboard, or a relationship always means one part.

EditorFontErrorclassSource ↗

Typed adapter error reported both through onFontError and accessible alert UI.

declare class EditorFontError extends Error
MemberTypeSummary
(constructor)Constructs a new instance of the `EditorFontError` class
codeEditorFontErrorCode
diagnostic?string
namestring
request?FontFaceRequest

OpBatchclassSource ↗

declare class OpBatch
MemberTypeSummary
(constructor)Constructs a new instance of the `OpBatch` class
armedCaretbooleanSet when a command formatted an empty run at a caret: a format armed for the text typed next. The editor keeps such a batch as session state and commits it with that text.
elementThe current element for an id in a part.
insertInsert and return the new element's id.
opsPptxOp[]
parentIdThe parent id of node `id` in a part, or undefined for the root or a missing node.
parentKindThe kind of the parent of node `id` (`grpSp` for a group), read without holding the parent: an edit after it writes in place. Undefined for the root or a missing node.
pkgPptxPackageThe working package after every op so far.
pushApply an op to the working package, or refuse the transaction.
pushAllApply many ops in one pass over the working package, or refuse the transaction. Each op still lands in `ops`, so the store re-applies the same ops; a bulk copy then costs one package update, not one for each part.
reservedPartNamesReadonlySet<string>Case-folded part names that new parts must not take.

SlideshowControllerclassSource ↗

Navigation state of one slide show. Create one per show; it ends itself (done) on Escape or after the end screen.

declare class SlideshowController
MemberTypeSummary
(constructor)Constructs a new instance of the `SlideshowController` class
blankToggle a black or white screen over the slide.
exitEnd the show.
firstThe first shown slide.
goToShow slide `index` (0-based), hidden or not, as for a typed number.
keyApply a key press. Returns true when the show used the key. Keys with Ctrl, Cmd, or Alt are left to the host.
lastThe last shown slide.
nextAdvance: leave a blank screen, else the next shown slide, else the end screen, else end.
previousGo back: leave a blank or end screen, else the previous shown slide.
stateSlideshowStateThe current state. The same object until something changes.
subscribeCall `listener` after every change. Returns the unsubscribe function.
updateThe deck changed while the show runs: keep the slide on show where it still exists.

Interfaces (163)

AltTextinterfaceSource ↗

The alt text of an element (p:cNvPr).

interface AltText
MemberTypeSummary
decorativebooleanMarked as decorative (the `adec:decorative` extension).
descriptionstring
titlestring

AnimationEffect_2interface

One effect of a slide, in the order the slide plays it.

interface AnimationEffect
MemberTypeSummary
delayMsnumberThe delay before the effect starts, in milliseconds.
durationMsnumber | nullHow long the effect plays, in milliseconds; null for an effect that is instant.
editablebooleanWhether the animation commands can change it.
effectClassAnimationClass
idstringThe effect's `p:cTn/@id`: the handle that the animation commands take.
nodeIdstring | nullThe node id of that shape on the slide, or null when the slide has no such shape.
paragraphs?{ readonly start: number; readonly end: number; }The paragraphs it animates (`p:pRg`, 0-based and inclusive), when it animates text.
presetAnimationPreset | nullThe preset, when it is one that `addAnimation` writes; otherwise null.
presetIdnumber | nullThe `presetID` of the effect, or null.
sequence'main' | 'interactive'The main sequence (`mainSeq`), or a sequence that a click on another shape starts (`interactive`). Only main sequence effects can be edited.
shapeIdstringThe `p:cNvPr/@id` of the shape it animates.
shapeNamestringThe name of that shape (`p:cNvPr/@name`), or an empty string.
stepnumber | nullThe click that starts it in the main sequence: 0 for effects that play when the slide starts, then 1, 2, and so on. Null for an interactive effect.
triggerAnimationTrigger
triggerShapeId?stringFor an interactive effect, the `p:cNvPr/@id` of the shape whose click starts it.
triggerShapeName?stringThe name of that shape, or an empty string.

BulletFormatMixedinterfaceSource ↗

What the selected paragraphs share when their bullet formats differ, so the Bullets and Numbering dialog opens on their list's tab and shows the values they have in common.

interface BulletFormatMixed
MemberTypeSummary
kindsreadonly ('bullet' | 'number' | 'picture' | 'none')[]The list kind of each selected paragraph, each kind once, in selection order.
sizePercentnumber | nullPercent of the text size, when every bullet and number has the same; otherwise null.
startAt?number | nullThe first number, when every numbered paragraph has the same; otherwise null. Absent when no paragraph is numbered.

BulletsDialogFieldsinterfaceSource ↗

Every field of the form. '' is a blank: the selected paragraphs differ.

interface BulletsDialogFields
MemberTypeSummary
bulletstringA Bullets gallery key, `current` (the paragraphs' own or a custom bullet), or `''`.
charstringThe bullet character, in its font's own code (`v` is the Wingdings star).
colorColorPickThe bullet or number color, as the color field picks it.
fontstringThe bullet font; `''` follows the text font.
kindBulletsDialogTabThe open tab: Bulleted or Numbered.
numberstringA Numbering gallery key, `current`, or `''`.
pictureUint8Array | nullA picture the user chose for a picture bullet (PNG, JPEG, or GIF bytes), or null.
sizePercentstringPercent of the text size.
startAtstringThe first number, 1 to 32767, as typed.

ChartColorEntryinterfaceSource ↗

The color of one series, or of one data point of a pie or doughnut chart.

interface ChartColorEntry
MemberTypeSummary
automaticColorChoiceThe theme color that the automatic color starts from, for a swatch.
colorColorChoice | nullThe color the chart part sets, or null for the automatic color.
namestringThe series name, or the category label of a pie or doughnut point.

ChartDatainterfaceSource ↗

The data of one chart: its categories and its series.

interface ChartData
MemberTypeSummary
categoriesreadonly ChartDataCategory[]
kindChartDataKind
seriesreadonly ChartDataSeries[]
workbook?ChartWorkbookStateOn read only: where the chart's workbook is. A write ignores it.

ChartDataCategoryinterfaceSource ↗

One category (or X value) of a chart.

interface ChartDataCategory
MemberTypeSummary
labelstringThe label, or the X value of a scatter chart as text.
source?numberOn read: the position of the category in the chart. On write: the category this one continues, so its data point formatting and data labels stay with it. Absent: a new category.

ChartDataSeriesinterfaceSource ↗

One series of a chart.

interface ChartDataSeries
MemberTypeSummary
namestringThe series name, as the legend shows it.
source?numberOn read: the position of the series in the chart. On write: the series this one continues, so its formatting stays with it. Absent: a new series, with automatic formatting.
valuesreadonly (number | null)[]One value for each category; `null` is a blank cell.

ChartFormatinterfaceSource ↗

The type and elements of a chart, as chartFormat reads them. A field is null when the chart type has no such element: a pie chart has no axes.

interface ChartFormat
MemberTypeSummary
axesboolean | nullWhether the chart shows its axes; null for a chart with no axes.
axisTitles{ readonly category: string | null; readonly value: string | null; } | nullThe axis titles, or null for no title; null for a chart with no axes.
colorsreadonly ChartColorEntry[]
colorsBy'series' | 'point'What `colors` and `setChartColor` color: each series, or each point of a pie chart.
dataLabelsbooleanWhether the chart shows a value label at each data point.
gridlinesboolean | nullWhether the value axis shows major gridlines; null for a chart with no axes.
legendChartLegendPosition
titlestring | nullThe title text, or null for no title. An automatic title reads as its series name.
typeChartType | nullThe chart type, or null for a type that `setChartType` does not write (3-D, stock).

ChartFormatChangeinterfaceSource ↗

The chart elements that setChartFormat changes. An absent field keeps its value. A title of null removes the title; a string sets its text and keeps its formatting.

interface ChartFormatChange
MemberTypeSummary
axes?boolean
categoryAxisTitle?string | null
dataLabels?boolean
gridlines?boolean
legend?ChartLegendPosition
title?string | null
valueAxisTitle?string | null

ChromeControlinterfaceSource ↗

One toolbar control.

interface ChromeControl
MemberTypeSummary
defaultToolbar?false`false` keeps this public slot composable (`Toolbar.Slot` in a host group or with `preset={false}`, menus, the ribbon) but leaves it out of the default formatting bar, as in DOCX Editor.
idstring
labelKeyTranslationKeyi18n key for the accessible name and tooltip.
optionGroups?readonly { readonly id: string; readonly labelKey: TranslationKey; }[]Submenus of a dropdown whose options have a `group` (Shape Effects: Shadow, Reflection, Glow, Soft Edges). The value names the chosen option of each group.
options?readonly { readonly value: string; readonly labelKey: TranslationKey; readonly labelParams?: Readonly<Record<string, string | number>>; readonly paths?: readonly string[]; readonly glyph?: string; readonly dialog?: ChromeDialogKey; readonly group?: string; }[]Dropdown options: value plus i18n label key (and optional icon).
pathsreadonly string[] | nullMaterial Symbols path data, or null for a picker.
shape?ChromeControlShape
stateChromeControlState
toggle?ChromeControlToggleHow the control shows its state; absent for an action.

ChromeGroupinterfaceSource ↗

One toolbar group.

interface ChromeGroup
MemberTypeSummary
contextual?booleanA group the formatting bar does not show: a menu places its slots (View Smart guides). The same flag as DOCX Editor's registry.
controlsreadonly ChromeControl[]
idChromeGroupId
labelKeyTranslationKey

ChromeMenuinterfaceSource ↗

One menu of the menu bar.

interface ChromeMenu
MemberTypeSummary
entriesreadonly ChromeMenuEntry[]
idChromeMenuId
labelKeyTranslationKey

ChromeMenuItemEntryinterfaceSource ↗

A row that runs one chrome slot.

interface ChromeMenuItemEntry
MemberTypeSummary
direct?trueFor a value slot without `value`: the row runs the slot's own command instead of opening its choices. The canvas menu's New slide adds a slide on the layout `newSlideLayout` picks.
kind'item'
labelKey?TranslationKeyA plain label for the row, in place of the slot's own label. A slot's label is a tooltip, and some fold a shortcut into the text; a menu shows the shortcut in its own column.
shortcutKey?TranslationKeyThe shortcut shown at the end of the row.
slotChromeSlotId
value?stringThe value a value slot runs with (`arrange.order` with `front`).

ChromeMenuSeparatorEntryinterfaceSource ↗

A line between groups of rows.

interface ChromeMenuSeparatorEntry
MemberTypeSummary
kind'separator'

ChromeMenuSubmenuEntryinterfaceSource ↗

A row that opens a nested panel of rows. It has no command of its own.

interface ChromeMenuSubmenuEntry
MemberTypeSummary
idstringA stable id, so a host can find the submenu.
itemsreadonly ChromeMenuEntry[]
kind'submenu'
labelKeyTranslationKey
pathsreadonly string[] | null

ClipboardNodeinterfaceSource ↗

A serialized element, structurally the store's NodeSpec.

interface ClipboardNode
MemberTypeSummary
attrs?readonly { ns: string; local: string; prefix?: string; value: string; }[]
children?readonly (ClipboardNode | { readonly text: string; })[]
localstring
nsstring
nsDecls?readonly { prefix: string; uri: string; }[]
prefix?string

ClipboardPayloadinterfaceSource ↗

The clipboard format for shapes (application/x-pptx-editor+json).

interface ClipboardPayload
MemberTypeSummary
documentstringThe session the shapes came from; pasting into it reuses its parts.
relationshipsreadonly ClipboardRelationship[]
shapesreadonly ClipboardNode[]
slidePartstringThe slide part the shapes came from; pasting onto it offsets them.
version1

ClipboardRelationshipinterfaceSource ↗

A relationship a copied shape uses, with the bytes of its target. A chart, a diagram, or an embedded object carries its own relationships in relationships. A web link carries its address in target and no bytes. A link to a slide names the slide part and carries no bytes; paste keeps it only in the presentation it came from.

interface ClipboardRelationship
MemberTypeSummary
base64string
contentTypestring
idstring
partstring
relationships?readonly ClipboardRelationship[]The relationships of the carried part.
target?stringThe address of an external link.
typestring

CollaborationDocumentPortinterfaceSource ↗

What the editor gives a collaboration session: the document as ops in and ops out. The session owns transport, ordering, and conflict handling; the port never reads the DOM or the clock.

interface CollaborationDocumentPort
MemberTypeSummary
applyRemoteApply a peer's ops as one transaction. It makes no local history entry and clears local undo and redo (undo restores snapshots and would revert the peer). A refusal is returned, never dropped, so the session can resynchronize.
applyRemotePartsPublish parts that a state-based replica rebuilt (`buildReplicaPart`), and drop `removed` parts, as one remote revision. Same history rule as `applyRemote`.
packageThe current package, for a session that bootstraps a room from the opened deck.
revisionThe store revision.
subscribeLocalLocal transactions with their ops, in commit order. Returns the unsubscribe function.

CollaborationFailureinterfaceSource ↗

One collaboration failure: a typed code plus optional free-form detail.

interface CollaborationFailure
MemberTypeSummary
codeCollaborationFailureCodeStable code for application logic.
detail?stringBounded diagnostic text for logs. Not a parsing contract.

CollaborationIdentityinterfaceSource ↗

Human or automation identity attached to authored collaboration transactions.

interface CollaborationIdentity
MemberTypeSummary
actorIdstringStable author id. Recorded on authored changes.
color?stringPresence color, a CSS color string.
namestringDisplay name.
role?'human' | 'agent'Whether a person or an automation made the change.

CollaborationLocalTransactioninterfaceSource ↗

One committed local change, as the replica sends it to its peers: an edit, an undo, or a redo. A state-based replica (the pro Yjs binding) diffs before and after over parts; an op-based one sends ops, which only edits carry.

interface CollaborationLocalTransaction
MemberTypeSummary
afterPptxPackageThe package after the change.
beforePptxPackageThe package before the change.
fromRevisionnumberThe store revision before the commit.
label?stringThe history label (`typing`, `move`), when the command set one.
merged?booleanTrue when the store merged this edit into the previous history entry (typing a word).
ops?readonly PptxOp[]The committed ops, in order. Absent for undo and redo, which restore snapshots.
origin'user' | 'undo' | 'redo'What made the change.
partsreadonly string[]Part names whose content changed.
toRevisionnumberThe store revision after the commit.

CollaborationModuleContributioninterfaceSource ↗

What a collaboration module contributes: the session the editor attaches.

interface CollaborationModuleContribution
MemberTypeSummary
sessionEditorCollaborationSessionA ready session. The host creates the room, then wraps it with `collaborationModule`.

CollaborationParticipantinterfaceSource ↗

One participant in a collaboration room.

interface CollaborationParticipant extends CollaborationIdentity
MemberTypeSummary
isLocalbooleanWhether this participant is the local editor.

CollaborationRemoteSelectioninterfaceSource ↗

A peer's selection, mapped onto this replica's node ids.

interface CollaborationRemoteSelection
MemberTypeSummary
actorIdstringThe peer's author id.
color?stringThe peer's presence color.
namestringThe peer's display name.
selectionCollaborationLocalSelectionWhat the peer selected.

CollaborationSelectionMoveinterfaceSource ↗

How a remote change moved this replica's published selection: to is from re-read through the room's relative positions, after DOCX Editor's CollaborationSelectionMove.

interface CollaborationSelectionMove
MemberTypeSummary
fromCollaborationLocalSelectionThe selection as it was published, on the ids before the change.
toCollaborationLocalSelectionThe same selection after the change, on the current ids.

CollaborationStatusSnapshotinterfaceSource ↗

Cached status read, as in DOCX Editor. Same reference until one of its fields changes.

interface CollaborationStatusSnapshot
MemberTypeSummary
failureCount?numberHow many failures this session has recorded. Absent from a session that does not count.
lastFailureCollaborationFailure | undefinedThe most recent `error` reason. Kept after the replica recovers.
reasonCollaborationFailure | undefinedWhy the replica holds `status`, or `undefined` when nothing is wrong.
recovering?booleanIn `error`, but the session heals by itself on the next clean update. Absent means false.
statusCollaborationStatusCurrent lifecycle state.

CollaborationStatusTrackerinterfaceSource ↗

A session's status state.

interface CollaborationStatusTracker
MemberTypeSummary
setSet the status. `recovering` marks an `error` the session heals by itself. Returns whether the snapshot changed.
snapshotThe cached snapshot: the same reference until a value changes.
statusThe current status.

ColumnsDialogFieldsinterfaceSource ↗

Every field of the form, as typed text. '' is a blank: the selected shapes differ.

interface ColumnsDialogFields
MemberTypeSummary
countstring
spacingstringInches.

CommandContextinterfaceSource ↗

Editor state a command compiles against.

interface CommandContext
MemberTypeSummary
active{ bold: boolean; italic: boolean; underline: boolean; strike: boolean; bullets: boolean; numbering: boolean; fontSize?: number; renderedFontSize?: number; fontSizeMixed?: boolean; superscript?: boolean; subscript?: boolean; }Formatting state for toggles (true when the selection is already bold, …).
author?stringThe author of new comments and replies when the command names none (`setAuthor`).
base?PptxPackageThe package to compile against instead of the store's: the preview of an armed format.
caretArm?booleanCompile a format that is already armed at the caret (`caret-arm.ts`): a caret inside a word arms too, as the arm was decided when it started. The editor sets it for its replays.
collaborating?booleanThe editor is in a collaboration room. A merge then keeps a hidden copy of the text it moves in each covered cell, so a peer's concurrent delete of the top-left cell cannot lose it.
pasteRepeat?numberHow many times in a row this payload has been pasted, counting this paste (1 = first).
probe?booleanOnly find out whether the command can run (`Editor.can`): skip the autofit re-measurement, which adds ops but never refuses. The ops of a probe are never committed.
readOnlyboolean
selectedSlides?readonly number[]The slides selected in the rail, ascending; always holds `slide`.
selectionEditorSelection
sessionDocumentSession
slidenumber
slideMaster?booleanThe slide master view is on: commands that act on slides are off (`master-view.ts`).
slideSorter?booleanThe Slide Sorter view is on: it shows no slide to put a new shape on.
translate?(key: string) => stringThe host's translator, for text a command writes into the deck (a section name).

CommandEffectinterfaceSource ↗

What a compiled command does to editor state besides the document.

interface CommandEffect
MemberTypeSummary
labelstring
selection?EditorSelection
slide?number
slides?readonly number[]The slides the rail selects after the command; `slide` is the current one among them.

CommentAuthorInputinterfaceSource ↗

Who writes a comment or a reply. Absent, the editor's author option (setAuthor) applies, then the collaboration identity. Without a name, the command is refused (disabled.noCommentAuthor).

interface CommentAuthorInput
MemberTypeSummary
author?stringThe display name, 1 to 255 characters.
date?stringISO 8601 date and time. Default: now, in UTC.
initials?stringInitials, up to 8 characters. Default: the first letters of the first two words.

CommentExpectinterfaceSource ↗

What a host showed of a comment, for a command that acts on it: pass the comment's author, date, text, and identity as the snapshot gave them. The editor refuses the command (errors.commentChanged) when the comment at commentId has another author or date.

A twin shares its GUID, author, and creation time with another comment of the slide, or, in the legacy format, its author and index. A twin's id holds its place among its twins (~<n>, or -<n> for a legacy comment). For an id with a place, the editor also compares the text (errors.commentChanged), and refuses the command when the comment has no twin left (errors.noComment): the id may have named the twin that is gone.

Without identity, an id with a place is also refused when another twin has the same text (errors.commentAmbiguous), and when it named another comment since the last snapshot (errors.commentChanged, until the next snapshot). With identity, the editor checks it instead. So a collaborator's edit of a comment without a twin never refuses yours.

Always pass identity. Without it, after the next snapshot, an old id can reach another twin with the same author, date, and text.

interface CommentExpect
MemberTypeSummary
authorstringThe author's display name, as `SlideComment.author` gave it.
date?stringThe date, as `SlideComment.date` gave it; absent when the comment has none.
identity?stringThe `identity`, as the snapshot gave it. With it, the editor refuses the command when the comment at `commentId` has another identity now: as the snapshot shows it for the current slide, and as the editor reads the slide's comments now for another slide. It tells apart twins, even twins with the same text.
textstringThe text, as `SlideComment.text` gave it.

CommentSnapshotinterfaceSource ↗

The comment fields of the editor snapshot (EditorSnapshot).

interface CommentSnapshot
MemberTypeSummary
activeComment?string | nullThe thread a comment marker or `selectComment` picked, or null.
commentAuthor?string | nullThe name that signs a new comment or reply: the editor's `author` option (`setAuthor`), else the collaboration identity's name, else null. With null, the editor refuses a new comment that names no author (`disabled.noCommentAuthor`).
comments?readonly CommentThread[] | nullThe current slide's comment threads, in file order. Null without a review module (`@pptx-editor.dev/pro`); the comment commands still work. Reference-stable while unchanged.

CommentTextRangeinterfaceSource ↗

A range of a shape's text, with the points that a text selection (EditorSelection) uses. A snapshot gives start before end. addComment takes the two points in either order.

interface CommentTextRange
MemberTypeSummary
endTextPointThe point after the last character of the range.
startTextPointThe first character of the range.

CommentThreadinterfaceSource ↗

A comment and its replies (EditorSnapshot.comments).

interface CommentThread extends SlideComment
MemberTypeSummary
anchorCommentAnchor
formatCommentFormat
repliesreadonly SlideComment[]The replies, oldest first.
resolvedbooleanWhether the thread is resolved. Always false for the `legacy` format, which has no state.

ComposeFontOriginsOptionsinterfaceSource ↗

Diagnostics hook for ordered font-origin composition.

interface ComposeFontOriginsOptions
MemberTypeSummary
onOriginFailure?(failure: FontOriginFailure) => voidFire-and-forget diagnostics; returned promises are observed but do not delay resolution.

ConnectionTargetinterfaceSource ↗

A connection site of a shape: the shape's node id and the site's index.

interface ConnectionTarget
MemberTypeSummary
indexnumberThe index of the site in the shape's geometry (`a:cxnLst`), from 0.
nodeIdstringThe node id of the shape, as `EditorSelection` names shapes.

ConnectorRouteinterfaceSource ↗

A connector's route and the shapes its ends glue to. Each field is optional: an absent field keeps the connector's current value.

interface ConnectorRoute
MemberTypeSummary
adjust?Readonly<Record<string, number>>The adjust values of the preset by guide name, in guide units (see `a:gd`).
end?ConnectionTarget | nullThe connection site the end glues to (`a:endCxn`); null unglues it.
preset?stringThe connector preset (`a:prstGeom/@prst`): `straightConnector1`, `bentConnector2` to `bentConnector5`, or `curvedConnector2` to `curvedConnector5`.
start?ConnectionTarget | nullThe connection site the start glues to (`a:stCxn`); null unglues it.

CustomFontsOptionsinterfaceSource ↗

Options for loading application fonts when the editor resolves its font configuration.

interface CustomFontsOptions extends Omit<LoadFontsRequest, 'signal'>
MemberTypeSummary
onFailure?(failure: FontLoadFailure) => voidReports each failed face. Defaults to a console warning. Cancellation does not call this handler.

CustomShowSummaryinterfaceSource ↗

A custom show of the deck (p:custShow, ECMA-376 Part 1, 19.2.1.7), for links.

interface CustomShowSummary
MemberTypeSummary
idnumberThe show's `id` in the file.
namestringThe show's name, on one line.

DateTimeStateinterfaceSource ↗

The date that the slides show (EditorSnapshot.dateTime).

interface DateTimeState
MemberTypeSummary
fixedbooleanTrue for fixed text; false for a date field.
textstringThe text that the date shows.

DiagramNodeStateinterfaceSource ↗

One node of the selected diagram, in outline order.

interface DiagramNodeState
MemberTypeSummary
editablebooleanWhether `setDiagramText` and typing can change the text: one drawing shape shows the text of this node alone.
levelnumber0 for a top-level node, 1 for its child, and so on.
nodestringThe data model id of the node (`dgm:pt/@modelId`).
textstringThe node's plain text: a newline between paragraphs and at each line break.

DocumentOpenFailureinterfaceSource ↗

A file the editor refused to open. It carries a stable code only, never the file's content or name. Each refusal is a new object, so a host can tell a second refusal of the same file from the first.

interface DocumentOpenFailure
MemberTypeSummary
codestringThe engine's reason, the same value as `EditorSnapshot.error` (`zip`, `xml`, `empty`).
reasonDocumentOpenFailureReasonThe group of `code` that picks the message.

DocumentSearchFindOptionsinterfaceSource ↗

Options of find.

interface DocumentSearchFindOptions extends FindOptions
MemberTypeSummary
selectFirst?booleanSelect the first match.

DocumentSearchStateinterfaceSource ↗

The state of a find session.

interface DocumentSearchState
MemberTypeSummary
activeIndexnumberThe index of the selected match, or `-1` when the selection is on no match.
activeMatchFindMatch | nullThe selected match, or null.
isPendingbooleanAlways false: the search runs at once. Kept for DOCX Editor's shape.
matchCaseboolean
matchesreadonly FindMatch[]Every match of `query`, in deck order: slides, then their notes.
querystringThe text to find.
truncatedbooleanAlways false: the engine returns every match. Kept for DOCX Editor's shape.
wholeWordboolean

EditorinterfaceSource ↗

The editor contract adapters render.

interface Editor
MemberTypeSummary
attach
beginHistoryGroupOpen a history group: every command run with it (`exec(command, { historyGroup })`) until `end()` is one undo step. Opening one creates no undo entry. Undo, redo, and a command with another handle or none split the step; a selection change does not. `load` and `destroy` close every handle. End it in a `finally` block, so a refused or throwing command does not leave it open.
canDry run: whether `exec` would apply. A closed or foreign `historyGroup` refuses.
copyThe selected shapes as a clipboard payload, or null when nothing is copyable.
destroy
detach
execRun a command. Pass `options.historyGroup` to make several commands one undo step. See [HistoryGroupOptions](HistoryGroupOptions).
focusGive the keyboard back to the slide, as DOCX Editor's `focus()`: the text caret for a text selection, else the slide surface. Host pickers call it after a pick.
goToSlide
loadOpen `bytes` in place of the current presentation. Resolves once the presentation can be edited. A long deck resolves when its first slide is ready (`options.startSlide`, or the first one) and opens the other slides in the background (`EditorSnapshot.pendingSlides`).
renderThumbnailPaint a slide thumbnail into a container. The first paint is synchronous, unless `options.defer` is set (see [RenderThumbnailOptions](RenderThumbnailOptions)). A container repaints when its slide changes, when the editor is idle.
saveThe presentation as `.pptx` bytes. The bytes own an `ArrayBuffer`, so `new Blob([bytes])` takes them as they are. A long deck still opening opens the rest first.
selectAllSelect every shape in the current scope (the slide or the entered group).
selectSlideClick slide `index` in the rail: `replace` selects only it (as `goToSlide`), `toggle` (Ctrl/Cmd+click) adds or removes it, and `range` (Shift+click) selects from the anchor to it. The clicked slide becomes current, unless a toggle removed it.
setMode
setZoom
snapshot
subscribe

EditorCaretinterfaceSource ↗

The caret: the text box that holds it, and a paragraph and an offset in that text box, as DOCX Editor's EditorCaret. cell names the table cell when the text box is a table, and diagramNode names the data model node when the text box is a diagram shape.

interface EditorCaret
MemberTypeSummary
cell?TableCellAddress
diagramNode?string
nodeIdstring
offsetnumber
paragraphnumber

EditorCollaborationSessioninterfaceSource ↗

A ready collaboration session, created by the host before mount. The member names follow DOCX Editor's EditorCollaborationSession; selection, history, and journal members arrive with the collaboration change.

interface EditorCollaborationSession
MemberTypeSummary
attachAttach to an opened document. Returns the detach function.
attachedbooleanWhether a document is attached.
canRedoWhether the session can redo.
canUndoCollaboration-owned history. When present, the editor's undo and redo go to the session, which undoes only this replica's own changes. Absent, local store undo stays the authority.
destroyLeave the room and release the transport.
documentIdstringThe room's document identity, chosen by the host before mount.
historySelectionThe selection the last `undo` or `redo` returns to: the selection published when that change was made, re-read against the current room. `null` when there is none.
identityCollaborationIdentityThe local author.
participantsEveryone in the room, the local participant included.
redoRedo this replica's last undone change. Returns false when there is nothing to redo, or when the step could not apply.
remoteSelectionMoveHow the last remote change moved this replica's published selection, or `null` when it did not. The editor follows it, so a caret stays on its character while a peer types before it.
remoteSelectionsPeers' selections, mapped onto this replica's node ids.
sessionIdstringThis replica's session identity. It must be unique per replica (per tab, not per user): the editor mints new relationship ids, part names, slide ids, and shape ids from it, so two replicas with one session id can mint one id twice.
setLocalSelectionPublish this replica's selection to the room. `null` clears it.
statusThe current replica state.
statusSnapshotStatus, reason, and last failure. Same reference until a value changes.
subscribeParticipantsListen to participant changes. Returns the unsubscribe function.
subscribeRemoteSelectionsListen to remote selection changes. Returns the unsubscribe function.
subscribeStatusListen to state changes, with the reason. Returns the unsubscribe function.
undoUndo this replica's last change. Returns false when there is nothing to undo, or when the step could not apply.

EditorFontSubstitutioninterfaceSource ↗

A family the deck names that renders with another face.

interface EditorFontSubstitution
MemberTypeSummary
familystring
metricCompatiblebooleanTrue when the substitute keeps the line breaks of the original font (same advance widths).
substitutestring

EditorModuleinterfaceSource ↗

One registered capability module. Registration is construction-time (createPptxEditor({ modules })) and fixed for the instance's lifetime.

interface EditorModule
MemberTypeSummary
collaboration?CollaborationModuleContributionAbsent, the editor stays single-user and local undo is the authority.
idstringDiagnostic identity (`'review'`, `'collaboration'`); not a dispatch key.
review?ReviewModuleContributionReview capability: the queue derivation and display modes.

EditorModuleRegistryinterfaceSource ↗

The resolved modules an editor instance dispatches over.

interface EditorModuleRegistry
MemberTypeSummary
collaborationCollaborationModuleContribution | nullThe first registered collaboration contribution, or null.
reviewReviewModuleContribution | nullThe first registered review contribution, or null.

EditorRejectioninterfaceSource ↗

A refused edit: the i18n key of the reason and an optional detail.

interface EditorRejection
MemberTypeSummary
detail?stringWhat the reason names, for the `{reason}` or `{detail}` placeholder.
noop?booleanTrue when the command had nothing to do (`disabled.nothingToUndo`, `disabled.nothingToRedo`, `disabled.noSelection`), not when an edit was refused. Chrome shows no notice for it.
reasonstringThe i18n key of the reason (`errors.*`, `disabled.*`).

EditorRemovalinterfaceSource ↗

A Delete that the user can undo: what it removed and how many.

interface EditorRemoval
MemberTypeSummary
countnumber
kind'shapes' | 'slides'
serialnumberGrows with each removal, so chrome tells two equal removals apart.

EditorSnapshotinterfaceSource ↗

interface EditorSnapshot extends CommentSnapshot
MemberTypeSummary
animationOrder?booleanWhether the canvas shows the order number of each effect on its shape (`showAnimationOrder`). A view setting, never saved. Absent reads as false.
animations?SlideAnimationsThe current slide's effects and transition. Optional: absent means the implementation does not edit animations.
canRedoboolean
canUndoboolean
chart?SelectedChartState | nullThe selected chart, while exactly one chart frame is selected; the chart controls show then. Optional: absent means the implementation does not edit chart data.
collapsedSections?readonly string[]The ids of the collapsed sections (`SlideSection.id`). A view setting, never saved.
currentSlidenumberThe slide on the canvas: an index into the deck's slides. In the slide master view, it is the template index of the layout or master on the canvas instead, not a position in `slides`; read the current entry with `currentSlideSummary`.
customShows?readonly CustomShowSummary[]The deck's custom shows, in file order; empty when it has none. A link can go to one (`#custom-show-<id>`). Reference-stable while they do not change. Optional: absent means the implementation does not report custom shows.
dateTime?DateTimeState | nullThe date (Insert Date and time), read as `footer` is: its text, and whether it is fixed text or a field. Null when no open slide shows one. Absent reads as null.
diagram?SelectedDiagramState | nullThe selected diagram, or the diagram that holds the caret. Absent: no diagram editing.
embeddedFontFacesnumber
equation?SelectedEquationState | nullThe selected equation, while one text box with one equation is selected.
error?string
fitZoomboolean
formatSelectionFormat | null
formatPainter?FormatPainterModeThe format painter. The surface shows the paintbrush cursor and the next selection made with the pointer takes the copied formatting while it is not `off`. Optional: absent means the implementation has no format painter.
geometrySelectionGeometry | null
image?SelectedImageState | nullThe selected pictures, while every selected element is a picture; the picture controls show then. Optional: absent means the implementation does not report pictures.
insertionsnumberHow many objects (shapes, lines, text boxes, pictures, tables) this editor inserted. A ribbon opens the new object's Format tab when the count grows.
isOpening?booleanWhether a deck is still on its way to its first painted slide (`status` is `loading`). Show an opening screen while it holds. It turns false when the first slide paints; that slide takes input while the others open (`pendingSlides`). Optional and additive: absent reads as `false`.
lastRejection?EditorRejection | nullWhy the last edit was refused, or null. Keyboard input, the clipboard, and commands set it when the editor does not apply them; the next applied edit clears it. Optional: absent means the implementation does not report refusals.
lastRemoval?EditorRemoval | nullThe last Delete of shapes or slides, while it is the newest edit: chrome offers to undo it. The next applied edit, an undo or redo, and opening a document clear it. Cut sets none. Optional: absent means the implementation does not report removals.
layouts?readonly SlideLayoutSummary[]The deck's slide layouts, masters in order and each master's layouts in order. Reference-stable while they do not change. Optional: absent means the implementation does not list layouts.
modeEditorMode
notesstring
notesFormatted?readonly NotesParagraph[]The current slide's notes as paragraphs of formatted runs; their text equals `notes`. Reference-stable while the notes do not change. Optional: absent means the implementation does not report notes formatting.
openFailure?DocumentOpenFailure | nullThe file the editor refused to open, or absent. A deck that was open before stays open (`status` stays `ready`); with no deck, `status` is `error`. It clears when the next file starts to open.
pendingSlides?numberHow many slides are still opening. A long deck shows its first slide and takes input while the other slides parse in the background; each one's summary carries `pending` until it is ready. Edits, undo, search, and save work before then: a slide that is needed parses at once, and `save` parses the rest first. Moves at most every 300 ms, and `selectionChange` fires when it does. Optional and additive: absent reads as 0.
presentationView?PresentationViewView Normal or Slide Sorter. Optional: absent means the implementation has only the normal view.
readOnlyReason?'damaged-slide' | nullWhy the open presentation is read-only, or `null`. `'damaged-slide'`: a long deck that opened and holds edits had a slide or a notes slide that did not parse. It stays on screen in view mode with its edits, and its other slides go on opening; commands, undo, `save()`, and automation writes are refused. `openFailure` stays `null`: the file did open. `change` fires once when it is set. It clears when the next file opens, and that file opens in the mode the host set (`setMode`): only `snapshot().mode` shows view meanwhile. Optional and additive: absent reads as `null`.
revisionnumber
sections?readonly SlideSection[]The deck's sections, in order; empty when it has none. Reference-stable while they do not change. Optional: absent means the implementation does not report sections.
selectedSlidesreadonly number[]The slides selected in the slide rail, ascending. Always holds `currentSlide`, except in the slide master view, where it is empty. Shift+click selects a range and Ctrl/Cmd+click adds or removes one slide (`selectSlide`).
selectionEditorSelection
shapes?readonly ShapeSummary[]The current slide's elements, top first, for the selection pane. Hidden elements are in the list. Optional: absent means the implementation has no selection pane.
slideBackgroundSlideBackgroundStateThe current slide's background.
slideHeightnumber
slideNumbersbooleanWhether the current slide shows its slide number (Insert Slide numbers).
slidesreadonly SlideSummary[]
slideWidthnumberSlide size in EMU.
smartGuidesbooleanWhether drags snap to smart guides (View Smart guides). On by default.
status'empty' | 'loading' | 'ready' | 'error'
substitutedFontsreadonly EditorFontSubstitution[]Named families rendered with another face; reference-stable while unchanged.
table?TableContext | nullThe table of the selection (a caret in a cell, a cell range, or the selected table frame), or null. Optional: absent means the implementation does not edit tables.
tableBorderPen?TableBorderPenThe table border pen: the line the Borders menu draws and the target it last drew (`setTableBorderPen`). Optional: absent means the implementation has no border pen.
themeColorsreadonly (readonly ThemeSwatch[])[]The current slide's theme colors in the layout of the color menus: the first row is the ten theme colors (Background 1, Text 1, Background 2, Text 2, Accent 1–6), and each later row one lighter or darker variant of every column. Empty with no document open; reference-stable while the theme and color map do not change.
zoomnumber

FindMatchinterfaceSource ↗

One match of a find. Offsets are UTF-16 offsets in the paragraph.

interface FindMatch
MemberTypeSummary
endnumber
nodeIdstringThe element the text belongs to: a `p:sp`, or the `p:graphicFrame` of a table.
paragraphnumber
partstringThe part that holds the text: the slide part, or the slide's notes part.
slidenumberThe slide index.
startnumber
textstringThe text the match covers.
txBodyIdstringThe text body: a shape's `p:txBody` or a table cell's `a:txBody`.
where'slide' | 'notes'`slide` for text on the slide (shapes, groups, table cells); `notes` for speaker notes.

FindOptionsinterfaceSource ↗

How find compares text.

interface FindOptions
MemberTypeSummary
matchCase?booleanMatch upper and lower case exactly.
wholeWord?booleanMatch whole words only: no letter, digit, or underscore touches either end.

FontConfigurationinterfaceSource ↗

Public font source configuration sampled when an adapter mounts. It must be immutable for that editor lifetime; remount the adapter to replace bytes or substitutions atomically.

interface FontConfiguration
MemberTypeSummary
defaultFont{ readonly family: string; readonly sizeHalfPoints: number; }
epochnumber
language?string
maxFontBytesnumber
sourcesreadonly FontSource[]
substitutions?readonly FontSourceSubstitution[]
supportedFamilies?readonly string[]Selectable provider families, independent of loaded bytes. Listing them performs no fetch.

FontConfigurationBaseinterfaceSource ↗

The base of a composition: everything a FontConfiguration carries, all optional. Omitted fields take the documented defaults (epoch 0, maxFontBytes at the engine hard maximum, defaultFont Calibri at 11pt — the default face and size).

interface FontConfigurationBase extends FontConfigurationFragment
MemberTypeSummary
defaultFont?FontConfiguration['defaultFont']The face used when a run names no font. Defaults to Calibri at 11pt.
epoch?numberIdentity of this configuration's byte set. The engine uses it to tell one resolved font set from another; leave it unset and the editor supplies the load sequence.
language?stringBCP-47 tag passed to the shaper for language-sensitive shaping.
maxFontBytes?numberPer-face byte ceiling. Defaults to the engine hard maximum; lower it to tighten intake.

FontConfigurationFragmentinterfaceSource ↗

A partial font configuration one origin contributes: sources, substitutions, or both. loadDefaultFonts() (the substitute package) and loadFonts() (the fetch helper) both return this shape, so every origin composes through composeFontConfiguration the same way.

interface FontConfigurationFragment
MemberTypeSummary
deferred?Promise<FontConfigurationFragment | undefined>Faces that arrive after the document first paints. The editor lays the document out with `sources` and `substitutions`, then lays it out again once this settles. Use it for large faces, such as CJK fonts, that would otherwise hold back the first paint.
sources?readonly FontSource[]
substitutions?readonly FontSourceSubstitution[]
supportedFamilies?readonly string[]Selectable provider families, independent of loaded bytes. Listing them performs no fetch.

FontDialogFieldsinterfaceSource ↗

Every field of the form. '' is a blank: the selected runs disagree.

interface FontDialogFields
MemberTypeSummary
allCapsCheckState
bystringPoints, without its sign: Expanded or Condensed gives the direction.
colorColorPickThe text always has a color, so the field opens at "no change".
doubleStrikeCheckState
fontFamilystring
kerningCheckState
kerningAtstringPoints and above.
offsetstringPercent, without its sign: Superscript or Subscript gives the direction.
sizestringPoints.
smallCapsCheckState
spacingSpacingChoice | ''
strikeCheckState
styleFontStyleChoice | ''
subscriptCheckState
superscriptCheckState
underlineUnderlineStyle | ''
underlineColorColorPick`auto`: the underline takes the text color (`a:uFillTx`, or no fill).

FontFaceRequestinterfaceSource ↗

A concrete font face requested by authored document content.

interface FontFaceRequest
MemberTypeSummary
familystring
style'normal' | 'italic'
weightnumber

FontFormatCommandinterfaceSource ↗

The fields of the Font dialog (Font and Character Spacing tabs), as setFontFormat takes them. An omitted field keeps each run's value. The same shape as ParagraphFormatCommand.

interface FontFormatCommand
MemberTypeSummary
baseline?numberOffset in percent of the font size, -100 to 100 (`baseline`): positive raises (superscript), negative lowers, 0 turns an inherited offset off.
bold?booleanBold (`b`).
caps?CapsStyleSmall caps or all caps (`cap`).
characterSpacingPt?numberPoints added after each character, -1584 to 1584 (`spc`); negative condenses.
color?ColorChoice | nullA color choice, or null for the inherited color.
fontFamily?stringThe Latin font (`a:latin`): a family name of 1 to 64 letters, digits, spaces, `-._+`.
fontSizePt?numberSize in points, 1 to 4000 (`sz`).
italic?booleanItalic (`i`).
kerningPt?number | nullKerning for fonts of this size in points and above, 0.01 to 1584 (`kern`, in hundredths); null turns kerning off, which the engine writes as `kern="0"`.
strike?StrikeStyleStrikethrough (`strike`): none, single, or double.
underline?UnderlineStyleThe underline style (`u`); `none` removes it.
underlineColor?ColorChoice | nullThe underline color (`a:uFill`), or null for the underline to take the text color (`a:uFillTx`, also over a list style that sets one).

FontFormatReadinterfaceSource ↗

The selected text as the Font dialog reads it: resolved values. A field is null when the selected runs disagree (disagrees says which), so a control can show a blank.

interface FontFormatRead
MemberTypeSummary
baselinenumber | nullPercent of the font size; positive is superscript.
boldboolean | nullBold.
capsCapsStyle | nullCapitals: none, small, or all.
characterSpacingPtnumber | nullPoints.
disagrees{ readonly fontFamily: boolean; readonly fontSizePt: boolean; readonly bold: boolean; readonly italic: boolean; readonly underline: boolean; readonly strike: boolean; readonly baseline: boolean; readonly caps: boolean; readonly characterSpacingPt: boolean; readonly kerningPt: boolean; readonly underlineColor: boolean; }Which fields differ between the selected runs.
fontFamilystring | nullThe Latin font (`a:latin`), resolved through the theme.
fontSizePtnumber | nullPoints.
italicboolean | nullItalic.
kerningPtnumber | nullPoints and above; null when kerning is off or the runs disagree (see `disagrees`).
strikeStrikeStyle | nullStrikethrough: none, single, or double.
underlineUnderlineStyle | nullThe underline style; `none` without an underline.
underlineColorstring | nullThe underline's own solid color, `#RRGGBB`; null when it takes the text color, when its fill is not solid (a gradient or a pattern), or when the runs disagree.

FontLoadFailureinterfaceSource ↗

One face that did not load, with whatever evidence the failure produced.

Non-fatal: [LoadFontsResult](LoadFontsResult) still carries every source that succeeded, and the affected family falls back to the engine's fixed measurement.

interface FontLoadFailure
MemberTypeSummary
actualHash?string
diagnostic?string
expectedHash?string
reasonFontLoadFailureReason
requestFontFaceRequest
status?numberHTTP status for `httpError`; hashes for `hashMismatch`.
urlstring

FontMeasurementStateinterfaceSource ↗

Which measurer the open deck's layout runs on, and whether the host's fonts are still on the way. Returned by [PptxEditorInstance.fontMeasurement](PptxEditorInstance.fontMeasurement), as in DOCX Editor.

interface FontMeasurementState
MemberTypeSummary
measurer'fixed' | 'shaped'`fixed` estimates advance widths; `shaped` measures real font bytes with HarfBuzz. It is `fixed` while no deck is open, and until the text engine and its faces arrive.
resolvingbooleanTrue while font work for the deck is still running: the text engine, the packaged substitutes, or faces the deck asked the `fonts` origins for. Late faces count for at most 10 seconds. The deck shows with stand-in faces meanwhile, and `substitutedFonts` stays empty, so a substitution notice does not show for fonts that are still loading.

FontOriginFailureinterfaceSource ↗

A failed font origin or a partial failure in an otherwise usable fragment.

interface FontOriginFailure
MemberTypeSummary
causeunknown
originIndexnumberZero-based position in the first-wins origin list.
originName?stringResolver function name when one is safely available.

FontPickerGroupinterfaceSource ↗

One group of the font picker, with its i18n heading key (toolbar.fontGroups.theme, toolbar.fontGroups.document, toolbar.fontGroups.all).

interface FontPickerGroup
MemberTypeSummary
idFontPickerGroupIdWhich group this is: the theme fonts, the fonts the deck uses, or the other fonts.
labelKeyTranslationKeyThe i18n key of the group heading; show it with `t(labelKey)`.
rowsreadonly FontPickerRow[]The rows of the group, in the order the picker shows them.

FontPickerRowinterfaceSource ↗

One row of the font picker, as useFontFamily().groups gives it. Pass value to useFontFamily().setValue.

interface FontPickerRow
MemberTypeSummary
disabledbooleanTrue on a theme row whose theme font is empty in the slide's theme: the row shows its role with no family and applies nothing. Only a host's `Item` gives such a row.
facestring | nullThe CSS value that draws the name in its own face (a quoted family), or null for a name that is not a valid family. A face that is not loaded falls back to the chrome font.
familystringThe family name the row shows.
roleKeyTranslationKey | nullThe i18n key of the theme role (`Headings`, `Body`), on theme font rows only.
theme'major' | 'minor' | nullThe theme font of a theme row, or null on a row that names a literal family.
valuestringWhat the row applies: the theme font reference (`+mj-lt`, `+mn-lt`) on a theme row, so the text follows a later theme change (ECMA-376 Part 1, 20.1.4.1.17 `latin`), else the family.

FontReportinterfaceSource ↗

Summary of the fonts a session uses, for the settings panel and the report.

interface FontReport
MemberTypeSummary
embeddedFacesnumber
facesreadonly { readonly family: string; readonly origin: string; }[]
refusedEmbeddedreadonly string[]
substituteFailuresreadonly SubstituteFontFailure[]Packaged substitute faces that failed to load. Text in those families measures and paints with another face, or with none.

FontResolutionRequestinterfaceSource ↗

What the document turned out to need, handed to an on-demand resolver.

The families are the ones the file actually names — already name-validated and capped, so a resolver may treat them as a list to look up, never as URLs or paths to build.

interface FontResolutionRequest
MemberTypeSummary
defaultFamilystringThe face a run naming no font resolves to, so a resolver can cover it too.
familiesreadonly string[]Families needed by the document, deduped and capped at [MAX_RESOLVER_FAMILIES](MAX_RESOLVER_FAMILIES). Order is deterministic but may express host priority; do not sort it before resolving.
resolvedFaces?readonly FontFaceRequest[]Faces an EARLIER origin in the same composition can already PAINT — either because it supplied the bytes, or because it mapped that face onto one it did supply.
signal?AbortSignalCancels document-scoped resolution; network-backed resolvers should pass it to fetch.

FontResolverMarkinterfaceSource ↗

The type-level half of the mark: what [defineFontResolver](defineFontResolver) adds to a function's type so a FontOrigin list can REQUIRE it.

Declared with a string key so @docx-editor.dev/fonts can declare an identical interface and have the two unify without importing anything from the engine. Set at runtime as well as in the type — non-enumerable, so it stays out of Object.keys and out of a host's own spread.

interface FontResolverMark
MemberTypeSummary
"docx-editor.dev/font-resolver"trueAlways `true`. Set non-enumerably by [defineFontResolver](defineFontResolver).

FontSourceinterfaceSource ↗

Immutable, byte-backed font face supplied to layout and browser paint.

interface FontSource
MemberTypeSummary
availability?'available' | 'forbidden'
bytesUint8Array
faceIndexnumber
hashstring
idstring
requestFontFaceRequest

FontSourceSubstitutioninterfaceSource ↗

An explicit authored-font substitution. No implicit platform fallback is performed.

interface FontSourceSubstitution
MemberTypeSummary
fromFontFaceRequest
lineMetrics?{ readonly heightEm: number; readonly baselineEm: number; }Line-box metrics for the requested face, expressed as em ratios.
toFontFaceRequest

FontSubstitutioninterfaceSource ↗

A family the deck names that measures with another face.

interface FontSubstitution
MemberTypeSummary
familystring
metricCompatiblebooleanTrue when the substitute keeps the original's advance widths, so line breaks match.
substitutestring

FontUrlSourceinterfaceSource ↗

One URL to fetch and the face it claims to be.

interface FontUrlSource
MemberTypeSummary
faceIndex?number
familystring
hash?stringExpected `sha256:` content hash. When present, mismatching bytes are REFUSED — pin this for any URL not under the app's sole control.
style'normal' | 'italic'
urlstring
weightnumber

GradientFillinterfaceSource ↗

A gradient fill as the chrome edits it.

interface GradientFill
MemberTypeSummary
anglenumberDegrees clockwise from left-to-right (`a:lin/@ang`); 90 runs top to bottom.
kind'linear' | 'radial'`linear` (`a:lin`) or `radial` from the center (`a:path path="circle"`).
rotWithShapebooleanThe gradient turns with the shape (`rotWithShape`).
stopsreadonly { readonly pos: number; readonly color: string; }[]Two to ten stops; `pos` from 0 to 1, `color` as `#RRGGBB`.

HeaderFooterTargetsinterfaceSource ↗

The slides that setSlideNumbers, setFooter, and setDateTime act on.

interface HeaderFooterTargets
MemberTypeSummary
hideOnTitleSlides?booleanWith `show: true`, slides whose layout is a title slide layout (`p:sldLayout type="title"`) hide the placeholder instead. Default false.
indices?readonly number[]The slide indexes to change. Default: all slides.

HistoryGroupinterfaceSource ↗

The engine-owned identity of one gesture. Create it with Editor.beginHistoryGroup().

Every command that names one open handle becomes part of one undo step. Undo, redo, and a command with another handle (or none) close the step, so a later command with the handle starts a new one. A selection change, and a command that the editor refuses before it writes, leave the step open. Redo restores the selection after the last command of the step.

interface HistoryGroup
MemberTypeSummary
[historyGroupBrand]true
endEnd this gesture without reverting any edits. Safe to call more than once.
state'open' | 'closed'Closed after `end()`, after a new document loads, and after `destroy()`.

HistoryGroupBindinginterfaceSource ↗

Dispose when the element or editor changes.

interface HistoryGroupBinding
MemberTypeSummary
disposeClose the gesture and remove every listener. The edits stay.
optionsOptions for the next synchronous command: `{ historyGroup }`.

HistoryGroupBindingOptionsinterfaceSource ↗

Native event policy for one continuous control gesture.

interface HistoryGroupBindingOptions
MemberTypeSummary
kind'native-color' | 'range' | 'repeat' | 'keyboard'

HistoryGroupOptionsinterfaceSource ↗

Options for a command that can join an explicit history group.

interface HistoryGroupOptions
```ts
const resize = editor.beginHistoryGroup();
editor.exec({ type: 'setTableGrid', columns: [914400, 914400] }, { historyGroup: resize });
editor.exec({ type: 'setTableGrid', columns: [1828800, 914400] }, { historyGroup: resize });
resize.end();
editor.exec({ type: 'undo' }); // reverts both commands
```
MemberTypeSummary
historyGroup?HistoryGroupAn open handle from `Editor.beginHistoryGroup` on this editor. A closed handle, or a handle from another editor, refuses the command with `errors.unsupported` and changes nothing.

HostFacesinterfaceSource ↗

Host faces from the fonts option and its shims, after the embedded faces: the faces under their own family, and host substitutions (FontSourceSubstitution) registered under the requested family with the target family they draw.

interface HostFaces
MemberTypeSummary
facesreadonly FontSource[]
substitutionsreadonly { readonly face: FontSource; readonly target: string; }[]

HyperlinkPopupActionsinterfaceSource ↗

The actions of the link popup, as DOCX Editor's UseHyperlinkPopupResult.

interface HyperlinkPopupActions
MemberTypeSummary
beginEdit() => voidChange to editing mode.
close() => voidHide the popup.
commitEdit() => booleanApply the draft to the selection. False when the engine refused it.
copy() => Promise<boolean>Copy the safe target. False when there is nothing safe to copy.
open(link?: { readonly url: string; readonly href?: string | null; } | null, anchor?: HTMLElement | null) => voidOpen the link at the caret in reading mode, or the URL field when there is none. A null link requests editing. Caller-supplied targets never replace the selected target.
openAtCaret(anchor?: HTMLElement | null) => voidOpen for the selection, as Ctrl/Cmd+K and the toolbar's link control do: in editing mode, with the link of the selection in the field when it has one.
openTarget() => booleanOpen the safe target in a new tab. False for a target that never opens.
setUrl(url: string) => voidChange the draft target.

The link a popup shows.

interface HyperlinkPopupLink
MemberTypeSummary

HyperlinkPopupStateinterfaceSource ↗

The link popup's state.

interface HyperlinkPopupState
MemberTypeSummary
anchorHTMLElement | nullThe element the panel opens under: the caret for a click, the opener otherwise.
canEditbooleanWhether the link command can run now; a read-only editor trims Edit and Unlink.
copiedbooleanTrue after Copy, until the next change: for a "Copied" confirmation.
draftstringThe URL field's draft, in edit mode.
errorstring | nullThe translation key (or engine text) of why the last Apply was refused, or null.
hrefstring | null`url` as `sanitizeHref` passes it, or null when it is not safe to open or copy.
modeHyperlinkPopupMode
urlstringThe link of the selection when the popup opened, as the file stores it, or `''`.

ImageAdjustmentsinterfaceSource ↗

Picture corrections, color, and transparency, as the Picture Format tab sets them.

interface ImageAdjustments
MemberTypeSummary
brightness?numberBrightness from −1 to 1 (`a:lum/@bright`).
contrast?numberContrast from −1 to 1 (`a:lum/@contrast`).
recolor?ImageRecolorA Recolor preset of the Color gallery; `none` removes the color effect.
transparency?numberTransparency from 0 to 1 (`a:alphaModFix`, 1 − amount).

ImageCropPercentinterfaceSource ↗

The crop of each edge of a picture, in percent of the image (a:srcRect), after DOCX Editor's ImageCropPercent: a positive value removes that part of the image. Unlike DOCX Editor's 0 to 100, a value may be negative: it adds space on that side as padding (Fit writes it).

interface ImageCropPercent
MemberTypeSummary
bottomnumber
leftnumber
rightnumber
topnumber

ImagePropertiesinterfaceSource ↗

The Format Picture values, as DOCX Editor's setImageProperties names them. The size is the size on the slide, as the Size fields show it (SelectedImageState.widthEmu; inside a scaled group it differs from the file's a:ext), and keeps the top-left corner of the unrotated box; the crop keeps the image fixed on the slide.

interface ImageProperties
MemberTypeSummary
crop?ImageCropPercentThe crop of each edge in percent of the image.
heightEmu?numberThe height on the slide, in EMU.
rotationDegrees?numberThe rotation in degrees, clockwise.
widthEmu?numberThe width on the slide, in EMU.

ImageRasterFontinterfaceSource ↗

One face that the SVG of a picture names: family is the name in its font-family attributes and @font-face rules, and name is the family the presentation asked for.

interface ImageRasterFont
MemberTypeSummary
boldbooleanWhether the face is bold.
bytesUint8ArrayThe font file. Use it for this picture only: never store it, cache it, or write it to disk. A rasterizer with a process-wide font registry registers the faces for one call and removes them before it returns, in a `finally` block, so one document never draws with the fonts of another. `family` is unique for each open document, so faces of two documents never collide.
familystringThe name of the face in the SVG: its `font-family` attributes and `@font-face` rules.
italicbooleanWhether the face is italic.
namestringThe family the presentation asked for.

ImageRasterRequestinterfaceSource ↗

What a rasterizer draws: a standalone SVG document of width by height pixels from the editor's own paint. Pictures are inline as data URLs. Each face is inline as an @font-face rule too, and listed in fonts for a rasterizer that does not read CSS fonts. Glyphs carry their x positions from layout, so a rasterizer never breaks a line again.

interface ImageRasterRequest
MemberTypeSummary
fontsreadonly ImageRasterFont[]The faces that the SVG names.
heightnumberThe height of the PNG to answer, in pixels.
svgstringThe SVG document as text.
widthnumberThe width of the PNG to answer, in pixels.

ListGalleryIteminterfaceSource ↗

One gallery item: its key, and the bullet format it applies (null turns the list off).

interface ListGalleryItem<K extends string = string>
MemberTypeSummary
formatBulletFormat | nullThe bullet format the item applies, the command's `format`; null turns the list off.
keyKA stable key, never renamed: `none`, a bullet name (`filledRound`), or a scheme.

LoadFontsRequestinterfaceSource ↗

What to fetch, and under what limits.

Only sources is required. Each carries its own expected hash, so bytes are trusted by CONTENT rather than by origin — a swapped asset fails admission even from a trusted host.

interface LoadFontsRequest
MemberTypeSummary
cacheName?stringCache API bucket name; default `docx-editor-fonts`.
fetcher?typeof fetchInjectable for tests and CSP-constrained hosts; defaults to global `fetch`.
maxFontBytes?numberPer-font byte ceiling; defaults to the engine hard maximum.
signal?AbortSignalCancels loading with `signal.reason`, without returning per-source failures.
sourcesreadonly FontUrlSource[]

LoadFontsResultinterfaceSource ↗

What one loadFonts call produced: the faces that arrived, plus the ones that did not.

A FontConfigurationFragment, so it composes straight into composeFontConfiguration alongside other font sources. Partial success is the normal case — compose it even with failures present.

interface LoadFontsResult extends FontConfigurationFragment
MemberTypeSummary
failuresreadonly FontLoadFailure[]
sourcesreadonly FontSource$1[]

LoadOptionsinterfaceSource ↗

Options of Editor.load.

interface LoadOptions
MemberTypeSummary
startSlide?numberThe slide to show first, zero-based; clamped to the deck. In a long deck it is the slide that parses first. Default 0.

MailtoPartsinterfaceSource ↗

The fields of an email link the form edits, and the fields it keeps as they are.

interface MailtoParts
MemberTypeSummary
addressstring
reststringThe other fields of the link (`cc`, `body`), still encoded, joined with `&`.
subjectstring

NewChartDatainterfaceSource ↗

The data of a new chart: its categories (or X values) and its series.

interface NewChartData
MemberTypeSummary
categoriesreadonly string[]
seriesreadonly { readonly name: string; readonly values: readonly (number | null)[]; }[]

NotesParagraphinterfaceSource ↗

One paragraph of the speaker notes.

interface NotesParagraph
MemberTypeSummary
runsreadonly NotesRun[]The paragraph's runs; neighbors with the same formatting are joined.

NotesRuninterfaceSource ↗

A run of the speaker notes with its character formatting.

interface NotesRun
MemberTypeSummary
boldbooleanBold, from the run or the notes text style it inherits.
italicbooleanItalic, from the run or the notes text style it inherits.
strikebooleanStruck through (single or double).
textstringThe run's text. A line break inside a paragraph is `\n`.
underlinebooleanUnderlined (any underline style).

OpBatchOptionsinterfaceSource ↗

Options for an OpBatch.

interface OpBatchOptions
MemberTypeSummary
reservedPartNames?ReadonlySet<string>Case-folded part names (`partNameKey`) that new parts must not take: every name the session has held. A name then always means one part, also across delete and undo.

OpenFailureReportContextinterfaceSource ↗

What openFailureReport adds besides the failure.

interface OpenFailureReportContext
MemberTypeSummary
time?DateWhen the open failed. Defaults to now.
userAgent?stringThe browser, such as `navigator.userAgent`. Defaults to it in a browser.

OpenOptionsinterfaceSource ↗

Options for opening a presentation.

interface OpenOptions
MemberTypeSummary
fixedMeasurer?booleanUse the deterministic fixed measurer (tests only).
fonts?readonly FontSource[]Extra faces (for example, local system fonts in the fidelity harness). Tried first.
substitutes?booleanLoad the metric-compatible substitutes from `@docx-editor.dev/fonts`. Default true.

PaneRequestinterfaceSource ↗

How a side panel answers a request: whether it moves the focus to the tab.

interface PaneRequest
MemberTypeSummary
focusbooleanFalse keeps the focus where it is: Insert Chart opens the Chart tab, and the keyboard stays on the slide, so Undo and Delete act on the new chart.

ParagraphDialogFieldsinterfaceSource ↗

Every field of the form, as the controls hold it. '' is a blank: the selection disagrees and the user has not chosen.

interface ParagraphDialogFields
MemberTypeSummary
alignmentParagraphAlignment | ''
indentLeftstringInches.
lineAtstring
lineRuleLineRule | ''
spaceAfterstring
spaceAfterUnitSpacingUnit
spaceBeforestring
spaceBeforeUnitSpacingUnit
specialSpecialIndent | ''
specialBystringInches.

ParagraphFormatCommandinterfaceSource ↗

The fields of the Paragraph dialog, as setParagraphFormat takes them. An omitted field keeps the paragraph's value. null removes the paragraph's own value, so it takes the inherited value again (from the layout, the master, or the shape's list style); a zero is a value and blocks the inherited one.

interface ParagraphFormatCommand
MemberTypeSummary
alignment?ParagraphAlignmentAlignment (`algn`).
indentFirstLineEmu?number | nullThe first line's offset from the left indent in EMU (`indent`): negative is a hanging indent, positive a first-line indent.
indentLeftEmu?number | null"Before text": the left indent of the text in EMU (`marL`), 0 to 51206400.
lineSpacing?ParagraphLineSpacing | nullLine spacing (`a:lnSpc`): a multiple from 0.01 to 9.99, or 0.01 to 1584 points.
spaceAfterLines?number | nullSpace after the paragraph in lines (`a:spcAft/a:spcPct`), 0 to 132.
spaceAfterPt?number | nullSpace after the paragraph in points (`a:spcAft/a:spcPts`), 0 to 1584.
spaceBeforeLines?number | nullSpace before the paragraph in lines of its text (`a:spcBef/a:spcPct`), 0 to 132. Give this or `spaceBeforePt`, not both.
spaceBeforePt?number | nullSpace before the paragraph in points (`a:spcBef/a:spcPts`), 0 to 1584.

ParagraphFormatReadinterfaceSource ↗

The selected paragraphs as the Paragraph dialog reads them. A field is null when the paragraphs disagree (disagrees says which), so a control can show a blank. Values are resolved: inherited values count.

interface ParagraphFormatRead
MemberTypeSummary
alignmentParagraphAlignment | nullAlignment; null when the paragraphs disagree.
disagrees{ readonly alignment: boolean; readonly spaceBefore: boolean; readonly spaceAfter: boolean; readonly lineSpacing: boolean; readonly indentLeft: boolean; readonly indentFirstLine: boolean; }Which fields differ between the selected paragraphs.
indentFirstLineEmunumber | nullThe first line's offset from the left indent, EMU (negative hangs).
indentLeftEmunumber | null"Before text", EMU; null when the paragraphs disagree.
lineSpacingParagraphLineSpacing | nullLine spacing; null when the paragraphs disagree.
spaceAfterLinesnumber | nullLines, or null when the space is in points or the paragraphs disagree.
spaceAfterPtnumber | nullPoints, or null when the space is in lines or the paragraphs disagree.
spaceBeforeLinesnumber | nullLines, or null when the space is in points or the paragraphs disagree.
spaceBeforePtnumber | nullPoints, or null when the space is in lines or the paragraphs disagree.

ParagraphLineSpacinginterfaceSource ↗

Line spacing as the Paragraph dialog sets it: a multiple of single spacing (a:spcPct), or exact points (a:spcPts). DOCX Editor's rule names; a:lnSpc has no "at least".

interface ParagraphLineSpacing
MemberTypeSummary
rule'multiple' | 'exact'`multiple` of single spacing (`a:spcPct`), or `exact` points (`a:spcPts`).
valuenumberLines for `multiple` (1 is single), points for `exact`.

PatternFillinterfaceSource ↗

A preset pattern fill (a:pattFill) as the chrome edits it.

interface PatternFill
MemberTypeSummary
backgroundstringThe background, as `#RRGGBB`.
foregroundstringThe foreground (the pattern's ink), as `#RRGGBB`.
presetPatternPreset

PictureStatusinterfaceSource ↗

The state of one EMF or WMF picture part (session.pictureStatus).

interface PictureStatus
MemberTypeSummary
partstringThe picture's part name, such as `/ppt/media/image1.emf`.
state'ready' | 'pending' | 'failed' | 'timed-out'- `ready`: it draws as its PNG. - `pending`: it is not converted yet: it converts, waits to, or converts when its slide paints. It draws as the placeholder, or as its PNG from before a font change. - `failed`: it cannot convert: a damaged picture, or content the converter does not draw. - `timed-out`: two conversions ran out of time. `picturesReady` with `retry: true` converts it again. The first `picturesReady` after the timeout, a font change, and a page that shows again after it ran out of time while hidden also try once more.

PicturesWaitinterfaceSource ↗

How session.picturesReady waits.

interface PicturesWait
MemberTypeSummary
retry?booleanConvert again the pictures that ran out of time (`timed-out`). Default `false`.
timeoutMs?numberHow long to wait, in milliseconds. Default 30000; `Infinity` waits for every picture.

PptxEditorEventsinterfaceSource ↗

The events useEditorEvent subscribes to, and what each handler receives.

interface PptxEditorEvents
MemberTypeSummary
change(snapshot: EditorSnapshot) => voidThe presentation changed: an applied edit, an undo or redo, or a load that finished or failed. Selection, zoom, and view changes do not fire it, and neither does a slide of a long deck that finishes opening in the background (`selectionChange` reports those): a host that saves on `change` does not save, and parse the whole deck, while it opens. It also fires once when the deck turns read-only (`EditorSnapshot.readOnlyReason`), so a host that saves on `change` sees `save()` return `null` and can say why.
openFailure(failure: DocumentOpenFailure, snapshot: EditorSnapshot) => voidA file did not open (`EditorSnapshot.openFailure`).
rejection(rejection: EditorRejection, snapshot: EditorSnapshot) => voidThe editor refused an edit (`EditorSnapshot.lastRejection`).
selectionChange(snapshot: EditorSnapshot) => voidThe shape or text selection, the current slide, or the selected slides changed; or, while a long deck opens, the count of slides still opening (`EditorSnapshot.pendingSlides`), as DOCX Editor reports pages laid out in the background.

PptxEditorInstanceinterfaceSource ↗

The editor instance: the Editor contract plus engine extras.

interface PptxEditorInstance extends Editor
MemberTypeSummary
chartDataThe data of the selected chart, or of the chart frame `nodeId` on the current slide: its categories, series names, and values, and where its workbook is. Refused with a reason (a translation key) for a chart whose data shape the editor does not edit. The Edit Data dialog shows it; `setChartData` writes it back.
chartFormatThe type and elements of the selected chart, or of the chart frame `nodeId` on the current slide: its title, legend, data labels, gridlines, axes, and colors. The Chart tab shows it; `setChartType`, `setChartFormat`, and `setChartColor` change it.
findPptxFindFind and replace in slide text, tables, and speaker notes.
fontFamiliesFamilies the font picker offers: standard, configured, embedded, and the deck's own.
fontMeasurementWhich measurer the deck's layout runs on, and whether the host's fonts are still on the way. A deck that opens waits at most 2 seconds for its fonts, then shows with stand-in faces; the host's faces install when they arrive.
fontsPptxEditorOptions['fonts']The fonts in force: the value last passed as `fonts` or to `setFonts`. Compose it with another origin (`withFontOrigin`) to add faces without dropping the host's.
getReviewAuthorsThe review authors of the open deck, with the color each one draws in: every comment author by order of first appearance (slide order, each thread before its replies), then the author of new comments. An author keeps a slot for the deck's session, also after their comments go, so a delete and its undo recolor nobody. The comment markers, the text bands, the shape rings, and the Pro comments pane all draw from this list. The same array while no slot changes; empty without an open deck.
inputApply text input at the current text selection, exactly as the keyboard does. A refusal is returned and also published as `lastRejection`.
lastCopiedClipboardPayload | nullThe shapes copied last in this editor (paste uses it when the clipboard is not readable).
renderLayoutThumbnailPaint how a new slide on a layout (`SlideLayoutSummary.id`) looks, with its placeholder prompts, into a container: the Layout and New Slide galleries.
selectCommentPick a comment thread of the current slide (`EditorSnapshot.activeComment`), as a press on its marker does, or `null` for none. A comments pane shows the picked thread.
sessionDocumentSession | nullThe open session (store, measurer, layouts), for advanced hosts and tests.
setAuthorReplace the author of new comments and replies (the `author` option). Existing comments keep their authors. `undefined` removes it.
setFontFamiliesReplace the families the font picker offers besides the standard ones and the deck's own (the `fontFamilies` option). A list with the same families, in the same order, changes nothing; another list publishes a change. The document and the undo history stay.
setFontsReplace host font resources without replacing the document or its edit history, as DOCX Editor's `setFonts`. The previous resolution is cancelled (its `AbortSignal` aborts). `undefined` removes the host faces; a new value keeps the current faces until its faces install. A value that supplies nothing usable, or fails, removes the replaced faces and reports through `onFontError`. Embedded deck faces stay. The session, selection, undo history, and collaboration session stay. Throws after `destroy()`.
setSelectionSet the selection programmatically (shape ids or a text range).
tableStylesTable styles the Table Styles picker offers: the deck's own and the built-in default.

PptxEditorOptionsinterfaceSource ↗

Options for createPptxEditor.

interface PptxEditorOptions extends Omit<OpenOptions, 'fonts'>
MemberTypeSummary
author?stringThe author of new comments and replies, as in DOCX Editor. Without it, a collaboration session's identity name applies, and without that the comment commands need `author`.
autoCorrect?booleanAutoCorrect while typing (default true): the ©, ®, and ™ signs, ellipses, fractions, and lists started by typing `1.`, `1)`, `*`, or `-` and a space. Capitals, curly quotes, and dashes are never automatic here: keyboards and systems that offer them apply them, whatever this option is.
document?Uint8Array
fontFamilies?readonly string[]Families the font picker offers besides the standard ones and the deck's own. A family picked that no loaded face covers is requested from the `fonts` origins. `setFontFamilies` replaces them.
fonts?EditorFontsOptionFont bytes for the host's faces, as in DOCX Editor: a `FontConfiguration`, a `FontConfigurationFragment` (`{ sources, substitutions }`), or a `FontResolver` such as `packagedFonts()` or `googleFonts()` from `@docx-editor.dev/fonts`. A resolver is called once per deck, after it opens, with the families the deck names (theme fonts first) and its default family (the theme's minor Latin font), and again for a family picked in the font picker. Host faces rank after the deck's embedded faces and before the packaged substitutes. Omitted, the packaged substitutes load as before and nothing is fetched. A resolver that fetches makes opening a deck perform network requests; the engine never supplies one. Failures report through `onFontError`. `setFonts` replaces it.
mode?EditorMode
modules?readonly EditorModule[]Capability modules, such as the review and collaboration modules of the pro package.
onFontError?(error: EditorFontError) => voidCalled for each font failure: a failed origin, a refused face, or a failed resolution.
readClipboardDrawing?ClipboardDrawingReaderReads the DrawingML clipboard package from the system clipboard, for a host that can, such as a desktop wrapper. Presentation applications write copied shapes in this package (`DRAWING_CLIPBOARD_TYPES`) and as a picture, and browsers give a page only the picture. When a paste holds a picture, the editor calls this reader and pastes the package's shapes as editable shapes. Without a package, or without this option, the picture pastes.
smartGuides?booleanWhether drags snap to smart guides; on by default. `toggleSmartGuides` switches it.
translate?(key: string, params?: Record<string, string | number>) => stringTranslates engine-generated labels (placeholder frames, the canvas name). Adapters pass their i18n translator; English keys show when omitted.
zoom?number | 'fit'

PptxFindinterfaceSource ↗

Find and replace on an editor. Each call takes the query and options, so the find bar owns them. A step selects its match: text on a slide or in a table cell as a text selection, and speaker notes by going to the slide.

interface PptxFind
MemberTypeSummary
matchesEvery match of `query`, ordered by slide and position (notes after the slide's shapes).
nextSelect the next match after the selection, wrapping at the end of the deck.
positionThe index of the match the editor shows now, or -1.
previousSelect the match before the selection, wrapping at the start of the deck.
replaceReplace the match the editor shows and select the next one. When the editor shows no match, select the next match and replace nothing.
replaceAllReplace every match as one undo step.

RenderThumbnailOptionsinterfaceSource ↗

Options of renderThumbnail.

interface RenderThumbnailOptions
MemberTypeSummary
defer?booleanDefer the first paint, for a list with one container per slide (the rail, the slide sorter). The first containers asked for in one task and the current slide's paint at once; the others paint when they scroll into view or when the browser is idle, and stay empty until then. A container that is not on the page paints at once.

ReviewAuthorInfointerfaceSource ↗

One review author, resolved: who, which ramp slot, and what they draw in.

interface ReviewAuthorInfo
MemberTypeSummary
authorstringThe author's display name, exactly as the file gives it.
colorstringThe color this author draws in: `var(--doc-review-author-<slot % 8>)`.
slotnumberStable session rank, by order of first appearance: an unbounded index. The ramp defines [REVIEW_AUTHOR_SLOTS](REVIEW_AUTHOR_SLOTS) colors and every DOM hook wraps into it, so the ninth author ranks 8 here and carries `data-review-author-slot="0"`. A selector built from this value needs the same wrap: `slot % 8`.

ReviewIteminterfaceSource ↗

One entry of the review queue.

interface ReviewItem
MemberTypeSummary
author?stringThe author's display name.
date?stringISO 8601 date, as stored.
idstringStable within one package revision.
kindReviewItemKindA comment from the deck, or a suggestion held by the review module.
parentId?stringFor a reply, the id of the comment it answers.
slidePartstringThe slide part the item belongs to.
textstringThe comment text, or a summary of the suggestion.

ReviewModelInputinterfaceSource ↗

What a review module reads to build its queue.

interface ReviewModelInput
MemberTypeSummary
packagePptxPackageThe package of the current store revision.

ReviewModuleContributioninterfaceSource ↗

What a review module contributes.

interface ReviewModuleContribution
MemberTypeSummary
collectReviewItemsCollectReviewItemsThe review queue derivation.
displayModesreadonly ReviewDisplayMode[]Display modes this module unlocks. The free engine shows `final` only.
pane?ReviewPaneOptionsThe comment view settings: how a comment marker looks and what a press on it opens.

ReviewPaneOptionsinterfaceSource ↗

The comment view settings of a review module. Every field is optional.

interface ReviewPaneOptions
MemberTypeSummary
commentMarkers?CommentMarkerStyleDefault `'icon'`.
opening?ReviewPaneOpeningDefault `'auto'`.

RibbonGroupPickinterfaceSource ↗

Some controls of one registry group, in the given order.

interface RibbonGroupPick
MemberTypeSummary
controlsreadonly string[]Control ids of the group (`add` for `slide.add`).
idChromeGroupId

RibbonTabinterfaceSource ↗

One ribbon tab: its title and its groups, in order. A tab names each group once: the bar keys its groups by id.

interface RibbonTab
MemberTypeSummary
context?RibbonContextA contextual tab shows only while its context holds.
groupsreadonly (ChromeGroupId | RibbonGroupPick)[]Whole groups by id, or some controls of a group.
idRibbonTabId
labelKeyTranslationKey

RibbonTabLayoutinterfaceSource ↗

A tab as the ribbon shows it now: its entry and its registered groups.

interface RibbonTabLayout
MemberTypeSummary
groupsreadonly ChromeGroup[]
tabRibbonTab

SelectedChartStateinterfaceSource ↗

The selected chart, while exactly one chart frame is selected.

interface SelectedChartState
MemberTypeSummary
editablebooleanWhether `setChartData` can edit the chart's data.
nodeIdstringThe node id of the chart's graphic frame.
reason?stringWhy the data cannot be edited, as a translation key, when `editable` is false.

SelectedDiagramStateinterfaceSource ↗

The selected diagram, while one diagram frame is selected or holds the caret.

interface SelectedDiagramState
MemberTypeSummary
nodestring | nullThe diagram node whose text holds the caret (`dgm:pt/@modelId`), or null.
nodeIdstringThe node id of the diagram's graphic frame.
nodesreadonly DiagramNodeState[]The content nodes of the data model, in outline order: each node, then its children.
reason?stringWhy the shapes cannot be added or deleted, as a translation key, when `structure` is false.
structurebooleanWhether `addDiagramShape` and `deleteDiagramShape` can change this diagram: its saved drawing reads as a line of blocks that the editor can lay out again.

SelectedEquationStateinterfaceSource ↗

The selected equation: one text box with one equation is selected.

interface SelectedEquationState
MemberTypeSummary
linearstring | nullThe linear form of the equation, for Edit Equation. Null when the equation has a construct, run property, or character that the linear form does not cover: then only its box, its place, and its paragraph can change.
nodeIdstringThe node id of the equation (`a14:m`), for `setEquation`.

SelectedImageStateinterfaceSource ↗

The selected pictures, as the picture controls show them: the values are the first picture's.

interface SelectedImageState
MemberTypeSummary
brightnessnumberBrightness from −1 to 1 (`a:lum/@bright`); 0 is none.
canCropbooleanWhether the picture can be cropped: false with `a:picLocks/@noCrop`, as DOCX Editor's `canCrop`.
canResizebooleanWhether `setImageProperties` and Reset Picture & Size can change the size: false with `a:picLocks/@noResize`, as DOCX Editor's `canResize`.
canRotatebooleanWhether `setImageProperties` can change the rotation: false with `a:picLocks/@noRot`.
contrastnumberContrast from −1 to 1 (`a:lum/@contrast`); 0 is none.
countnumberHow many pictures are selected. Crop, Change Picture, Format Picture, and Alt Text take one.
cropImageCropPercentThe crop of each edge in percent of the image (`a:srcRect`).
croppingbooleanCrop mode is on: the crop handles show.
heightEmunumberThe height on the slide, in EMU, as `setImageProperties` takes it.
lockAspectbooleanThe value of the Lock Aspect Ratio check box (`a:picLocks/@noChangeAspect`): the Format Picture default. Unlike DOCX Editor's `locks.changeAspect`, the engine does not enforce it, and the dialog does not save the box.
nodeIdstringThe first selected picture.
recolorImageRecolor | 'other'The Recolor preset the picture matches, or `other` for another color effect.
rotationDegreesnumberThe rotation in degrees, clockwise.
shapestringThe preset the picture is cropped to (`rect` for none), or `custom` (`a:custGeom`); the value `cropToShape` takes as `preset`.
style?ImageStyleIdThe picture style the picture matches, if any.
transparencynumberTransparency from 0 (opaque) to 1 (`a:alphaModFix`, 1 − amount).
widthEmunumberThe width on the slide, in EMU, as `setImageProperties` takes it.

SelectionFormatinterfaceSource ↗

Formatting at the selection, for toolbar state.

interface SelectionFormat
MemberTypeSummary
align?TextAlign
boldboolean
bulletFormat?BulletFormatRead | nullThe bullet format of the selected paragraphs: null when they have no list, absent when they differ (so no gallery row is checked).
bulletFormatMixed?BulletFormatMixedWhat the selected paragraphs share, when `bulletFormat` is absent because they differ.
bulletsboolean
color?string
columns?TextColumnsThe text columns of the selected shapes with text; absent when they differ.
font?FontFormatReadThe selected text, for the Font dialog and the character spacing menu.
fontFamily?stringThe family the text is drawn in; a theme font reads as the theme's family name.
fontFamilyTheme?'major' | 'minor'The theme font the family comes from: `major` for `+mj-lt` (headings), `minor` for `+mn-lt` (body). Absent when the text names a literal family. ECMA-376 Part 1, 20.1.4.1.17 `latin`.
fontSize?number
italicboolean
numberingboolean
paragraph?ParagraphFormatReadThe selected paragraphs, for the Paragraph dialog and `useParagraphFormat`.
renderedFontSize?number | null`fontSize` as drawn under `a:normAutofit/@fontScale`; null when the shapes differ.
strikeboolean
subscript?booleanThe text is lowered (`baseline` below 0).
superscript?booleanThe text is raised (`baseline` above 0).
textDirection?TextOrientationThe text direction of the selected shapes with text (`vert`); absent when they differ. A file value outside `ST_TextVerticalType` reads as `horizontal`, as layout draws it.
underlineboolean
verticalAlign?VerticalAlignVertical alignment of the text in its shape.

SelectionGeometryinterfaceSource ↗

The selected element's geometry, for the Format panel. EMU and degrees.

interface SelectionGeometry
MemberTypeSummary
altText?AltTextThe element's alt text.
cxnumber
cynumber
effects?ShapeEffectsStateShadow, reflection, glow, and soft edges. Shapes, connectors, and pictures only.
fill?stringSolid fill as `#RRGGBB`, `none`, `gradient`, `pattern`, `picture`, or `other`. Shapes only.
flipH?booleanFlips of the element's transform.
flipV?boolean
gradient?GradientFillThe gradient, when `fill` is `gradient`.
kind'shape' | 'picture' | 'group' | 'connector' | 'graphicFrame'
lineColor?stringOutline color as `#RRGGBB`, `none`, or `other`.
lineDash?string
lineHead?LineEndTypeArrowheads, for lines and connectors.
lineTail?LineEndType
lineWidth?numberOutline width in points.
lockAspectRatio?booleanThe aspect ratio is locked (`noChangeAspect`): a drag of any resize handle on the canvas keeps the ratio.
namestring
nodeIdstringThe element's node id; position and size are in its file coordinates.
pattern?PatternFillThe pattern, when `fill` is `pattern`.
rotnumber
shapeStyle?ShapeStyleChoiceThe Shape Styles gallery cell the shape's `p:style` matches. Shapes only.
textFitting?TextFittingText fitting, for shapes with a text body.
textWarp?TextWarpPresetThe text warp (`a:prstTxWarp`), `textNoShape` for none. Shapes with a text body only.
xnumber
ynumber

ShapeCategoryinterfaceSource ↗

One gallery category.

interface ShapeCategory
MemberTypeSummary
idstring
labelKeyTranslationKeyi18n key of the category name.
presetsreadonly string[]Preset names (`a:prstGeom/@prst`); each has the i18n label `shapes.<preset>`.

ShapeEffectsStateinterfaceSource ↗

The effects of the selected element as the chrome shows them. A shadow or reflection that is not a gallery preset reads other. Sizes are in points; 0 is no effect.

interface ShapeEffectsState
MemberTypeSummary
bevelBevelPreset | 'none'The top bevel preset, or `none`.
blurnumberBlur radius in points; 0 is no blur.
glownumber
glowAccent?Exclude<ShapeStyleColor, 'dk1'>The theme accent of a Glow Variations color (40% opacity), when the glow has one.
glowColor?stringThe glow color as `#RRGGBB`, when there is a glow.
reflectionReflectionPreset | 'none' | 'other'
rotation3dRotation3DPreset | 'none' | 'other'The camera preset when it is a 3-D Rotation gallery choice, `none` for a front camera.
shadowShadowPreset | 'none' | 'other'
softEdgenumber

ShapePreviewinterfaceSource ↗

A gallery preview: SVG path data in a 0…100 box.

interface ShapePreview
MemberTypeSummary
pathsreadonly { readonly d: string; readonly fill: boolean; readonly stroke: boolean; }[]
viewBoxstring

ShapeStyleChoiceinterfaceSource ↗

One cell of the Shape Styles gallery.

interface ShapeStyleChoice
MemberTypeSummary
colorShapeStyleColor
rowShapeStyleRow

ShapeSummaryinterfaceSource ↗

One element of the current slide, as the selection pane lists it.

interface ShapeSummary
MemberTypeSummary
children?readonly ShapeSummary[]A group's children, top first.
hiddenboolean`p:cNvPr/@hidden`: the element does not draw.
kind'shape' | 'picture' | 'group' | 'connector' | 'graphicFrame'
namestring`p:cNvPr/@name`.
nodeIdstring

SlideAnimationsinterfaceSource ↗

The animations and the transition of the current slide (EditorSnapshot.animations).

interface SlideAnimations
MemberTypeSummary
editablebooleanWhether `addAnimation` and the effect commands can edit this slide. A slide whose timing is in markup-compatibility content (`mc:AlternateContent`) or whose main sequence has a structure the commands do not write is read-only.
effectsreadonly AnimationEffect[]The effects, main sequence first, in the order the slide plays them.
transitionSlideTransitionState

SlideBackgroundStateinterfaceSource ↗

The current slide's background, as the chrome shows it.

interface SlideBackgroundState
MemberTypeSummary
color?string
gradient?GradientFill
inheritedbooleanTrue when the background comes from the layout or master, not the slide.
kind'solid' | 'gradient' | 'pattern' | 'picture' | 'none' | 'other'`none` is white; `other` is a fill the chrome does not edit.
pattern?PatternFill
tile?booleanTrue for a picture that tiles at its own size instead of stretching over the slide.

SlideCommentinterfaceSource ↗

One comment or reply. Its text and author come from the file: show them as text.

interface SlideComment
MemberTypeSummary
authorstringThe author's display name. Empty when the file names no author for the comment.
date?stringThe date as the file stores it (ISO 8601), or absent.
idstringThe id that the comment commands take. When the slide repeats the comment's GUID, or a legacy comment's author and index, a delete of another comment can change it, and a twin (see `identity`) can take the id of a deleted one. Send `expect` with a command, so the editor refuses it when the comment at the id is not the one you showed.
identitystringA token that names the comment in this editor's snapshots. Key UI state, such as an open field, by it; pass `id` to the commands. Once shown, an identity never names another comment, also after the slide changes and comes back, or the editor opens another deck.
initialsstringThe author's initials. Empty when the file has none.
textstringThe text, with one line feed between paragraphs.
textEditablebooleanWhether `editComment` can replace the text of this comment in a deck open for editing. False for a body that holds more than plain text, such as a mention.

SlideImageOptionsinterfaceSource ↗

Options for a slide picture.

interface SlideImageOptions
MemberTypeSummary
frameLabel?(kind: string) => stringThe label of an element the editor draws as a placeholder (chart, diagram), as on the canvas.
picturesTimeoutMs?numberPNG and ZIP export only: how long to wait for each slide's EMF and WMF pictures, in milliseconds. Default 30000; `Infinity` waits until each one converted or failed.
width?numberWidth in pixels, from 16 to 8192; the height follows the slide's aspect ratio. Default 1920.

SlideLayoutSummaryinterfaceSource ↗

One slide layout of the deck, as the Layout and New Slide galleries list it.

interface SlideLayoutSummary
MemberTypeSummary
idstringThe layout's identity in the open document.
masterIdstringThe slide master the layout belongs to; galleries group layouts by master.
masterNamestringThe master's name, as the gallery's group header shows it: the master's own name, or the name of its theme (`a:theme/@name`).
namestringThe layout's name (`p:cSld/@name`, for example "Title and Content").
typeSlideLayoutKind`p:sldLayout/@type`.

SlideSectioninterfaceSource ↗

One section of the slide list (p14:section).

interface SlideSection
MemberTypeSummary
firstSlidenumberThe index of its first slide; for an empty section, the index its slides would take.
idstringThe section's identity: its GUID in the file.
namestring
slideCountnumber

SlideshowFitinterfaceSource ↗

A slide box on the screen, in CSS pixels on whole device pixels.

interface SlideshowFit
MemberTypeSummary
heightnumberSlide height on the screen.
leftnumberLeft edge from the screen's left edge.
topnumberTop edge from the screen's top edge.
widthnumberSlide width on the screen.

SlideshowKeyinterfaceSource ↗

A key press as the show reads it (a KeyboardEvent fits).

interface SlideshowKey
MemberTypeSummary
altKey?booleanModifier state, as on a `KeyboardEvent`.
ctrlKey?booleanModifier state, as on a `KeyboardEvent`.
keystringThe `KeyboardEvent.key` value.
metaKey?booleanModifier state, as on a `KeyboardEvent`.
shiftKey?booleanModifier state, as on a `KeyboardEvent`.

SlideshowPaintOptionsinterfaceSource ↗

Options for paintSlideshowSlide.

interface SlideshowPaintOptions
MemberTypeSummary
frameLabel?(kind: string) => stringLabel for an element the editor does not render (chart, diagram, OLE).

SlideshowSlideinterfaceSource ↗

One slide as the show sees it.

interface SlideshowSlide
MemberTypeSummary
hiddenboolean`p:sld/@show="0"`: next and previous skip the slide.

SlideshowStateinterfaceSource ↗

The state of a running show.

interface SlideshowState
MemberTypeSummary
donebooleanTrue once the show has ended (Escape, or an advance past the end screen).
indexnumberThe slide on show; on the end screen, the slide shown last.
screenSlideshowScreenWhat is on the screen.
slideCountnumberAll slides, hidden ones too.
typedstringDigits typed so far for "number, then Enter".

SlideSizeFieldsinterfaceSource ↗

The slide size fields of the Page setup draft. Width and height are typed inches.

interface SlideSizeFields
MemberTypeSummary
heightstring
orientationSlideOrientation
scaleContentbooleanWhether the boxes on every slide scale to the new size (`content: 'scale'`).
sizeSlideSizePreset
widthstring

SlideSummaryinterfaceSource ↗

One slide in the rail.

interface SlideSummary
MemberTypeSummary
hiddenboolean
idstringThe slide's identity in the open document: it stays the same when slides move, and a deleted slide's id is never given to another slide.
indexnumber
keystringChanges whenever the slide's rendering may change, for thumbnail caching.
layoutId?stringThe slide's layout (`SlideLayoutSummary.id`); absent when the slide names none.
masterId?stringIn the slide master view, the master of a layout (its `id`).
name?stringIn the slide master view, the template's name (`p:cSld/@name`).
pending?trueThe slide is still opening (`EditorSnapshot.pendingSlides`): its thumbnail shows a placeholder until it is ready. Absent once it is.
template?'master' | 'layout'In the slide master view, the template this entry shows: a slide master, or one of its slide layouts. Absent for a slide.
usedBy?numberIn the slide master view, how many slides use the template: the slides on a layout, or on any layout of a master.

SlideTransitionStateinterfaceSource ↗

The transition of a slide (p:transition).

interface SlideTransitionState
MemberTypeSummary
advanceAfterMsnumber | nullThe time after which the slide moves on by itself (`advTm`), or null.
advanceOnClickbooleanWhether a click moves to the next slide (`advClick`).
durationMsnumberHow long it plays, in milliseconds (`p14:dur`, else the speed `spd`).
kindTransitionKind | 'none' | 'other'The kind, `none` with no effect, or `other` for a kind that `setTransition` does not write.

SubstituteFontFailureinterfaceSource ↗

A packaged substitute face that failed to load, as DOCX Editor's DefaultFontLoadFailure reports it.

interface SubstituteFontFailure
MemberTypeSummary
diagnosticstringWhy it failed. Do not use this text for program control.
familystringThe family the face substitutes for, for example `Calibri`.
filestringThe packaged file, for example `Carlito-Regular.ttf`. Empty when the whole family failed.

TableBorderPeninterfaceSource ↗

The border pen: the line the Borders menu draws, and the target it last drew. A pen color, style, or weight pick arms the pen and writes nothing. A border target pick draws the pen there; after it, a pen pick redraws that target with the new pen, as DOCX Editor's table chrome draft does, until No Border.

interface TableBorderPen
MemberTypeSummary
drawnbooleanWhether a pen pick redraws `target`: true after a border target pick, until No Border.
specTableBorderSpecThe line the pen draws.
targetTableBorderEdgeTargetThe target the pen last drew (All Borders until the first pick).

TableBorderSpecinterfaceSource ↗

A cell border: color, width in points, and dash. DOCX Editor's spec counts eighths of a point and names a WordprocessingML border style; a DrawingML line (a:lnL) has a width and a preset dash, so the fields follow setLineWidth and setLineDash (and Office.js BorderProperties.weight).

interface TableBorderSpec
MemberTypeSummary
colorColorChoiceThe line color.
dash?LineDashThe preset dash; solid when absent.
widthnumberThe line width in points (at most 1,584, `ST_LineWidth`).

TableCellAddressinterfaceSource ↗

A table cell by its row and column, zero-based: the shape of the cell that DOCX Editor's getSelectedTable() returns. A merged cell is addressed by its top-left grid position.

interface TableCellAddress
MemberTypeSummary
columnnumberThe grid column, zero-based.
rownumberThe row, zero-based.

TableContextinterfaceSource ↗

The table of the selection, for the Table Design and Table Layout chrome: DOCX Editor's TableContext (rows, columns, rowIndex, columnIndex), with the selected cell range that a slide table selection adds.

interface TableContext
MemberTypeSummary
cellFill?stringThe first selected cell's fill as drawn (its own or the style's): `#RRGGBB`, `none`, `gradient`, or `other`, as `SelectionGeometry.fill`.
columnIndexnumberThe column of the caret, or of the focus cell of a cell range (0 for a selected table).
columnsnumberThe number of grid columns (`a:gridCol`).
columnWidthnumberThe first selected grid column's width, EMU.
margins{ readonly left: number; readonly right: number; readonly top: number; readonly bottom: number; }The first selected cell's margins, EMU.
nodeIdstringThe table's `p:graphicFrame`.
optionsreadonly TableStyleOption[]The style options that are on.
rowHeightnumberThe first selected row's laid-out height, EMU.
rowIndexnumberThe row of the caret, or of the focus cell of a cell range (0 for a selected table).
rowsnumberThe number of rows (`a:tr`).
selectedColumns{ readonly from: number; readonly to: number; }The selected grid columns, first to last, inclusive.
selectedRows{ readonly from: number; readonly to: number; }The selected rows and columns, first to last, inclusive: the shape of DOCX Editor's `getTableCellSelection()` range (`from`, `to`).
styleId?stringThe table style id, when the table names one.

TableStyleChoiceinterfaceSource ↗

A table style the Table Styles picker offers. A deck style carries its styleName; the built-in default is builtIn with no name, so the chrome names it in the user's language.

interface TableStyleChoice
MemberTypeSummary
builtIn?trueThe editor's own Medium Style 2 - Accent 1 (no name): the chrome shows its label.
idstringThe style GUID, `{…}`, as `a:tableStyleId` holds it.
namestringThe style's `styleName`, which can be empty.

TextColumnsinterfaceSource ↗

Text columns of a shape.

interface TextColumns
MemberTypeSummary
countnumber1 to 16.
gapEmunumberThe gap between columns, EMU (DOCX Editor: `gapTwips`).

TextPointinterfaceSource ↗

A caret position: paragraph index and UTF-16 offset in the paragraph.

interface TextPoint
MemberTypeSummary
affinity?CaretAffinityWhere the caret shows when the offset has two places on a line that mixes directions: `'upstream'` after the character before the offset, `'downstream'` (the default) before the character at the offset. The caret, the arrow keys, and a click set it; edits and collaboration read only the offset.
offsetnumber
paragraphnumber

ThemeColorChoiceinterfaceSource ↗

A theme color pick. It is written as a:schemeClr, so the color follows the theme when the theme changes. shift is the luminance variant of [ThemeSwatch](ThemeSwatch).

interface ThemeColorChoice
MemberTypeSummary
shift?number0 or absent for the theme color; −99 to 99 for "Darker n%" or "Lighter n%".
themeThemeColorSlot

ThemeSwatchinterfaceSource ↗

One swatch of the theme color grid.

interface ThemeSwatch
MemberTypeSummary
colorstringThe color as a slide renders it, `#RRGGBB`.
scheme?stringThe theme color the slot names through the slide's color map (`p:clrMap`): `lt1` for `bg1` with the default map, `dk1` on a dark map. A `p:style` reference to `dk1` or `lt1` names this theme color directly, not through the map.
shiftnumberThe luminance variant: 0 is the theme color itself, a positive number is "Lighter n%" (`a:lumMod` 100−n, `a:lumOff` n), and a negative number is "Darker n%" (`a:lumMod` 100−n).
slotThemeColorSlot

ToolbarCommandStateinterfaceSource ↗

The shared can-before-exec state of one control.

interface ToolbarCommandState
MemberTypeSummary
activeboolean
disabledReasonstring | nulli18n key of the reason when disabled.
enabledboolean
idChromeSlotId
value?string | number

ToolbarValueMapinterfaceSource ↗

The value each typed value slot takes.

interface ToolbarValueMap
MemberTypeSummary
"arrange.align"ObjectAlign | 'distributeHorizontal' | 'distributeVertical'
"arrange.order"OrderMove
"arrange.rotate"RotateChoice
"font.family"string
"font.size"number | { readonly step: 1 | -1; }Points (`1` or more), or `{ step: 1 }` / `{ step: -1 }` for Increase and Decrease Font Size (the size list).
"insert.chart"ChartTypeThe type of the new chart.
"insert.line"LineKind
"insert.shape"stringA preset geometry name (`rect`).
"list.bulletStyle"BulletGalleryKeyA Bullets gallery item; `none` turns the list off.
"list.lineSpacing"numberA line spacing multiple (`1.5`).
"list.numberStyle"NumberGalleryKeyA Numbering gallery item; `none` turns the list off.
"paragraph.align"TextAlign
"paragraph.autofit"TextFittingHow the text fits its shape: `none`, `shrink` (text on overflow), or `shape` (shape to text).
"paragraph.columns"numberThe number of text columns, 1 to 16.
"paragraph.dialog"ParagraphFormatCommandThe Paragraph dialog's fields, run as one `setParagraphFormat` without the dialog.
"paragraph.textDirection"Exclude<TextOrientation, 'mongolianVertical' | 'wordArtVerticalRtl'>Home Text Direction: the orientations the editor sets.
"paragraph.valign"VerticalAlign
"shape.effects"ShapeEffectsValue
"shape.fill"ColorChoice | null
"shape.lineColor"ColorChoice | null
"shape.lineDash"LineDash
"shape.lineEnd"LineEndType
"shape.lineStart"LineEndType
"shape.lineWidth"numberPoints.
"shape.styles"ShapeStyleValue | ShapeStyleChoice
"shape.textEffects"TextEffectsValue
"slide.add"stringA layout id from `snapshot().layouts`.
"slide.layout"stringA layout id from `snapshot().layouts`.
"text.changeCase"TextCaseHome Change Case.
"text.characterSpacing"numberPoints added after each character; 0 is Normal, negative condenses.
"text.color"ColorChoice | null
"text.dialog"FontFormatCommandThe Font dialog's fields, run as one `setFontFormat` without the dialog.
"text.highlight"ColorChoice | null
"view.presentationView"'normal' | 'slideSorter' | 'slideMaster'

TransformIteminterfaceSource ↗

One element's new box, in its file coordinates (its parent's child space).

interface TransformItem
MemberTypeSummary
connector?ConnectorRouteA connector's route and glued ends (`p:cxnSp` only). Absent keeps them.
cxnumber
cynumber
flipH?booleanFlips; absent keeps the current ones. A line's direction is its flips.
flipV?boolean
nodeIdstring
rotnumberRotation in degrees, clockwise. The file stores it in 60,000ths of a degree.
xnumber
ynumber

UsePptxSourceOptionsinterfaceSource ↗

Options for usePptxSource.

interface UsePptxSourceOptions
MemberTypeSummary
fetchOptions?RequestInitPassed to `fetch` for a URL source: credentials and headers.
fonts?PptxFontsSourceThe fonts. Eager origins hold the deck back until they settle, for at most 2 seconds.

Type aliases (150)

AnimationClasstypeSource ↗

The class of an effect (p:cTn/@presetClass): entrance (entr), emphasis (emph), exit (exit), motion path (path), or another class, such as a media call.

type AnimationClass = 'entrance' | 'emphasis' | 'exit' | 'motionPath' | 'other';

AnimationCommandtypeSource ↗

The animation commands.

type AnimationCommand = 
/**
 * Add an effect to each selected shape, at the end of the main sequence. A shape in a group
 * animates as its whole group. `trigger` defaults to `onClick`.
 */
{
    readonly type: 'addAnimation';
    readonly preset: AnimationPreset;
    readonly trigger?: AnimationTrigger;
}
/** Remove the effect `effectId` (`AnimationEffect.id`) of the current slide. */
 | {
    readonly type: 'removeAnimation';
    readonly effectId: string;
}
/** Move the effect `effectId` to position `to` of the main sequence (0-based). */
 | {
    readonly type: 'moveAnimation';
    readonly effectId: string;
    readonly to: number;
}
/**
 * Change when the effect `effectId` starts and how long it plays. Absent fields stay. Delay is
 * 0 to 3,600,000 ms; duration is 10 to 59,000 ms and is refused for an instant effect.
 */
 | {
    readonly type: 'setAnimationTiming';
    readonly effectId: string;
    readonly trigger?: AnimationTrigger;
    readonly delayMs?: number;
    readonly durationMs?: number;
}
/**
 * Set the transition of the current slide, or of the slides `indices`. Absent fields keep
 * their values. `kind: 'none'` removes the effect. Duration is 10 to 59,000 ms;
 * `advanceAfterMs` is 0 to 3,600,000 ms, or null to clear it.
 */
 | {
    readonly type: 'setTransition';
    readonly kind?: TransitionKind | 'none';
    readonly durationMs?: number;
    readonly advanceOnClick?: boolean;
    readonly advanceAfterMs?: number | null;
    readonly indices?: readonly number[];
}
/**
 * Show the order number of each effect on its shape on the canvas. A view setting, not an
 * edit: no undo step, never saved.
 */
 | {
    readonly type: 'showAnimationOrder';
    readonly show: boolean;
};

AnimationPresettypeSource ↗

The effects that addAnimation writes. Entrance: appear, fade, flyIn, wipe, zoom. Emphasis: pulse, spin, growShrink. Exit: disappear, fadeOut, flyOut, wipeOut, zoomOut.

type AnimationPreset = 'appear' | 'fade' | 'flyIn' | 'wipe' | 'zoom' | 'pulse' | 'spin' | 'growShrink' | 'disappear' | 'fadeOut' | 'flyOut' | 'wipeOut' | 'zoomOut';

AnimationStartLabeltypeSource ↗

When an effect starts, for its row: the i18n key and its values. An effect of the main sequence plays at a click step, or with the slide start (step 0). An effect whose step the editor cannot read (in a read-only timing) shows its trigger. An effect of an interactive sequence plays on a click of its trigger shape; shapeName is empty for a shape with no name.

type AnimationStartLabel = {
    readonly key: 'panel.animations.withSlide';
} | {
    readonly key: 'panel.animations.step';
    readonly step: number;
} | {
    readonly key: 'panel.animations.onShapeClick';
    readonly shapeName: string;
} | {
    readonly key: `panel.animations.triggers.${AnimationTrigger}`;
};

AnimationTriggertypeSource ↗

When an effect starts (p:cTn/@nodeType): on a click (clickEffect), with the effect before it (withEffect), or after the effect before it (afterEffect).

type AnimationTrigger = 'onClick' | 'withPrevious' | 'afterPrevious';

AutonumberSchemetypeSource ↗

Numbering schemes the editor sets: the ST_TextAutonumberScheme values that layout numbers exactly. Arabic, Roman, and Latin letters with a period, a right parenthesis, or both parentheses, and Arabic numbers with nothing (arabicPlain; the schema has no other plain scheme).

type AutonumberScheme = `${'arabic' | 'romanUc' | 'romanLc' | 'alphaUc' | 'alphaLc'}${'Period' | 'ParenR' | 'ParenBoth'}` | 'arabicPlain';

BevelPresettypeSource ↗

The presets of the Bevel gallery: the top bevel presets of ST_BevelPresetType (ECMA-376 Part 1, 20.1.10.9), each 6 pt wide and 6 pt high.

type BevelPreset = 'circle' | 'relaxedInset' | 'cross' | 'coolSlant' | 'angle' | 'softRound' | 'convex' | 'slope' | 'divot' | 'riblet' | 'hardEdge' | 'artDeco';

BulletFormattypeSource ↗

A bullet format: a bullet character in a font (a:buChar, a:buFont), or a numbering scheme (a:buAutoNum), with its size and color. An omitted field keeps each paragraph's value, so a command can change only the size, the color, or the start number. With no kind, only the size and color change, on the paragraphs that show a list, and each keeps its own bullet or number. A paragraph with no list takes the bullet its placeholder inherits, or the first gallery item; one with the other kind takes the first gallery item for an omitted character or scheme. null makes the bullet follow the text (a:buSzTx, a:buClrTx), also over a list style that sets a value.

type BulletFormat = {
    readonly kind: 'bullet';
    readonly char?: string;
    readonly font?: string;
    readonly sizePercent?: number | null;
    readonly color?: ColorChoice | null;
} | {
    readonly kind: 'number';
    readonly scheme?: AutonumberScheme;
    readonly startAt?: number;
    readonly sizePercent?: number | null;
    readonly color?: ColorChoice | null;
} | {
    readonly kind: 'picture';
    readonly picture: Uint8Array;
    readonly sizePercent?: number | null;
} | {
    readonly kind?: undefined;
    readonly sizePercent?: number | null;
    readonly color?: ColorChoice | null;
};

BulletFormatReadtypeSource ↗

The bullet format of the selected paragraphs, as the gallery and dialog show it: resolved values.

type BulletFormatRead = {
    readonly kind: 'bullet';
    readonly char: string;
    readonly font?: string;
    readonly sizePercent: number;
    readonly color?: string;
} | {
    readonly kind: 'number';
    readonly scheme: string;
    readonly startAt: number;
    readonly sizePercent: number;
    readonly color?: string;
} | {
    readonly kind: 'picture';
    readonly sizePercent: number;
};

BulletGalleryKeytypeSource ↗

The keys of the Bullets gallery (Home Bullets), in its order.

type BulletGalleryKey = 'none' | 'filledRound' | 'hollowRound' | 'filledSquare' | 'hollowSquare' | 'star' | 'arrow' | 'checkmark';

BulletsDialogTabtypeSource ↗

The dialog's tabs, after the list kinds.

type BulletsDialogTab = 'bullet' | 'number';

CanResulttypeSource ↗

Whether a command can run now; when it cannot, the i18n key of the reason.

type CanResult = {
    readonly ok: true;
} | {
    readonly ok: false;
    readonly reason: string;
};

CanvasMenuKindtypeSource ↗

What a canvas context menu opened on: shapes, pictures only, one chart, text being edited, a table cell (a caret in a cell, or a cell range), or empty slide area.

type CanvasMenuKind = 'shapes' | 'picture' | 'chart' | 'diagram' | 'text' | 'table' | 'tableFrame' | 'slide';

CapsStyletypeSource ↗

Capitals: none, small caps, or all caps (ST_TextCapsType).

type CapsStyle = 'none' | 'small' | 'all';

CaretAffinitytypeSource ↗

The side of a direction boundary a caret shows on (TextPoint.affinity).

type CaretAffinity = 'downstream' | 'upstream';

ChartCommandtypeSource ↗

The chart commands.

type ChartCommand = {
    readonly type: 'setChartData';
    readonly nodeId?: string;
    readonly data: Omit<ChartData, 'workbook'>;
} | {
    readonly type: 'insertChart';
    readonly chartType: ChartType;
    readonly data?: NewChartData;
} | {
    readonly type: 'setChartType';
    readonly nodeId?: string;
    readonly chartType: ChartType;
} | {
    readonly type: 'setChartFormat';
    readonly nodeId?: string;
    readonly format: ChartFormatChange;
} | {
    readonly type: 'setChartColor';
    readonly nodeId?: string;
    readonly index: number;
    readonly color: ColorChoice | null;
};

ChartDataKindtypeSource ↗

How a chart plots its data. category: each series has one value per category (bar, column, line, area, pie, doughnut, and radar charts). xy: each series has one Y value per X value (scatter charts); the categories are the X values.

type ChartDataKind = 'category' | 'xy';

ChartDataReadtypeSource ↗

The data of a chart, or why it cannot be edited. reason is a translation key, such as errors.chartData.unsupportedType.

type ChartDataRead = {
    readonly ok: true;
    readonly data: ChartData;
} | {
    readonly ok: false;
    readonly reason: string;
};

ChartFormatReadtypeSource ↗

The type and elements of a chart, or why the editor does not edit them. reason is a translation key, such as errors.chartData.combination.

type ChartFormatRead = {
    readonly ok: true;
    readonly format: ChartFormat;
} | {
    readonly ok: false;
    readonly reason: string;
};

ChartLegendPositiontypeSource ↗

Where a chart shows its legend (c:legendPos), or none for no legend.

type ChartLegendPosition = 'none' | 'top' | 'bottom' | 'left' | 'right';

ChartPaneChangetypeSource ↗

One change of the Chart Data tab: a committed field, or an add or a remove.

type ChartPaneChange = {
    readonly type: 'value';
    readonly series: number;
    readonly category: number;
    readonly text: string;
} | {
    readonly type: 'seriesName';
    readonly series: number;
    readonly text: string;
} | {
    readonly type: 'label';
    readonly category: number;
    readonly text: string;
} | {
    readonly type: 'addSeries';
    readonly name: string;
} | {
    readonly type: 'removeSeries';
    readonly series: number;
} | {
    readonly type: 'addCategory';
    readonly label: string;
} | {
    readonly type: 'removeCategory';
    readonly category: number;
};

ChartPaneResulttypeSource ↗

The command of a change, or the i18n key of why the typed text is refused.

type ChartPaneResult = {
    readonly ok: true;
    readonly command: EditorCommand;
} | {
    readonly ok: false;
    readonly error: 'chartData.errors.number' | 'chartData.errors.xNumber' | 'chartData.errors.tooLong' | 'chartData.errors.limit';
};

ChartSlotIdtypeSource ↗

The chart slot ids.

type ChartSlotId = 'chart.editData';

ChartTypetypeSource ↗

A chart type that insertChart and setChartType write (ECMA-376 Part 1, 21.2.2): the plot element, and its direction, grouping, or style. Column and bar charts are c:barChart with vertical or horizontal bars; lineMarkers shows a marker at each point; scatter shows markers only, and scatterLines joins them with lines.

type ChartType = 'columnClustered' | 'columnStacked' | 'columnPercentStacked' | 'barClustered' | 'barStacked' | 'barPercentStacked' | 'line' | 'lineMarkers' | 'area' | 'areaStacked' | 'areaPercentStacked' | 'pie' | 'doughnut' | 'radar' | 'scatter' | 'scatterLines';

ChartWorkbookStatetypeSource ↗

Where the chart's workbook is, and what an edit does to it. embedded: an edit writes the new values into the embedded workbook too. kept: the embedded workbook has a structure that the editor does not change, so it keeps its old values. external: the workbook is a linked file, which the editor never opens; an edit turns off its automatic update. none: the chart has no workbook.

type ChartWorkbookState = 'embedded' | 'kept' | 'external' | 'none';

CheckStatetypeSource ↗

A checkbox: on, off, or mixed (the selected runs disagree).

type CheckState = boolean | 'mixed';

ChromeControlShapetypeSource ↗

How a control renders.

type ChromeControlShape = 'icon' | 'stepper' | 'dropdown' | 'colorSplit' | 'gallery'
/** A rows × columns grid to pick a table size (Insert > Table). */
 | 'tableGrid';

ChromeControlStatetypeSource ↗

How a control dispatches.

type ChromeControlState = 
/** One fixed command: `commandForSlot(slot)`. */
{
    readonly kind: 'command';
}
/** A picked value: `commandForSlotValue(slot, value)`. */
 | {
    readonly kind: 'value';
}
/** Bytes from the host (an image file) to insert: `insertImage`. */
 | {
    readonly kind: 'load';
}
/**
 * Bytes from the host (an image file) that replace the selected picture's image: Change
 * Picture, `replaceImage`. A kind apart from `load` because the two dispatch differently, and
 * an adapter branching on `kind` must tell them apart (as DOCX Editor's `load` JSDoc asks).
 */
 | {
    readonly kind: 'replace';
}
/**
 * Opens a panel the adapter owns: the find bar. The adapter dispatches a `pptx-find-request`
 * event with `{ editor, replace }`, and the panel answers it.
 */
 | {
    readonly kind: 'panel';
}
/**
 * Shows a tab of the side panel: Format, Selection, or Chart Data. The slot sends
 * `requestPane`, which a mounted side panel and the host answer.
 */
 | {
    readonly kind: 'pane';
    readonly pane: 'format' | 'selection' | 'chart' | 'diagram';
}
/**
 * Opens a dialog of the `popups` registry by its key. With a probe command, the slot is on when
 * the engine takes it; the dialog runs the command.
 */
 | {
    readonly kind: 'dialog';
    readonly dialog: ChromeDialogKey;
}
/**
 * A clipboard action the adapter runs (cut, copy, paste, select all): not an editing
 * command, because a browser gives the system clipboard to a page only on a user gesture.
 */
 | {
    readonly kind: 'clipboard';
}
/** Starts the adapter's slide show, from the first shown slide or the current slide. */
 | {
    readonly kind: 'slideshow';
    readonly from: 'start' | 'current';
};

ChromeControlToggletypeSource ↗

How a control shows its state. pressed: a two-state button that carries aria-pressed (bold, bullets). choice: a dropdown of exclusive options, where the option equal to the slot's value is checked (menuitemradio). A control without it runs an action and shows no state.

type ChromeControlToggle = 'pressed' | 'choice';

ChromeDialogKeytypeSource ↗

The registry dialogs a control, a dropdown row, or a menu row opens.

type ChromeDialogKey = 'pageSetup' | 'background' | 'paragraph' | 'font' | 'bulletsAndNumbering' | 'columns' | 'imageAltText' | 'imageProperties' | 'equation';

ChromeGroupIdtypeSource ↗

The ids of the registered chrome groups. A host passes one to Toolbar.Group to change that group, as with DOCX Editor's ChromeGroupId.

type ChromeGroupId = 'history' | 'font' | 'text' | 'script' | 'paragraph' | 'list' | 'insert' | 'shape' | 'format' | 'arrange' | 'more' | 'find' | 'view' | 'file' | 'edit' | 'slide' | 'image' | 'section' | 'table' | 'chart' | 'diagram' | 'review';

ChromeMenuEntrytypeSource ↗

One row of a chrome menu.

type ChromeMenuEntry = ChromeMenuItemEntry | ChromeMenuSubmenuEntry | ChromeMenuSeparatorEntry;

ChromeMenuIdtypeSource ↗

Every menu id of the menu bar. Stable public API: renaming one is a breaking change, as for a slot id.

type ChromeMenuId = 'file' | 'edit' | 'view' | 'insert' | 'format' | 'arrange' | 'slideShow';

ChromeSlotIdtypeSource ↗

Every public slot id: <group>.<control>.

type ChromeSlotId = 'history.undo' | 'history.redo' | 'font.family' | 'font.size' | 'text.bold' | 'text.italic' | 'text.underline' | 'text.strike' | 'text.color' | 'text.highlight' | 'text.link' | 'text.characterSpacing' | 'text.changeCase' | 'text.dialog' | 'script.super' | 'script.sub' | 'paragraph.align' | 'list.bullet' | 'list.numbered' | 'list.bulletStyle' | 'list.numberStyle' | 'list.outdent' | 'list.indent' | 'list.lineSpacing' | 'paragraph.valign' | 'paragraph.dialog' | 'paragraph.textDirection' | 'paragraph.autofit' | 'paragraph.columns' | 'insert.textBox' | 'insert.line' | 'insert.shape' | 'insert.image' | 'shape.fill' | 'shape.lineColor' | 'shape.lineWidth' | 'shape.lineStart' | 'shape.lineEnd' | 'shape.lineDash' | 'shape.styles' | 'shape.effects' | 'shape.textEffects' | 'shape.properties' | 'format.painter' | 'format.clear' | 'arrange.order' | 'arrange.align' | 'arrange.group' | 'arrange.ungroup' | 'arrange.rotate' | 'arrange.selectionPane' | 'more.duplicate' | 'more.delete' | 'find.find' | 'find.replace' | 'view.smartGuides' | 'view.presentationView' | 'file.pageSetup' | 'edit.cut' | 'edit.copy' | 'edit.paste' | 'edit.selectAll' | 'slide.add' | 'slide.layout' | 'slide.reset' | 'slide.hide' | 'slide.background' | 'view.playFromStart' | 'view.playFromCurrent' | 'section.add' | 'section.rename' | 'section.remove' | 'section.removeAll' | 'section.collapseAll' | 'section.expandAll' | TableSlotId | ImageSlotId | ChartSlotId | DiagramSlotId | EquationSlotId | ChartInsertSlotId | ReviewSlotId;

ChromeTranslatetypeSource ↗

A host's translation function for the editor chrome, as DOCX Editor's ChromeTranslate: a key of the locale catalog, and its parameters, to display text.

type ChromeTranslate = (key: string, params?: TranslationParams) => string;

ClipboardDrawingReadertypeSource ↗

Reads the DrawingML clipboard package from the system clipboard: its bytes, or null when the clipboard holds none.

type ClipboardDrawingReader = () => Uint8Array | null | undefined | Promise<Uint8Array | null | undefined>;

CollaborationApplyResulttypeSource ↗

The outcome of applying a peer's ops.

type CollaborationApplyResult = {
    readonly ok: true;
    readonly revision: number;
} | {
    readonly ok: false;
    readonly rejection: OpRejection;
};

CollaborationFailureCodetypeSource ↗

Why a replica refused work, left ready, or failed a check. The subset of DOCX Editor's CollaborationFailureCode that PPTX Editor emits, with the same meanings. Branch on the code; log the detail.

type CollaborationFailureCode = 
/** The session was destroyed. Terminal. */
'collaboration-session-destroyed'
/** Factory input rejected before joining. Fix the value the host passed. */
 | 'invalid-document-id' | 'invalid-identity' | 'invalid-identity-color'
/** This client and the room have different formats. Terminal. Save local work. */
 | 'schema-version-mismatch'
/** A remote update is not applied yet. Heals when a later update arrives. Wait. */
 | 'remote-apply-failed'
/** The store refused a rebuilt part name. Terminal for this room. */
 | 'unsafe-part-name'
/** The host reported that the provider lost its connection. Recovers on its own. */
 | 'transport-disconnected';

CollaborationLocalSelectiontypeSource ↗

A selection as the local editor reports it to a session. Ids are this replica's store node ids; the session sends shared keys, never these ids. A text point is an offset (UTF-16) into a text node, or offset 0 of a paragraph element that holds no text yet.

type CollaborationLocalSelection = {
    readonly kind: 'shapes';
    readonly part: string;
    readonly shapes: readonly NodeId[];
} | {
    readonly kind: 'text';
    readonly part: string;
    readonly anchor: {
        readonly node: NodeId;
        readonly offset: number;
    };
    readonly head: {
        readonly node: NodeId;
        readonly offset: number;
    };
};

CollaborationStatustypeSource ↗

The state of a collaboration replica. The same values as DOCX Editor's CollaborationStatus.

type CollaborationStatus = 'initializing' | 'ready' | 'disconnected' | 'error' | 'destroyed';

CollectReviewItemstypeSource ↗

Derives the review queue. The free engine has no implementation.

type CollectReviewItems = (input: ReviewModelInput) => readonly ReviewItem[];

ColorChoicetypeSource ↗

A color the chrome writes: #RRGGBB (a:srgbClr) or a theme color (a:schemeClr).

type ColorChoice = string | ThemeColorChoice;

ColorModetypeSource ↗

The chrome color mode: light, dark, or the operating system's setting.

type ColorMode = 'light' | 'dark' | 'system';

ColorPicktypeSource ↗

A color field's value: the inherited color (auto), no change (keep, or mixed when the selection's colors differ), a theme color, a theme tint or shade (accent1:40 is Lighter 40%, accent1:-25 Darker 25%), or #RRGGBB.

type ColorPick = 'auto' | 'keep' | 'mixed' | ThemeColorSlot | `${ThemeColorSlot}:${number}` | `#${string}`;

CommandResulttypeSource ↗

The outcome of a command. A refusal with noop means the command had nothing to do (nothing to undo, nothing selected): nothing changed, and nothing went wrong.

type CommandResult = {
    readonly ok: true;
} | {
    readonly ok: false;
    readonly reason: string;
    readonly detail?: string;
    readonly noop?: boolean;
};

CommentAnchortypeSource ↗

Where a thread points on its slide. text: a range of an element's text, by its node id. shape: an element of the slide, by its node id. point: a place on the slide, in EMU. slide: the slide as a whole, with no place.

A text thread follows its text through edits. When an edit removes all of its text, the thread points at the element (shape). Only the threaded format holds text anchors.

type CommentAnchor = {
    readonly kind: 'slide';
} | {
    readonly kind: 'point';
    readonly x: number;
    readonly y: number;
} | {
    readonly kind: 'shape';
    readonly nodeId: string;
} | ({
    readonly kind: 'text';
    readonly nodeId: string;
} & CommentTextRange);

CommentCommandtypeSource ↗

The comment commands. Text is 1 to 10,000 characters; a line feed starts a new paragraph. The commands on an existing comment take expect, what the host showed of that comment. A new comment uses the threaded format, unless the deck has only legacy comments.

type CommentCommand = 
/**
 * Add a thread on the current slide. With `nodeId`, it points at that element, and with
 * `nodeId` and `range`, at that range of its text. Without `nodeId`, it points at the
 * selected text of a shape, else at the selected element when one element is selected, else
 * at the slide. A deck with only legacy comments has no text anchors: the thread then points
 * at the element.
 */
({
    readonly type: 'addComment';
    readonly text: string;
    readonly nodeId?: string;
    readonly range?: CommentTextRange;
} & CommentAuthorInput)
/** Reply to the thread of `commentId` (a thread or one of its replies). */
 | ({
    readonly type: 'replyToComment';
    readonly commentId: string;
    readonly text: string;
    readonly expect?: CommentExpect;
} & CommentAuthorInput)
/** Replace the text of a comment or a reply. */
 | {
    readonly type: 'editComment';
    readonly commentId: string;
    readonly text: string;
    readonly expect?: CommentExpect;
}
/** Delete a reply, or a whole thread when `commentId` is a thread. */
 | {
    readonly type: 'deleteComment';
    readonly commentId: string;
    readonly expect?: CommentExpect;
}
/** Mark a thread resolved. Refused for the legacy format (`disabled.commentNoStatus`). */
 | {
    readonly type: 'resolveComment';
    readonly commentId: string;
    readonly expect?: CommentExpect;
}
/** Mark a resolved thread active again. */
 | {
    readonly type: 'reopenComment';
    readonly commentId: string;
    readonly expect?: CommentExpect;
};

CommentFormattypeSource ↗

The file format of a comment thread.

type CommentFormat = 'modern' | 'legacy';

CommentMarkerStyletypeSource ↗

How a comment marker on the slide looks. icon: the comment icon. initials: a badge with the thread author's initials in the author's color, the reply count, and a check mark when the thread is resolved.

type CommentMarkerStyle = 'initials' | 'icon';

CustomFontsResolvertypeSource ↗

A font origin that supplies validated application font bytes on demand.

type CustomFontsResolver = MarkedFontResolver<(request: FontResolutionRequest) => Promise<LoadFontsResult>>;

DiagramCommandtypeSource ↗

The diagram commands.

type DiagramCommand = {
    readonly type: 'addDiagramShape';
    readonly position: DiagramShapePosition;
    readonly nodeId?: string;
    readonly node?: string;
} | {
    readonly type: 'deleteDiagramShape';
    readonly nodeId?: string;
    readonly node?: string;
} | {
    readonly type: 'setDiagramText';
    readonly node: string;
    readonly text: string;
    readonly nodeId?: string;
};

DiagramShapePositiontypeSource ↗

Where addDiagramShape puts the new shape: after or before the target node at its level, or below it as its last child.

type DiagramShapePosition = 'after' | 'before' | 'below';

DiagramSlotIdtypeSource ↗

The diagram slot ids.

type DiagramSlotId = 'diagram.editText' | 'diagram.addAfter' | 'diagram.addBefore' | 'diagram.addBelow' | 'diagram.delete';

DocumentOpenFailureReasontypeSource ↗

What a person can do about a file that did not open, after DOCX Editor's reason groups: damaged (the archive or its XML is broken, or the file is not a ZIP package at all), not-pptx (the package holds no presentation, or the file is empty), too-large (the file crosses a size, count, or depth limit), blocked (the file uses XML features that the editor refuses for security), and unknown.

type DocumentOpenFailureReason = 'damaged' | 'not-pptx' | 'too-large' | 'blocked' | 'unknown';

EditorCommandtypeSource ↗

Every editing command. Each compiles to store ops or is refused with a reason.

type EditorCommand = CommentCommand | {
    readonly type: 'undo';
} | {
    readonly type: 'redo';
} | {
    readonly type: 'toggleBold';
} | {
    readonly type: 'toggleItalic';
} | {
    readonly type: 'toggleUnderline';
} | {
    readonly type: 'toggleStrike';
} | {
    readonly type: 'setFontSize';
    readonly points: number;
} | {
    readonly type: 'stepFontSize';
    readonly direction: 1 | -1;
} | {
    readonly type: 'setFontFamily';
    readonly family: string;
}
/** Text color: a color choice, or null for the inherited color. */
 | {
    readonly type: 'setTextColor';
    readonly color: ColorChoice | null;
} | {
    readonly type: 'setHighlight';
    readonly color: ColorChoice | null;
} | {
    readonly type: 'setAlign';
    readonly align: TextAlign;
} | {
    readonly type: 'toggleBullets';
} | {
    readonly type: 'toggleNumbering';
} | {
    readonly type: 'indent';
    readonly direction: 1 | -1;
}
/**
 * Backspace at the start of a list item: remove the bullet or number of every list item the
 * selection touches. The item keeps its level, and its text moves to where the bullet was.
 */
 | {
    readonly type: 'removeBullet';
} | {
    readonly type: 'setLineSpacing';
    readonly multiple: number;
} | {
    readonly type: 'insertTextBox';
} | {
    readonly type: 'insertShape';
    readonly preset: string;
} | {
    readonly type: 'insertImage';
    readonly bytes: Uint8Array;
    readonly mime: string;
    readonly width: number;
    readonly height: number;
} | {
    readonly type: 'order';
    readonly move: OrderMove;
} | {
    readonly type: 'alignObjects';
    readonly align: ObjectAlign;
} | {
    readonly type: 'duplicate';
} | {
    readonly type: 'delete';
}
/**
 * Home > New Slide: add a slide after the current one. `layoutId` (`SlideLayoutSummary.id`)
 * picks its layout. Without it, the slide takes the current slide's layout, or Title and
 * Content after a title slide.
 */
 | {
    readonly type: 'addSlide';
    readonly layoutId?: string;
} | {
    readonly type: 'duplicateSlide';
    readonly index: number;
}
/**
 * Paste copied slides after the current slide. `file` is a presentation (`.pptx` bytes),
 * read with the limits of any opened file, and `slides` are its slide indexes in order. The
 * slides go on this presentation's layouts of the same type (destination theme).
 */
 | {
    readonly type: 'pasteSlides';
    readonly file: Uint8Array;
    readonly slides: readonly number[];
} | {
    readonly type: 'deleteSlide';
    readonly index: number;
}
/**
 * Move slide `from` to position `to`. It joins the section of the slide before it, or
 * `section`, by the one rule of `moveSlides`. Behavior change: a slide moved up to the first
 * place of a section joined that section before; now it joins the section before it. Pass
 * that section's id as `section` to get the earlier result.
 */
 | {
    readonly type: 'moveSlide';
    readonly from: number;
    readonly to: number;
    readonly section?: string;
}
/**
 * Insert > Slide numbers: show or hide the slide number, through the slide-number placeholder
 * of each slide's layout or master. Takes the `HeaderFooterTargets` options; by default, every
 * slide. Refused, also to hide, when no target slide can have a slide number.
 */
 | ({
    readonly type: 'setSlideNumbers';
    readonly show: boolean;
} & HeaderFooterTargets)
/**
 * Insert > Footer: show or hide the footer, through the footer placeholder (`p:ph type="ftr"`)
 * of each slide's layout or master. With `text`, every slide that shows the footer shows
 * `text`. Without `text`, a slide keeps its footer text, and a slide without a footer takes the
 * text that the other slides show. A slide that has a footer keeps its box and format. Refused
 * when no target slide's layout or master has a footer placeholder, for blank or multi-line
 * text, and without `text` when no slide shows a footer (`disabled.noFooterText`). Text is one
 * line of 1,024 characters at most.
 */
 | ({
    readonly type: 'setFooter';
    readonly show: boolean;
    readonly text?: string;
} & HeaderFooterTargets)
/**
 * Insert > Date and time: show or hide the date, through the date placeholder
 * (`p:ph type="dt"`) of each slide's layout or master. With `text`, every slide that shows the
 * date shows `text`: a `datetime1` field, which a presentation application can update when it
 * opens the file, or fixed text with `fixed: true`. Without `text`, a slide keeps its date, and
 * a slide without one takes the date that the other slides show, else today's date
 * (month/day/year) as a field; with `fixed: true`, the dates become fixed text. A slide that has
 * a date keeps its box and format. Refused when no target slide's layout or master has a date
 * placeholder, and for blank or multi-line text.
 */
 | ({
    readonly type: 'setDateTime';
    readonly show: boolean;
    readonly text?: string;
    readonly fixed?: boolean;
} & HeaderFooterTargets)
/** Delete the selected slides (`EditorSnapshot.selectedSlides`) as one undo step. */
 | {
    readonly type: 'deleteSlides';
    readonly indices: readonly number[];
}
/** Duplicate the selected slides; the copies follow the last one, in order. */
 | {
    readonly type: 'duplicateSlides';
    readonly indices: readonly number[];
}
/**
 * Move the selected slides as one block, in order, so the block starts at `to`, counted
 * among the slides that do not move. The block joins the section of the slide before it.
 * `section` (a `SlideSection.id`) puts it into that section instead, for a drop below a
 * section header or a step across one in the slide pane: the section must be the
 * section of the slide before the block, of the slide after it, or an empty section between
 * them; otherwise the command is refused. With `section`, a block that stays in place only
 * changes its section.
 */
 | {
    readonly type: 'moveSlides';
    readonly indices: readonly number[];
    readonly to: number;
    readonly section?: string;
}
/**
 * Speaker notes: write `text` as slide `index`'s notes. With `paragraphs` (the same text as
 * formatted runs, as a notes field shows it), each character also takes the bold, italic,
 * underline, and strikethrough it has there, in the same undo step.
 */
 | {
    readonly type: 'setNotes';
    readonly index: number;
    readonly text: string;
    readonly paragraphs?: readonly NotesParagraph[];
}
/**
 * Speaker notes: bold, italic, underline, or strikethrough on the plain-text range
 * `[start, end)` of slide `index`'s notes (offsets as in `EditorSnapshot.notes`), as one undo
 * step. `value` absent toggles: on, unless the whole range already has the format.
 */
 | {
    readonly type: 'formatNotes';
    readonly index: number;
    readonly start: number;
    readonly end: number;
    readonly format: NotesFormat;
    readonly value?: boolean;
}
/**
 * Home > Section > Add Section: a section that starts at slide `index` (the current slide when
 * absent) and takes the rest of the section it splits. `name` defaults to the translated
 * "Untitled Section" (`sections.untitled`). In a deck without sections, the slides before it go
 * into a first section named `defaultSectionName`, by default "Default Section" (`sections.default`).
 */
 | {
    readonly type: 'addSection';
    readonly name?: string;
    readonly index?: number;
    readonly defaultSectionName?: string;
}
/** Home > Section > Remove All Sections: the slides stay, the section list goes. */
 | {
    readonly type: 'removeAllSections';
}
/** Home > Section > Rename Section. */
 | {
    readonly type: 'renameSection';
    readonly sectionId: string;
    readonly name: string;
}
/**
 * Remove Section: its slides join the section before it (after it, for the first). With
 * `withSlides`, Remove Section & Slides deletes them. The last section removes the list.
 * `sectionId` absent: the section of the current slide.
 */
 | {
    readonly type: 'removeSection';
    readonly sectionId?: string;
    readonly withSlides?: boolean;
}
/** Move Section Up (`-1`) or Down (`1`), with its slides. */
 | {
    readonly type: 'moveSection';
    readonly sectionId: string;
    readonly direction: -1 | 1;
}
/**
 * Home > Layout: put the slides on a layout of the deck (`SlideLayoutSummary.id`) as one undo
 * step. Placeholders re-map by type and index, and their content is kept.
 * `indices` absent: the selected slides (`EditorSnapshot.selectedSlides`).
 */
 | {
    readonly type: 'applyLayout';
    readonly layoutId: string;
    readonly indices?: readonly number[];
}
/**
 * Home > Reset: re-apply each slide's layout. Text placeholders go back to the layout's
 * position, size, and formatting, and deleted placeholders come back; their text stays.
 * Pictures, tables, and charts in placeholders keep their own box. `indices` absent: the
 * selected slides.
 */
 | {
    readonly type: 'resetSlides';
    readonly indices?: readonly number[];
}
/**
 * Slide Show > Hide Slide: hide the slides (`p:sld/@show="0"`) or show them again. `indices`
 * absent: the selected slides. `hidden` absent: the toggle, which hides them unless every one
 * of them is hidden already.
 */
 | {
    readonly type: 'setSlidesHidden';
    readonly indices?: readonly number[];
    readonly hidden?: boolean;
}
/** View > Smart guides: drags snap to and show alignment guides. A view setting, not an edit. */
 | {
    readonly type: 'toggleSmartGuides';
}
/**
 * Set the table border pen (`snapshot.tableBorderPen`) that the Borders menu draws with. A
 * setting of this editor, not an edit: no undo step, never saved.
 */
 | {
    readonly type: 'setTableBorderPen';
    readonly pen: TableBorderPen;
}
/** View > Normal or Slide Sorter. A view setting, not an edit: no undo step, never saved. */
 | {
    readonly type: 'setPresentationView';
    readonly view: PresentationView;
}
/**
 * Collapse or expand sections in the slide pane and the slide sorter (Collapse All, Expand All
 * when `sectionIds` is absent). A view setting, not an edit: no undo step, never saved.
 */
 | {
    readonly type: 'setSectionsCollapsed';
    readonly collapsed: boolean;
    readonly sectionIds?: readonly string[];
}
/**
 * Replace one find match with `replacement`. The new text takes the formatting of the first
 * replaced character. Refused when the matched text is no longer there.
 */
 | {
    readonly type: 'replace';
    readonly match: FindMatch;
    readonly replacement: string;
}
/** Replace every match of `query` in the deck (slides, tables, notes) as one undo step. */
 | {
    readonly type: 'replaceAll';
    readonly query: string;
    readonly replacement: string;
    readonly options?: FindOptions;
} | {
    readonly type: 'setTransform';
    readonly nodeId: string;
    readonly x: number;
    readonly y: number;
    readonly cx: number;
    readonly cy: number;
    readonly rot: number;
} | {
    readonly type: 'nudge';
    readonly dx: number;
    readonly dy: number;
}
/** Shape fill: a color choice, or null for no fill. */
 | {
    readonly type: 'setShapeFill';
    readonly color: ColorChoice | null;
}
/** Shape fill: a linear or radial gradient. */
 | {
    readonly type: 'setShapeGradient';
    readonly gradient: GradientFill;
}
/** Outline color: a color choice, or null for no outline. */
 | {
    readonly type: 'setLineColor';
    readonly color: ColorChoice | null;
}
/** Outline width in points. */
 | {
    readonly type: 'setLineWidth';
    readonly points: number;
} | {
    readonly type: 'setLineDash';
    readonly dash: LineDash;
}
/**
 * Link the selected text to a URL (`http`, `https`, `mailto`, `tel`, `ftp`), or to a slide:
 * `#slide-3`, `#next-slide`, `#previous-slide`, `#first-slide`, `#last-slide`. null unlinks.
 */
 | {
    readonly type: 'setLink';
    readonly url: string | null;
}
/** Remove character formatting from the selected text; links stay. */
 | {
    readonly type: 'clearFormatting';
}
/** Vertical alignment of text in its shape (`a:bodyPr/@anchor`). */
 | {
    readonly type: 'setVerticalAlign';
    readonly anchor: VerticalAlign;
}
/** Arrowheads of a line: `head` at its start, `tail` at its end. Absent keeps the current end. */
 | {
    readonly type: 'setLineEnds';
    readonly head?: LineEndType;
    readonly tail?: LineEndType;
}
/**
 * The slide background: a color, a gradient, or a picture; null removes the slide's own
 * background so the layout's shows. `allSlides` applies it to every slide.
 */
 | {
    readonly type: 'setSlideBackground';
    readonly background: SlideBackground | null;
    readonly allSlides?: boolean;
}
/** Slide size in EMU, 1 to 56 in a side; `content: 'scale'` (default) fits the content. */
 | {
    readonly type: 'setSlideSize';
    readonly width: number;
    readonly height: number;
    readonly content?: 'scale' | 'keep';
}
/** Adjust values of one preset shape by guide name, in guide units (see `a:gd`). */
 | {
    readonly type: 'setAdjustments';
    readonly values: Readonly<Record<string, number>>;
}
/** Insert a line, an arrow, or an elbow or curved connector. */
 | {
    readonly type: 'insertLine';
    readonly kind: LineKind;
}
/** Text fitting: none, shrink text on overflow, or resize the shape to fit its text. */
 | {
    readonly type: 'setAutofit';
    readonly mode: TextFitting;
}
/** The selected shapes' text warp, with adjust values by guide name; null removes it. */
 | {
    readonly type: 'setTextWarp';
    readonly preset: TextWarpPreset | null;
    readonly adjust?: Readonly<Record<string, number>>;
} | {
    readonly type: 'setTransforms';
    readonly items: readonly TransformItem[];
} | {
    readonly type: 'group';
} | {
    readonly type: 'ungroup';
} | {
    readonly type: 'paste';
    readonly payload: ClipboardPayload;
}
/**
 * The Format Painter button. A press copies the formatting of the selection and arms the
 * painter for one paint; a second press within the double-click time keeps it on until
 * Escape (`sticky` does that at once); a press while it is on turns it off.
 */
 | {
    readonly type: 'toggleFormatPainter';
    readonly sticky?: boolean;
}
/** Copy the formatting of the selection without arming the painter (Ctrl/Cmd+Shift+C). */
 | {
    readonly type: 'copyFormat';
}
/** Apply the copied formatting to the selection as one undo step (Ctrl/Cmd+Shift+V). */
 | {
    readonly type: 'pasteFormat';
} | TextFormatCommand | PictureCommand | ChartCommand | EquationCommand | DiagramCommand | FillCommand | AnimationCommand
/**
 * Shape Effects: set or remove one effect of the selected shapes, connectors, and pictures.
 * A shape whose effects come from its theme style (`a:effectRef`) gets that style's effects
 * written into it first, so its other effects stay.
 */
 | {
    readonly type: 'setShapeEffect';
    readonly effect: ShapeEffectChoice;
}
/**
 * Shape Styles: apply a theme style of the Shape Styles gallery to the selected shapes. It
 * writes `p:style` and removes the shape's own fill, outline, and effects.
 */
 | {
    readonly type: 'setShapeStyle';
    readonly style: ShapeStyleChoice;
}
/**
 * Distribute the selected elements so the gaps between them are equal. One element centers
 * on the slide; two are refused; three or more keep the outer two in place.
 */
 | {
    readonly type: 'distributeObjects';
    readonly axis: ObjectAxis;
}
/** Flip each selected element about its own center (`a:xfrm/@flipH`, `@flipV`). */
 | {
    readonly type: 'flipObjects';
    readonly axis: ObjectAxis;
}
/** Turn each selected element by `degrees` about its center; 90 is Rotate Right 90°. */
 | {
    readonly type: 'rotateObjects';
    readonly degrees: number;
}
/** Lock or unlock the aspect ratio of the selected elements (`noChangeAspect`). */
 | {
    readonly type: 'setLockAspectRatio';
    readonly lock: boolean;
}
/** Selection pane: show or hide elements of the current slide (`p:cNvPr/@hidden`). */
 | {
    readonly type: 'setShapesVisible';
    readonly nodeIds: readonly string[];
    readonly visible: boolean;
}
/** Selection pane: rename an element of the current slide (`p:cNvPr/@name`). */
 | {
    readonly type: 'renameShape';
    readonly nodeId: string;
    readonly name: string;
} | TableCommand;

EditorCommandTypetypeSource ↗

The command type names.

type EditorCommandType = EditorCommand['type'];

EditorExecOptionstypeSource ↗

Options for one command.

type EditorExecOptions = HistoryGroupOptions;

EditorFontErrorCodetypeSource ↗

Why a font was not admitted.

Distinguished rather than collapsed because the responses differ: overLimit and malformed are the caller's own bytes, while forbidden and hashMismatch mean the source was not what it claimed and the load should not be retried. wasmUnavailable alone is a HOST fault — the shaper's WASM never loaded, diagnostic carries the remedy — surface it as a setup error.

type EditorFontErrorCode = 'initializationFailed' | 'wasmUnavailable' | 'missing' | 'forbidden' | 'overLimit' | 'malformed' | 'hashMismatch' | 'metadataMismatch' | 'fontFaceLoadFailed' | 'unsupportedFaceIndex' | 'missingFont' | 'hashInvalid' | 'fontMismatch' | 'unsupportedFace' | 'loadFailed';

EditorFontsOptiontypeSource ↗

What the fonts option and prop take, as DOCX Editor's DocxEditorConfig.fonts.

type EditorFontsOption = FontConfiguration | FontConfigurationFragment | FontResolver;

EditorModetypeSource ↗

The editing mode, matching the toolbar's mode pill.

type EditorMode = 'edit' | 'view';

EditorSelectiontypeSource ↗

What is selected.

type EditorSelection = {
    readonly kind: 'none';
} | {
    readonly kind: 'shapes';
    readonly nodeIds: readonly string[];
    readonly group?: string;
} | {
    readonly kind: 'text';
    readonly nodeId: string;
    readonly anchor: TextPoint;
    readonly focus: TextPoint;
    readonly cell?: TableCellAddress;
    readonly diagramNode?: string;
} | {
    readonly kind: 'cells';
    readonly nodeId: string;
    readonly anchor: TableCellAddress;
    readonly focus: TableCellAddress;
};

ElementKindLabelKeytypeSource ↗

The i18n key that names a selected element in the Format panel.

type ElementKindLabelKey = 'panel.format.elementKind.shape' | 'panel.format.elementKind.picture' | 'panel.format.elementKind.group' | 'panel.format.elementKind.connector' | 'panel.format.elementKind.graphicFrame' | 'panel.format.elementKind.table' | 'panel.format.elementKind.chart' | 'panel.format.elementKind.diagram';

EquationCommandtypeSource ↗

The equation commands. An equation's math is written from a linear form, a short text syntax: a/b is a fraction, x^2 and x_i are scripts, \sqrt(x) is a square root, \sum_(i=1)^n is a sum, and \alpha is a Greek letter. The equations guide lists the whole syntax.

type EquationCommand = 
/**
 * Insert > Equation: a new text box centered on the slide, with the equation of `linear`.
 * `font` names the font of its math runs; default `Cambria Math`. The text box is selected.
 */
{
    readonly type: 'insertEquation';
    readonly linear: string;
    readonly font?: string;
}
/**
 * Replace the math of an equation (`SelectedEquationState.nodeId`) with the equation of
 * `linear`. The equation keeps its alignment and the font, size, and color of its first run.
 */
 | {
    readonly type: 'setEquation';
    readonly nodeId: string;
    readonly linear: string;
};

EquationSlotIdtypeSource ↗

The insert.equation slot id.

type EquationSlotId = 'insert.equation';

FillCommandtypeSource ↗

The fill commands of shapes beyond a color and a gradient.

type FillCommand = 
/** Shape fill: a preset pattern. */
{
    readonly type: 'setShapePattern';
    readonly pattern: PatternFill;
}
/**
 * Shape fill: a PNG, JPEG, or GIF picture, stretched over the shape, or tiled at its own
 * size when `tile` is true. The type comes from the bytes; other bytes are refused.
 */
 | {
    readonly type: 'setShapePicture';
    readonly bytes: Uint8Array;
    readonly mime?: string;
    readonly tile?: boolean;
};

FindSteptypeSource ↗

Where a find step landed. index is -1 and match null when nothing matches.

type FindStep = {
    readonly ok: true;
    readonly match: FindMatch | null;
    readonly index: number;
    readonly total: number;
} | {
    readonly ok: false;
    readonly reason: string;
    readonly detail?: string;
};

FontCatalogConfigurationtypeSource ↗

A configuration in either public spelling — full or fragment-with-defaults.

type FontCatalogConfiguration = FontConfiguration | FontConfigurationBase;

FontLoadFailureReasontypeSource ↗

Why one font did not load.

Distinguished rather than collapsed to "failed" because the responses differ: networkError and httpError are worth retrying, while hashMismatch and malformed mean the bytes were not what the source claimed and retrying will fetch the same wrong thing.

type FontLoadFailureReason = 'networkError' | 'httpError' | 'hashMismatch' | 'overLimit' | 'emptyResponse'
/** The declared face itself is unusable (empty family, out-of-range weight); nothing was fetched. */
 | 'invalidRequest'
/** The bytes are not a font at all — most often an HTML error page served with 200. */
 | 'malformed';

FontOrigintypeSource ↗

ONE font origin, in the one shape every origin takes: a finished configuration, a fragment, a promise for either, or a marked resolver that answers per document.

The point of the union is that packagedFonts(), googleFonts(), await defaultFonts() and a hand-built { sources } are all the same kind of thing, so a list of them needs no ordering rule beyond "first wins".

The resolver arm is [MarkedFontResolver](MarkedFontResolver), not bare FontResolver: a list may also hold a zero-argument loader, and only the mark separates the two.

type FontOrigin = FontConfiguration | FontConfigurationFragment | MarkedFontResolver | Promise<FontConfiguration | FontConfigurationFragment | undefined> | undefined;

FontPickerGroupIdtypeSource ↗

A font picker group: the slide's theme fonts (theme), the other families the deck names (document), or every family the editor offers (all).

type FontPickerGroupId = 'theme' | 'document' | 'all';

FontResolvertypeSource ↗

Resolve fonts once the document's needs are known, instead of ahead of them.

Called after the file is mounted and again when editing requests a new family. Results compose with previously supplied faces; resolvedFaces identifies that coverage. Returning nothing is a valid answer — it means "I cover none of this", and the document stays on the fixed measurer.

A resolver that fetches makes opening a document perform network requests. That is a real change in posture and it must stay the APP's decision: the engine never supplies one, and the families here are file-derived, so a resolver must look them up in a set it shipped rather than interpolate them into a URL.

type FontResolver = (request: FontResolutionRequest) => FontConfiguration | FontConfigurationFragment | undefined | Promise<FontConfiguration | FontConfigurationFragment | undefined>;

FontStyleChoicetypeSource ↗

The Font style choice: bold and italic together.

type FontStyleChoice = 'regular' | 'italic' | 'bold' | 'boldItalic';

FormatPainterModetypeSource ↗

The format painter: off, armed for one paint (once), or on until Escape or a second press (sticky).

type FormatPainterMode = 'off' | 'once' | 'sticky';

HyperlinkPopupModetypeSource ↗

What the link popup shows.

type HyperlinkPopupMode = 
/** Not shown. */
'closed'
/** The link under the caret: its target, with Copy, Edit, and Unlink. */
 | 'reading'
/** The URL field, for a new link or a change to one. */
 | 'editing';

ImageCroptypeSource ↗

A picture crop. rect crops each edge in percent: the image stays in place and the frame changes, as a crop handle does; with keepFrame, the frame stays and the image moves in it. fill and fit keep the frame and crop the image to cover it or to show all of it; aspect crops the image to a width-to-height ratio.

type ImageCrop = ({
    readonly kind: 'rect';
    readonly keepFrame?: boolean;
} & ImageCropPercent) | {
    readonly kind: 'fill';
} | {
    readonly kind: 'fit';
} | {
    readonly kind: 'aspect';
    readonly width: number;
    readonly height: number;
};

ImageRasterizertypeSource ↗

Turns the SVG of a picture into PNG bytes of exactly width by height pixels.

type ImageRasterizer = (request: ImageRasterRequest) => Promise<Uint8Array> | Uint8Array;

ImageRecolortypeSource ↗

The Recolor presets of the Color gallery. accentNDark and accentNLight are the dark and light variations of theme accent N (a:duotone).

type ImageRecolor = 'none' | 'grayscale' | 'sepia' | 'blackWhite25' | 'blackWhite50' | 'blackWhite75' | `accent${1 | 2 | 3 | 4 | 5 | 6}${'Dark' | 'Light'}`;

ImageSlotIdtypeSource ↗

The image slot ids.

type ImageSlotId = 'image.corrections' | 'image.color' | 'image.transparency' | 'image.change' | 'image.reset' | 'image.styles' | 'image.altText' | 'image.crop' | 'image.cropToShape' | 'image.cropFit' | 'image.properties';

ImageStyleIdtypeSource ↗

The picture styles the gallery offers, with the gallery's names in camel case.

type ImageStyleId = 'simpleFrameWhite' | 'simpleFrameBlack' | 'softEdgeRectangle' | 'softEdgeOval' | 'reflectedRoundedRectangle';

LineDashtypeSource ↗

Outline dash presets offered by the chrome (a:prstDash values).

type LineDash = 'solid' | 'sysDot' | 'sysDash' | 'dash' | 'dashDot' | 'lgDash' | 'lgDashDot';

LineEndTypetypeSource ↗

Line end (arrowhead) types (a:headEnd/@type, a:tailEnd/@type).

type LineEndType = 'none' | 'triangle' | 'arrow' | 'stealth' | 'oval' | 'diamond';

LineKindtypeSource ↗

Lines the chrome inserts.

type LineKind = 'line' | 'arrow' | 'elbow' | 'curved';

LineRuletypeSource ↗

The Line Spacing choice, as the dialog lists it.

type LineRule = 'single' | 'onePointFive' | 'double' | 'exact' | 'multiple';

LocalFontsOutcometypeSource ↗

Why reading local fonts produced nothing.

type LocalFontsOutcome = {
    readonly ok: true;
    readonly sources: readonly FontSource$1[];
} | {
    readonly ok: false;
    readonly reason: 'unsupported' | 'denied' | 'none';
};

MarkedFontResolvertypeSource ↗

A [FontResolver](FontResolver) that has been through [defineFontResolver](defineFontResolver).

This, not bare FontResolver, is what a FontOrigin list accepts. The mark is the only thing separating a resolver from a zero-argument loader, and getting that wrong loses every font silently, so the type asks for it up front.

type MarkedFontResolver<T extends FontResolver = FontResolver> = T & FontResolverMark;

NotesFormattypeSource ↗

Character formats the speaker notes pane sets.

type NotesFormat = 'bold' | 'italic' | 'underline' | 'strike';

NumberGalleryKeytypeSource ↗

The keys of the Numbering gallery (Home Numbering), in its order.

type NumberGalleryKey = 'none' | 'arabicPeriod' | 'arabicParenR' | 'romanUcPeriod' | 'alphaUcPeriod' | 'alphaLcParenR' | 'alphaLcPeriod' | 'romanLcPeriod';

ObjectAligntypeSource ↗

Object alignment targets.

type ObjectAlign = 'left' | 'center' | 'right' | 'top' | 'middle' | 'bottom';

ObjectAxistypeSource ↗

The axis of a flip or a distribute: horizontal acts along x.

type ObjectAxis = 'horizontal' | 'vertical';

OpenErrortypeSource ↗

Why a file could not be opened.

type OpenError = PackageRejection | {
    readonly reason: 'empty';
};

OrderMovetypeSource ↗

Z-order moves.

type OrderMove = 'forward' | 'backward' | 'front' | 'back';

ParagraphAlignmenttypeSource ↗

Paragraph alignment as the Paragraph dialog names it (algn: l, ctr, r, just, dist).

type ParagraphAlignment = 'left' | 'center' | 'right' | 'justify' | 'distributed';

PatternPresettypeSource ↗

The 54 preset patterns (ST_PresetPatternVal, ECMA-376 Part 1, 20.1.10.51).

type PatternPreset = 'pct5' | 'pct10' | 'pct20' | 'pct25' | 'pct30' | 'pct40' | 'pct50' | 'pct60' | 'pct70' | 'pct75' | 'pct80' | 'pct90' | 'horz' | 'vert' | 'ltHorz' | 'ltVert' | 'dkHorz' | 'dkVert' | 'narHorz' | 'narVert' | 'dashHorz' | 'dashVert' | 'cross' | 'dnDiag' | 'upDiag' | 'ltDnDiag' | 'ltUpDiag' | 'dkDnDiag' | 'dkUpDiag' | 'wdDnDiag' | 'wdUpDiag' | 'dashDnDiag' | 'dashUpDiag' | 'diagCross' | 'smCheck' | 'lgCheck' | 'smGrid' | 'lgGrid' | 'dotGrid' | 'smConfetti' | 'lgConfetti' | 'horzBrick' | 'diagBrick' | 'solidDmnd' | 'openDmnd' | 'dotDmnd' | 'plaid' | 'sphere' | 'weave' | 'divot' | 'shingle' | 'wave' | 'trellis' | 'zigZag';

PictureCommandtypeSource ↗

The picture commands (picture-commands.ts): crop, crop to shape, crop mode, Change Picture, Reset Picture, Corrections and Color, styles, Format Picture, and alt text.

type PictureCommand = 
/**
 * Crop the selected picture (`a:srcRect`): to a crop rectangle, where the image stays in place
 * on the slide and the frame changes; to fill or fit its frame; or to an aspect ratio.
 */
{
    readonly type: 'cropImage';
    readonly crop: ImageCrop;
}
/** Crop the selected pictures to a preset shape (`a:prstGeom`); `rect` crops back to a rectangle. */
 | {
    readonly type: 'cropToShape';
    readonly preset: string;
}
/**
 * The Crop button: turn crop mode on for the selected picture, or off. In crop mode the crop
 * handles show; Escape, a second press, or another selection ends it.
 */
 | {
    readonly type: 'toggleCrop';
}
/**
 * Change Picture: replace the selected picture's image with an image file. The new image fits
 * in the old frame; the crop resets, and the border, effects, and adjustments stay. `width` and
 * `height` are the stored pixel size; without them, the engine reads it from the image header.
 * A JPEG's EXIF orientation does not count: the stored pixels do.
 */
 | {
    readonly type: 'replaceImage';
    readonly bytes: Uint8Array;
    readonly mime: string;
    readonly width?: number;
    readonly height?: number;
}
/**
 * Reset Picture: remove the adjustments, the border, the effects, and the crop to a shape.
 * `size` also removes the crop and gives the picture its own size (Reset Picture & Size).
 */
 | {
    readonly type: 'resetImage';
    readonly size?: boolean;
}
/** Corrections, color, and transparency of the selected pictures. Absent fields stay. */
 | {
    readonly type: 'setImageAdjustments';
    readonly adjustments: ImageAdjustments;
}
/** A picture style of the Picture Styles gallery: border, effects, and shape. */
 | {
    readonly type: 'setImageStyle';
    readonly style: ImageStyleId;
}
/**
 * Format Picture: the size, rotation, and crop of the selected picture as one undo step, with
 * the fields on the command, after DOCX Editor's `setImageProperties`. It takes `widthEmu`,
 * `heightEmu`, and `crop` as DOCX Editor does, plus `rotationDegrees`; absent fields stay, and
 * any other field is refused. DOCX Editor's other fields live elsewhere: alt text in
 * `setAltText` (every object), links in `setLink`, the natural size in `resetImage` with
 * `size`, the border in the Shape line commands; it has no target check, as the dialog closes
 * when its picture changes. DOCX Editor's wrap and position fields have no slide equivalent.
 */
 | ({
    readonly type: 'setImageProperties';
} & ImageProperties)
/**
 * Alt text of the selected element (`p:cNvPr/@descr` and `@title`). `decorative` marks it as
 * decorative, as the Alt Text pane does; a decorative element keeps no description,
 * and a description for one is refused unless `decorative` is false. An absent field keeps the
 * element's own; an empty description or title removes it.
 */
 | {
    readonly type: 'setAltText';
    readonly description?: string;
    readonly title?: string;
    readonly decorative?: boolean;
};

PptxFontOrigintypeSource ↗

One entry of a fonts list: any FontOrigin, or a zero-argument loader. A function that takes a request must be marked by defineFontResolver.

type PptxFontOrigin = FontOrigin | (() => PptxFontsInput | Promise<PptxFontsInput>);

PptxFontsInputtypeSource ↗

A complete font configuration, or a fragment that composes with the defaults.

type PptxFontsInput = FontConfiguration | FontConfigurationFragment;

PptxFontsSourcetypeSource ↗

How a host supplies fonts: one origin, or a list of them in precedence order.

type PptxFontsSource = PptxFontOrigin | readonly PptxFontOrigin[];

PptxSourcetypeSource ↗

The presentation: a URL to fetch, or bytes already in hand. A string is always a URL.

type PptxSource = string | URL | Uint8Array | ArrayBuffer;

PresentationViewtypeSource ↗

How the editor shows the deck: normal (the slide with the rail and notes), slideSorter (every slide as a thumbnail, by section), or slideMaster (the slide masters and layouts, edited on the canvas), as the View tab names them (ppViewNormal, ppViewSlideSorter, ppViewSlideMaster).

type PresentationView = 'normal' | 'slideSorter' | 'slideMaster';

ReflectionPresettypeSource ↗

The presets of the Reflection gallery: size, and the gap to the shape.

type ReflectionPreset = 'tightTouching' | 'halfTouching' | 'fullTouching' | 'tight4pt' | 'half4pt' | 'full4pt' | 'tight8pt' | 'half8pt' | 'full8pt';

ReplaceAllResulttypeSource ↗

The outcome of replace all: how many matches were replaced.

type ReplaceAllResult = {
    readonly ok: true;
    readonly count: number;
} | {
    readonly ok: false;
    readonly reason: string;
    readonly detail?: string;
};

ResolvedColorModetypeSource ↗

The theme a root resolved from colorMode, never 'system'. DOCX Editor's type.

type ResolvedColorMode = 'light' | 'dark';

ReviewDisplayModetypeSource ↗

How the editor shows review content. final is the free engine's view: the deck as saved. markup shows comment markers and suggestions.

type ReviewDisplayMode = 'final' | 'markup';

ReviewItemKindtypeSource ↗

The kinds of review item. PresentationML has comments but no tracked-change markup, so a suggestion is a proposed set of ops that the review module holds outside the deck until a reviewer accepts or rejects it.

type ReviewItemKind = 'comment' | 'suggestion';

ReviewPaneOpeningtypeSource ↗

What a press on a comment marker does besides picking the thread. auto: it also asks for the **Comments** tab of the side panel (requestPane). manual: it only picks the thread, and the host opens its own comments view.

type ReviewPaneOpening = 'auto' | 'manual';

ReviewSlotIdtypeSource ↗

The review slot ids.

type ReviewSlotId = 'review.addComment';

RibbonContexttypeSource ↗

What a contextual tab waits for: shapes, a picture, a chart, a diagram, or a table in the selection.

type RibbonContext = 'shape' | 'picture' | 'chart' | 'diagram' | 'table';

RibbonSelectiontypeSource ↗

What a contextual tab reads from the snapshot.

type RibbonSelection = Pick<EditorSnapshot, 'selection' | 'image' | 'table'> & Partial<Pick<EditorSnapshot, 'chart' | 'diagram'>>;

RibbonTabIdtypeSource ↗

Every ribbon tab id. Stable public API, as ChromeGroupId. quickAccess is the Quick Access Toolbar beside the tab names.

type RibbonTabId = 'quickAccess' | 'home' | 'insert' | 'design' | 'slideShow' | 'view' | 'shapeFormat' | 'pictureFormat' | 'chartDesign' | 'diagramDesign' | 'tableDesign' | 'tableLayout';

RotateChoicetypeSource ↗

An arrange.rotate value: the 90° turns, then the flips.

type RotateChoice = 'right90' | 'left90' | 'flipVertical' | 'flipHorizontal';

Rotation3DPresettypeSource ↗

The presets of the 3-D Rotation gallery: camera presets of ST_PresetCameraType (ECMA-376 Part 1, 20.1.10.47) with parallel projection.

type Rotation3DPreset = 'isometricLeftDown' | 'isometricRightUp' | 'isometricTopUp' | 'isometricOffAxis1Left' | 'isometricOffAxis1Right' | 'obliqueTopLeft' | 'obliqueTopRight' | 'obliqueBottomLeft' | 'obliqueBottomRight';

ShadowPresettypeSource ↗

The presets of the Shadow gallery: the nine Outer shadows ("Offset: Bottom Right") and the nine Inner shadows ("Inside: Top Left").

type ShadowPreset = 'outerBottomRight' | 'outerBottom' | 'outerBottomLeft' | 'outerRight' | 'outerCenter' | 'outerLeft' | 'outerTopRight' | 'outerTop' | 'outerTopLeft' | 'innerTopLeft' | 'innerTop' | 'innerTopRight' | 'innerLeft' | 'innerCenter' | 'innerRight' | 'innerBottomLeft' | 'innerBottom' | 'innerBottomRight';

ShapeEffectChoicetypeSource ↗

One effect to set; a null preset or size removes the effect.

type ShapeEffectChoice = {
    readonly kind: 'shadow';
    readonly preset: ShadowPreset | null;
} | {
    readonly kind: 'reflection';
    readonly preset: ReflectionPreset | null;
} | {
    readonly kind: 'glow';
    readonly size: number | null;
    readonly color?: ColorChoice;
}
/** Soft edge size in points (the gallery offers 1, 2.5, 5, 10, 25, and 50). */
 | {
    readonly kind: 'softEdge';
    readonly size: number | null;
}
/** Blur radius in points (`a:blur`). No gallery offers it. */
 | {
    readonly kind: 'blur';
    readonly size: number | null;
}
/** A top bevel (`a:sp3d/a:bevelT`), with a front camera when the shape has no scene. */
 | {
    readonly kind: 'bevel';
    readonly preset: BevelPreset | null;
}
/** A camera preset (`a:scene3d/a:camera`); null turns the camera back to the front. */
 | {
    readonly kind: 'rotation3d';
    readonly preset: Rotation3DPreset | null;
};

ShapeEffectsValuetypeSource ↗

A shape.effects option value: an effect and its choice (shadow.outerTop, glow.8.accent2, softEdge.none). A glow without a color keeps the shape's glow color. Sizes are points above 0; the command refuses others. The slot's state value lists the current choice of each effect, separated by spaces: test an option with chromeOptionChecked.

type ShapeEffectsValue = `shadow.${ShadowPreset | 'none'}` | `reflection.${ReflectionPreset | 'none'}` | `glow.${number | 'none'}` | `glow.${number}.${Exclude<ShapeStyleColor, 'dk1'>}` | `softEdge.${number | 'none'}` | `bevel.${BevelPreset | 'none'}` | `rotation3d.${Rotation3DPreset | 'none'}`;

ShapeStyleColortypeSource ↗

The columns of the Shape Styles gallery: Dark 1, then Accent 1 to 6 (theme color names).

type ShapeStyleColor = 'dk1' | 'accent1' | 'accent2' | 'accent3' | 'accent4' | 'accent5' | 'accent6';

ShapeStyleRowtypeSource ↗

The rows of the Shape Styles gallery (theme styles), top to bottom: Colored Outline, Colored Fill, Light 1 Outline Colored Fill, Subtle Effect, Moderate Effect, Intense Effect.

type ShapeStyleRow = 'coloredOutline' | 'coloredFill' | 'lightOutline' | 'subtleEffect' | 'moderateEffect' | 'intenseEffect';

ShapeStyleValuetypeSource ↗

A shape.styles value: a gallery cell as row.color (intenseEffect.accent2).

type ShapeStyleValue = `${ShapeStyleRow}.${ShapeStyleColor}`;

SidePanelTabtypeSource ↗

A tab of the side panel: Format, Chart Data, Diagram (the text of the diagram's shapes), Selection (the selection pane), Animations, or Comments.

type SidePanelTab = (typeof SIDE_PANEL_TABS)[number];

SlideBackgroundtypeSource ↗

A slide background the chrome sets.

type SlideBackground = {
    readonly kind: 'solid';
    readonly color: ColorChoice;
} | {
    readonly kind: 'gradient';
    readonly gradient: GradientFill;
} | {
    readonly kind: 'pattern';
    readonly pattern: PatternFill;
} | {
    readonly kind: 'picture';
    readonly bytes: Uint8Array;
    readonly mime: string;
    readonly tile?: boolean;
};

SlideLayoutKindtypeSource ↗

The kind of a slide layout, with the file's own values: ST_SlideLayoutType (ECMA-376 Part 1, §19.7.15). cust is a custom layout, and also the value for a file that names none or an unknown kind. The Office.js SlideLayoutType enum names the same idea with other values ("TitleOnly" for titleOnly); the automation API keeps that name for its own type.

type SlideLayoutKind = 'title' | 'tx' | 'twoColTx' | 'tbl' | 'txAndChart' | 'chartAndTx' | 'dgm' | 'chart' | 'txAndClipArt' | 'clipArtAndTx' | 'titleOnly' | 'blank' | 'txAndObj' | 'objAndTx' | 'objOnly' | 'obj' | 'txAndMedia' | 'mediaAndTx' | 'objOverTx' | 'txOverObj' | 'txAndTwoObj' | 'twoObjAndTx' | 'twoObjOverTx' | 'fourObj' | 'vertTx' | 'clipArtAndVertTx' | 'vertTitleAndTx' | 'vertTitleAndTxOverChart' | 'twoObj' | 'objAndTwoObj' | 'twoObjAndObj' | 'cust' | 'secHead' | 'twoTxTwoObj' | 'objTx' | 'picTx';

SlideOrientationtypeSource ↗

Landscape: the width is the longer side.

type SlideOrientation = 'landscape' | 'portrait';

SlideRailOrientationtypeSource ↗

Where the slide rail runs: a column (vertical) or a row (horizontal).

type SlideRailOrientation = 'vertical' | 'horizontal';

SlideSelectModetypeSource ↗

How a click in the slide rail changes the slide selection.

type SlideSelectMode = 'replace' | 'toggle' | 'range';

SlideshowScreentypeSource ↗

What the show displays: the slide, a black or white screen, or the end screen.

type SlideshowScreen = 'slide' | 'black' | 'white' | 'end';

SlideshowStarttypeSource ↗

Where a show starts: the first slide shown, or a slide index.

type SlideshowStart = 'start' | number;

SlideSizePresettypeSource ↗

A named slide size, or custom.

type SlideSizePreset = 'widescreen' | 'standard' | 'a4' | 'letter' | 'custom';

SpacingChoicetypeSource ↗

The Character Spacing choice.

type SpacingChoice = 'normal' | 'expanded' | 'condensed';

SpacingUnittypeSource ↗

The unit of a Before or After field.

type SpacingUnit = 'pt' | 'lines';

SpecialIndenttypeSource ↗

The Special choice: the sign of the first-line offset.

type SpecialIndent = 'none' | 'firstLine' | 'hanging';

StrikeStyletypeSource ↗

Strikethrough: none, single, or double (ST_TextStrikeType).

type StrikeStyle = 'none' | 'single' | 'double';

TableBorderEdgeTargettypeSource ↗

The edges a border is set on: every target but none, as DOCX Editor's type.

type TableBorderEdgeTarget = Exclude<TableBorderTarget, 'none'>;

TableBorderTargettypeSource ↗

Which cell edges a border command sets, as DOCX Editor's TableBorderTarget.

type TableBorderTarget = 'all' | 'outside' | 'inside' | 'none' | 'top' | 'bottom' | 'left' | 'right';

TableChromeSlotIdtypeSource ↗

A slot of the table group that a table selection shows (every one but Insert Table).

type TableChromeSlotId = Exclude<Extract<ChromeSlotId, `table.${string}`>, 'table.insert'>;

TableCommandtypeSource ↗

Table commands (table-commands.ts). Each acts on the table of the selection: a caret in a cell, a cell range, or the selected table frame. The structure commands have DOCX Editor's names; three differ (the style options, the shared Align buttons, and No Border).

type TableCommand = 
/** Insert > Table: a `rows` × `cols` table with the theme's default table style. */
{
    readonly type: 'insertTable';
    readonly rows: number;
    readonly cols: number;
}
/** Insert a row above or below the selected rows. */
 | {
    readonly type: 'insertRow';
    readonly where: 'above' | 'below';
}
/** Insert a column left or right of the selected columns. */
 | {
    readonly type: 'insertColumn';
    readonly where: 'left' | 'right';
} | {
    readonly type: 'deleteRow';
} | {
    readonly type: 'deleteColumn';
} | {
    readonly type: 'deleteTable';
}
/** Select the whole table, or the rows or columns of the selected cells. Not an edit. */
 | {
    readonly type: 'selectTableRegion';
    readonly region: 'table' | 'row' | 'column';
}
/** Merge the selected cell range into one cell; the text of every cell is kept. */
 | {
    readonly type: 'mergeCells';
}
/** Split the selected cell into `rows` × `cols` cells. */
 | {
    readonly type: 'splitCell';
    readonly rows: number;
    readonly cols: number;
}
/** Cell shading: a color choice, or null for No Fill (`a:noFill`, over the style's fill). */
 | {
    readonly type: 'setCellFill';
    readonly color: ColorChoice | null;
}
/** Borders of the selected cells, drawn with `spec`; `scope: 'none'` removes them. */
 | {
    readonly type: 'setTableBorders';
    readonly scope: 'none';
} | {
    readonly type: 'setTableBorders';
    readonly scope: TableBorderEdgeTarget;
    readonly spec: TableBorderSpec;
}
/** The table style (`a:tableStyleId`), by `styleId`. */
 | {
    readonly type: 'setTableStyle';
    readonly styleId: string;
}
/** Turn one table style option (`a:tblPr` flag) on or off. */
 | {
    readonly type: 'toggleTableStyleOption';
    readonly option: TableStyleOption;
}
/** Cell margins in EMU; an absent side keeps its value. */
 | {
    readonly type: 'setCellMargins';
    readonly margins: {
        readonly left?: number;
        readonly right?: number;
        readonly top?: number;
        readonly bottom?: number;
    };
}
/** The height of the selected rows in EMU (`a:tr/@h`, a minimum). */
 | {
    readonly type: 'setRowHeight';
    readonly height: number;
}
/** The width of the selected columns in EMU (`a:gridCol/@w`). */
 | {
    readonly type: 'setColumnWidth';
    readonly width: number;
}
/**
 * Fill cells with plain text from the top-left cell of the selection (a paste of copied
 * cells): one array for each row, one string for each cell. Each written cell keeps the format
 * of its first run. Text past the table's edge adds rows at the bottom and columns at the end of the grid (the right, or the left in a right-to-left table)
 * (new columns share the table's width), up to the table limits; a position inside a merged
 * cell is skipped.
 */
 | {
    readonly type: 'pasteCells';
    readonly texts: readonly (readonly string[])[];
}
/** Give the selected rows (or every row) the same height. */
 | {
    readonly type: 'distributeRows';
}
/** Give the selected columns (or every column) the same width. */
 | {
    readonly type: 'distributeColumns';
}
/**
 * Set every column width and row height of the selected table, in EMU (a grid line drag).
 * Run the steps of one drag with one `historyGroup` (`exec` options) for one undo step.
 */
 | {
    readonly type: 'setTableGrid';
    readonly columns?: readonly number[];
    readonly rows?: readonly number[];
};

TableSlotIdtypeSource ↗

The slots of the table group, part of ChromeSlotId.

type TableSlotId = 'table.insert' | 'table.style' | 'table.headerRow' | 'table.totalRow' | 'table.bandedRows' | 'table.firstColumn' | 'table.lastColumn' | 'table.bandedColumns' | 'table.cellFill' | 'table.borderTarget' | 'table.borderColor' | 'table.borderStyle' | 'table.borderWidth' | 'table.select' | 'table.delete' | 'table.insertRowAbove' | 'table.insertRowBelow' | 'table.insertColumnLeft' | 'table.insertColumnRight' | 'table.mergeCells' | 'table.splitCell' | 'table.distributeRows' | 'table.distributeColumns' | 'table.cellMargins';

TableStyleOptiontypeSource ↗

Table style options, the a:tblPr flags: Header Row, Total Row, Banded Rows, First Column, Last Column, Banded Columns.

type TableStyleOption = 'firstRow' | 'lastRow' | 'bandRow' | 'firstCol' | 'lastCol' | 'bandCol';

TextAligntypeSource ↗

Paragraph alignment values the chrome can set.

type TextAlign = 'l' | 'ctr' | 'r' | 'just';

TextCasetypeSource ↗

Change Case choices: "Sentence case.", "lowercase", "UPPERCASE", "Capitalize Each Word", and "tOGGLE cASE".

type TextCase = 'sentence' | 'lower' | 'upper' | 'capitalize' | 'toggle';

TextEffectsValuetypeSource ↗

A shape.textEffects option value: transform. and a text warp, or transform.none to remove the warp.

type TextEffectsValue = `transform.${Exclude<TextWarpPreset, 'textNoShape'> | 'none'}`;

TextFittingtypeSource ↗

Text fitting modes (a:noAutofit, a:normAutofit, a:spAutoFit).

type TextFitting = 'none' | 'shrink' | 'shape';

TextFormatCommandtypeSource ↗

The text format commands of EditorCommand: the Paragraph, Font, and Bullets and Numbering dialogs, superscript and subscript, Change Case, character spacing, Text Direction, and Columns. Each acts on the selected text, or on all text of the selected shapes.

type TextFormatCommand = 
/**
 * Format > Paragraph: alignment, indents, spacing before and after, and line spacing on every
 * selected paragraph, as one undo step. DOCX Editor's command name; the fields follow its
 * `ParagraphFormatCommand`, in PresentationML units (EMU indents, spacing in points or lines).
 */
({
    readonly type: 'setParagraphFormat';
} & ParagraphFormatCommand)
/** Superscript on or off: the button writes `baseline` 30 % up. */
 | {
    readonly type: 'toggleSuperscript';
}
/** Subscript on or off: the button writes `baseline` 25 % down. */
 | {
    readonly type: 'toggleSubscript';
}
/** Home > Change Case: rewrite the letters of the selected text. Formatting stays. */
 | {
    readonly type: 'changeCase';
    readonly case: TextCase;
}
/** Home > Character Spacing: points added after each character (`spc`); 0 is Normal. */
 | {
    readonly type: 'setCharacterSpacing';
    readonly points: number;
}
/** Format > Font: the fields of the Font dialog, as one undo step. */
 | ({
    readonly type: 'setFontFormat';
} & FontFormatCommand)
/**
 * Home > Text Direction (`a:bodyPr/@vert`) of the selected shapes. The type leaves out
 * `mongolianVertical` and `wordArtVerticalRtl`, which layout does not draw correctly;
 * the engine refuses them too.
 */
 | {
    readonly type: 'setTextDirection';
    readonly direction: Exclude<TextOrientation, 'mongolianVertical' | 'wordArtVerticalRtl'>;
}
/**
 * Home > Columns: the number of text columns (1 to 16, `numCol`) of the selected shapes, and
 * the gap between them in EMU (`spcCol`, 0 to 51206400). An absent `gapEmu` keeps the gap.
 */
 | {
    readonly type: 'setColumns';
    readonly count: number;
    readonly gapEmu?: number;
}
/**
 * Home > Bullets or Numbering (a gallery item), or Format > Bullets and Numbering: the bullet
 * format of the selected paragraphs (Office.js `ParagraphFormat.bulletFormat`).
 * `null` is the gallery's None: the list turns off.
 */
 | {
    readonly type: 'setBulletFormat';
    readonly format: BulletFormat | null;
}
/**
 * Paste formatted text: DrawingML paragraphs (`a:p`, as `ClipboardNode`s) replace the selected
 * text, or, with no text selected, go in a new text box in the middle of the slide. The
 * paragraphs are checked as untrusted input: runs, breaks, and their formatting are kept, and
 * links, pictures, and relationship references are left out. A field becomes plain text.
 */
 | {
    readonly type: 'pasteText';
    readonly paragraphs: readonly ClipboardNode[];
};

TextInputKindtypeSource ↗

Every kind of text input the editor applies.

type TextInputKind = 'text' | 'deleteBackward' | 'deleteForward' | 'deleteWordBackward' | 'deleteWordForward' | 'deleteLineBackward' | 'deleteLineForward' | 'paragraph' | 'lineBreak';

TextOrientationtypeSource ↗

The orientation of a shape's text (Home Text Direction), in the words of Office.js's the Office.js ShapeTextOrientation enum:horizontal, rotated 90° (vertical, file vert) or 270° (vertical270), stacked letters (wordArtVertical), upright East Asian text (eastAsianVertical, file eaVert), and the two the editor reads but does not set (mongolianVertical, wordArtVerticalRtl). Not DOCX Editor's TextDirection, which is bidi.

type TextOrientation = 'horizontal' | 'vertical' | 'vertical270' | 'wordArtVertical' | 'eastAsianVertical' | 'mongolianVertical' | 'wordArtVerticalRtl';

TextWarpPresettypeSource ↗

A preset text warp (a:prstTxWarp/@prst, ST_TextShapeType, ECMA-376 Part 1, 20.1.10.76). textNoShape draws the text flat.

type TextWarpPreset = 'textNoShape' | 'textPlain' | 'textStop' | 'textTriangle' | 'textTriangleInverted' | 'textChevron' | 'textChevronInverted' | 'textRingInside' | 'textRingOutside' | 'textArchUp' | 'textArchDown' | 'textCircle' | 'textButton' | 'textArchUpPour' | 'textArchDownPour' | 'textCirclePour' | 'textButtonPour' | 'textCurveUp' | 'textCurveDown' | 'textCanUp' | 'textCanDown' | 'textWave1' | 'textWave2' | 'textDoubleWave1' | 'textWave4' | 'textInflate' | 'textDeflate' | 'textInflateBottom' | 'textDeflateBottom' | 'textInflateTop' | 'textDeflateTop' | 'textDeflateInflate' | 'textDeflateInflateDeflate' | 'textFadeRight' | 'textFadeLeft' | 'textFadeUp' | 'textFadeDown' | 'textSlantUp' | 'textSlantDown' | 'textCascadeUp' | 'textCascadeDown';

ThemeColorSlottypeSource ↗

A theme color as the color menus name it: the color map's names, so bg1 is the color the slide's p:clrMap maps to Background 1.

type ThemeColorSlot = 'bg1' | 'tx1' | 'bg2' | 'tx2' | 'accent1' | 'accent2' | 'accent3' | 'accent4' | 'accent5' | 'accent6';

ToolbarShownValuetypeSource ↗

The value a typed slot shows: its ToolbarValueMap type, except shape.effects, which shows one choice for each effect kind, separated by spaces (shadow.outerTop reflection.none …), shape.styles, which shows the row.color string, font.size, which shows points, and paragraph.textDirection, which also shows the two orientations the editor does not set.

type ToolbarShownValue<K extends keyof ToolbarValueMap> = K extends 'shape.effects' ? string : K extends 'shape.styles' ? ShapeStyleValue : K extends 'font.size' ? number : K extends 'paragraph.textDirection' ? TextOrientation : ToolbarValueMap[K];

ToolbarSlotValuetypeSource ↗

The value a slot takes: its ToolbarValueMap type, or unknown for a slot not listed.

type ToolbarSlotValue<K extends ChromeSlotId> = K extends keyof ToolbarValueMap ? ToolbarValueMap[K] : unknown;

TransitionKindtypeSource ↗

The kinds of transition that setTransition writes.

type TransitionKind = 'fade' | 'push' | 'wipe' | 'split' | 'cut';

UnderlineStyletypeSource ↗

Underline styles: ST_TextUnderlineType in words, as Office.js names them (single is sng, double is dbl, wavyDouble is wavyDbl).

type UnderlineStyle = 'none' | 'words' | 'single' | 'double' | 'heavy' | 'dotted' | 'dottedHeavy' | 'dash' | 'dashHeavy' | 'dashLong' | 'dashLongHeavy' | 'dotDash' | 'dotDashHeavy' | 'dotDotDash' | 'dotDotDashHeavy' | 'wavy' | 'wavyHeavy' | 'wavyDouble';

VerticalAligntypeSource ↗

Vertical text alignment: top, middle, bottom.

type VerticalAlign = 't' | 'ctr' | 'b';

Variables (29)

ANIMATION_PRESET_GROUPSconstSource ↗

The presets of the Add effect menu, by class.

ANIMATION_PRESET_GROUPS: readonly {
    readonly effectClass: 'entrance' | 'emphasis' | 'exit';
    readonly presets: readonly AnimationPreset[];
}[]

ANIMATION_TRIGGERSconstSource ↗

The start options of an effect.

ANIMATION_TRIGGERS: readonly AnimationTrigger[]

The Bullets gallery, in its order (Home Bullets).

BULLET_GALLERY: readonly ListGalleryItem<BulletGalleryKey>[]

CANVAS_CONTEXT_MENUSconstSource ↗

The canvas context menus, one per kind of target, in a fixed order. Rows the selection cannot run stay in the menu, disabled with the engine's reason. The New comment row (review.addComment) is the exception: without a comments pane, canvasMenuRows leaves it out.

CANVAS_CONTEXT_MENUS: Readonly<Record<CanvasMenuKind, readonly ChromeMenuEntry[]>>

CHART_LEGEND_CHOICESconstSource ↗

The legend positions the Chart tab offers.

CHART_LEGEND_CHOICES: readonly ChartLegendPosition[]

CHART_TYPE_CHOICESconstSource ↗

The chart types the Chart tab offers, in the order of its type list.

CHART_TYPE_CHOICES: readonly ChartType[]

CHROME_GROUPSconstSource ↗

The complete chrome, in bar order.

CHROME_GROUPS: readonly ChromeGroup[]

CHROME_MENUSconstSource ↗

The menu bar, in this order: File, Edit, View, Insert, Format, Arrange, Slide Show.

CHROME_MENUS: readonly ChromeMenu[]

The Crop to Shape gallery: the shape gallery without the presets that have no inside to show a picture in (lines and connectors), by the rule cropToShape applies.

CROP_SHAPE_GALLERY: readonly ShapeCategory[]

DEFAULT_FONTconstSource ↗

The document default font when nothing else says otherwise: Calibri at 11pt.

DEFAULT_FONT: FontConfiguration['defaultFont']

DEFAULT_TABLE_BORDER_PENconstSource ↗

The pen before any pick: all borders, 1 pt solid in the theme's Text 1. Frozen.

DEFAULT_TABLE_BORDER_PEN: TableBorderPen

DRAWING_CLIPBOARD_TYPESconstSource ↗

The system clipboard types that hold a DrawingML clipboard package, by platform. A desktop host reads one of them and passes the bytes to drawingClipboardPayload.

DRAWING_CLIPBOARD_TYPES: Readonly<{
    macos: "com.microsoft.Art--GVML-ClipFormat";
    windows: "Art::GVML ClipFormat";
}>

FONT_RESOLVER_BRANDconstSource ↗

The runtime marker defineFontResolver sets and [isFontResolver](isFontResolver) reads.

Exported because a package mirroring the font contract structurally still has to mark the resolvers it builds. A package in that position sets Symbol.for('docx-editor.dev/font-resolver') itself; this constant is the same symbol, named, for everyone who can import it.

FONT_RESOLVER_BRAND: unique symbol

FONT_RESOLVER_MARK_KEYconstSource ↗

The namespaced key carrying the type-level half of the mark, and the runtime property name that backs it.

A plain string rather than a symbol on purpose: @docx-editor.dev/fonts has no runtime or type dependency on the engine, so it declares the same mark itself, and two unique symbols in two packages would not unify. Two identical string keys do.

FONT_RESOLVER_MARK_KEY = "docx-editor.dev/font-resolver"

HOST_SUBSTITUTE_ORIGINconstSource ↗

The origin of a host substitution's face: the face of another family, registered under the family that the deck names.

HOST_SUBSTITUTE_ORIGIN = "host-substitute"

ICON_PATHSconstSource ↗

Material Symbol name → SVG path data.

ICON_PATHS: Readonly<Record<string, readonly string[]>>

MAX_ALT_TEXTconstSource ↗

The longest alt text the editor writes.

MAX_ALT_TEXT = 4000

MAX_LINEAR_LENGTHconstSource ↗

The longest linear form that the parser reads.

MAX_LINEAR_LENGTH = 1000

MAX_RESOLVER_FAMILIESconstSource ↗

Ceiling on the families one document can put in front of a resolver.

A resolver typically turns each family into up to four faces, and the resource snapshot refuses more than HARD_MAX_FONT_SOURCES (256) sources — so 64 families is the point past which a document could no longer be served anyway. Capping here means a file declaring thousands of distinct w:rFonts cannot fan a resolver out across thousands of lookups (or fetches) before that limit is ever reached.

MAX_RESOLVER_FAMILIES = 64

NO_HOST_FACESconstSource ↗

NO_HOST_FACES: HostFaces

NOTES_FIND_HIGHLIGHTconstSource ↗

The highlight name the editor stylesheet paints (::highlight(pptx-find)).

NOTES_FIND_HIGHLIGHT = "pptx-find"

The Numbering gallery, in its order (Home Numbering).

NUMBER_GALLERY: readonly ListGalleryItem<NumberGalleryKey>[]

REVIEW_AUTHOR_SLOTSconstSource ↗

How many author slots the --doc-review-author-N token ramp defines.

REVIEW_AUTHOR_SLOTS = 8

RIBBON_TABSconstSource ↗

The ribbon, in the reference order. A group may sit on more than one tab: Shape and Arrange are on Home and on Shape Format.

RIBBON_TABS: readonly RibbonTab[]

The gallery, in menu order.

SHAPE_GALLERY: readonly ShapeCategory[]

TABLE_CHROME_SLOT_IDSconstSource ↗

Every [TableChromeSlotId](TableChromeSlotId), in the group's order.

TABLE_CHROME_SLOT_IDS: readonly TableChromeSlotId[]

TRANSITION_KINDSconstSource ↗

The transition kinds of the Transition menu, none first.

TRANSITION_KINDS: readonly (TransitionKind | 'none')[]

UNDERLINE_STYLESconstSource ↗

Every underline style, in the order the Font dialog lists them.

UNDERLINE_STYLES: readonly UnderlineStyle[]

WORD_DEFAULT_FONTconstSource ↗

Deprecated. Use [DEFAULT_FONT](DEFAULT_FONT).

The DOCX Editor default font, under the name DOCX Editor's font-composition.ts exports. This module keeps the copied API equal to DOCX Editor's, so the name stays; it is the same value as [DEFAULT_FONT](DEFAULT_FONT).

WORD_DEFAULT_FONT: FontConfiguration['defaultFont']