@pptx-editor.dev/core/cascade

Functions (37)

applyTransformsfunctionSource ↗

Apply the transforms listed as children of a color element, in document order, as the spec requires (each transform sees the result of the previous one).

declare function applyTransforms(base: Rgba, transforms: readonly Element[]): Rgba;

collectionScriptFontfunctionSource ↗

The East Asian (ea) or complex-script (cs) face of a collection for a language: the slot's own typeface, else the script font of the language's script (ECMA-376 Part 1, 20.1.4.1.16 font). Undefined when the collection names neither.

declare function collectionScriptFont(collection: FontCollection, slot: 'ea' | 'cs', lang?: string): string | undefined;

colorChildfunctionSource ↗

The first color-model child of a fill or other color container.

declare function colorChild(el: Element | undefined): Element | undefined;

colorElementfunctionSource ↗

An a:srgbClr element for a resolved color, keeping its alpha.

declare function colorElement(color: Rgba): Element;

defaultTableStyleIdfunctionSource ↗

The style that a new table takes: a:tblStyleLst/@def (ECMA-376 Part 1, 20.1.4.2.27), else Medium Style 2 - Accent 1. A def that the package does not define is a built-in style the editor cannot draw (the definitions are not in the file or the specification), so a new table takes Medium Style 2 - Accent 1, which the editor has a built-in definition for.

declare function defaultTableStyleId(pkg: PptxPackage): string;

effectContainerfunctionSource ↗

p:spPr-like containers keep the effect list as a direct child.

declare function effectContainer(spPr: Element | undefined): Element | undefined;

fillElementOffunctionSource ↗

The fill element among a property container's children (p:spPr, a:rPr, p:bgPr).

declare function fillElementOf(props: Element | undefined): Element | undefined;

flagfunctionSource ↗

xsd:boolean read for bodyPr flags.

declare function flag(el: Element | undefined, name: string): boolean | undefined;

fontRefEntryfunctionSource ↗

A style's font reference as a chain entry (a:defPPr/a:defRPr): its theme font and color then take precedence over everything below it in the chain.

declare function fontRefEntry(ref: FontRef | undefined): Element | undefined;

inheritedPlaceholdersfunctionSource ↗

The placeholders a slide element inherits from, nearest first: its layout placeholder, then the master placeholder, matched as resolveSlide matches them. Empty for an element that is not a placeholder. An edit that starts an own value from the inherited one reads these.

declare function inheritedPlaceholders(pkg: PptxPackage, slidePart: string, el: Element): Element[];

isColorElementfunctionSource ↗

Whether an element is one of the six DrawingML color models.

declare function isColorElement(el: Element): boolean;

levelEntriesfunctionSource ↗

The pPr-like entries for one level of a list style (defPPr first, then lvlNpPr).

declare function levelEntries(lstStyle: Element | undefined, level: number): Element[];

linearToSrgbfunction

Linear component (0–1) to sRGB.

declare function linearToSrgb(c: number): number;

parseHexfunction

Parse RRGGBB. Anything else reads as undefined.

declare function parseHex(hex: string | undefined): Rgba | undefined;

parseThemefunctionSource ↗

Parse a theme part. A missing theme yields the default theme.

declare function parseTheme(part: XmlPart | undefined): Theme;

qfunctionSource ↗

The expanded name for a conventional prefix:local spelling. Unprefixed means no namespace (the usual case for attributes). Throws on an unknown prefix: this is for engine code, never for file data.

declare function q(name: string): QName;

readColorMapfunctionSource ↗

Read a p:clrMap (or a:overrideClrMapping) element into a map.

declare function readColorMap(el: Element | undefined): ReadonlyMap<string, string> | undefined;

readKinsokufunctionSource ↗

Read p:kinsoku (ECMA-376 Part 1, 19.2.1.17) from p:presentation.

declare function readKinsoku(presentation: Element | undefined): KinsokuRules | undefined;

resolveChartPartfunctionSource ↗

The chart part a chart frame's a:graphicData names, or undefined when the reference, the relationship, the part, or its root is missing or of another kind. An external target is never fetched.

declare function resolveChartPart(pkg: PptxPackage, sourcePart: string, graphicData: Element | undefined, colors: ColorContext, theme: Theme): ResolvedChartPart | undefined;

resolveColorfunctionSource ↗

Resolve a color element (a:srgbClr …) to RGBA, or undefined if it cannot resolve.

declare function resolveColor(el: Element | undefined, ctx: ColorContext): Rgba | undefined;

resolveEffectsfunctionSource ↗

Resolve an effect list (a:effectLst). a:effectDag is reported unsupported.

declare function resolveEffects(container: Element | undefined, ctx: ColorContext): ResolvedEffects | undefined;

resolveFillElementfunctionSource ↗

Resolve one fill element (a:solidFill, a:gradFill, …).

declare function resolveFillElement(el: Element | undefined, ctx: ColorContext): ResolvedFill | undefined;

resolveLinefunctionSource ↗

Resolve an outline from the direct a:ln and the style a:ln it overrides, property by property: direct attributes and children win; anything absent comes from the style.

declare function resolveLine(direct: Element | undefined, style: Element | undefined, directCtx: ColorContext, styleCtx: ColorContext): ResolvedLine | undefined;

resolveParagraphfunctionSource ↗

Resolve one a:p.

declare function resolveParagraph(input: ParagraphInputs): ResolvedParagraph;

resolveRunPropsfunctionSource ↗

Resolve run properties over a chain of rPr-like elements (lowest first).

declare function resolveRunProps(chain: readonly Element[], ctx: ColorContext, theme: Theme, fontRef: FontRef | undefined): RunProps;

resolveSlidefunctionSource ↗

Resolve slide index (0-based, presentation order).

declare function resolveSlide(pkg: PptxPackage, index: number): ResolvedSlide | undefined;

resolveTablefunctionSource ↗

Resolve the a:tbl inside a frame's a:graphicData.

declare function resolveTable(graphicData: Element | undefined, scope: TableScope): ResolvedTable | undefined;

resolveThemeFontfunctionSource ↗

Resolve a theme font reference (+mj-lt, +mn-ea, …) to a typeface. Returns the input unchanged when it is a plain typeface name. lang picks the script font of an ea or cs reference when the theme's slot is empty.

declare function resolveThemeFont(typeface: string, theme: Theme, lang?: string): string | undefined;

schemeColorfunctionSource ↗

Resolve a scheme color name through the color map to the theme scheme.

declare function schemeColor(name: string, ctx: ColorContext): Rgba | undefined;

srgbToLinearfunction

sRGB component (0–1) to linear.

declare function srgbToLinear(c: number): number;

styleRefContextfunctionSource ↗

Resolve a theme style-matrix reference (a:fillRef, a:lnRef, a:effectRef, p:bgRef). The reference's own color becomes phClr inside the referenced style.

declare function styleRefContext(ref: Element | undefined, ctx: ColorContext): ColorContext;

syntheticElementfunctionSource ↗

A DrawingML element built by the cascade, not read from a part (ids are never addressed).

declare function syntheticElement(local: string, attrs?: Readonly<Record<string, string>>, kids?: readonly Element[]): Element;

tableStyleForfunctionSource ↗

The style a table uses: inline a:tableStyle, else a:tableStyleId looked up.

declare function tableStyleFor(pkg: PptxPackage, tblPr: Element | undefined): Element | undefined;

tableStyleListfunctionSource ↗

The styles a table can use: the deck's own, in file order, and the built-in default. A deck style carries its styleName; the built-in default is marked builtIn and has no name, so the chrome names it in the user's language.

declare function tableStyleList(pkg: PptxPackage): readonly {
    id: string;
    name: string;
    builtIn?: true;
}[];

themeFillfunctionSource ↗

The theme fill a fillRef/bgRef index points at. 0 and 1000 mean no fill.

declare function themeFill(idx: number, theme: Theme): Element | undefined;

toCssfunctionSource ↗

rgba(...) CSS, for paint.

declare function toCss(c: Rgba): string;

toHexfunction

#rrggbb.

declare function toHex(c: Rgba): string;

Interfaces (35)

BodyPropsinterfaceSource ↗

Resolved a:bodyPr. Insets in EMU.

interface BodyProps
MemberTypeSummary
anchor't' | 'ctr' | 'b' | 'just' | 'dist'
anchorCtrboolean
autofitAutofit
bInsnumber
lInsnumber
numColnumber
rInsnumber
rotnumber
spcColnumber
spcFirstLastParaboolean
tInsnumber
uprightboolean
vertstring
warp?TextWarpThe preset text warp (`a:prstTxWarp`, ECMA-376 Part 1, 20.1.9.19), when it draws one: absent for `textNoShape` and for a name that `ST_TextShapeType` does not hold.
wrap'square' | 'none'

CellBordersinterfaceSource ↗

The borders of one table cell. Absent: no line.

interface CellBorders
MemberTypeSummary
blToTr?ResolvedLineDiagonal from the bottom-left to the top-right corner.
bottom?ResolvedLine
left?ResolvedLine
right?ResolvedLine
tlToBr?ResolvedLineDiagonal from the top-left to the bottom-right corner.
top?ResolvedLine

ColorContextinterfaceSource ↗

What a color reference resolves against.

interface ColorContext
MemberTypeSummary
colorMapReadonlyMap<string, string>The effective color map: bg1 → lt1, tx1 → dk1, … (master clrMap with any override).
placeholderColor?RgbaThe style-reference color substituted for `phClr`, when inside a style reference.
schemeReadonlyMap<string, Rgba>The theme color scheme: dk1, lt1, dk2, lt2, accent1–6, hlink, folHlink.

ConnectionRefinterfaceSource ↗

One end of a connector glued to a shape (CT_Connection, ECMA-376 Part 1, 20.1.2.2.4).

interface ConnectionRef
MemberTypeSummary
idstringThe drawing id (`p:cNvPr/@id`) of the shape.
idxnumberThe index of the connection site in the shape's geometry (`a:cxnLst`).

EffectPlacementinterfaceSource ↗

Scale, skew, alignment, and offset shared by outer shadows and reflections.

interface EffectPlacement
MemberTypeSummary
alignEffectAlign
blurnumberBlur radius, EMU.
dirnumber
distnumberOffset distance, EMU, at `dir` degrees (clockwise from the x axis).
kxnumberSkew angles, degrees.
kynumber
rotWithShapebooleanTrue: the effect turns with the shape (the schema default).
sxnumber
synumber

FontCollectioninterfaceSource ↗

One script slot of a font scheme collection.

interface FontCollection
MemberTypeSummary
cs?string
ea?string
latin?string
scripts?ReadonlyMap<string, string>The script fonts (`a:font script="Jpan" typeface="…"`, ECMA-376 Part 1, 20.1.4.1.16), by ISO 15924 script code. They name the East Asian and complex-script faces when `a:ea` or `a:cs` is empty. Absent when the collection has none.

FontRefinterfaceSource ↗

The theme font and color a shape's p:style/a:fontRef contributes.

interface FontRef
MemberTypeSummary
color?Rgba
font?'major' | 'minor'

GradientStopinterfaceSource ↗

One gradient stop. pos is 0–1.

interface GradientStop
MemberTypeSummary
colorRgba
posnumber

KinsokuRulesinterfaceSource ↗

Custom East Asian line breaking lists (p:kinsoku, ECMA-376 Part 1, 19.2.1.17): the characters that may not start a line (invalStChars) and may not end one (invalEndChars).

interface KinsokuRules
MemberTypeSummary
lang?stringThe language the lists apply to (`lang`), a BCP 47 tag. No tag: every language.
notEndstringCharacters that may not end a line (`invalEndChars`).
notStartstringCharacters that may not start a line (`invalStChars`).

LineEndinterfaceSource ↗

Arrowhead description.

interface LineEnd
MemberTypeSummary
len'sm' | 'med' | 'lg'
typestring
w'sm' | 'med' | 'lg'

ParagraphInputsinterfaceSource ↗

Inputs for resolving one paragraph.

interface ParagraphInputs
MemberTypeSummary
chainFor(level: number) => readonly Element[]Builds the level chain (lowest first, excluding the paragraph's own pPr).
ctxColorContext
fontRef?FontRef
kinsoku?KinsokuRulesThe presentation's custom kinsoku lists (`readKinsoku`).
paragraphElement
pictures?PictureBulletSourceThe package and the part of each chain entry, for picture bullets (`a:buBlip`).
slideNumbernumberText for `a:fld type="slidenum"`.
themeTheme

PictureBulletSourceinterfaceSource ↗

Where the picture of a picture bullet comes from.

interface PictureBulletSource
MemberTypeSummary
partOf(entry: Element) => string | undefinedThe part that holds a chain entry (`a:lvlNpPr`, `a:defPPr`, `a:pPr`), or undefined.
pkgPptxPackage

RelRectinterfaceSource ↗

A rectangle inset as fractions of the bounds (a:srcRect, a:fillToRect).

interface RelRect
MemberTypeSummary
bnumber
lnumber
rnumber
tnumber

ResolvedBevelinterfaceSource ↗

A bevel (a:bevelT, a:bevelB): width and height in EMU, and its preset.

interface ResolvedBevel
MemberTypeSummary
hnumberHeight, toward the viewer.
presetBevelPresetType`ST_BevelPresetType`; an unknown value reads `circle`, the schema default.
wnumberWidth, inward from the outline.

ResolvedChartPartinterfaceSource ↗

A resolved chart part: its tree, and what its colors and fonts resolve against.

interface ResolvedChartPart
MemberTypeSummary
chartSpaceElementThe `c:chartSpace` root. Read-only: the package keeps the part's own bytes.
colorsColorContextThe slide's color context, with the chart's own color map override (`c:clrMapOvr`, ECMA-376 Part 1, 21.2.2.28) applied.
partNamestringThe chart part name.
themeThemeThe theme, for the `+mj-lt` and `+mn-lt` fonts of chart text.

ResolvedEffectsinterfaceSource ↗

Resolved shape effects. Distances in EMU, angles in degrees.

interface ResolvedEffects
MemberTypeSummary
blur?{ readonly radius: number; readonly grow: boolean; }A blur of the whole shape (`a:blur`): radius in EMU; `grow` lets it spread past the edge.
fillOverlay?{ readonly blend: BlendMode; readonly fill: Exclude<ResolvedFill, { type: 'group'; }>; }A fill drawn over the shape's fill with a blend mode (`a:fillOverlay`).
glow?{ readonly radius: number; readonly color: Rgba; }
innerShadow?{ readonly blur: number; readonly dist: number; readonly dir: number; readonly color: Rgba; }
outerShadow?EffectPlacement & { readonly color: Rgba; }
reflection?EffectPlacement & { readonly startAlpha: number; readonly startPos: number; readonly endAlpha: number; readonly endPos: number; readonly fadeDir: number; }
secondShadow?EffectPlacement & { readonly color: Rgba; }A second outer shadow, under the first: the far or opposite copy of a preset shadow (`a:prstShdw`), or a preset shadow next to an `a:outerShdw`.
softEdge?{ readonly radius: number; }
threeD?ResolvedThreeDBevels, extrusion, contour, and the camera (`a:scene3d`, `a:sp3d`).
unsupportedreadonly string[]Effect elements present but not rendered, for the fidelity report.

ResolvedGraphicFrameinterfaceSource ↗

p:graphicFrame: tables, charts, diagrams, OLE. Tables, OLE posters, and diagrams with a saved drawing render, and charts render through an installed chart renderer; the rest show a fallback.

interface ResolvedGraphicFrame extends ResolvedBase
MemberTypeSummary
chart?ResolvedChartPartThe chart part, for `frameKind: 'chart'` (ECMA-376 Part 1, 21.2). Absent when the part is missing or is not a chart. The engine draws a chart only through an installed chart renderer (`installDrawingRenderers`); without one the frame shows a placeholder.
drawing?readonly ResolvedElement[]The saved drawing of a diagram (`dsp:drawing`; ECMA-376 Part 1, 21.4): its shapes and groups, in the frame's local space, drawn by the normal shape renderer. Read-only. Absent when the diagram has no saved drawing, or when the drawing does not resolve within the limits; the frame then shows a placeholder.
drawingFallback?DiagramFallbackWhy a diagram frame shows its placeholder: `no-drawing` (no saved drawing, or a part that does not resolve), `unsupported` (an element outside the supported subset), or `limit` (past the shape, depth, or slide limit). Absent when `drawing` is present and for other frames.
fallbackRId?string
frameKind'chart' | 'diagram' | 'table' | 'ole' | 'unknown'
kind'graphicFrame'
poster?ResolvedPictureThe picture that shows an OLE object (`p:oleObj/p:pic`; ECMA-376 Part 1, 19.3.1.36), placed in the frame's box. It carries the frame's node id. Absent for other frames, and when the picture is not an internal PNG, JPEG, GIF, or BMP part (the frame then shows a placeholder).
table?ResolvedTableThe table, for `frameKind: 'table'`.
uristring

ResolvedGroupinterfaceSource ↗

p:grpSp. Child coordinates are in the chOff/chExt space.

interface ResolvedGroup extends ResolvedBase
MemberTypeSummary
childExtent{ readonly cx: number; readonly cy: number; }
childOffset{ readonly x: number; readonly y: number; }
childrenreadonly ResolvedElement[]
fillResolvedFill
kind'group'

ResolvedLineinterfaceSource ↗

A resolved outline. Width in EMU.

interface ResolvedLine
MemberTypeSummary
cap'flat' | 'rnd' | 'sq'
compoundstring
dashstringPreset dash name, or `custom` with `dashes` in multiples of line width.
dashes?readonly number[]
fillResolvedFill
head?LineEnd
join'round' | 'bevel' | 'miter'
miterLimitnumber
tail?LineEnd
widthnumber

ResolvedParagraphinterfaceSource ↗

A resolved paragraph. Lengths in EMU.

interface ResolvedParagraph
MemberTypeSummary
align'l' | 'ctr' | 'r' | 'just' | 'dist' | 'justLow' | 'thaiDist'
bulletResolvedBullet | null
defaultTabnumber
eaLineBreakboolean
endPropsRunPropsProperties of the paragraph mark (`a:endParaRPr`), sizing an empty paragraph.
hangingPunctboolean`hangingPunct`: East Asian commas and full stops may hang past the line end.
indentnumber
kinsoku?KinsokuRulesThe presentation's custom East Asian line breaking lists (`p:kinsoku`), when they apply to the paragraph's language. They replace the built-in lists.
latinLineBreakboolean
levelnumber
lineSpacingSpacing
marLnumber
marRnumber
nodeIdstring
rtlboolean
runsreadonly ResolvedRun[]
spaceAfterSpacing
spaceBeforeSpacing
tabsreadonly { readonly pos: number; readonly align: string; }[]

ResolvedPictureinterfaceSource ↗

p:pic.

interface ResolvedPicture extends ResolvedBase
MemberTypeSummary
effects?ResolvedEffects
fillExtract<ResolvedFill, { type: 'picture'; }> | { readonly type: 'none'; }
geometryGeometrySpec
kind'picture'
line?ResolvedLine
media?stringVideo/audio or an OLE icon: render the poster, preserve the media.

ResolvedRuninterfaceSource ↗

One inline item of a paragraph.

interface ResolvedRun
MemberTypeSummary
fieldType?string
kind'text' | 'break' | 'field' | 'math'
math?MathZoneThe equation of a math run (`a14:m`, ECMA-376 Part 1, 22.1). Its `text` is one object character (U+FFFC): the caret steps over the whole equation.
nodeIdstringThe `a:r` / `a:br` / `a:fld` / `a14:m` node.
propsRunProps
textstring
textNodeId?stringThe `a:t` node holding the text (text and field runs).

ResolvedShapeinterfaceSource ↗

p:sp or p:cxnSp.

interface ResolvedShape extends ResolvedBase
MemberTypeSummary
connections?{ readonly start?: ConnectionRef; readonly end?: ConnectionRef; }A connector's glued ends (`p:cNvCxnSpPr/a:stCxn` and `a:endCxn`).
diagramNode?stringThe data model point (`dgm:pt/@modelId`) whose text a diagram shape shows, when it shows the text of exactly one node. A diagram text edit writes this point and the shape.
effects?ResolvedEffects
fillResolvedFill
geometryGeometrySpec
kind'shape' | 'connector'
line?ResolvedLine
text?ResolvedTextBody
textBox?trueA text box (`p:cNvSpPr/@txBox`, ECMA-376 Part 1, 19.3.1.13): a press in it edits its text.
textXfrm?XfrmThe text rectangle of a diagram shape (`dsp:txXfrm`), in the same space as `xfrm`. Its turn adds to the shape's turn. Text lays out in it, not in the geometry's text rectangle.

ResolvedSlideinterfaceSource ↗

One slide, fully resolved.

interface ResolvedSlide
MemberTypeSummary
backgroundResolvedFill
backgroundPartstringThe part whose relationships resolve the background picture.
elementsreadonly ResolvedElement[]In paint order: master, layout, slide.
heightnumber
indexnumber
partNamestring
widthnumberSlide size, EMU.

ResolvedTableinterfaceSource ↗

A resolved a:tbl. Lengths in EMU.

interface ResolvedTable
MemberTypeSummary
backgroundResolvedFillThe table background (`a:tblPr` fill, or the style's `tblBg`).
cellsreadonly ResolvedTableCell[]Row-major; `cells[r * columns.length + c]`.
columnsreadonly number[]
rowsreadonly { readonly nodeId: string; readonly height: number; }[]Minimum row heights (`a:tr/@h`).
rtlboolean
styleId?stringThe style the table uses, when it was found (`styleId`).

ResolvedTableCellinterfaceSource ↗

One a:tc, at its grid position. Covered cells of a merge have covered set.

interface ResolvedTableCell
MemberTypeSummary
bordersCellBorders
colnumber
coveredbooleanCovered by another cell's `gridSpan` or `rowSpan`, or no `a:tc` at the position: not drawn. A merge marker (`hMerge`, `vMerge`) that no span reaches does not cover its cell.
fillResolvedFill
gridSpannumber
nodeIdstring
rownumber
rowSpannumber
textResolvedTextBody

ResolvedTextBodyinterfaceSource ↗

A resolved text body.

interface ResolvedTextBody
MemberTypeSummary
bodyBodyProps
nodeId?stringThe `p:txBody` node, or undefined when the text comes only from an inherited prompt.
paragraphsreadonly ResolvedParagraph[]

ResolvedThreeDinterfaceSource ↗

The resolved 3-D properties of a shape. Lengths in EMU.

interface ResolvedThreeD
MemberTypeSummary
bevelBottom?ResolvedBevelThe bottom bevel (`a:bevelB`), on the back.
bevelTop?ResolvedBevelThe top bevel (`a:bevelT`), on the face.
camerastring`a:camera/@prst` (`ST_PresetCameraType`), as written.
cameraRot?Rotation3D`a:camera/a:rot`, when present: it replaces the preset's rotation.
contourColor?Rgba
contourWnumberThe contour width (`@contourW`) and its color (`a:contourClr`).
extrusionColor?Rgba
extrusionHnumberThe extrusion depth (`@extrusionH`) and its color (`a:extrusionClr`).
lightDirstring
lightRigstring`a:lightRig/@rig` (`ST_LightRigType`) and `@dir` (`ST_LightRigDirection`).
materialstring`ST_PresetMaterialType`; `warmMatte` is the schema default.

Rgbainterface

A resolved color: sRGB 0–255 integers and alpha 0–1.

interface Rgba
MemberTypeSummary
anumber
bnumber
gnumber
rnumber

Rotation3DinterfaceSource ↗

A rotation in degrees (a:rot: latitude, longitude, revolution).

interface Rotation3D
MemberTypeSummary
latnumberLatitude: the turn about the x axis.
lonnumberLongitude: the turn about the y axis.
revnumberRevolution: the turn about the z axis.

RunPropsinterfaceSource ↗

Fully resolved character properties. Sizes in hundredths of a point.

interface RunProps
MemberTypeSummary
altLang?stringThe run's alternate language (`altLang`), a BCP 47 tag.
baselinenumberSuperscript/subscript offset, percent of size (positive raises).
boldboolean
caps'none' | 'all' | 'small'
csstring
eastring
fillResolvedFill
highlight?Rgba
hyperlinkAction?stringThe run's link action (`a:hlinkClick/@action`), such as a jump to another slide.
italicboolean
kern?numberKerning threshold in hundredths of a point (`kern`); kerning applies at or above it.
lang?stringThe run's language (`lang`), a BCP 47 tag.
latinstring
latinTheme?'major' | 'minor'The theme font `latin` comes from (`+mj-lt` is `major`, `+mn-lt` is `minor`); absent when a level names a literal family. ECMA-376 Part 1, 20.1.4.1.17 `latin`.
outline?ResolvedLine
sizenumber
spacingnumberCharacter spacing, hundredths of a point.
strikestring
sym?string
underlinestring
underlineFill?ResolvedFillThe underline's own fill (`a:uFill`); absent when the underline takes the text fill.

TableScopeinterfaceSource ↗

What table resolution needs about the slide.

interface TableScope
MemberTypeSummary
ctxColorContext
defaultTextStyle?Element
kinsoku?KinsokuRulesThe presentation's custom kinsoku lists (`p:kinsoku`).
partName?stringThe part of the table, whose relationships the picture bullets of its cells name.
pkgPptxPackage
presentationPart?stringThe presentation part, whose relationships the picture bullets of `defaultTextStyle` name.
slideNumbernumber
themeTheme

TextWarpinterfaceSource ↗

A preset text warp: its ST_TextShapeType name and its adjust values (a:avLst).

interface TextWarp
MemberTypeSummary
adjustReadonlyMap<string, number>
presetstring

ThemeinterfaceSource ↗

A parsed theme.

interface Theme
MemberTypeSummary
backgroundFillStylesreadonly Element[]`a:bgFillStyleLst`. `bgRef idx` 1001 is entry 0.
colorsReadonlyMap<string, Rgba>
effectStylesreadonly Element[]
fillStylesreadonly Element[]`a:fmtScheme` lists. Index 0 is `idx="1"`, as `p:style` references count from 1.
lineStylesreadonly Element[]
majorFontFontCollection
minorFontFontCollection

XfrminterfaceSource ↗

A 2D transform in EMU, as stored in a:xfrm. rot is in degrees.

interface Xfrm
MemberTypeSummary
cxnumber
cynumber
flipHboolean
flipVboolean
rotnumber
xnumber
ynumber

Type aliases (12)

AutofittypeSource ↗

Autofit as stored.

type Autofit = {
    readonly kind: 'none';
} | {
    readonly kind: 'normal';
    readonly fontScale: number;
    readonly lineSpaceReduction: number;
} | {
    readonly kind: 'shape';
};

BevelPresetTypetypeSource ↗

One ST_BevelPresetType value.

type BevelPresetType = (typeof BEVEL_PRESET_TYPES)[number];

BlendModetypeSource ↗

A blend mode (ST_BlendMode), as a:fillOverlay and a:blend use it.

type BlendMode = 'over' | 'mult' | 'screen' | 'darken' | 'lighten';

BlipEffecttypeSource ↗

A blip (image) effect, in document order.

type BlipEffect = {
    readonly kind: 'alphaModFix';
    readonly amount: number;
} | {
    readonly kind: 'grayscale';
} | {
    readonly kind: 'duotone';
    readonly dark: Rgba;
    readonly light: Rgba;
} | {
    readonly kind: 'lum';
    readonly bright: number;
    readonly contrast: number;
} | {
    readonly kind: 'biLevel';
    readonly threshold: number;
} | {
    readonly kind: 'unsupported';
    readonly name: string;
};

DiagramFallbacktypeSource ↗

Why a diagram frame shows its placeholder (ResolvedGraphicFrame.drawingFallback).

type DiagramFallback = 'no-drawing' | 'unsupported' | 'limit';

EffectAligntypeSource ↗

The point of a shape's box an effect scales and skews about (a:outerShdw/@algn).

type EffectAlign = 'tl' | 't' | 'tr' | 'l' | 'ctr' | 'r' | 'bl' | 'b' | 'br';

GeometrySpectypeSource ↗

Shape geometry: a preset with adjust values, or a custom geometry element.

type GeometrySpec = {
    readonly kind: 'preset';
    readonly preset: string;
    readonly adjust: ReadonlyMap<string, number>;
} | {
    readonly kind: 'custom';
    readonly element: Element;
}
/**
 * Paths already evaluated in the element's local box (EMU). Never read from a file: a drawing
 * renderer emits them, for example the bars and lines of a chart.
 */
 | {
    readonly kind: 'paths';
    readonly paths: readonly GeometryPath[];
};

LayertypeSource ↗

Where an element comes from. Only slide elements are editable in v0.

type Layer = 'master' | 'layout' | 'slide';

ResolvedBullettypeSource ↗

Bullet of a paragraph. Sizes: pct of the first run's size, or pts in hundredths.

type ResolvedBullet = {
    readonly type: 'char';
    readonly char: string;
    readonly font?: string;
    readonly size: {
        readonly pct: number;
    } | {
        readonly pts: number;
    };
    readonly color?: Rgba;
} | {
    readonly type: 'autonum';
    readonly scheme: string;
    readonly startAt: number;
    readonly font?: string;
    readonly size: {
        readonly pct: number;
    } | {
        readonly pts: number;
    };
    readonly color?: Rgba;
} | {
    readonly type: 'picture';
    readonly part: string;
    readonly rId: string;
    readonly svgRId?: string;
    readonly aspect: number;
    readonly size: {
        readonly pct: number;
    } | {
        readonly pts: number;
    };
};

ResolvedElementtypeSource ↗

type ResolvedElement = ResolvedShape | ResolvedPicture | ResolvedGroup | ResolvedGraphicFrame;

ResolvedFilltypeSource ↗

A resolved fill.

type ResolvedFill = {
    readonly type: 'none';
} | {
    readonly type: 'solid';
    readonly color: Rgba;
} | {
    readonly type: 'linear';
    readonly stops: readonly GradientStop[];
    readonly angle: number;
    readonly scaled: boolean;
    readonly rotWithShape: boolean;
    readonly tileRect?: RelRect;
} | {
    readonly type: 'path';
    readonly path: 'circle' | 'rect' | 'shape';
    readonly stops: readonly GradientStop[];
    readonly fillToRect: RelRect;
    readonly rotWithShape: boolean;
    readonly tileRect?: RelRect;
} | {
    readonly type: 'picture';
    readonly rId: string;
    readonly svgRId?: string;
    readonly srcRect: RelRect;
    readonly mode: 'stretch' | 'tile';
    readonly fillRect: RelRect;
    readonly tile?: {
        readonly tx: number;
        readonly ty: number;
        readonly sx: number;
        readonly sy: number;
        readonly flip: string;
        readonly algn: string;
    };
    readonly effects: readonly BlipEffect[];
    readonly rotWithShape: boolean;
} | {
    readonly type: 'pattern';
    readonly preset: string;
    readonly fg: Rgba;
    readonly bg: Rgba;
} | {
    readonly type: 'group';
};

SpacingtypeSource ↗

Line spacing: a percentage of single spacing, or an exact size in hundredths of a point.

type Spacing = {
    readonly pct: number;
} | {
    readonly pts: number;
};

Variables (7)

BEVEL_PRESET_TYPESconstSource ↗

The bevel presets of ST_BevelPresetType (ECMA-376 Part 1, 20.1.10.9).

BEVEL_PRESET_TYPES: readonly ["relaxedInset", "circle", "slope", "cross", "angle", "softRound", "convex", "coolSlant", "divot", "riblet", "hardEdge", "artDeco"]

BLACKconst

Opaque black, the fallback color. Frozen, because every caller shares it.

BLACK: Rgba

CHART_CONTENT_TYPEconstSource ↗

The content type of a chart part (ECMA-376 Part 1, 14.2.1).

CHART_CONTENT_TYPE = "application/vnd.openxmlformats-officedocument.drawingml.chart+xml"

DEFAULT_COLOR_MAPconstSource ↗

Default color map, used when a master has none: bg1=lt1, tx1=dk1, bg2=lt2, tx2=dk2.

DEFAULT_COLOR_MAP: ReadonlyMap<string, string>

DEFAULT_LINE_WIDTHconstSource ↗

Default outline width when neither the shape nor its style gives one: 0.75 pt.

DEFAULT_LINE_WIDTH = 9525

DEFAULT_TABLE_STYLE_IDconstSource ↗

Medium Style 2 - Accent 1: the default table style of a new table.

DEFAULT_TABLE_STYLE_ID = "{5C22544A-7EE6-4342-B048-85BDC9FD1C3A}"

PRESET_COLORSconstSource ↗

Preset color name → RRGGBB. A null-prototype record: names come from files.

PRESET_COLORS: Readonly<Record<string, string>>