@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| Member | Type | Summary |
|---|---|---|
| anchor | 't' | 'ctr' | 'b' | 'just' | 'dist' | |
| anchorCtr | boolean | |
| autofit | Autofit | |
| bIns | number | |
| lIns | number | |
| numCol | number | |
| rIns | number | |
| rot | number | |
| spcCol | number | |
| spcFirstLastPara | boolean | |
| tIns | number | |
| upright | boolean | |
| vert | string | |
| warp? | TextWarp | The 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| Member | Type | Summary |
|---|---|---|
| blToTr? | ResolvedLine | Diagonal from the bottom-left to the top-right corner. |
| bottom? | ResolvedLine | |
| left? | ResolvedLine | |
| right? | ResolvedLine | |
| tlToBr? | ResolvedLine | Diagonal from the top-left to the bottom-right corner. |
| top? | ResolvedLine |
ColorContextinterfaceSource ↗
What a color reference resolves against.
interface ColorContext| Member | Type | Summary |
|---|---|---|
| colorMap | ReadonlyMap<string, string> | The effective color map: bg1 → lt1, tx1 → dk1, … (master clrMap with any override). |
| placeholderColor? | Rgba | The style-reference color substituted for `phClr`, when inside a style reference. |
| scheme | ReadonlyMap<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| Member | Type | Summary |
|---|---|---|
| id | string | The drawing id (`p:cNvPr/@id`) of the shape. |
| idx | number | The 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| Member | Type | Summary |
|---|---|---|
| align | EffectAlign | |
| blur | number | Blur radius, EMU. |
| dir | number | |
| dist | number | Offset distance, EMU, at `dir` degrees (clockwise from the x axis). |
| kx | number | Skew angles, degrees. |
| ky | number | |
| rotWithShape | boolean | True: the effect turns with the shape (the schema default). |
| sx | number | |
| sy | number |
FontCollectioninterfaceSource ↗
One script slot of a font scheme collection.
interface FontCollection| Member | Type | Summary |
|---|---|---|
| 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| Member | Type | Summary |
|---|---|---|
| color? | Rgba | |
| font? | 'major' | 'minor' |
GradientStopinterfaceSource ↗
One gradient stop. pos is 0–1.
interface GradientStop| Member | Type | Summary |
|---|---|---|
| color | Rgba | |
| pos | number |
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| Member | Type | Summary |
|---|---|---|
| lang? | string | The language the lists apply to (`lang`), a BCP 47 tag. No tag: every language. |
| notEnd | string | Characters that may not end a line (`invalEndChars`). |
| notStart | string | Characters that may not start a line (`invalStChars`). |
LineEndinterfaceSource ↗
Arrowhead description.
interface LineEnd| Member | Type | Summary |
|---|---|---|
| len | 'sm' | 'med' | 'lg' | |
| type | string | |
| w | 'sm' | 'med' | 'lg' |
ParagraphInputsinterfaceSource ↗
Inputs for resolving one paragraph.
interface ParagraphInputs| Member | Type | Summary |
|---|---|---|
| chainFor | (level: number) => readonly Element[] | Builds the level chain (lowest first, excluding the paragraph's own pPr). |
| ctx | ColorContext | |
| fontRef? | FontRef | |
| kinsoku? | KinsokuRules | The presentation's custom kinsoku lists (`readKinsoku`). |
| paragraph | Element | |
| pictures? | PictureBulletSource | The package and the part of each chain entry, for picture bullets (`a:buBlip`). |
| slideNumber | number | Text for `a:fld type="slidenum"`. |
| theme | Theme |
PictureBulletSourceinterfaceSource ↗
Where the picture of a picture bullet comes from.
interface PictureBulletSource| Member | Type | Summary |
|---|---|---|
| partOf | (entry: Element) => string | undefined | The part that holds a chain entry (`a:lvlNpPr`, `a:defPPr`, `a:pPr`), or undefined. |
| pkg | PptxPackage |
RelRectinterfaceSource ↗
A rectangle inset as fractions of the bounds (a:srcRect, a:fillToRect).
interface RelRect| Member | Type | Summary |
|---|---|---|
| b | number | |
| l | number | |
| r | number | |
| t | number |
ResolvedBevelinterfaceSource ↗
A bevel (a:bevelT, a:bevelB): width and height in EMU, and its preset.
interface ResolvedBevel| Member | Type | Summary |
|---|---|---|
| h | number | Height, toward the viewer. |
| preset | BevelPresetType | `ST_BevelPresetType`; an unknown value reads `circle`, the schema default. |
| w | number | Width, inward from the outline. |
ResolvedChartPartinterfaceSource ↗
A resolved chart part: its tree, and what its colors and fonts resolve against.
interface ResolvedChartPart| Member | Type | Summary |
|---|---|---|
| chartSpace | Element | The `c:chartSpace` root. Read-only: the package keeps the part's own bytes. |
| colors | ColorContext | The slide's color context, with the chart's own color map override (`c:clrMapOvr`, ECMA-376 Part 1, 21.2.2.28) applied. |
| partName | string | The chart part name. |
| theme | Theme | The theme, for the `+mj-lt` and `+mn-lt` fonts of chart text. |
ResolvedEffectsinterfaceSource ↗
Resolved shape effects. Distances in EMU, angles in degrees.
interface ResolvedEffects| Member | Type | Summary |
|---|---|---|
| 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? | ResolvedThreeD | Bevels, extrusion, contour, and the camera (`a:scene3d`, `a:sp3d`). |
| unsupported | readonly 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| Member | Type | Summary |
|---|---|---|
| chart? | ResolvedChartPart | The 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? | DiagramFallback | Why 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? | ResolvedPicture | The 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? | ResolvedTable | The table, for `frameKind: 'table'`. |
| uri | string |
ResolvedGroupinterfaceSource ↗
p:grpSp. Child coordinates are in the chOff/chExt space.
interface ResolvedGroup extends ResolvedBase| Member | Type | Summary |
|---|---|---|
| childExtent | {
readonly cx: number;
readonly cy: number;
} | |
| childOffset | {
readonly x: number;
readonly y: number;
} | |
| children | readonly ResolvedElement[] | |
| fill | ResolvedFill | |
| kind | 'group' |
ResolvedLineinterfaceSource ↗
A resolved outline. Width in EMU.
interface ResolvedLine| Member | Type | Summary |
|---|---|---|
| cap | 'flat' | 'rnd' | 'sq' | |
| compound | string | |
| dash | string | Preset dash name, or `custom` with `dashes` in multiples of line width. |
| dashes? | readonly number[] | |
| fill | ResolvedFill | |
| head? | LineEnd | |
| join | 'round' | 'bevel' | 'miter' | |
| miterLimit | number | |
| tail? | LineEnd | |
| width | number |
ResolvedParagraphinterfaceSource ↗
A resolved paragraph. Lengths in EMU.
interface ResolvedParagraph| Member | Type | Summary |
|---|---|---|
| align | 'l' | 'ctr' | 'r' | 'just' | 'dist' | 'justLow' | 'thaiDist' | |
| bullet | ResolvedBullet | null | |
| defaultTab | number | |
| eaLineBreak | boolean | |
| endProps | RunProps | Properties of the paragraph mark (`a:endParaRPr`), sizing an empty paragraph. |
| hangingPunct | boolean | `hangingPunct`: East Asian commas and full stops may hang past the line end. |
| indent | number | |
| kinsoku? | KinsokuRules | The presentation's custom East Asian line breaking lists (`p:kinsoku`), when they apply to the paragraph's language. They replace the built-in lists. |
| latinLineBreak | boolean | |
| level | number | |
| lineSpacing | Spacing | |
| marL | number | |
| marR | number | |
| nodeId | string | |
| rtl | boolean | |
| runs | readonly ResolvedRun[] | |
| spaceAfter | Spacing | |
| spaceBefore | Spacing | |
| tabs | readonly {
readonly pos: number;
readonly align: string;
}[] |
ResolvedPictureinterfaceSource ↗
p:pic.
interface ResolvedPicture extends ResolvedBase| Member | Type | Summary |
|---|---|---|
| effects? | ResolvedEffects | |
| fill | Extract<ResolvedFill, {
type: 'picture';
}> | {
readonly type: 'none';
} | |
| geometry | GeometrySpec | |
| kind | 'picture' | |
| line? | ResolvedLine | |
| media? | string | Video/audio or an OLE icon: render the poster, preserve the media. |
ResolvedRuninterfaceSource ↗
One inline item of a paragraph.
interface ResolvedRun| Member | Type | Summary |
|---|---|---|
| fieldType? | string | |
| kind | 'text' | 'break' | 'field' | 'math' | |
| math? | MathZone | The 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. |
| nodeId | string | The `a:r` / `a:br` / `a:fld` / `a14:m` node. |
| props | RunProps | |
| text | string | |
| textNodeId? | string | The `a:t` node holding the text (text and field runs). |
ResolvedShapeinterfaceSource ↗
p:sp or p:cxnSp.
interface ResolvedShape extends ResolvedBase| Member | Type | Summary |
|---|---|---|
| connections? | {
readonly start?: ConnectionRef;
readonly end?: ConnectionRef;
} | A connector's glued ends (`p:cNvCxnSpPr/a:stCxn` and `a:endCxn`). |
| diagramNode? | string | The 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 | |
| fill | ResolvedFill | |
| geometry | GeometrySpec | |
| kind | 'shape' | 'connector' | |
| line? | ResolvedLine | |
| text? | ResolvedTextBody | |
| textBox? | true | A text box (`p:cNvSpPr/@txBox`, ECMA-376 Part 1, 19.3.1.13): a press in it edits its text. |
| textXfrm? | Xfrm | The 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| Member | Type | Summary |
|---|---|---|
| background | ResolvedFill | |
| backgroundPart | string | The part whose relationships resolve the background picture. |
| elements | readonly ResolvedElement[] | In paint order: master, layout, slide. |
| height | number | |
| index | number | |
| partName | string | |
| width | number | Slide size, EMU. |
ResolvedTableinterfaceSource ↗
A resolved a:tbl. Lengths in EMU.
interface ResolvedTable| Member | Type | Summary |
|---|---|---|
| background | ResolvedFill | The table background (`a:tblPr` fill, or the style's `tblBg`). |
| cells | readonly ResolvedTableCell[] | Row-major; `cells[r * columns.length + c]`. |
| columns | readonly number[] | |
| rows | readonly {
readonly nodeId: string;
readonly height: number;
}[] | Minimum row heights (`a:tr/@h`). |
| rtl | boolean | |
| styleId? | string | The 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| Member | Type | Summary |
|---|---|---|
| borders | CellBorders | |
| col | number | |
| covered | boolean | Covered 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. |
| fill | ResolvedFill | |
| gridSpan | number | |
| nodeId | string | |
| row | number | |
| rowSpan | number | |
| text | ResolvedTextBody |
ResolvedTextBodyinterfaceSource ↗
A resolved text body.
interface ResolvedTextBody| Member | Type | Summary |
|---|---|---|
| body | BodyProps | |
| nodeId? | string | The `p:txBody` node, or undefined when the text comes only from an inherited prompt. |
| paragraphs | readonly ResolvedParagraph[] |
ResolvedThreeDinterfaceSource ↗
The resolved 3-D properties of a shape. Lengths in EMU.
interface ResolvedThreeD| Member | Type | Summary |
|---|---|---|
| bevelBottom? | ResolvedBevel | The bottom bevel (`a:bevelB`), on the back. |
| bevelTop? | ResolvedBevel | The top bevel (`a:bevelT`), on the face. |
| camera | string | `a:camera/@prst` (`ST_PresetCameraType`), as written. |
| cameraRot? | Rotation3D | `a:camera/a:rot`, when present: it replaces the preset's rotation. |
| contourColor? | Rgba | |
| contourW | number | The contour width (`@contourW`) and its color (`a:contourClr`). |
| extrusionColor? | Rgba | |
| extrusionH | number | The extrusion depth (`@extrusionH`) and its color (`a:extrusionClr`). |
| lightDir | string | |
| lightRig | string | `a:lightRig/@rig` (`ST_LightRigType`) and `@dir` (`ST_LightRigDirection`). |
| material | string | `ST_PresetMaterialType`; `warmMatte` is the schema default. |
Rgbainterface
A resolved color: sRGB 0–255 integers and alpha 0–1.
interface Rgba| Member | Type | Summary |
|---|---|---|
| a | number | |
| b | number | |
| g | number | |
| r | number |
Rotation3DinterfaceSource ↗
A rotation in degrees (a:rot: latitude, longitude, revolution).
interface Rotation3D| Member | Type | Summary |
|---|---|---|
| lat | number | Latitude: the turn about the x axis. |
| lon | number | Longitude: the turn about the y axis. |
| rev | number | Revolution: the turn about the z axis. |
RunPropsinterfaceSource ↗
Fully resolved character properties. Sizes in hundredths of a point.
interface RunProps| Member | Type | Summary |
|---|---|---|
| altLang? | string | The run's alternate language (`altLang`), a BCP 47 tag. |
| baseline | number | Superscript/subscript offset, percent of size (positive raises). |
| bold | boolean | |
| caps | 'none' | 'all' | 'small' | |
| cs | string | |
| ea | string | |
| fill | ResolvedFill | |
| highlight? | Rgba | |
| hyperlink? | string | |
| hyperlinkAction? | string | The run's link action (`a:hlinkClick/@action`), such as a jump to another slide. |
| italic | boolean | |
| kern? | number | Kerning threshold in hundredths of a point (`kern`); kerning applies at or above it. |
| lang? | string | The run's language (`lang`), a BCP 47 tag. |
| latin | string | |
| 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 | |
| size | number | |
| spacing | number | Character spacing, hundredths of a point. |
| strike | string | |
| sym? | string | |
| underline | string | |
| underlineFill? | ResolvedFill | The underline's own fill (`a:uFill`); absent when the underline takes the text fill. |
TableScopeinterfaceSource ↗
What table resolution needs about the slide.
interface TableScope| Member | Type | Summary |
|---|---|---|
| ctx | ColorContext | |
| defaultTextStyle? | Element | |
| kinsoku? | KinsokuRules | The presentation's custom kinsoku lists (`p:kinsoku`). |
| partName? | string | The part of the table, whose relationships the picture bullets of its cells name. |
| pkg | PptxPackage | |
| presentationPart? | string | The presentation part, whose relationships the picture bullets of `defaultTextStyle` name. |
| slideNumber | number | |
| theme | Theme |
TextWarpinterfaceSource ↗
A preset text warp: its ST_TextShapeType name and its adjust values (a:avLst).
interface TextWarp| Member | Type | Summary |
|---|---|---|
| adjust | ReadonlyMap<string, number> | |
| preset | string |
ThemeinterfaceSource ↗
A parsed theme.
interface Theme| Member | Type | Summary |
|---|---|---|
| backgroundFillStyles | readonly Element[] | `a:bgFillStyleLst`. `bgRef idx` 1001 is entry 0. |
| colors | ReadonlyMap<string, Rgba> | |
| effectStyles | readonly Element[] | |
| fillStyles | readonly Element[] | `a:fmtScheme` lists. Index 0 is `idx="1"`, as `p:style` references count from 1. |
| lineStyles | readonly Element[] | |
| majorFont | FontCollection | |
| minorFont | FontCollection |
XfrminterfaceSource ↗
A 2D transform in EMU, as stored in a:xfrm. rot is in degrees.
interface Xfrm| Member | Type | Summary |
|---|---|---|
| cx | number | |
| cy | number | |
| flipH | boolean | |
| flipV | boolean | |
| rot | number | |
| x | number | |
| y | number |
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: RgbaCHART_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 = 9525DEFAULT_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>>