Skip to content

API Reference: Types ​

All types are exported from the main pptx-craft package.

typescript
import type { TextOptions, Color, Fill, ChartType /* ... */ } from 'pptx-craft';

Measurements & Placement ​

Inches ​

typescript
type Inches = number;

All position and size values use inches as the unit.

Emu ​

typescript
type Emu = number;

English Metric Units (914,400 EMUs per inch). Used internally for OOXML.

Placement ​

typescript
interface Placement {
  x: Inches;       // horizontal offset from left edge
  y: Inches;       // vertical offset from top edge
  w: Inches;       // width
  h: Inches;       // height
  rotation?: number; // clockwise rotation (0–360°)
}

Colors ​

Color ​

typescript
type Color = string | SrgbColor | SchemeColor | SystemColor | PresetColor | HslColor;

A bare hex string (e.g. 'FF6600') for solid sRGB, or a structured color object.

SrgbColor ​

typescript
interface SrgbColor {
  hex: string;
  transforms?: ColorTransform;
}

SchemeColor ​

typescript
interface SchemeColor {
  scheme: SchemeColorVal;
  transforms?: ColorTransform;
}

SchemeColorVal ​

typescript
type SchemeColorVal =
  | 'dk1' | 'lt1' | 'dk2' | 'lt2'
  | 'accent1' | 'accent2' | 'accent3' | 'accent4' | 'accent5' | 'accent6'
  | 'hlink' | 'folHlink'
  | 'phClr' | 'bg1' | 'bg2' | 'tx1' | 'tx2';

SystemColor ​

typescript
interface SystemColor {
  sys: string;
  lastClr?: string;
  transforms?: ColorTransform;
}

PresetColor ​

typescript
interface PresetColor {
  preset: string;
  transforms?: ColorTransform;
}

HslColor ​

typescript
interface HslColor {
  hue: number;
  sat: number;
  lum: number;
  transforms?: ColorTransform;
}

ColorTransform ​

Modifiers applied as children of any color element.

typescript
interface ColorTransform {
  tint?: number;
  shade?: number;
  lumMod?: number;
  lumOff?: number;
  alpha?: number;
  alphaOff?: number;
  satMod?: number;
  satOff?: number;
  hueMod?: number;
  hueOff?: number;
}

Fills ​

Fill ​

typescript
type Fill = string | GradientFill | PatternFill | PictureFill;

A hex string for solid fill, or an object for gradient / pattern / picture.

GradientFill ​

typescript
interface GradientFill {
  type: GradientDirection;       // 'linear' | 'radial' | 'path'
  stops: GradientStop[];
  angle?: number;                // degrees, for linear gradients
}

GradientStop ​

typescript
interface GradientStop {
  position: number;   // 0–100
  color: Color;
  alpha?: number;     // opacity 0–100 (default 100)
}

GradientDirection ​

typescript
type GradientDirection = 'linear' | 'radial' | 'path';

PatternFill ​

typescript
interface PatternFill {
  pattern: PatternType;
  foreground: Color;
  background: Color;
}

PatternType ​

DrawingML preset pattern identifiers. Common values: 'pct5', 'pct10', 'pct20', 'pct25', 'pct50', 'horz', 'vert', 'cross', 'dnDiag', 'upDiag', 'diagCross', 'smCheck', 'lgCheck', 'smGrid', 'lgGrid', 'dotGrid', 'plaid', 'sphere', 'weave', 'zigZag', and more.

PictureFill ​

typescript
interface PictureFill {
  path?: string;
  data?: Uint8Array;
  contentType?: string;
  stretch?: boolean;                                    // default true
  tile?: { sx: number; sy: number; tx: number; ty: number };
}

Lines ​

LineProperties ​

typescript
interface LineProperties {
  color?: Color;
  width?: number;          // points
  dash?: LineDash;
  cap?: LineCap;
  join?: LineJoin;
  headEnd?: LineEndProperties;
  tailEnd?: LineEndProperties;
  fill?: Fill;
  opacity?: number;        // 0–100
  compound?: 'sng' | 'dbl' | 'thickThin' | 'thinThick' | 'tri';
  alignment?: 'ctr' | 'in';
  customDash?: Array<{ d: number; sp: number }>;  // EMUs
}

LineDash ​

typescript
type LineDash =
  | 'solid' | 'dash' | 'dashDot' | 'lgDash' | 'lgDashDot'
  | 'lgDashDotDot' | 'sysDash' | 'sysDashDot' | 'sysDashDotDot'
  | 'sysDot' | 'dot';

LineCap ​

typescript
type LineCap = 'flat' | 'round' | 'square';

LineJoin ​

typescript
type LineJoin = 'round' | 'bevel' | 'miter';

LineEndType ​

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

LineEndSize ​

typescript
type LineEndSize = 'sm' | 'med' | 'lg';

LineEndProperties ​

typescript
interface LineEndProperties {
  type?: LineEndType;
  width?: LineEndSize;
  length?: LineEndSize;
}

Effects ​

EffectProperties ​

typescript
interface EffectProperties {
  shadow?: ShadowEffect;
  glow?: GlowEffect;
  reflection?: ReflectionEffect;
  softEdge?: SoftEdgeEffect;
}

ShadowEffect ​

typescript
interface ShadowEffect {
  type?: 'outer' | 'inner';
  color?: Color;
  alpha?: number;     // 0–100
  blur?: number;      // points
  offset?: number;    // points
  angle?: number;     // degrees
}

GlowEffect ​

typescript
interface GlowEffect {
  color?: Color;
  alpha?: number;    // 0–100
  radius?: number;   // points
}

ReflectionEffect ​

typescript
interface ReflectionEffect {
  blur?: number;         // points
  startAlpha?: number;   // 0–100
  endAlpha?: number;     // 0–100
  distance?: number;     // points
  direction?: number;    // degrees
  fadeDirection?: number; // degrees
}

SoftEdgeEffect ​

typescript
interface SoftEdgeEffect {
  radius?: number;   // points
}

3D Properties ​

Scene3DProperties ​

typescript
interface Scene3DProperties {
  camera?: { preset?: CameraPreset; fov?: number };
  lightRig?: { type?: LightRigType; direction?: LightRigDirection };
}

Shape3DProperties ​

typescript
interface Shape3DProperties {
  bevelTop?: BevelProperties;
  bevelBottom?: BevelProperties;
  extrusionHeight?: number;
  contourWidth?: number;
  extrusionColor?: Color;
  contourColor?: Color;
  material?: PresetMaterial;
}

BevelProperties ​

typescript
interface BevelProperties {
  width?: number;
  height?: number;
  preset?: BevelPreset;
}

BevelPreset ​

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

PresetMaterial ​

typescript
type PresetMaterial =
  | 'matte' | 'warmMatte' | 'plastic' | 'metal' | 'dkEdge'
  | 'softEdge' | 'flat' | 'softmetal' | 'clear' | 'powder'
  | 'translucentPowder' | 'legacyMatte' | 'legacyPlastic'
  | 'legacyMetal' | 'legacyWireframe';

CameraPreset ​

Common values: 'orthographicFront', 'isometricTopUp', 'isometricTopDown', 'perspectiveFront', 'perspectiveLeft', 'perspectiveRight', 'perspectiveAbove', 'perspectiveRelaxed'.

Full list includes 40+ presets covering orthographic, isometric, oblique, and perspective projections.

LightRigType ​

typescript
type LightRigType =
  | 'flood' | 'contrasting' | 'morning' | 'sunrise' | 'sunset'
  | 'chilly' | 'freezing' | 'flat' | 'twoPt' | 'glow'
  | 'brightRoom' | 'soft' | 'harsh' | 'balanced' | 'threePt'
  | /* legacy variants */ 'legacyFlat1' | 'legacyNormal1' | 'legacyHarsh1' /* ... */;

LightRigDirection ​

typescript
type LightRigDirection = 't' | 'tl' | 'tr' | 'b' | 'bl' | 'br' | 'l' | 'r';

TransformProperties ​

typescript
interface TransformProperties {
  rotation?: number;   // clockwise degrees (0–360)
  flipH?: boolean;     // mirror horizontally
  flipV?: boolean;     // mirror vertically
}

HyperlinkProperties ​

typescript
interface HyperlinkProperties {
  url?: string;       // external URL
  slide?: number;     // internal slide (1-based)
  tooltip?: string;   // hover tooltip
  email?: string;     // generates mailto: link
  file?: string;      // local file path
  action?: string;    // e.g. 'ppaction://hlinkshowjump?jump=nextslide'
}

Text ​

TextOptions ​

Combined options for addText() — merges Placement, TextRunOptions, ParagraphOptions, TextBodyOptions, plus shape styling.

OptionTypeFrom
x, y, w, h, rotationnumberPlacement
bold, italic, underline, fontSize, fontFace, color, ...variousTextRunOptions
align, lineSpacing, bullet, numbering, ...variousParagraphOptions
verticalAlign, textDirection, wordWrap, autoFit, margin, ...variousTextBodyOptions
fillFillText box background
lineLinePropertiesText box border
effectsEffectPropertiesVisual effects
transformTransformPropertiesRotation/flip
scene3dScene3DProperties3D camera + lighting
shape3dShape3DProperties3D extrusion/bevel

TextRunOptions ​

Character-level formatting (a:rPr).

typescript
interface TextRunOptions {
  bold?: boolean;
  italic?: boolean;
  underline?: boolean;
  strikethrough?: boolean | 'single' | 'double';
  fontSize?: number;             // points
  fontFace?: string;
  color?: Color;
  subscript?: boolean;
  superscript?: boolean;
  highlight?: Color;
  letterSpacing?: number;        // points
  baseline?: number;             // percentage
  hyperlink?: HyperlinkProperties;
  outline?: LineProperties;
  shadow?: ShadowEffect;
  caps?: 'none' | 'small' | 'all';
  lang?: string;                 // e.g. 'en-US'
  eastAsianFont?: string;
  complexScriptFont?: string;
  altLang?: string;
}

ParagraphOptions ​

Paragraph-level formatting (a:pPr).

typescript
interface ParagraphOptions {
  align?: 'left' | 'center' | 'right' | 'justify';
  lineSpacing?: number | { value: number; unit: 'pt' | 'pct' };
  spaceBefore?: number | { value: number; unit: 'pt' | 'pct' };
  spaceAfter?: number | { value: number; unit: 'pt' | 'pct' };
  indent?: number;              // points (negative = hanging indent)
  marginLeft?: number;          // points
  level?: number;               // 0–8
  rtl?: boolean;
  bullet?: BulletOptions | boolean;
  numbering?: NumberingOptions;
  tabStops?: TabStop[];
  defaultRunOptions?: TextRunOptions;
}

TextBodyOptions ​

Text body formatting (a:bodyPr).

typescript
interface TextBodyOptions {
  verticalAlign?: 'top' | 'middle' | 'bottom';
  textDirection?: 'horz' | 'vert' | 'vert270' | 'wordArtVert';
  wordWrap?: boolean;
  autoFit?: boolean | 'shrink' | 'none';
  margin?: { top?: number; right?: number; bottom?: number; left?: number };
  columns?: number;
  columnSpacing?: number;       // points
  textPath?: { preset: string };
}

BulletOptions ​

typescript
interface BulletOptions {
  type?: 'char' | 'auto';
  char?: string;      // e.g. '•', '–'
  color?: Color;
  size?: number;      // percentage of text size
  font?: string;
}

NumberingOptions ​

typescript
interface NumberingOptions {
  type?: 'arabicPeriod' | 'arabicParenR' | 'romanUcPeriod'
       | 'romanLcPeriod' | 'alphaUcPeriod' | 'alphaLcPeriod'
       | 'arabicPlain';
  startAt?: number;   // default 1
  color?: Color;
  size?: number;      // percentage of text size
  font?: string;
}

TabStop ​

typescript
interface TabStop {
  position: number;                       // points from left margin
  alignment?: 'l' | 'ctr' | 'r' | 'dec';
}

Images ​

ImageOptions ​

typescript
interface ImageOptions extends Partial<Placement> {
  path?: string;
  data?: Uint8Array;
  contentType?: string;          // default 'image/png'
  border?: LineProperties;
  effects?: EffectProperties;
  transform?: TransformProperties;
  scene3d?: Scene3DProperties;
  shape3d?: Shape3DProperties;
  opacity?: number;              // 0–100
  crop?: { top?: number; bottom?: number; left?: number; right?: number };
  hyperlink?: HyperlinkProperties;
  sizing?: {
    type: 'contain' | 'cover' | 'crop';
    align?: 'tl' | 'tc' | 'tr' | 'ml' | 'mc' | 'mr' | 'bl' | 'bc' | 'br';
  };
  lockAspectRatio?: boolean;     // default true
  brightness?: number;           // -100 to 100
  contrast?: number;             // -100 to 100
  saturation?: number;           // 0–200 (100 = normal)
  duotone?: { color1: Color; color2: Color };
  cropShape?: PresetGeometry;
}

Shapes ​

PresetGeometry ​

Over 180 built-in shape types. Common shapes:

CategoryShapes
Basic'rect', 'roundRect', 'ellipse', 'triangle', 'diamond', 'pentagon', 'hexagon', 'octagon'
Stars'star4', 'star5', 'star6', 'star7', 'star8', 'star10', 'star12', 'star16', 'star24', 'star32'
Arrows'arrow', 'leftArrow', 'rightArrow', 'upArrow', 'downArrow', 'leftRightArrow', 'upDownArrow', 'bentArrow', 'curvedRightArrow'
Callouts'wedgeRectCallout', 'wedgeRoundRectCallout', 'wedgeEllipseCallout', 'cloudCallout'
Flowchart'flowChartProcess', 'flowChartDecision', 'flowChartTerminator', 'flowChartDocument', 'flowChartConnector'
Math'mathPlus', 'mathMinus', 'mathMultiply', 'mathDivide', 'mathEqual', 'mathNotEqual'
Lines'line', 'lineInv', 'straightConnector1'
Fun'heart', 'smileyFace', 'moon', 'sun', 'cloud', 'lightningBolt'

ShapeOptions ​

typescript
interface ShapeOptions extends Partial<Placement> {
  fill?: Fill;
  line?: LineProperties;
  effects?: EffectProperties;
  transform?: TransformProperties;
  scene3d?: Scene3DProperties;
  shape3d?: Shape3DProperties;
  opacity?: number;                    // 0–100
  text?: string;
  textOptions?: ShapeTextOptions;
  textRunOptions?: TextRunOptions;
  textParagraphOptions?: ParagraphOptions;
  adjustValues?: Record<string, number>;
  hyperlink?: HyperlinkProperties;
  customGeometry?: CustomGeometry;
  locks?: ShapeLocks;
}

ShapeTextOptions ​

typescript
interface ShapeTextOptions {
  verticalAlign?: 'top' | 'middle' | 'bottom';
  wordWrap?: boolean;
  margin?: { top?: number; right?: number; bottom?: number; left?: number };
  autoFit?: boolean | 'shrink' | 'none';
}

CustomGeometry ​

typescript
interface CustomGeometry {
  paths: CustomGeometryPath[];
}

interface CustomGeometryPath {
  w?: number;
  h?: number;
  commands: PathCommand[];
}

type PathCommand =
  | { type: 'moveTo'; x: number; y: number }
  | { type: 'lineTo'; x: number; y: number }
  | { type: 'arcTo'; wR: number; hR: number; stAng: number; swAng: number }
  | { type: 'cubicBezTo'; x1: number; y1: number; x2: number; y2: number; x: number; y: number }
  | { type: 'close' };

ShapeLocks ​

typescript
interface ShapeLocks {
  noGroup?: boolean;
  noRotation?: boolean;
  noMove?: boolean;
  noResize?: boolean;
  noSelect?: boolean;
  noTextEdit?: boolean;
}

Tables ​

TableRow ​

typescript
type TableRow = TableCell[];

TableCell ​

typescript
interface TableCell {
  text: string;
  options?: TextRunOptions & {
    fill?: Fill;
    colSpan?: number;
    rowSpan?: number;
    margin?: { top?: number; right?: number; bottom?: number; left?: number };
    verticalAlign?: 'top' | 'middle' | 'bottom' | 'distributed';
    textBody?: TextBodyOptions;
    borderLeft?: TableCellBorder;
    borderRight?: TableCellBorder;
    borderTop?: TableCellBorder;
    borderBottom?: TableCellBorder;
    align?: 'left' | 'center' | 'right' | 'justify';
  };
}

TableCellBorder ​

typescript
interface TableCellBorder {
  color?: Color;
  width?: number;   // points
}

TableOptions ​

typescript
interface TableOptions extends Partial<Placement> {
  colWidths?: number[];          // inches
  rowHeights?: number[];         // inches
  border?: TableBorderOptions;
  fill?: Fill;
  firstRow?: boolean;
  lastRow?: boolean;
  firstCol?: boolean;
  lastCol?: boolean;
  bandRow?: boolean;
  bandCol?: boolean;
  bandRowColors?: [Color, Color];
  effects?: EffectProperties;
  transform?: TransformProperties;
  tableStyleId?: string;         // built-in table style GUID
}

TableBorderOptions ​

typescript
interface TableBorderOptions {
  color?: Color;
  width?: number;
  left?: TableCellBorder;
  right?: TableCellBorder;
  top?: TableCellBorder;
  bottom?: TableCellBorder;
  insideH?: TableCellBorder;
  insideV?: TableCellBorder;
}

Charts ​

ChartType ​

typescript
type ChartType =
  | 'bar' | 'col' | 'line' | 'pie' | 'area' | 'scatter'
  | 'doughnut' | 'radar' | 'bubble' | 'stock' | 'surface'
  | 'bar3D' | 'col3D' | 'line3D' | 'pie3D' | 'area3D';

ChartData ​

typescript
interface ChartData {
  categories?: string[];
  series: ChartSeries[];
  xValues?: number[];       // scatter/bubble charts
  bubbleSizes?: number[];   // bubble charts
}

ChartSeries ​

typescript
interface ChartSeries {
  name: string;
  values: number[];
  color?: Color;
  colors?: Color[];            // per-data-point (e.g. pie slices)
  lineWidth?: number;          // points
  lineDash?: LineDash;
  marker?: ChartMarkerOptions;
  smooth?: boolean;
  fill?: Color;                // area fill
  opacity?: number;            // 0–100
  trendline?: TrendlineOptions;
  errorBars?: ErrorBarOptions;
  dataLabels?: DataLabelOptions;
  explosion?: number;          // pie/doughnut slice explosion
}

ChartOptions ​

typescript
interface ChartOptions extends Partial<Placement> {
  title?: string;
  showLegend?: boolean;
  showDataLabels?: boolean;
  showGridLines?: boolean;
  titleFontSize?: number;
  titleColor?: Color;
  legendPosition?: 'b' | 't' | 'l' | 'r' | 'tr';
  catAxis?: AxisOptions;
  valAxis?: AxisOptions;
  secondaryValAxis?: AxisOptions;
  plotArea?: { fill?: Color; border?: LineProperties };
  barGapWidth?: number;             // 0–500%
  barOverlap?: number;              // -100 to 100%
  barGrouping?: 'clustered' | 'stacked' | 'percentStacked';
  pieExplosion?: number;            // 0–400%
  doughnutHoleSize?: number;        // 10–90%
  lineGrouping?: 'standard' | 'stacked' | 'percentStacked';
  areaGrouping?: 'standard' | 'stacked' | 'percentStacked';
  scatterStyle?: 'lineMarker' | 'line' | 'marker' | 'smooth' | 'smoothMarker';
  radarStyle?: 'standard' | 'marker' | 'filled';
  border?: LineProperties;
  fill?: Color;
  dataLabels?: DataLabelOptions;
  view3D?: {
    rotX?: number;
    rotY?: number;
    depthPercent?: number;
    rAngAx?: boolean;
    perspective?: number;
  };
}

AxisOptions ​

typescript
interface AxisOptions {
  title?: string;
  titleFontSize?: number;
  min?: number;
  max?: number;
  majorUnit?: number;
  minorUnit?: number;
  orientation?: 'minMax' | 'maxMin';
  labelFontSize?: number;
  labelColor?: Color;
  labelRotation?: number;          // degrees
  format?: string;                 // e.g. '#,##0'
  position?: 'b' | 't' | 'l' | 'r';
  delete?: boolean;                // hide axis
  majorGridlines?: boolean | { color?: Color; width?: number };
  minorGridlines?: boolean | { color?: Color; width?: number };
  crossesAt?: number | 'min' | 'max' | 'auto';
  logBase?: number;                // e.g. 10
}

ChartMarkerOptions ​

typescript
interface ChartMarkerOptions {
  type?: 'circle' | 'square' | 'diamond' | 'triangle' | 'star' | 'x' | 'plus' | 'none';
  size?: number;                   // 2–72
  fill?: Color;
  border?: { color?: Color; width?: number };
}

TrendlineOptions ​

typescript
interface TrendlineOptions {
  type?: 'linear' | 'exp' | 'log' | 'movingAvg' | 'poly' | 'power';
  order?: number;
  period?: number;
  forward?: number;
  backward?: number;
  intercept?: number;
  displayEquation?: boolean;
  displayRSquared?: boolean;
  color?: Color;
  width?: number;
  dash?: LineDash;
}

ErrorBarOptions ​

typescript
interface ErrorBarOptions {
  direction?: 'x' | 'y';
  type?: 'both' | 'plus' | 'minus';
  valueType?: 'fixedVal' | 'percentage' | 'stdDev' | 'stdErr' | 'cust';
  value?: number;
  noEndCap?: boolean;
  color?: Color;
  width?: number;
}

DataLabelOptions ​

typescript
interface DataLabelOptions {
  position?: 'ctr' | 'inEnd' | 'outEnd' | 'bestFit' | 't' | 'b' | 'l' | 'r';
  showValue?: boolean;
  showCategory?: boolean;
  showSeriesName?: boolean;
  showPercent?: boolean;
  separator?: string;
  numberFormat?: string;
  fontSize?: number;
  fontFace?: string;
  color?: Color;
}

Media ​

MediaOptions ​

typescript
interface MediaOptions extends Partial<Placement> {
  path?: string;
  data?: Uint8Array;
  contentType?: string;             // default: 'video/mp4' or 'audio/mpeg'
  poster?: MediaPoster;
  playback?: MediaPlaybackOptions;
  effects?: EffectProperties;
  transform?: TransformProperties;
}

MediaPlaybackOptions ​

typescript
interface MediaPlaybackOptions {
  start?: number;           // ms offset
  end?: number;             // ms offset
  loop?: boolean;
  autoPlay?: boolean;
  mute?: boolean;
  showControls?: boolean;   // default true
  rewind?: boolean;
  fullscreen?: boolean;
}

MediaPoster ​

typescript
interface MediaPoster {
  path?: string;
  data?: Uint8Array;
  contentType?: string;
}

Slide Background ​

SlideBackground ​

typescript
interface SlideBackground {
  fill?: Fill;       // gradient, pattern, or picture background
  color?: Color;     // shortcut for solid color
}

Transitions ​

SlideTransition ​

typescript
interface SlideTransition {
  type?: TransitionType;
  duration?: number;            // ms
  advanceAfter?: number;        // ms (0 = click only)
  advanceOnClick?: boolean;     // default true
  direction?: 'l' | 'r' | 'u' | 'd' | 'lu' | 'ru' | 'ld' | 'rd';
  durationMs?: number;          // raw ms, overrides spd mapping
}

TransitionType ​

typescript
type TransitionType =
  | 'fade' | 'push' | 'wipe' | 'split' | 'cover' | 'uncover'
  | 'strips' | 'blinds' | 'checker' | 'dissolve' | 'comb'
  | 'newsflash' | 'randomBars' | 'circle' | 'diamond' | 'plus'
  | 'wedge' | 'wheel' | 'zoom' | 'cut' | 'random' | 'none';

Animations ​

Animation ​

typescript
interface Animation {
  elementIndex: number;              // 0-based index of target element
  effect: AnimationEffect;
  category?: AnimationCategory;      // default 'entrance'
  trigger?: AnimationTrigger;        // default 'onClick'
  duration?: number;                 // ms (default 500)
  delay?: number;                    // ms
  direction?: string;                // effect-specific variant
  repeatCount?: number | 'indefinite';
  acceleration?: number;             // 0–100
  deceleration?: number;             // 0–100
  motionPath?: string;               // SVG-style, e.g. 'M 0 0 L 1 0'
}

AnimationEffect ​

typescript
type AnimationEffect =
  | 'appear' | 'fade' | 'flyIn' | 'split' | 'wipe' | 'blinds'
  | 'box' | 'checkerboard' | 'circle' | 'diamond' | 'dissolve'
  | 'peek' | 'plus' | 'randomBars' | 'strips' | 'wedge' | 'wheel'
  | 'zoom' | 'grow' | 'shrink' | 'spin' | 'transparency'
  | 'pulse' | 'colorPulse' | 'teeter' | 'bounce' | 'float' | 'swivel';

AnimationTrigger ​

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

AnimationCategory ​

typescript
type AnimationCategory = 'entrance' | 'exit' | 'emphasis' | 'motionPath';

Connectors ​

ConnectorOptions ​

typescript
interface ConnectorOptions extends Partial<Placement> {
  type?: ConnectorType;           // default 'straight'
  line?: LineProperties;
  startArrow?: LineEndProperties;
  endArrow?: LineEndProperties;
}

ConnectorType ​

typescript
type ConnectorType = 'straight' | 'elbow' | 'curved';

Groups ​

GroupOptions ​

typescript
interface GroupOptions extends Partial<Placement> {}

Presentation Properties ​

SlideShowProperties ​

typescript
interface SlideShowProperties {
  loop?: boolean;
  showNarration?: boolean;
  showAnimation?: boolean;
  useTimings?: boolean;
}

PrintProperties ​

typescript
interface PrintProperties {
  frameSlides?: boolean;
  hiddenSlides?: boolean;
}

PresentationProperties ​

typescript
interface PresentationProperties {
  slideShow?: SlideShowProperties;
  print?: PrintProperties;
}

ViewProperties ​

typescript
interface ViewProperties {
  lastView?: LastViewType;
}

LastViewType ​

typescript
type LastViewType =
  | 'sldView' | 'sldMasterView' | 'notesView'
  | 'handoutView' | 'sldSorterView';

Comments & Tags ​

CommentAuthor ​

typescript
interface CommentAuthor {
  id: number;
  name: string;
  initials: string;
  lastIdx: number;
  clrIdx: number;
}

SlideComment ​

typescript
interface SlideComment {
  authorId: number;
  text: string;
  date?: string;                     // ISO 8601
  position?: { x: number; y: number };
  index?: number;
}

UserDefinedTag ​

typescript
interface UserDefinedTag {
  name: string;
  value: string;
}

SlideSyncData ​

typescript
interface SlideSyncData {
  serverSldId: string;
  serverSldModifiedTime: string;     // ISO 8601
  clientInsertedTime: string;        // ISO 8601
}

Theme ​

Theme ​

typescript
interface Theme {
  name: string;
  colors: ColorScheme;
  fonts: FontScheme;
  extraColorSchemes?: ColorScheme[];
}

ColorScheme ​

typescript
interface ColorScheme {
  dk1: string;  lt1: string;  dk2: string;  lt2: string;
  accent1: string;  accent2: string;  accent3: string;
  accent4: string;  accent5: string;  accent6: string;
  hlink: string;  folHlink: string;
}

FontScheme ​

typescript
interface FontScheme {
  majorFont: string;
  minorFont: string;
  majorEastAsian?: string;
  majorComplexScript?: string;
  minorEastAsian?: string;
  minorComplexScript?: string;
}

Default Exports ​

typescript
import { defaultTheme, defaultColorScheme, defaultFontScheme } from 'pptx-craft';

The default theme uses "Office Theme" with Calibri Light (headings) and Calibri (body).


Masters & Layouts ​

SlideMasterDef ​

typescript
interface SlideMasterDef {
  name: string;
  background?: string;
  elements?: IElement[];
}

SlideLayoutDef ​

typescript
interface SlideLayoutDef {
  name: string;
  type: LayoutType;
  placeholders?: PlaceholderDef[];
}

LayoutType ​

typescript
type LayoutType = 'blank' | 'title' | 'titleAndContent' | 'sectionHeader' | 'twoContent';

PlaceholderDef ​

typescript
interface PlaceholderDef {
  type: PlaceholderType;
  placement: Placement;
  idx?: number;
}

PlaceholderType ​

typescript
type PlaceholderType = 'title' | 'body' | 'ctrTitle' | 'subTitle' | 'dt' | 'ftr' | 'sldNum';

NotesMasterDef ​

typescript
interface NotesMasterDef {
  name?: string;   // default "Default Notes Master"
}

HandoutMasterDef ​

typescript
interface HandoutMasterDef {
  name?: string;   // default "Default Handout Master"
}

Plugin System ​

IPlugin ​

typescript
interface IPlugin {
  name: string;
  install(registry: IRegistry): void;
}

IRegistry ​

typescript
interface IRegistry {
  registerElement<E extends IElement>(type: ElementType, serializer: IElementSerializer<E>): void;
  getSerializer(type: ElementType): IElementSerializer | undefined;
}

IElement ​

typescript
interface IElement {
  readonly type: ElementType;
  placement: Placement;
  name?: string;
}

IElementSerializer ​

typescript
interface IElementSerializer<E extends IElement = IElement> {
  type: ElementType;
  serialize(element: E, ctx: SerializationContext): string;
}

SerializationContext ​

typescript
interface SerializationContext {
  addRelationship(type: string, target: string, data?: Uint8Array): string;
  theme: Theme;
  slideIndex: number;
}

ElementType ​

typescript
type ElementType = string;

Built-in types: 'text', 'image', 'shape', 'table', 'chart', 'media', 'group', 'connector'.

Released under the MIT License.