@pptx-editor. dev/ core
v0.3.1 · 8 published subpaths with full TypeScript signatures and JSDoc.
Subpaths
@pptx-editor.dev/core/contracts
@pptx-editor.dev/core/store
@pptx-editor.dev/core/cascade
@pptx-editor.dev/core/layout
@pptx-editor.dev/core/automation
@pptx-editor.dev/core/output
@pptx-editor.dev/core/editor
Package root
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) => ColorPickchartPaneCommandfunctionSource ↗
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) => stringchromeControlForSlotfunctionSource ↗
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| Member | Type | Summary |
|---|---|---|
| (constructor) | | Constructs a new instance of the `CommandRefusal` class |
| detail? | string | undefined | |
| reason | string |
DocumentSessionclassSource ↗
declare class DocumentSession| Member | Type | Summary |
|---|---|---|
| (constructor) | | Constructs a new instance of the `DocumentSession` class |
| batch | | A 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. |
| dispose | | Release blob URLs. |
| faces | readonly RegisteredFace[] | Registered faces, for paint registration. Replaced when the host faces change. |
| fontGeneration | number | Bumped every time the face set changes. |
| fontReport | FontReport | |
| id | string | Identifies this open document (clipboard payloads carry it). |
| imageSize | (sourcePart: string, rId: string) => {
cx: number;
cy: number;
} | undefined | The 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 | undefined | A URL for an image relationship. Internal parts only: an external target is never fetched. Blob URLs are created lazily and revoked by `dispose()`. |
| info | PresentationInfo | |
| layout | | Layout 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. |
| layoutOf | | Layout of slide `index` over a package that is not committed (a preview); not cached. |
| measurer | TextMeasurer | The measurer in force. Replaced when the host faces change. |
| picturesReady | | Waits 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. |
| pictureStatus | | The EMF and WMF pictures of slide `index`, or of every slide, each with its state. |
| store | PptxDocumentStore | |
| substitutedFamilies | | Families the deck names that measure with a different family. Fixed-measurer sessions report none (they model no fonts). |
| substituteFamilies | readonly DefaultFamily[] | null | The families whose packaged substitutes the session loads; null when it loads none. |
| usedPartNames | ReadonlySet<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| Member | Type | Summary |
|---|---|---|
| (constructor) | | Constructs a new instance of the `EditorFontError` class |
| code | EditorFontErrorCode | |
| diagnostic? | string | |
| name | string | |
| request? | FontFaceRequest |
OpBatchclassSource ↗
declare class OpBatch| Member | Type | Summary |
|---|---|---|
| (constructor) | | Constructs a new instance of the `OpBatch` class |
| armedCaret | boolean | Set 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. |
| element | | The current element for an id in a part. |
| insert | | Insert and return the new element's id. |
| ops | PptxOp[] | |
| parentId | | The parent id of node `id` in a part, or undefined for the root or a missing node. |
| parentKind | | The 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. |
| pkg | PptxPackage | The working package after every op so far. |
| push | | Apply an op to the working package, or refuse the transaction. |
| pushAll | | Apply 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. |
| reservedPartNames | ReadonlySet<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| Member | Type | Summary |
|---|---|---|
| (constructor) | | Constructs a new instance of the `SlideshowController` class |
| blank | | Toggle a black or white screen over the slide. |
| exit | | End the show. |
| first | | The first shown slide. |
| goTo | | Show slide `index` (0-based), hidden or not, as for a typed number. |
| key | | Apply a key press. Returns true when the show used the key. Keys with Ctrl, Cmd, or Alt are left to the host. |
| last | | The last shown slide. |
| next | | Advance: leave a blank screen, else the next shown slide, else the end screen, else end. |
| previous | | Go back: leave a blank or end screen, else the previous shown slide. |
| state | SlideshowState | The current state. The same object until something changes. |
| subscribe | | Call `listener` after every change. Returns the unsubscribe function. |
| update | | The 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| Member | Type | Summary |
|---|---|---|
| decorative | boolean | Marked as decorative (the `adec:decorative` extension). |
| description | string | |
| title | string |
AnimationEffect_2interface
One effect of a slide, in the order the slide plays it.
interface AnimationEffect| Member | Type | Summary |
|---|---|---|
| delayMs | number | The delay before the effect starts, in milliseconds. |
| durationMs | number | null | How long the effect plays, in milliseconds; null for an effect that is instant. |
| editable | boolean | Whether the animation commands can change it. |
| effectClass | AnimationClass | |
| id | string | The effect's `p:cTn/@id`: the handle that the animation commands take. |
| nodeId | string | null | The 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. |
| preset | AnimationPreset | null | The preset, when it is one that `addAnimation` writes; otherwise null. |
| presetId | number | null | The `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. |
| shapeId | string | The `p:cNvPr/@id` of the shape it animates. |
| shapeName | string | The name of that shape (`p:cNvPr/@name`), or an empty string. |
| step | number | null | The 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. |
| trigger | AnimationTrigger | |
| triggerShapeId? | string | For an interactive effect, the `p:cNvPr/@id` of the shape whose click starts it. |
| triggerShapeName? | string | The 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| Member | Type | Summary |
|---|---|---|
| kinds | readonly ('bullet' | 'number' | 'picture' | 'none')[] | The list kind of each selected paragraph, each kind once, in selection order. |
| sizePercent | number | null | Percent of the text size, when every bullet and number has the same; otherwise null. |
| startAt? | number | null | The 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| Member | Type | Summary |
|---|---|---|
| bullet | string | A Bullets gallery key, `current` (the paragraphs' own or a custom bullet), or `''`. |
| char | string | The bullet character, in its font's own code (`v` is the Wingdings star). |
| color | ColorPick | The bullet or number color, as the color field picks it. |
| font | string | The bullet font; `''` follows the text font. |
| kind | BulletsDialogTab | The open tab: Bulleted or Numbered. |
| number | string | A Numbering gallery key, `current`, or `''`. |
| picture | Uint8Array | null | A picture the user chose for a picture bullet (PNG, JPEG, or GIF bytes), or null. |
| sizePercent | string | Percent of the text size. |
| startAt | string | The 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| Member | Type | Summary |
|---|---|---|
| automatic | ColorChoice | The theme color that the automatic color starts from, for a swatch. |
| color | ColorChoice | null | The color the chart part sets, or null for the automatic color. |
| name | string | The 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| Member | Type | Summary |
|---|---|---|
| categories | readonly ChartDataCategory[] | |
| kind | ChartDataKind | |
| series | readonly ChartDataSeries[] | |
| workbook? | ChartWorkbookState | On read only: where the chart's workbook is. A write ignores it. |
ChartDataCategoryinterfaceSource ↗
One category (or X value) of a chart.
interface ChartDataCategory| Member | Type | Summary |
|---|---|---|
| label | string | The label, or the X value of a scatter chart as text. |
| source? | number | On 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| Member | Type | Summary |
|---|---|---|
| name | string | The series name, as the legend shows it. |
| source? | number | On 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. |
| values | readonly (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| Member | Type | Summary |
|---|---|---|
| axes | boolean | null | Whether the chart shows its axes; null for a chart with no axes. |
| axisTitles | {
readonly category: string | null;
readonly value: string | null;
} | null | The axis titles, or null for no title; null for a chart with no axes. |
| colors | readonly ChartColorEntry[] | |
| colorsBy | 'series' | 'point' | What `colors` and `setChartColor` color: each series, or each point of a pie chart. |
| dataLabels | boolean | Whether the chart shows a value label at each data point. |
| gridlines | boolean | null | Whether the value axis shows major gridlines; null for a chart with no axes. |
| legend | ChartLegendPosition | |
| title | string | null | The title text, or null for no title. An automatic title reads as its series name. |
| type | ChartType | null | The 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| Member | Type | Summary |
|---|---|---|
| axes? | boolean | |
| categoryAxisTitle? | string | null | |
| dataLabels? | boolean | |
| gridlines? | boolean | |
| legend? | ChartLegendPosition | |
| title? | string | null | |
| valueAxisTitle? | string | null |
ChromeControlinterfaceSource ↗
One toolbar control.
interface ChromeControl| Member | Type | Summary |
|---|---|---|
| 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. |
| id | string | |
| labelKey | TranslationKey | i18n 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). |
| paths | readonly string[] | null | Material Symbols path data, or null for a picker. |
| shape? | ChromeControlShape | |
| state | ChromeControlState | |
| toggle? | ChromeControlToggle | How the control shows its state; absent for an action. |
ChromeGroupinterfaceSource ↗
One toolbar group.
interface ChromeGroup| Member | Type | Summary |
|---|---|---|
| contextual? | boolean | A group the formatting bar does not show: a menu places its slots (View Smart guides). The same flag as DOCX Editor's registry. |
| controls | readonly ChromeControl[] | |
| id | ChromeGroupId | |
| labelKey | TranslationKey |
ChromeMenuinterfaceSource ↗
One menu of the menu bar.
interface ChromeMenu| Member | Type | Summary |
|---|---|---|
| entries | readonly ChromeMenuEntry[] | |
| id | ChromeMenuId | |
| labelKey | TranslationKey |
ChromeMenuItemEntryinterfaceSource ↗
A row that runs one chrome slot.
interface ChromeMenuItemEntry| Member | Type | Summary |
|---|---|---|
| direct? | true | For 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? | TranslationKey | A 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? | TranslationKey | The shortcut shown at the end of the row. |
| slot | ChromeSlotId | |
| value? | string | The value a value slot runs with (`arrange.order` with `front`). |
ChromeMenuSeparatorEntryinterfaceSource ↗
A line between groups of rows.
interface ChromeMenuSeparatorEntry| Member | Type | Summary |
|---|---|---|
| kind | 'separator' |
ChromeMenuSubmenuEntryinterfaceSource ↗
A row that opens a nested panel of rows. It has no command of its own.
interface ChromeMenuSubmenuEntry| Member | Type | Summary |
|---|---|---|
| id | string | A stable id, so a host can find the submenu. |
| items | readonly ChromeMenuEntry[] | |
| kind | 'submenu' | |
| labelKey | TranslationKey | |
| paths | readonly string[] | null |
ClipboardNodeinterfaceSource ↗
A serialized element, structurally the store's NodeSpec.
interface ClipboardNode| Member | Type | Summary |
|---|---|---|
| attrs? | readonly {
ns: string;
local: string;
prefix?: string;
value: string;
}[] | |
| children? | readonly (ClipboardNode | {
readonly text: string;
})[] | |
| local | string | |
| ns | string | |
| nsDecls? | readonly {
prefix: string;
uri: string;
}[] | |
| prefix? | string |
ClipboardPayloadinterfaceSource ↗
The clipboard format for shapes (application/x-pptx-editor+json).
interface ClipboardPayload| Member | Type | Summary |
|---|---|---|
| document | string | The session the shapes came from; pasting into it reuses its parts. |
| relationships | readonly ClipboardRelationship[] | |
| shapes | readonly ClipboardNode[] | |
| slidePart | string | The slide part the shapes came from; pasting onto it offsets them. |
| version | 1 |
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| Member | Type | Summary |
|---|---|---|
| base64 | string | |
| contentType | string | |
| id | string | |
| part | string | |
| relationships? | readonly ClipboardRelationship[] | The relationships of the carried part. |
| target? | string | The address of an external link. |
| type | string |
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| Member | Type | Summary |
|---|---|---|
| applyRemote | | Apply 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. |
| applyRemoteParts | | Publish parts that a state-based replica rebuilt (`buildReplicaPart`), and drop `removed` parts, as one remote revision. Same history rule as `applyRemote`. |
| package | | The current package, for a session that bootstraps a room from the opened deck. |
| revision | | The store revision. |
| subscribeLocal | | Local 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| Member | Type | Summary |
|---|---|---|
| code | CollaborationFailureCode | Stable code for application logic. |
| detail? | string | Bounded diagnostic text for logs. Not a parsing contract. |
CollaborationIdentityinterfaceSource ↗
Human or automation identity attached to authored collaboration transactions.
interface CollaborationIdentity| Member | Type | Summary |
|---|---|---|
| actorId | string | Stable author id. Recorded on authored changes. |
| color? | string | Presence color, a CSS color string. |
| name | string | Display 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| Member | Type | Summary |
|---|---|---|
| after | PptxPackage | The package after the change. |
| before | PptxPackage | The package before the change. |
| fromRevision | number | The store revision before the commit. |
| label? | string | The history label (`typing`, `move`), when the command set one. |
| merged? | boolean | True 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. |
| parts | readonly string[] | Part names whose content changed. |
| toRevision | number | The store revision after the commit. |
CollaborationModuleContributioninterfaceSource ↗
What a collaboration module contributes: the session the editor attaches.
interface CollaborationModuleContribution| Member | Type | Summary |
|---|---|---|
| session | EditorCollaborationSession | A ready session. The host creates the room, then wraps it with `collaborationModule`. |
CollaborationParticipantinterfaceSource ↗
One participant in a collaboration room.
interface CollaborationParticipant extends CollaborationIdentity| Member | Type | Summary |
|---|---|---|
| isLocal | boolean | Whether this participant is the local editor. |
CollaborationRemoteSelectioninterfaceSource ↗
A peer's selection, mapped onto this replica's node ids.
interface CollaborationRemoteSelection| Member | Type | Summary |
|---|---|---|
| actorId | string | The peer's author id. |
| color? | string | The peer's presence color. |
| name | string | The peer's display name. |
| selection | CollaborationLocalSelection | What 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| Member | Type | Summary |
|---|---|---|
| from | CollaborationLocalSelection | The selection as it was published, on the ids before the change. |
| to | CollaborationLocalSelection | The 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| Member | Type | Summary |
|---|---|---|
| failureCount? | number | How many failures this session has recorded. Absent from a session that does not count. |
| lastFailure | CollaborationFailure | undefined | The most recent `error` reason. Kept after the replica recovers. |
| reason | CollaborationFailure | undefined | Why the replica holds `status`, or `undefined` when nothing is wrong. |
| recovering? | boolean | In `error`, but the session heals by itself on the next clean update. Absent means false. |
| status | CollaborationStatus | Current lifecycle state. |
CollaborationStatusTrackerinterfaceSource ↗
A session's status state.
interface CollaborationStatusTracker| Member | Type | Summary |
|---|---|---|
| set | | Set the status. `recovering` marks an `error` the session heals by itself. Returns whether the snapshot changed. |
| snapshot | | The cached snapshot: the same reference until a value changes. |
| status | | The current status. |
ColumnsDialogFieldsinterfaceSource ↗
Every field of the form, as typed text. '' is a blank: the selected shapes differ.
interface ColumnsDialogFields| Member | Type | Summary |
|---|---|---|
| count | string | |
| spacing | string | Inches. |
CommandContextinterfaceSource ↗
Editor state a command compiles against.
interface CommandContext| Member | Type | Summary |
|---|---|---|
| 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? | string | The author of new comments and replies when the command names none (`setAuthor`). |
| base? | PptxPackage | The package to compile against instead of the store's: the preview of an armed format. |
| caretArm? | boolean | Compile 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? | boolean | The 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? | number | How many times in a row this payload has been pasted, counting this paste (1 = first). |
| probe? | boolean | Only 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. |
| readOnly | boolean | |
| selectedSlides? | readonly number[] | The slides selected in the rail, ascending; always holds `slide`. |
| selection | EditorSelection | |
| session | DocumentSession | |
| slide | number | |
| slideMaster? | boolean | The slide master view is on: commands that act on slides are off (`master-view.ts`). |
| slideSorter? | boolean | The Slide Sorter view is on: it shows no slide to put a new shape on. |
| translate? | (key: string) => string | The 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| Member | Type | Summary |
|---|---|---|
| label | string | |
| 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| Member | Type | Summary |
|---|---|---|
| author? | string | The display name, 1 to 255 characters. |
| date? | string | ISO 8601 date and time. Default: now, in UTC. |
| initials? | string | Initials, 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| Member | Type | Summary |
|---|---|---|
| author | string | The author's display name, as `SlideComment.author` gave it. |
| date? | string | The date, as `SlideComment.date` gave it; absent when the comment has none. |
| identity? | string | The `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. |
| text | string | The text, as `SlideComment.text` gave it. |
CommentSnapshotinterfaceSource ↗
The comment fields of the editor snapshot (EditorSnapshot).
interface CommentSnapshot| Member | Type | Summary |
|---|---|---|
| activeComment? | string | null | The thread a comment marker or `selectComment` picked, or null. |
| commentAuthor? | string | null | The 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[] | null | The 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| Member | Type | Summary |
|---|---|---|
| end | TextPoint | The point after the last character of the range. |
| start | TextPoint | The first character of the range. |
CommentThreadinterfaceSource ↗
A comment and its replies (EditorSnapshot.comments).
interface CommentThread extends SlideComment| Member | Type | Summary |
|---|---|---|
| anchor | CommentAnchor | |
| format | CommentFormat | |
| replies | readonly SlideComment[] | The replies, oldest first. |
| resolved | boolean | Whether the thread is resolved. Always false for the `legacy` format, which has no state. |
ComposeFontOriginsOptionsinterfaceSource ↗
Diagnostics hook for ordered font-origin composition.
interface ComposeFontOriginsOptions| Member | Type | Summary |
|---|---|---|
| onOriginFailure? | (failure: FontOriginFailure) => void | Fire-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| Member | Type | Summary |
|---|---|---|
| index | number | The index of the site in the shape's geometry (`a:cxnLst`), from 0. |
| nodeId | string | The 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| Member | Type | Summary |
|---|---|---|
| adjust? | Readonly<Record<string, number>> | The adjust values of the preset by guide name, in guide units (see `a:gd`). |
| end? | ConnectionTarget | null | The connection site the end glues to (`a:endCxn`); null unglues it. |
| preset? | string | The connector preset (`a:prstGeom/@prst`): `straightConnector1`, `bentConnector2` to `bentConnector5`, or `curvedConnector2` to `curvedConnector5`. |
| start? | ConnectionTarget | null | The 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'>| Member | Type | Summary |
|---|---|---|
| onFailure? | (failure: FontLoadFailure) => void | Reports 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| Member | Type | Summary |
|---|---|---|
| id | number | The show's `id` in the file. |
| name | string | The show's name, on one line. |
DateTimeStateinterfaceSource ↗
The date that the slides show (EditorSnapshot.dateTime).
interface DateTimeState| Member | Type | Summary |
|---|---|---|
| fixed | boolean | True for fixed text; false for a date field. |
| text | string | The text that the date shows. |
DiagramNodeStateinterfaceSource ↗
One node of the selected diagram, in outline order.
interface DiagramNodeState| Member | Type | Summary |
|---|---|---|
| editable | boolean | Whether `setDiagramText` and typing can change the text: one drawing shape shows the text of this node alone. |
| level | number | 0 for a top-level node, 1 for its child, and so on. |
| node | string | The data model id of the node (`dgm:pt/@modelId`). |
| text | string | The 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| Member | Type | Summary |
|---|---|---|
| code | string | The engine's reason, the same value as `EditorSnapshot.error` (`zip`, `xml`, `empty`). |
| reason | DocumentOpenFailureReason | The group of `code` that picks the message. |
DocumentSearchFindOptionsinterfaceSource ↗
Options of find.
interface DocumentSearchFindOptions extends FindOptions| Member | Type | Summary |
|---|---|---|
| selectFirst? | boolean | Select the first match. |
DocumentSearchStateinterfaceSource ↗
The state of a find session.
interface DocumentSearchState| Member | Type | Summary |
|---|---|---|
| activeIndex | number | The index of the selected match, or `-1` when the selection is on no match. |
| activeMatch | FindMatch | null | The selected match, or null. |
| isPending | boolean | Always false: the search runs at once. Kept for DOCX Editor's shape. |
| matchCase | boolean | |
| matches | readonly FindMatch[] | Every match of `query`, in deck order: slides, then their notes. |
| query | string | The text to find. |
| truncated | boolean | Always false: the engine returns every match. Kept for DOCX Editor's shape. |
| wholeWord | boolean |
EditorinterfaceSource ↗
The editor contract adapters render.
interface Editor| Member | Type | Summary |
|---|---|---|
| attach | | |
| beginHistoryGroup | | Open 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. |
| can | | Dry run: whether `exec` would apply. A closed or foreign `historyGroup` refuses. |
| copy | | The selected shapes as a clipboard payload, or null when nothing is copyable. |
| destroy | | |
| detach | | |
| exec | | Run a command. Pass `options.historyGroup` to make several commands one undo step. See [HistoryGroupOptions](HistoryGroupOptions). |
| focus | | Give 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 | | |
| load | | Open `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`). |
| renderThumbnail | | Paint 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. |
| save | | The 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. |
| selectAll | | Select every shape in the current scope (the slide or the entered group). |
| selectSlide | | Click 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| Member | Type | Summary |
|---|---|---|
| cell? | TableCellAddress | |
| diagramNode? | string | |
| nodeId | string | |
| offset | number | |
| paragraph | number |
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| Member | Type | Summary |
|---|---|---|
| attach | | Attach to an opened document. Returns the detach function. |
| attached | boolean | Whether a document is attached. |
| canRedo | | Whether the session can redo. |
| canUndo | | Collaboration-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. |
| destroy | | Leave the room and release the transport. |
| documentId | string | The room's document identity, chosen by the host before mount. |
| historySelection | | The 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. |
| identity | CollaborationIdentity | The local author. |
| participants | | Everyone in the room, the local participant included. |
| redo | | Redo this replica's last undone change. Returns false when there is nothing to redo, or when the step could not apply. |
| remoteSelectionMove | | How 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. |
| remoteSelections | | Peers' selections, mapped onto this replica's node ids. |
| sessionId | string | This 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. |
| setLocalSelection | | Publish this replica's selection to the room. `null` clears it. |
| status | | The current replica state. |
| statusSnapshot | | Status, reason, and last failure. Same reference until a value changes. |
| subscribeParticipants | | Listen to participant changes. Returns the unsubscribe function. |
| subscribeRemoteSelections | | Listen to remote selection changes. Returns the unsubscribe function. |
| subscribeStatus | | Listen to state changes, with the reason. Returns the unsubscribe function. |
| undo | | Undo 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| Member | Type | Summary |
|---|---|---|
| family | string | |
| metricCompatible | boolean | True when the substitute keeps the line breaks of the original font (same advance widths). |
| substitute | string |
EditorModuleinterfaceSource ↗
One registered capability module. Registration is construction-time (createPptxEditor({ modules })) and fixed for the instance's lifetime.
interface EditorModule| Member | Type | Summary |
|---|---|---|
| collaboration? | CollaborationModuleContribution | Absent, the editor stays single-user and local undo is the authority. |
| id | string | Diagnostic identity (`'review'`, `'collaboration'`); not a dispatch key. |
| review? | ReviewModuleContribution | Review capability: the queue derivation and display modes. |
EditorModuleRegistryinterfaceSource ↗
The resolved modules an editor instance dispatches over.
interface EditorModuleRegistry| Member | Type | Summary |
|---|---|---|
| collaboration | CollaborationModuleContribution | null | The first registered collaboration contribution, or null. |
| review | ReviewModuleContribution | null | The first registered review contribution, or null. |
EditorRejectioninterfaceSource ↗
A refused edit: the i18n key of the reason and an optional detail.
interface EditorRejection| Member | Type | Summary |
|---|---|---|
| detail? | string | What the reason names, for the `{reason}` or `{detail}` placeholder. |
| noop? | boolean | True 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. |
| reason | string | The i18n key of the reason (`errors.*`, `disabled.*`). |
EditorRemovalinterfaceSource ↗
A Delete that the user can undo: what it removed and how many.
interface EditorRemoval| Member | Type | Summary |
|---|---|---|
| count | number | |
| kind | 'shapes' | 'slides' | |
| serial | number | Grows with each removal, so chrome tells two equal removals apart. |
EditorSnapshotinterfaceSource ↗
interface EditorSnapshot extends CommentSnapshot| Member | Type | Summary |
|---|---|---|
| animationOrder? | boolean | Whether the canvas shows the order number of each effect on its shape (`showAnimationOrder`). A view setting, never saved. Absent reads as false. |
| animations? | SlideAnimations | The current slide's effects and transition. Optional: absent means the implementation does not edit animations. |
| canRedo | boolean | |
| canUndo | boolean | |
| chart? | SelectedChartState | null | The 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. |
| currentSlide | number | The 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 | null | The 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 | null | The selected diagram, or the diagram that holds the caret. Absent: no diagram editing. |
| embeddedFontFaces | number | |
| equation? | SelectedEquationState | null | The selected equation, while one text box with one equation is selected. |
| error? | string | |
| fitZoom | boolean | |
| footer? | string | null | The footer text (Insert Footer): the current slide's, else that of the first slide with a footer. Null when no slide shows one. Unlike `slideNumbers`, which reads the current slide, it reads the deck, as the command acts on the deck. It reads only the slides that are open: while `pendingSlides` is above 0, a slide that waits can have a footer. Optional, so that snapshots from hosts without it stay valid: absent reads as null. |
| format | SelectionFormat | null | |
| formatPainter? | FormatPainterMode | The 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. |
| geometry | SelectionGeometry | null | |
| image? | SelectedImageState | null | The selected pictures, while every selected element is a picture; the picture controls show then. Optional: absent means the implementation does not report pictures. |
| insertions | number | How 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? | boolean | Whether 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 | null | Why 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 | null | The 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. |
| mode | EditorMode | |
| notes | string | |
| 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 | null | The 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? | number | How 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? | PresentationView | View Normal or Slide Sorter. Optional: absent means the implementation has only the normal view. |
| readOnlyReason? | 'damaged-slide' | null | Why 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`. |
| revision | number | |
| 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. |
| selectedSlides | readonly 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`). |
| selection | EditorSelection | |
| 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. |
| slideBackground | SlideBackgroundState | The current slide's background. |
| slideHeight | number | |
| slideNumbers | boolean | Whether the current slide shows its slide number (Insert Slide numbers). |
| slides | readonly SlideSummary[] | |
| slideWidth | number | Slide size in EMU. |
| smartGuides | boolean | Whether drags snap to smart guides (View Smart guides). On by default. |
| status | 'empty' | 'loading' | 'ready' | 'error' | |
| substitutedFonts | readonly EditorFontSubstitution[] | Named families rendered with another face; reference-stable while unchanged. |
| table? | TableContext | null | The 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? | TableBorderPen | The 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. |
| themeColors | readonly (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. |
| zoom | number |
FindMatchinterfaceSource ↗
One match of a find. Offsets are UTF-16 offsets in the paragraph.
interface FindMatch| Member | Type | Summary |
|---|---|---|
| end | number | |
| nodeId | string | The element the text belongs to: a `p:sp`, or the `p:graphicFrame` of a table. |
| paragraph | number | |
| part | string | The part that holds the text: the slide part, or the slide's notes part. |
| slide | number | The slide index. |
| start | number | |
| text | string | The text the match covers. |
| txBodyId | string | The 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| Member | Type | Summary |
|---|---|---|
| matchCase? | boolean | Match upper and lower case exactly. |
| wholeWord? | boolean | Match 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| Member | Type | Summary |
|---|---|---|
| defaultFont | {
readonly family: string;
readonly sizeHalfPoints: number;
} | |
| epoch | number | |
| language? | string | |
| maxFontBytes | number | |
| sources | readonly 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| Member | Type | Summary |
|---|---|---|
| defaultFont? | FontConfiguration['defaultFont'] | The face used when a run names no font. Defaults to Calibri at 11pt. |
| epoch? | number | Identity 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? | string | BCP-47 tag passed to the shaper for language-sensitive shaping. |
| maxFontBytes? | number | Per-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| Member | Type | Summary |
|---|---|---|
| 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| Member | Type | Summary |
|---|---|---|
| allCaps | CheckState | |
| by | string | Points, without its sign: Expanded or Condensed gives the direction. |
| color | ColorPick | The text always has a color, so the field opens at "no change". |
| doubleStrike | CheckState | |
| fontFamily | string | |
| kerning | CheckState | |
| kerningAt | string | Points and above. |
| offset | string | Percent, without its sign: Superscript or Subscript gives the direction. |
| size | string | Points. |
| smallCaps | CheckState | |
| spacing | SpacingChoice | '' | |
| strike | CheckState | |
| style | FontStyleChoice | '' | |
| subscript | CheckState | |
| superscript | CheckState | |
| underline | UnderlineStyle | '' | |
| underlineColor | ColorPick | `auto`: the underline takes the text color (`a:uFillTx`, or no fill). |
FontFaceRequestinterfaceSource ↗
A concrete font face requested by authored document content.
interface FontFaceRequest| Member | Type | Summary |
|---|---|---|
| family | string | |
| style | 'normal' | 'italic' | |
| weight | number |
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| Member | Type | Summary |
|---|---|---|
| baseline? | number | Offset in percent of the font size, -100 to 100 (`baseline`): positive raises (superscript), negative lowers, 0 turns an inherited offset off. |
| bold? | boolean | Bold (`b`). |
| caps? | CapsStyle | Small caps or all caps (`cap`). |
| characterSpacingPt? | number | Points added after each character, -1584 to 1584 (`spc`); negative condenses. |
| color? | ColorChoice | null | A color choice, or null for the inherited color. |
| fontFamily? | string | The Latin font (`a:latin`): a family name of 1 to 64 letters, digits, spaces, `-._+`. |
| fontSizePt? | number | Size in points, 1 to 4000 (`sz`). |
| italic? | boolean | Italic (`i`). |
| kerningPt? | number | null | Kerning 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? | StrikeStyle | Strikethrough (`strike`): none, single, or double. |
| underline? | UnderlineStyle | The underline style (`u`); `none` removes it. |
| underlineColor? | ColorChoice | null | The 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| Member | Type | Summary |
|---|---|---|
| baseline | number | null | Percent of the font size; positive is superscript. |
| bold | boolean | null | Bold. |
| caps | CapsStyle | null | Capitals: none, small, or all. |
| characterSpacingPt | number | null | Points. |
| 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. |
| fontFamily | string | null | The Latin font (`a:latin`), resolved through the theme. |
| fontSizePt | number | null | Points. |
| italic | boolean | null | Italic. |
| kerningPt | number | null | Points and above; null when kerning is off or the runs disagree (see `disagrees`). |
| strike | StrikeStyle | null | Strikethrough: none, single, or double. |
| underline | UnderlineStyle | null | The underline style; `none` without an underline. |
| underlineColor | string | null | The 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| Member | Type | Summary |
|---|---|---|
| actualHash? | string | |
| diagnostic? | string | |
| expectedHash? | string | |
| reason | FontLoadFailureReason | |
| request | FontFaceRequest | |
| status? | number | HTTP status for `httpError`; hashes for `hashMismatch`. |
| url | string |
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| Member | Type | Summary |
|---|---|---|
| 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. |
| resolving | boolean | True 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| Member | Type | Summary |
|---|---|---|
| cause | unknown | |
| originIndex | number | Zero-based position in the first-wins origin list. |
| originName? | string | Resolver 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| Member | Type | Summary |
|---|---|---|
| id | FontPickerGroupId | Which group this is: the theme fonts, the fonts the deck uses, or the other fonts. |
| labelKey | TranslationKey | The i18n key of the group heading; show it with `t(labelKey)`. |
| rows | readonly 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| Member | Type | Summary |
|---|---|---|
| disabled | boolean | True 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. |
| face | string | null | The 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. |
| family | string | The family name the row shows. |
| roleKey | TranslationKey | null | The i18n key of the theme role (`Headings`, `Body`), on theme font rows only. |
| theme | 'major' | 'minor' | null | The theme font of a theme row, or null on a row that names a literal family. |
| value | string | What 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| Member | Type | Summary |
|---|---|---|
| embeddedFaces | number | |
| faces | readonly {
readonly family: string;
readonly origin: string;
}[] | |
| refusedEmbedded | readonly string[] | |
| substituteFailures | readonly 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| Member | Type | Summary |
|---|---|---|
| defaultFamily | string | The face a run naming no font resolves to, so a resolver can cover it too. |
| families | readonly 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? | AbortSignal | Cancels 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| Member | Type | Summary |
|---|---|---|
| "docx-editor.dev/font-resolver" | true | Always `true`. Set non-enumerably by [defineFontResolver](defineFontResolver). |
FontSourceinterfaceSource ↗
Immutable, byte-backed font face supplied to layout and browser paint.
interface FontSource| Member | Type | Summary |
|---|---|---|
| availability? | 'available' | 'forbidden' | |
| bytes | Uint8Array | |
| faceIndex | number | |
| hash | string | |
| id | string | |
| request | FontFaceRequest |
FontSourceSubstitutioninterfaceSource ↗
An explicit authored-font substitution. No implicit platform fallback is performed.
interface FontSourceSubstitution| Member | Type | Summary |
|---|---|---|
| from | FontFaceRequest | |
| lineMetrics? | {
readonly heightEm: number;
readonly baselineEm: number;
} | Line-box metrics for the requested face, expressed as em ratios. |
| to | FontFaceRequest |
FontSubstitutioninterfaceSource ↗
A family the deck names that measures with another face.
interface FontSubstitution| Member | Type | Summary |
|---|---|---|
| family | string | |
| metricCompatible | boolean | True when the substitute keeps the original's advance widths, so line breaks match. |
| substitute | string |
FontUrlSourceinterfaceSource ↗
One URL to fetch and the face it claims to be.
interface FontUrlSource| Member | Type | Summary |
|---|---|---|
| faceIndex? | number | |
| family | string | |
| hash? | string | Expected `sha256:` content hash. When present, mismatching bytes are REFUSED — pin this for any URL not under the app's sole control. |
| style | 'normal' | 'italic' | |
| url | string | |
| weight | number |
GradientFillinterfaceSource ↗
A gradient fill as the chrome edits it.
interface GradientFill| Member | Type | Summary |
|---|---|---|
| angle | number | Degrees 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"`). |
| rotWithShape | boolean | The gradient turns with the shape (`rotWithShape`). |
| stops | readonly {
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| Member | Type | Summary |
|---|---|---|
| hideOnTitleSlides? | boolean | With `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| Member | Type | Summary |
|---|---|---|
| [historyGroupBrand] | true | |
| end | | End 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| Member | Type | Summary |
|---|---|---|
| dispose | | Close the gesture and remove every listener. The edits stay. |
| options | | Options for the next synchronous command: `{ historyGroup }`. |
HistoryGroupBindingOptionsinterfaceSource ↗
Native event policy for one continuous control gesture.
interface HistoryGroupBindingOptions| Member | Type | Summary |
|---|---|---|
| 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
```| Member | Type | Summary |
|---|---|---|
| historyGroup? | HistoryGroup | An 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| Member | Type | Summary |
|---|---|---|
| faces | readonly FontSource[] | |
| substitutions | readonly {
readonly face: FontSource;
readonly target: string;
}[] |
HyperlinkPopupActionsinterfaceSource ↗
The actions of the link popup, as DOCX Editor's UseHyperlinkPopupResult.
interface HyperlinkPopupActions| Member | Type | Summary |
|---|---|---|
| beginEdit | () => void | Change to editing mode. |
| close | () => void | Hide the popup. |
| commitEdit | () => boolean | Apply 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) => void | Open 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) => void | Open 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 | () => boolean | Open the safe target in a new tab. False for a target that never opens. |
| setUrl | (url: string) => void | Change the draft target. |
| unlink | () => boolean | Remove the link from the selection. The text stays. |
HyperlinkPopupLinkinterfaceSource ↗
The link a popup shows.
interface HyperlinkPopupLink| Member | Type | Summary |
|---|---|---|
| href | string | null | The target that `sanitizeHref` allows, or null for a target that never opens. |
| url | string | The target as the file holds it. |
HyperlinkPopupStateinterfaceSource ↗
The link popup's state.
interface HyperlinkPopupState| Member | Type | Summary |
|---|---|---|
| anchor | HTMLElement | null | The element the panel opens under: the caret for a click, the opener otherwise. |
| canEdit | boolean | Whether the link command can run now; a read-only editor trims Edit and Unlink. |
| copied | boolean | True after Copy, until the next change: for a "Copied" confirmation. |
| draft | string | The URL field's draft, in edit mode. |
| error | string | null | The translation key (or engine text) of why the last Apply was refused, or null. |
| href | string | null | `url` as `sanitizeHref` passes it, or null when it is not safe to open or copy. |
| mode | HyperlinkPopupMode | |
| url | string | The 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| Member | Type | Summary |
|---|---|---|
| brightness? | number | Brightness from −1 to 1 (`a:lum/@bright`). |
| contrast? | number | Contrast from −1 to 1 (`a:lum/@contrast`). |
| recolor? | ImageRecolor | A Recolor preset of the Color gallery; `none` removes the color effect. |
| transparency? | number | Transparency 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| Member | Type | Summary |
|---|---|---|
| bottom | number | |
| left | number | |
| right | number | |
| top | number |
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| Member | Type | Summary |
|---|---|---|
| crop? | ImageCropPercent | The crop of each edge in percent of the image. |
| heightEmu? | number | The height on the slide, in EMU. |
| rotationDegrees? | number | The rotation in degrees, clockwise. |
| widthEmu? | number | The 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| Member | Type | Summary |
|---|---|---|
| bold | boolean | Whether the face is bold. |
| bytes | Uint8Array | The 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. |
| family | string | The name of the face in the SVG: its `font-family` attributes and `@font-face` rules. |
| italic | boolean | Whether the face is italic. |
| name | string | The 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| Member | Type | Summary |
|---|---|---|
| fonts | readonly ImageRasterFont[] | The faces that the SVG names. |
| height | number | The height of the PNG to answer, in pixels. |
| svg | string | The SVG document as text. |
| width | number | The 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>| Member | Type | Summary |
|---|---|---|
| format | BulletFormat | null | The bullet format the item applies, the command's `format`; null turns the list off. |
| key | K | A 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| Member | Type | Summary |
|---|---|---|
| cacheName? | string | Cache API bucket name; default `docx-editor-fonts`. |
| fetcher? | typeof fetch | Injectable for tests and CSP-constrained hosts; defaults to global `fetch`. |
| maxFontBytes? | number | Per-font byte ceiling; defaults to the engine hard maximum. |
| signal? | AbortSignal | Cancels loading with `signal.reason`, without returning per-source failures. |
| sources | readonly 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| Member | Type | Summary |
|---|---|---|
| failures | readonly FontLoadFailure[] | |
| sources | readonly FontSource$1[] |
LoadOptionsinterfaceSource ↗
Options of Editor.load.
interface LoadOptions| Member | Type | Summary |
|---|---|---|
| startSlide? | number | The 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| Member | Type | Summary |
|---|---|---|
| address | string | |
| rest | string | The other fields of the link (`cc`, `body`), still encoded, joined with `&`. |
| subject | string |
NewChartDatainterfaceSource ↗
The data of a new chart: its categories (or X values) and its series.
interface NewChartData| Member | Type | Summary |
|---|---|---|
| categories | readonly string[] | |
| series | readonly {
readonly name: string;
readonly values: readonly (number | null)[];
}[] |
NotesParagraphinterfaceSource ↗
One paragraph of the speaker notes.
interface NotesParagraph| Member | Type | Summary |
|---|---|---|
| runs | readonly 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| Member | Type | Summary |
|---|---|---|
| bold | boolean | Bold, from the run or the notes text style it inherits. |
| italic | boolean | Italic, from the run or the notes text style it inherits. |
| strike | boolean | Struck through (single or double). |
| text | string | The run's text. A line break inside a paragraph is `\n`. |
| underline | boolean | Underlined (any underline style). |
OpBatchOptionsinterfaceSource ↗
Options for an OpBatch.
interface OpBatchOptions| Member | Type | Summary |
|---|---|---|
| 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| Member | Type | Summary |
|---|---|---|
| time? | Date | When the open failed. Defaults to now. |
| userAgent? | string | The browser, such as `navigator.userAgent`. Defaults to it in a browser. |
OpenOptionsinterfaceSource ↗
Options for opening a presentation.
interface OpenOptions| Member | Type | Summary |
|---|---|---|
| fixedMeasurer? | boolean | Use the deterministic fixed measurer (tests only). |
| fonts? | readonly FontSource[] | Extra faces (for example, local system fonts in the fidelity harness). Tried first. |
| substitutes? | boolean | Load 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| Member | Type | Summary |
|---|---|---|
| focus | boolean | False 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| Member | Type | Summary |
|---|---|---|
| alignment | ParagraphAlignment | '' | |
| indentLeft | string | Inches. |
| lineAt | string | |
| lineRule | LineRule | '' | |
| spaceAfter | string | |
| spaceAfterUnit | SpacingUnit | |
| spaceBefore | string | |
| spaceBeforeUnit | SpacingUnit | |
| special | SpecialIndent | '' | |
| specialBy | string | Inches. |
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| Member | Type | Summary |
|---|---|---|
| alignment? | ParagraphAlignment | Alignment (`algn`). |
| indentFirstLineEmu? | number | null | The 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 | null | Line spacing (`a:lnSpc`): a multiple from 0.01 to 9.99, or 0.01 to 1584 points. |
| spaceAfterLines? | number | null | Space after the paragraph in lines (`a:spcAft/a:spcPct`), 0 to 132. |
| spaceAfterPt? | number | null | Space after the paragraph in points (`a:spcAft/a:spcPts`), 0 to 1584. |
| spaceBeforeLines? | number | null | Space before the paragraph in lines of its text (`a:spcBef/a:spcPct`), 0 to 132. Give this or `spaceBeforePt`, not both. |
| spaceBeforePt? | number | null | Space 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| Member | Type | Summary |
|---|---|---|
| alignment | ParagraphAlignment | null | Alignment; 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. |
| indentFirstLineEmu | number | null | The first line's offset from the left indent, EMU (negative hangs). |
| indentLeftEmu | number | null | "Before text", EMU; null when the paragraphs disagree. |
| lineSpacing | ParagraphLineSpacing | null | Line spacing; null when the paragraphs disagree. |
| spaceAfterLines | number | null | Lines, or null when the space is in points or the paragraphs disagree. |
| spaceAfterPt | number | null | Points, or null when the space is in lines or the paragraphs disagree. |
| spaceBeforeLines | number | null | Lines, or null when the space is in points or the paragraphs disagree. |
| spaceBeforePt | number | null | Points, 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| Member | Type | Summary |
|---|---|---|
| rule | 'multiple' | 'exact' | `multiple` of single spacing (`a:spcPct`), or `exact` points (`a:spcPts`). |
| value | number | Lines for `multiple` (1 is single), points for `exact`. |
PatternFillinterfaceSource ↗
A preset pattern fill (a:pattFill) as the chrome edits it.
interface PatternFill| Member | Type | Summary |
|---|---|---|
| background | string | The background, as `#RRGGBB`. |
| foreground | string | The foreground (the pattern's ink), as `#RRGGBB`. |
| preset | PatternPreset |
PictureStatusinterfaceSource ↗
The state of one EMF or WMF picture part (session.pictureStatus).
interface PictureStatus| Member | Type | Summary |
|---|---|---|
| part | string | The 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| Member | Type | Summary |
|---|---|---|
| retry? | boolean | Convert again the pictures that ran out of time (`timed-out`). Default `false`. |
| timeoutMs? | number | How 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| Member | Type | Summary |
|---|---|---|
| change | (snapshot: EditorSnapshot) => void | The 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) => void | A file did not open (`EditorSnapshot.openFailure`). |
| rejection | (rejection: EditorRejection, snapshot: EditorSnapshot) => void | The editor refused an edit (`EditorSnapshot.lastRejection`). |
| selectionChange | (snapshot: EditorSnapshot) => void | The 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| Member | Type | Summary |
|---|---|---|
| chartData | | The 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. |
| chartFormat | | The 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. |
| find | PptxFind | Find and replace in slide text, tables, and speaker notes. |
| fontFamilies | | Families the font picker offers: standard, configured, embedded, and the deck's own. |
| fontMeasurement | | Which 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. |
| fonts | PptxEditorOptions['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. |
| getReviewAuthors | | The 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. |
| input | | Apply text input at the current text selection, exactly as the keyboard does. A refusal is returned and also published as `lastRejection`. |
| lastCopied | ClipboardPayload | null | The shapes copied last in this editor (paste uses it when the clipboard is not readable). |
| renderLayoutThumbnail | | Paint how a new slide on a layout (`SlideLayoutSummary.id`) looks, with its placeholder prompts, into a container: the Layout and New Slide galleries. |
| selectComment | | Pick 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. |
| session | DocumentSession | null | The open session (store, measurer, layouts), for advanced hosts and tests. |
| setAuthor | | Replace the author of new comments and replies (the `author` option). Existing comments keep their authors. `undefined` removes it. |
| setFontFamilies | | Replace 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. |
| setFonts | | Replace 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()`. |
| setSelection | | Set the selection programmatically (shape ids or a text range). |
| tableStyles | | Table 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'>| Member | Type | Summary |
|---|---|---|
| author? | string | The 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? | boolean | AutoCorrect 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? | EditorFontsOption | Font 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) => void | Called for each font failure: a failed origin, a refused face, or a failed resolution. |
| readClipboardDrawing? | ClipboardDrawingReader | Reads 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? | boolean | Whether drags snap to smart guides; on by default. `toggleSmartGuides` switches it. |
| translate? | (key: string, params?: Record<string, string | number>) => string | Translates 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| Member | Type | Summary |
|---|---|---|
| matches | | Every match of `query`, ordered by slide and position (notes after the slide's shapes). |
| next | | Select the next match after the selection, wrapping at the end of the deck. |
| position | | The index of the match the editor shows now, or -1. |
| previous | | Select the match before the selection, wrapping at the start of the deck. |
| replace | | Replace the match the editor shows and select the next one. When the editor shows no match, select the next match and replace nothing. |
| replaceAll | | Replace every match as one undo step. |
RenderThumbnailOptionsinterfaceSource ↗
Options of renderThumbnail.
interface RenderThumbnailOptions| Member | Type | Summary |
|---|---|---|
| defer? | boolean | Defer 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| Member | Type | Summary |
|---|---|---|
| author | string | The author's display name, exactly as the file gives it. |
| color | string | The color this author draws in: `var(--doc-review-author-<slot % 8>)`. |
| slot | number | Stable 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| Member | Type | Summary |
|---|---|---|
| author? | string | The author's display name. |
| date? | string | ISO 8601 date, as stored. |
| id | string | Stable within one package revision. |
| kind | ReviewItemKind | A comment from the deck, or a suggestion held by the review module. |
| parentId? | string | For a reply, the id of the comment it answers. |
| slidePart | string | The slide part the item belongs to. |
| text | string | The comment text, or a summary of the suggestion. |
ReviewModelInputinterfaceSource ↗
What a review module reads to build its queue.
interface ReviewModelInput| Member | Type | Summary |
|---|---|---|
| package | PptxPackage | The package of the current store revision. |
ReviewModuleContributioninterfaceSource ↗
What a review module contributes.
interface ReviewModuleContribution| Member | Type | Summary |
|---|---|---|
| collectReviewItems | CollectReviewItems | The review queue derivation. |
| displayModes | readonly ReviewDisplayMode[] | Display modes this module unlocks. The free engine shows `final` only. |
| pane? | ReviewPaneOptions | The 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| Member | Type | Summary |
|---|---|---|
| commentMarkers? | CommentMarkerStyle | Default `'icon'`. |
| opening? | ReviewPaneOpening | Default `'auto'`. |
RibbonGroupPickinterfaceSource ↗
Some controls of one registry group, in the given order.
interface RibbonGroupPick| Member | Type | Summary |
|---|---|---|
| controls | readonly string[] | Control ids of the group (`add` for `slide.add`). |
| id | ChromeGroupId |
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| Member | Type | Summary |
|---|---|---|
| context? | RibbonContext | A contextual tab shows only while its context holds. |
| groups | readonly (ChromeGroupId | RibbonGroupPick)[] | Whole groups by id, or some controls of a group. |
| id | RibbonTabId | |
| labelKey | TranslationKey |
RibbonTabLayoutinterfaceSource ↗
A tab as the ribbon shows it now: its entry and its registered groups.
interface RibbonTabLayout| Member | Type | Summary |
|---|---|---|
| groups | readonly ChromeGroup[] | |
| tab | RibbonTab |
SelectedChartStateinterfaceSource ↗
The selected chart, while exactly one chart frame is selected.
interface SelectedChartState| Member | Type | Summary |
|---|---|---|
| editable | boolean | Whether `setChartData` can edit the chart's data. |
| nodeId | string | The node id of the chart's graphic frame. |
| reason? | string | Why 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| Member | Type | Summary |
|---|---|---|
| node | string | null | The diagram node whose text holds the caret (`dgm:pt/@modelId`), or null. |
| nodeId | string | The node id of the diagram's graphic frame. |
| nodes | readonly DiagramNodeState[] | The content nodes of the data model, in outline order: each node, then its children. |
| reason? | string | Why the shapes cannot be added or deleted, as a translation key, when `structure` is false. |
| structure | boolean | Whether `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| Member | Type | Summary |
|---|---|---|
| linear | string | null | The 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. |
| nodeId | string | The 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| Member | Type | Summary |
|---|---|---|
| brightness | number | Brightness from −1 to 1 (`a:lum/@bright`); 0 is none. |
| canCrop | boolean | Whether the picture can be cropped: false with `a:picLocks/@noCrop`, as DOCX Editor's `canCrop`. |
| canResize | boolean | Whether `setImageProperties` and Reset Picture & Size can change the size: false with `a:picLocks/@noResize`, as DOCX Editor's `canResize`. |
| canRotate | boolean | Whether `setImageProperties` can change the rotation: false with `a:picLocks/@noRot`. |
| contrast | number | Contrast from −1 to 1 (`a:lum/@contrast`); 0 is none. |
| count | number | How many pictures are selected. Crop, Change Picture, Format Picture, and Alt Text take one. |
| crop | ImageCropPercent | The crop of each edge in percent of the image (`a:srcRect`). |
| cropping | boolean | Crop mode is on: the crop handles show. |
| heightEmu | number | The height on the slide, in EMU, as `setImageProperties` takes it. |
| lockAspect | boolean | The 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. |
| nodeId | string | The first selected picture. |
| recolor | ImageRecolor | 'other' | The Recolor preset the picture matches, or `other` for another color effect. |
| rotationDegrees | number | The rotation in degrees, clockwise. |
| shape | string | The preset the picture is cropped to (`rect` for none), or `custom` (`a:custGeom`); the value `cropToShape` takes as `preset`. |
| style? | ImageStyleId | The picture style the picture matches, if any. |
| transparency | number | Transparency from 0 (opaque) to 1 (`a:alphaModFix`, 1 − amount). |
| widthEmu | number | The width on the slide, in EMU, as `setImageProperties` takes it. |
SelectionFormatinterfaceSource ↗
Formatting at the selection, for toolbar state.
interface SelectionFormat| Member | Type | Summary |
|---|---|---|
| align? | TextAlign | |
| bold | boolean | |
| bulletFormat? | BulletFormatRead | null | The bullet format of the selected paragraphs: null when they have no list, absent when they differ (so no gallery row is checked). |
| bulletFormatMixed? | BulletFormatMixed | What the selected paragraphs share, when `bulletFormat` is absent because they differ. |
| bullets | boolean | |
| color? | string | |
| columns? | TextColumns | The text columns of the selected shapes with text; absent when they differ. |
| font? | FontFormatRead | The selected text, for the Font dialog and the character spacing menu. |
| fontFamily? | string | The 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 | |
| italic | boolean | |
| link? | string | The link URL of the text at the selection. |
| numbering | boolean | |
| paragraph? | ParagraphFormatRead | The selected paragraphs, for the Paragraph dialog and `useParagraphFormat`. |
| renderedFontSize? | number | null | `fontSize` as drawn under `a:normAutofit/@fontScale`; null when the shapes differ. |
| strike | boolean | |
| subscript? | boolean | The text is lowered (`baseline` below 0). |
| superscript? | boolean | The text is raised (`baseline` above 0). |
| textDirection? | TextOrientation | The 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. |
| underline | boolean | |
| verticalAlign? | VerticalAlign | Vertical alignment of the text in its shape. |
SelectionGeometryinterfaceSource ↗
The selected element's geometry, for the Format panel. EMU and degrees.
interface SelectionGeometry| Member | Type | Summary |
|---|---|---|
| altText? | AltText | The element's alt text. |
| cx | number | |
| cy | number | |
| effects? | ShapeEffectsState | Shadow, reflection, glow, and soft edges. Shapes, connectors, and pictures only. |
| fill? | string | Solid fill as `#RRGGBB`, `none`, `gradient`, `pattern`, `picture`, or `other`. Shapes only. |
| flipH? | boolean | Flips of the element's transform. |
| flipV? | boolean | |
| gradient? | GradientFill | The gradient, when `fill` is `gradient`. |
| kind | 'shape' | 'picture' | 'group' | 'connector' | 'graphicFrame' | |
| lineColor? | string | Outline color as `#RRGGBB`, `none`, or `other`. |
| lineDash? | string | |
| lineHead? | LineEndType | Arrowheads, for lines and connectors. |
| lineTail? | LineEndType | |
| lineWidth? | number | Outline width in points. |
| lockAspectRatio? | boolean | The aspect ratio is locked (`noChangeAspect`): a drag of any resize handle on the canvas keeps the ratio. |
| name | string | |
| nodeId | string | The element's node id; position and size are in its file coordinates. |
| pattern? | PatternFill | The pattern, when `fill` is `pattern`. |
| rot | number | |
| shapeStyle? | ShapeStyleChoice | The Shape Styles gallery cell the shape's `p:style` matches. Shapes only. |
| textFitting? | TextFitting | Text fitting, for shapes with a text body. |
| textWarp? | TextWarpPreset | The text warp (`a:prstTxWarp`), `textNoShape` for none. Shapes with a text body only. |
| x | number | |
| y | number |
ShapeCategoryinterfaceSource ↗
One gallery category.
interface ShapeCategory| Member | Type | Summary |
|---|---|---|
| id | string | |
| labelKey | TranslationKey | i18n key of the category name. |
| presets | readonly 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| Member | Type | Summary |
|---|---|---|
| bevel | BevelPreset | 'none' | The top bevel preset, or `none`. |
| blur | number | Blur radius in points; 0 is no blur. |
| glow | number | |
| glowAccent? | Exclude<ShapeStyleColor, 'dk1'> | The theme accent of a Glow Variations color (40% opacity), when the glow has one. |
| glowColor? | string | The glow color as `#RRGGBB`, when there is a glow. |
| reflection | ReflectionPreset | 'none' | 'other' | |
| rotation3d | Rotation3DPreset | 'none' | 'other' | The camera preset when it is a 3-D Rotation gallery choice, `none` for a front camera. |
| shadow | ShadowPreset | 'none' | 'other' | |
| softEdge | number |
ShapePreviewinterfaceSource ↗
A gallery preview: SVG path data in a 0…100 box.
interface ShapePreview| Member | Type | Summary |
|---|---|---|
| paths | readonly {
readonly d: string;
readonly fill: boolean;
readonly stroke: boolean;
}[] | |
| viewBox | string |
ShapeStyleChoiceinterfaceSource ↗
One cell of the Shape Styles gallery.
interface ShapeStyleChoice| Member | Type | Summary |
|---|---|---|
| color | ShapeStyleColor | |
| row | ShapeStyleRow |
ShapeSummaryinterfaceSource ↗
One element of the current slide, as the selection pane lists it.
interface ShapeSummary| Member | Type | Summary |
|---|---|---|
| children? | readonly ShapeSummary[] | A group's children, top first. |
| kind | 'shape' | 'picture' | 'group' | 'connector' | 'graphicFrame' | |
| name | string | `p:cNvPr/@name`. |
| nodeId | string |
SlideAnimationsinterfaceSource ↗
The animations and the transition of the current slide (EditorSnapshot.animations).
interface SlideAnimations| Member | Type | Summary |
|---|---|---|
| editable | boolean | Whether `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. |
| effects | readonly AnimationEffect[] | The effects, main sequence first, in the order the slide plays them. |
| transition | SlideTransitionState |
SlideBackgroundStateinterfaceSource ↗
The current slide's background, as the chrome shows it.
interface SlideBackgroundState| Member | Type | Summary |
|---|---|---|
| color? | string | |
| gradient? | GradientFill | |
| inherited | boolean | True 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? | boolean | True 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| Member | Type | Summary |
|---|---|---|
| author | string | The author's display name. Empty when the file names no author for the comment. |
| date? | string | The date as the file stores it (ISO 8601), or absent. |
| id | string | The 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. |
| identity | string | A 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. |
| initials | string | The author's initials. Empty when the file has none. |
| text | string | The text, with one line feed between paragraphs. |
| textEditable | boolean | Whether `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| Member | Type | Summary |
|---|---|---|
| frameLabel? | (kind: string) => string | The label of an element the editor draws as a placeholder (chart, diagram), as on the canvas. |
| picturesTimeoutMs? | number | PNG 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? | number | Width 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| Member | Type | Summary |
|---|---|---|
| id | string | The layout's identity in the open document. |
| masterId | string | The slide master the layout belongs to; galleries group layouts by master. |
| masterName | string | The 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`). |
| name | string | The layout's name (`p:cSld/@name`, for example "Title and Content"). |
| type | SlideLayoutKind | `p:sldLayout/@type`. |
SlideSectioninterfaceSource ↗
One section of the slide list (p14:section).
interface SlideSection| Member | Type | Summary |
|---|---|---|
| firstSlide | number | The index of its first slide; for an empty section, the index its slides would take. |
| id | string | The section's identity: its GUID in the file. |
| name | string | |
| slideCount | number |
SlideshowFitinterfaceSource ↗
A slide box on the screen, in CSS pixels on whole device pixels.
interface SlideshowFit| Member | Type | Summary |
|---|---|---|
| height | number | Slide height on the screen. |
| left | number | Left edge from the screen's left edge. |
| top | number | Top edge from the screen's top edge. |
| width | number | Slide width on the screen. |
SlideshowKeyinterfaceSource ↗
A key press as the show reads it (a KeyboardEvent fits).
interface SlideshowKey| Member | Type | Summary |
|---|---|---|
| altKey? | boolean | Modifier state, as on a `KeyboardEvent`. |
| ctrlKey? | boolean | Modifier state, as on a `KeyboardEvent`. |
| key | string | The `KeyboardEvent.key` value. |
| metaKey? | boolean | Modifier state, as on a `KeyboardEvent`. |
| shiftKey? | boolean | Modifier state, as on a `KeyboardEvent`. |
SlideshowPaintOptionsinterfaceSource ↗
Options for paintSlideshowSlide.
interface SlideshowPaintOptions| Member | Type | Summary |
|---|---|---|
| frameLabel? | (kind: string) => string | Label for an element the editor does not render (chart, diagram, OLE). |
SlideshowSlideinterfaceSource ↗
One slide as the show sees it.
interface SlideshowSlide| Member | Type | Summary |
|---|
SlideshowStateinterfaceSource ↗
The state of a running show.
interface SlideshowState| Member | Type | Summary |
|---|---|---|
| done | boolean | True once the show has ended (Escape, or an advance past the end screen). |
| index | number | The slide on show; on the end screen, the slide shown last. |
| screen | SlideshowScreen | What is on the screen. |
| slideCount | number | All slides, hidden ones too. |
| typed | string | Digits 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| Member | Type | Summary |
|---|---|---|
| height | string | |
| orientation | SlideOrientation | |
| scaleContent | boolean | Whether the boxes on every slide scale to the new size (`content: 'scale'`). |
| size | SlideSizePreset | |
| width | string |
SlideSummaryinterfaceSource ↗
One slide in the rail.
interface SlideSummary| Member | Type | Summary |
|---|---|---|
| id | string | The 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. |
| index | number | |
| key | string | Changes whenever the slide's rendering may change, for thumbnail caching. |
| layoutId? | string | The slide's layout (`SlideLayoutSummary.id`); absent when the slide names none. |
| masterId? | string | In the slide master view, the master of a layout (its `id`). |
| name? | string | In the slide master view, the template's name (`p:cSld/@name`). |
| pending? | true | The 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? | number | In 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| Member | Type | Summary |
|---|---|---|
| advanceAfterMs | number | null | The time after which the slide moves on by itself (`advTm`), or null. |
| advanceOnClick | boolean | Whether a click moves to the next slide (`advClick`). |
| durationMs | number | How long it plays, in milliseconds (`p14:dur`, else the speed `spd`). |
| kind | TransitionKind | '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| Member | Type | Summary |
|---|---|---|
| diagnostic | string | Why it failed. Do not use this text for program control. |
| family | string | The family the face substitutes for, for example `Calibri`. |
| file | string | The 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| Member | Type | Summary |
|---|---|---|
| drawn | boolean | Whether a pen pick redraws `target`: true after a border target pick, until No Border. |
| spec | TableBorderSpec | The line the pen draws. |
| target | TableBorderEdgeTarget | The 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| Member | Type | Summary |
|---|---|---|
| color | ColorChoice | The line color. |
| dash? | LineDash | The preset dash; solid when absent. |
| width | number | The 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| Member | Type | Summary |
|---|---|---|
| column | number | The grid column, zero-based. |
| row | number | The 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| Member | Type | Summary |
|---|---|---|
| cellFill? | string | The first selected cell's fill as drawn (its own or the style's): `#RRGGBB`, `none`, `gradient`, or `other`, as `SelectionGeometry.fill`. |
| columnIndex | number | The column of the caret, or of the focus cell of a cell range (0 for a selected table). |
| columns | number | The number of grid columns (`a:gridCol`). |
| columnWidth | number | The 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. |
| nodeId | string | The table's `p:graphicFrame`. |
| options | readonly TableStyleOption[] | The style options that are on. |
| rowHeight | number | The first selected row's laid-out height, EMU. |
| rowIndex | number | The row of the caret, or of the focus cell of a cell range (0 for a selected table). |
| rows | number | The 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? | string | The 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| Member | Type | Summary |
|---|---|---|
| builtIn? | true | The editor's own Medium Style 2 - Accent 1 (no name): the chrome shows its label. |
| id | string | The style GUID, `{…}`, as `a:tableStyleId` holds it. |
| name | string | The style's `styleName`, which can be empty. |
TextColumnsinterfaceSource ↗
Text columns of a shape.
interface TextColumns| Member | Type | Summary |
|---|---|---|
| count | number | 1 to 16. |
| gapEmu | number | The gap between columns, EMU (DOCX Editor: `gapTwips`). |
TextPointinterfaceSource ↗
A caret position: paragraph index and UTF-16 offset in the paragraph.
interface TextPoint| Member | Type | Summary |
|---|---|---|
| affinity? | CaretAffinity | Where 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. |
| offset | number | |
| paragraph | number |
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| Member | Type | Summary |
|---|---|---|
| shift? | number | 0 or absent for the theme color; −99 to 99 for "Darker n%" or "Lighter n%". |
| theme | ThemeColorSlot |
ThemeSwatchinterfaceSource ↗
One swatch of the theme color grid.
interface ThemeSwatch| Member | Type | Summary |
|---|---|---|
| color | string | The color as a slide renders it, `#RRGGBB`. |
| scheme? | string | The 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. |
| shift | number | The 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). |
| slot | ThemeColorSlot |
ToolbarCommandStateinterfaceSource ↗
The shared can-before-exec state of one control.
interface ToolbarCommandState| Member | Type | Summary |
|---|---|---|
| active | boolean | |
| disabledReason | string | null | i18n key of the reason when disabled. |
| enabled | boolean | |
| id | ChromeSlotId | |
| value? | string | number |
ToolbarValueMapinterfaceSource ↗
The value each typed value slot takes.
interface ToolbarValueMap| Member | Type | Summary |
|---|---|---|
| "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" | ChartType | The type of the new chart. |
| "insert.line" | LineKind | |
| "insert.shape" | string | A preset geometry name (`rect`). |
| "list.bulletStyle" | BulletGalleryKey | A Bullets gallery item; `none` turns the list off. |
| "list.lineSpacing" | number | A line spacing multiple (`1.5`). |
| "list.numberStyle" | NumberGalleryKey | A Numbering gallery item; `none` turns the list off. |
| "paragraph.align" | TextAlign | |
| "paragraph.autofit" | TextFitting | How the text fits its shape: `none`, `shrink` (text on overflow), or `shape` (shape to text). |
| "paragraph.columns" | number | The number of text columns, 1 to 16. |
| "paragraph.dialog" | ParagraphFormatCommand | The 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" | number | Points. |
| "shape.styles" | ShapeStyleValue | ShapeStyleChoice | |
| "shape.textEffects" | TextEffectsValue | |
| "slide.add" | string | A layout id from `snapshot().layouts`. |
| "slide.layout" | string | A layout id from `snapshot().layouts`. |
| "text.changeCase" | TextCase | Home Change Case. |
| "text.characterSpacing" | number | Points added after each character; 0 is Normal, negative condenses. |
| "text.color" | ColorChoice | null | |
| "text.dialog" | FontFormatCommand | The Font dialog's fields, run as one `setFontFormat` without the dialog. |
| "text.highlight" | ColorChoice | null | |
| "text.link" | string | null | A URL, or null to remove the link. |
| "view.presentationView" | 'normal' | 'slideSorter' | 'slideMaster' |
TransformIteminterfaceSource ↗
One element's new box, in its file coordinates (its parent's child space).
interface TransformItem| Member | Type | Summary |
|---|---|---|
| connector? | ConnectorRoute | A connector's route and glued ends (`p:cxnSp` only). Absent keeps them. |
| cx | number | |
| cy | number | |
| flipH? | boolean | Flips; absent keeps the current ones. A line's direction is its flips. |
| flipV? | boolean | |
| nodeId | string | |
| rot | number | Rotation in degrees, clockwise. The file stores it in 60,000ths of a degree. |
| x | number | |
| y | number |
UsePptxSourceOptionsinterfaceSource ↗
Options for usePptxSource.
interface UsePptxSourceOptions| Member | Type | Summary |
|---|---|---|
| fetchOptions? | RequestInit | Passed to `fetch` for a URL source: credentials and headers. |
| fonts? | PptxFontsSource | The 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[]BULLET_GALLERYconstSource ↗
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[]CROP_SHAPE_GALLERYconstSource ↗
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: TableBorderPenDRAWING_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 symbolFONT_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 = 4000MAX_LINEAR_LENGTHconstSource ↗
The longest linear form that the parser reads.
MAX_LINEAR_LENGTH = 1000MAX_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 = 64NO_HOST_FACESconstSource ↗
NO_HOST_FACES: HostFacesNOTES_FIND_HIGHLIGHTconstSource ↗
The highlight name the editor stylesheet paints (::highlight(pptx-find)).
NOTES_FIND_HIGHLIGHT = "pptx-find"NUMBER_GALLERYconstSource ↗
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 = 8RIBBON_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[]SHAPE_GALLERYconstSource ↗
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']