> ## Documentation Index
> Fetch the complete documentation index at: https://docs.reducto.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Types: layout and fonts

Types that layout, rendering and font loading name, A to Z.

## `BrowserMetafileOptions`

Import from `@reductoai/pptx/browser`.

| Name | Type | Description |
| - | - | - |
| `deflate?` | `(bytes: Uint8Array) => Uint8Array` | zlib deflate for the intermediate PNGs the metafile renderer emits. Without it they use stored DEFLATE blocks: same pixels, far more memory. Wire e.g. `(bytes) => zlibSync(bytes, { level: 6 })` from fflate. |
| `drawScale?` | `number` | Scale applied to the known drawn extent before rasterising. A canvas consumes at most two raster pixels per CSS pixel, so 0.5 of node's 4x print budget is the browser default. |
| `fontAliases?` | `Readonly<Record<string, string>>` | Family substitutions for faces the page cannot supply. Defaults to the portable CJK set, which points the MS Gothic/Mincho families at "Droid Sans Fallback". |
| `fonts?` | `(families: readonly string[]) => FontBuffer[] \| Promise<FontBuffer[]>` | Faces offered to the rasteriser for one job. `families` names what that job's text asks for, so a host with a lazy font mirror can fetch exactly those before the job starts. Defaults to the registry's Carlito set — Word's EMF text is measured on Calibri and needs its metric clone. |
| `poolSize?` | `number` | Lane count; defaults to hardwareConcurrency - 1, capped at 8. |
| `renderRgba?` | `RgbaEncoder` | RGBA -> PNG encoder; defaults to OffscreenCanvas. |
| `renderSvg` | `SvgRasterizer` | Rasterise SVG on this thread. Used without a pool, and when a lane dies. |
| `spawnWorker?` | `() => WorkerLike` | Lane factory, e.g. `() => new Worker(new URL("./raster-worker.ts", import.meta.url), { type: "module" })`. |

## `CaretMove`

Import from `@reductoai/pptx/editor`.

```ts theme={null}
type CaretMove = "left" | "right" | "up" | "down" | "wordLeft" | "wordRight" | "lineStart" | "lineEnd" | "paragraphStart" | "paragraphEnd" | "nextParagraph" | "documentStart" | "documentEnd"
```

## `CellPathStep`

One hop from a host cell into a table it holds; `tbl` indexes the cell's own w:tbl children.

Import from `@reductoai/pptx/editor`.

| Name | Type | Description |
| - | - | - |
| `col` | `number` | |
| `row` | `number` | |
| `tbl` | `number` | |

## `ChartHitSource`

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `chartHits?` | `LayoutShapeGeom[]` | |
| `shapes?` | `LayoutShapeGeom[]` | |

## `ConvertProgress`

Progress events for the docx -> pdf path. A supervisor (e.g. a Modal job
with a hard timeout) can read these to tell "slow but alive" from "stuck":

* `layout done` carries the page count. That is the earliest point where
  a caller can size the remaining budget (render cost is \~linear in pages).
* `layout page` / `render page` are heartbeats. No heartbeat for N seconds
  means the process is stuck inside one block and can be killed.
* `parse part` marks each loader stage (styles, images, charts, fonts,
  headers, body, notes), so parse silence is attributable to a named
  stage. `parse block` ticks the body walk; `parse image` ticks each
  resolved image (metafile rasterisation dominates image-heavy docs).
  None carry progress totals: they are liveness only. `runPipeline` and
  `convertDocxToPdf` open the file in their layout engine and send only
  `start` and `done`; `extractDocx` also sends the stage beats.

Cancellation: layout and paint are synchronous, so `AbortSignal.timeout`
cannot fire while they hold the event loop — the `signal` options abort at
checkpoints only after `abort()` had a chance to run (async phase
boundaries, or an abort requested before the sync phase started). For a
hard in-process deadline over the sync phases, THROW from the `onProgress`
callback: it is invoked synchronously at every checkpoint and the error
propagates out of the pipeline.

Import from `@reductoai/pptx`, `@reductoai/pptx/browser`.

```ts theme={null}
type ConvertProgress = { kind: "start"; phase: "parse" } | { kind: "part"; part: string; phase: "parse" } | { block: number; kind: "block"; phase: "parse" } | { image: number; kind: "image"; phase: "parse" } | { kind: "done"; phase: "parse" } | { kind: "pass"; pass: number; phase: "layout" } | { kind: "page"; page: number; pages?: number; pass: number; phase: "layout" } | { kind: "done"; pages: number; passes: number; phase: "layout" } | { kind: "start"; pages: number; phase: "render" } | { kind: "fonts"; phase: "render" } | { kind: "images"; phase: "render" } | { image: number; kind: "image"; phase: "render" } | { kind: "page"; page: number; pages: number; phase: "render" } | { kind: "save"; phase: "render" } | { kind: "done"; pages: number; phase: "render" }
```

## `DecodedPng`

Import from `@reductoai/pptx/pdf`.

| Name | Type | Description |
| - | - | - |
| `alphaChannel?` | `Uint8Array` | |
| `height` | `number` | |
| `rgbChannel` | `Uint8Array` | |
| `width` | `number` | |

## `DeleteUnit`

How far a delete key reaches from a collapsed caret.

Import from `@reductoai/pptx/editor`.

```ts theme={null}
type DeleteUnit = "char" | "word" | "line" | "paragraph"
```

## `DocProperties`

Package metadata (docProps/core.xml, docProps/app.xml). Text values are
verbatim; dates stay in the W3CDTF form Word wrote. Only present keys are
emitted, so an empty `<dc:title/>` reads as absent.

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `application?` | `string` | |
| `appVersion?` | `string` | |
| `author?` | `string` | |
| `category?` | `string` | |
| `characters?` | `number` | |
| `company?` | `string` | |
| `created?` | `string` | |
| `description?` | `string` | |
| `keywords?` | `string` | |
| `lastModifiedBy?` | `string` | |
| `lastPrinted?` | `string` | |
| `manager?` | `string` | |
| `modified?` | `string` | |
| `pages?` | `number` | Counts as Word last saved them; app.xml, not a layout result. |
| `revision?` | `string` | |
| `subject?` | `string` | |
| `template?` | `string` | |
| `title?` | `string` | |
| `words?` | `number` | |

## `EastAsianScript`

Not exported by name. You get it from the API.

```ts theme={null}
type EastAsianScript = "ja" | "zh-hans" | "zh-hant" | "ko"
```

## `EditTarget`

Stable source coordinates shared by the layout parser and the editor. A
cell's `row`/`col` are local to the table that holds it; `path` names the
host cells from the body table down to that table, so a nested cell never
aliases a host cell at the same coordinates.

Import from `@reductoai/pptx/editor`.

```ts theme={null}
type EditTarget = { bodyIndex: number; gen?: number; kind: "paragraph"; story?: string } | { bodyIndex: number; col: number; gen?: number; kind: "table-cell"; path?: CellPathStep[]; row: number; story?: string }
```

## `EmbeddedFaceData`

One embedded face, serializable: it travels inside the layout IR so a
renderer in another process (or a browser) embeds the same bytes the
measurer used. `id` is the face's stable identity (`embed:<doc>/<slug>`).

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `data?` | `Uint8Array` | Non-enumerable fast path: the bytes when the face came from an in-process engine. |
| `dataB64` | `string` | |
| `id` | `string` | |

## `EmbeddedFontMap`

Import from `@reductoai/pptx`, `@reductoai/pptx/browser`.

```ts theme={null}
type EmbeddedFontMap = Record<string, Partial<Record<FaceKey, EmbeddedFaceData>>>
```

## `FaceKey`

Import from `@reductoai/pptx`, `@reductoai/pptx/browser`.

```ts theme={null}
type FaceKey = "regular" | "bold" | "italic" | "boldItalic"
```

## `FaceSet`

A family's four faces. Slots may be absent for partially-covered families.

Import from `@reductoai/pptx`, `@reductoai/pptx/browser`.

```ts theme={null}
type FaceSet = Partial<Record<FaceKey, FaceSource>>
```

## `FaceSource`

One face: a stable identity plus a byte source. `id` is what caches key on
(an absolute file path for node system fonts, `embed:<doc>/<family>-<key>`
for document-embedded faces, whatever the adapter chooses in a browser).
`bytes()` may be lazy and returns null when the face is unavailable.

Import from `@reductoai/pptx`, `@reductoai/pptx/browser`.

| Name | Type | Description |
| - | - | - |
| `bytes` | `() => Uint8Array \| null` | |
| `id` | `string` | |

## `FaceTable`

A static font mirror: which families exist, which face id fills each slot,
and which file holds each face. Families register up front with empty faces;
a face's bytes arrive only when a layout trace (or `familyFaces`) asks.

Import from `@reductoai/pptx/browser`.

| Name | Type | Description |
| - | - | - |
| `cjk?` | `string[]` | Families that are real CJK faces; replayed through `markCjkFamilies`. |
| `families` | `Record<string, Partial<Record<FaceKey, string>>>` | family (lower case) -> face key -> face id. |
| `files` | `Record<string, string>` | face id -> file, handed to `urlFor`. |
| `noSubset?` | `string[]` | Face ids a PDF embeds whole; replayed through `markNoSubsetFaces`. |

## `FetchProgress`

Not exported by name. You get it from the API.

```ts theme={null}
type FetchProgress = (done: number, total: number, bytes: number) => void
```

## `FontBuffer`

A font face for the SVG rasteriser: stable id plus its bytes.

Import from `@reductoai/pptx/browser`.

```ts theme={null}
type FontBuffer = [id: string, bytes: Uint8Array]
```

## `FontDecl`

Font-table properties used to select a substitute face.

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `altName?` | `string` | |
| `arabic?` | `true` | `w:charset="B2"` or the Arabic code page (1256) in `w:sig@csb0`. |
| `auto?` | `true` | |
| `caucasian?` | `true` | |
| `cjk?` | `EastAsianScript` | Script from `w:charset`, else from the `w:sig` code pages. |
| `eastAsia?` | `true` | |
| `korean?` | `true` | |
| `modern?` | `true` | `w:family="modern"`. |
| `nonAnsiCharset?` | `true` | `w:charset` names a code page other than ANSI (00), default (01) or Symbol (02). |
| `notTT?` | `true` | |
| `roman?` | `true` | |
| `scriptCharset?` | `true` | `w:charset` names a non-Western script (Cyrillic, Greek, CJK, Arabic, Thai, Vietnamese). |
| `swiss?` | `true` | |
| `symbol?` | `true` | |
| `thai?` | `true` | `w:charset="DE"` or the Thai code page (874) in `w:sig@csb0`. |

## `FontDeclMap`

Import from `@reductoai/pptx`, `@reductoai/pptx/browser`.

```ts theme={null}
type FontDeclMap = Record<string, FontDecl>
```

## `FontFallback`

One requested family that the registry could not serve as itself.

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `reason` | `FontFallbackReason` | |
| `requested` | `string` | |
| `served` | `string` | |

## `FontFallbackReason`

Why a requested family was not the family that got served.

alias   a metric-compatible clone from SUBSTITUTIONS (Arial -> Liberation
Sans). Expected on the portable profile; metrics are designed to
match, so this is information, not a defect.
script  a complex-script fallback replaced the run's face. The served face
has DIFFERENT advances, so line breaks and page count move.
missing nothing matched the name at all and resolveFamily's fontTable rule
chose the face. Same metric risk as `script`.

Not exported by name. You get it from the API.

```ts theme={null}
type FontFallbackReason = "alias" | "script" | "missing"
```

## `FontMirrorStats`

Import from `@reductoai/pptx/node`.

| Name | Type | Description |
| - | - | - |
| `cjkFamilies` | `number` | |
| `faces` | `number` | |
| `families` | `number` | |

## `ImageFlip`

Which axes a drawing's ink is mirrored across, about its bbox centre.

Not exported by name. You get it from the API.

```ts theme={null}
type ImageFlip = "h" | "v" | "hv"
```

## `LayoutAnchor`

A floating (wp:anchor) drawing, absolutely positioned on the page.

Import from `@reductoai/pptx`, `@reductoai/pptx/browser`.

| Name | Type | Description |
| - | - | - |
| `bbox` | `LayoutBBox` | |
| `behind?` | `boolean` | Drawn under all other content (wp:anchor @behindDoc). |
| `cellClip?` | `true` | Cut at the sides of the cell its origin sits in: a wrapping picture wider than its cell. |
| `image` | `LayoutImageRef` | |
| `inCell?` | `true` | Cell-owned `layoutInCell` float: cell borders paint over it. |
| `origin?` | `{ x: number; y: number }` | Page-local point a zero `wp:posOffset` on the anchor's own `relativeFrom` lands the frame at, after cell and column remapping. Provenance for editors that rewrite the offset; painters ignore it. |
| `shapeId?` | `number` | `wp:docPr/@id` of the floating drawing this was laid from. Provenance for editors that must find where an authored shape actually landed; painters ignore it. |
| `story?` | `"header" \| "footer"` | |
| `watermark?` | `true` | Authored as a watermark (Word's `WordPictureWatermark*` / a "watermark" docPr name). Metadata only. |
| `z?` | `number` | Floating paint-layer key (`wp:anchor@relativeHeight`); see `LayoutLine.z`. |

## `LayoutBBox`

Import from `@reductoai/pptx`, `@reductoai/pptx/browser`.

| Name | Type | Description |
| - | - | - |
| `h` | `number` | |
| `w` | `number` | |
| `x` | `number` | |
| `y` | `number` | |

## `LayoutBorderSide`

One drawn border side (pt width + CSS hex color). Absent side = no border.

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `color` | `string` | |
| `dash?` | `readonly number[]` | On/off stroke pattern in multiples of `widthPt`. |
| `split?` | `{ bands: readonly { color?: string; widthPt: number }[]; leftTop?: true }` | Ink split of a composite side: consecutive sub-bands in pt, summing to `widthPt`; a band without `color` is a blank gap. Absent = one solid bar. The first band is the one further from the box centre — unless `leftTop`, when the bands run top/left → bottom/right. |
| `texture?` | `"wave" \| "doubleWave" \| "hatch"` | Hairline art filling the band instead of a bar (see `strokeTexture`). |
| `widthPt` | `number` | |

## `LayoutColumnBand`

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `bottom` | `number` | Deepest content y the band filled; only meaningful on the last band. |
| `columns` | `{ w: number; x: number }[]` | |
| `top` | `number` | |

## `LayoutCommentBalloon`

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `anchor` | `{ x: number; y: number }` | Already transformed into final page coordinates. |
| `author` | `string` | |
| `bbox` | `LayoutBBox` | |
| `chrome` | `LayoutShapeGeom[]` | Connector polyline plus the rounded balloon box, in final page coords. |
| `color` | `string` | |
| `commentId?` | `string` | |
| `id` | `string` | Balloon key: `comment:<id>` or `revision:<id>`. |
| `initials` | `string` | |
| `lines` | `LayoutLine[]` | |
| `parentId?` | `string` | |
| `resolved?` | `boolean` | |
| `revision?` | `{ id: string; kind: "delete" \| "moveFrom" \| "moveTo" \| "format" }` | Present on a tracked-change balloon (deletion, move half, formatting). |

## `LayoutDocument`

`@reductoai/pptx` — PPTX → LayoutDocument. Browser-safe: no node builtins.

Surface: OPC access and the part graph, the raw shape tree, theme context
and the placeholder cascade, geometry and pictures, text layout inside a
shape, DrawingML tables, charts, and SmartArt. File I/O and the system font
scan live in `./node`; the PDF writer in `./pdf`; browser backends in
`./browser`.

Import from `@reductoai/pptx`, `@reductoai/pptx/browser`.

| Name | Type | Description |
| - | - | - |
| `blocks` | `({ bidi?: true; bodyIndex: number; headingLevel?: number; kind: "paragraph"; numPr?: { ilvl: number; numId: number }; page: number; preview: string; styleId?: string; title?: true; toc?: true } \| { bodyIndex: number; cols: number; kind: "table"; page: number; rows: number; tableIndex: number })[]` | |
| `bookmarks?` | `{ bodyIndex: number; name: string; textOffset: number }[]` | `w:bookmarkStart` targets in source coordinates (see `model.ts` Bookmark). A consumer resolves one to a page by finding the first run whose `source` has the same `bodyIndex` and covers `textOffset`. |
| `docDefaultFont?` | `string` | docDefaults typeface; the fallback for an unresolvable name (fonts.ts). |
| `drawingGrid?` | `LayoutDrawingGrid` | Absent = Word's default, a 9pt square grid from the margins. |
| `embeddedFonts?` | `EmbeddedFontMap` | Faces extracted from word/fonts, keyed by family (see fonts.ts). |
| `emittedAt` | `string` | |
| `faceManifest?` | `Record<string, { cssFamily: string; file: string; local?: string[]; metrics: { baselineFactor: number; strikePos: number; strikeThickness: number; underlinePos: number; underlineThickness: number; unitsPerEm: number }; synthBold?: true }>` | Resolved physical face per `(requested family, bold, italic)` actually used by runs in this document, keyed `"<requested lowercased>\|<faceKey>"`. Emitted by the demo adapter only. It lets a renderer that cannot run `resolveFace`, read the filesystem, or inspect font tables (the browser) load the exact face the measurer used and reuse its metrics, so both its shaping and its baselines match the PDF backend's. |
| `fontDecls?` | `FontDeclMap` | word/fontTable.xml declarations that drive fallback (see fonts.ts). |
| `fontFallbacks?` | `FontFallback[]` | Families this document asked for that the host could not serve as themselves (see `FontRegistry.fontFallbacks`). Absent when every name resolved exactly. A `script` or `missing` entry means the metrics used are not the document's own, so the pagination is host-dependent. |
| `fonts` | `string[]` | Fonts observed (for |
| `images?` | `Record<string, { data?: Uint8Array; dataB64: string \| null; mime: "png" \| "jpeg" \| "gif" \| "tiff" \| "svg" \| "other"; srcRect?: SrcRect; whole?: true }>` | Image payloads keyed by `LayoutImageRef.id`, base64-encoded so the IR round-trips through JSON. Absent when the document has no inline images. |
| `meta` | `{ engine: "typescript-ooxml" \| "libreoffice-viewcursor"; notes: string[] }` | |
| `pageCount` | `number` | |
| `pages` | `LayoutPage[]` | |
| `properties?` | `DocProperties` | docProps/core.xml + app.xml facts. Absent when the package has neither part. |
| `sourcePath` | `string` | |
| `unit` | `LayoutUnit` | |
| `version` | `1` | |
| `wordPlatform?` | `"mac"` | Laid out to match Word for Mac where it differs from Word for Windows (`WordPlatform`); absent = Windows. |

## `LayoutDrawingGrid`

`w:settings` drawing grid, shown by Word's View > Gridlines. Steps are the gap between
drawn lines (spacing times display-every); 0 draws no lines that way. Absent origin =
the page's margin corner, and the grid fills the margin box; otherwise it fills the page.

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `origin?` | `{ x: number; y: number }` | |
| `stepX` | `number` | |
| `stepY` | `number` | |

## `LayoutImageRef`

Import from `@reductoai/pptx`, `@reductoai/pptx/browser`.

| Name | Type | Description |
| - | - | - |
| `altText?` | `string` | Author's alt text (`wp:docPr/@descr`), verbatim. |
| `chartHits?` | `LayoutShapeGeom[]` | Closed chart outlines tagged with `part` for hit-testing (`chartPartAt`); never painted. |
| `clip?` | `string` | `pic:spPr` custom / non-rect preset geometry as SVG `d` in the unrotated ink box (hmm, y-down from the paint bbox). Painters clip the bitmap to it even-odd. Absent = the image fills its rectangle. |
| `drawHHmm?` | `number` | |
| `drawWHmm?` | `number` | Ink size of a ROTATED drawing, in hmm, before the rotation is applied. `wHmm`/`hHmm` then hold the slot the flow reserved (an anchor's rotated bounding box; an inline picture's extent, swapped past 45°), and painters draw the image into this size CENTRED in the bbox before rotating about that centre. Absent = the ink fills the bbox. |
| `effects?` | `{ glow?: { alpha: number; color: string; radiusHmm: number }; reflection?: { distHmm: number; endAlpha: number; size: number; startAlpha: number }; softEdgeHmm?: number }` | `pic:spPr/a:effectLst` glow, reflection and soft edges, painted against white paper as `shadow` is: a glow is stacked translucent rings behind the picture, a reflection a mirrored copy under a white fade, soft edges a white fade over each side. |
| `flip?` | `ImageFlip` | `a:xfrm@flipH`/`@flipV` (own or inherited from a group): painters mirror the ink about the bbox centre BEFORE rotating it. Absent = no mirror. |
| `hHmm` | `number` | |
| `id` | `string` | Key into `LayoutDocument.images`. Two sentinels never resolve there: `"shape"` (vector `shapes` ride on the ref) and `"rule"` (an `o:hr` slot whose stroke paints as chrome; the ref only reserves the line). |
| `layers?` | `LayoutImageRef[]` | Pictures composing one inline DrawingML group, in declared paint order. Their offsets and sizes are relative to this ref's flow slot. |
| `mime` | `"png" \| "jpeg" \| "gif" \| "tiff" \| "svg" \| "other"` | |
| `offsetXHmm?` | `number` | Offset of the painted child inside an inline drawing's flow slot. |
| `offsetYHmm?` | `number` | |
| `outline?` | `{ color: string; split?: LayoutBorderSide["split"]; widthPt: number }` | `pic:spPr/a:ln` — the picture's own frame (Word's "Picture Border"), stroked wholly outside the placed bbox as Word does. Absent = no frame. `split` is a compound line (`a:ln@cmpd`), its bands outer → inner on every side. |
| `rotDeg?` | `number` | `a:xfrm@rot` in degrees, CLOCKWISE (OOXML). Painters rotate about the placed bbox centre; absent = upright. |
| `shadow?` | `{ alpha?: number; blurPt?: number; color: string; dxHmm: number; dyHmm: number; rgb?: string }` | `pic:spPr/a:effectLst/a:outerShdw` flattened to one opaque offset copy of the bbox, painted under the picture. `dxHmm`/`dyHmm` are the shadow's displacement (dist resolved along dir); `color` is the shadow colour already composited against white for its alpha, because neither painter has an alpha channel — and no corpus shadow falls on anything but paper. The blur radius is dropped: a hard edge at the right offset is much closer to Word's ink than no shadow at all. `rgb`, `alpha` and `blurPt` keep the authored values for writers. |
| `shapeId?` | `number` | `wp:docPr/@id` of the inline drawing. Pure metadata for geometry queries (two drawings sharing one flow slot are otherwise indistinguishable); painters never read it. |
| `shapes?` | `LayoutShapeGeom[]` | Set instead of a bitmap payload when the drawing is DrawingML shape geometry. A shape has no image part, so `id` is the sentinel `"shape"` and `mime` is `"other"`: there is deliberately no `LayoutDocument.images` entry to look up, and painters must test this field BEFORE reaching for one (see `paintDrawing` in paint/scene.ts). |
| `slotHHmm?` | `number` | Height of the flow slot when the painted child is inset in it (effect extent). |
| `vectorKind?` | `"chart" \| "diagram"` | What the vector `shapes` ARE, when the parser knows: a chart plot or a SmartArt diagram. Pure metadata for sketches/tools; painters never read it. Absent = plain drawn geometry. |
| `wHmm` | `number` | Placed size in hmm (already scaled to fit the column). |

## `LayoutLine`

`@reductoai/pptx` — PPTX → LayoutDocument. Browser-safe: no node builtins.

Surface: OPC access and the part graph, the raw shape tree, theme context
and the placeholder cascade, geometry and pictures, text layout inside a
shape, DrawingML tables, charts, and SmartArt. File I/O and the system font
scan live in `./node`; the PDF writer in `./pdf`; browser backends in
`./browser`.

Import from `@reductoai/pptx`, `@reductoai/pptx/browser`.

| Name | Type | Description |
| - | - | - |
| `baseHmm?` | `number` | Baseline fixed below the line top by an `exact` line rule when the line carries an inline drawing. Word keeps the box at the rule value, puts the baseline at 4/5 of it and clips the drawing to the band, so a picture taller than the line shows only its bottom. Runs align to this instead of the tallest ink. |
| `behind?` | `boolean` | With `z`: under the body flow (`behindDoc`) vs over it (default). |
| `changeBar?` | `true` | Word inline-review change bar is painted beside this line. |
| `clip?` | `LayoutBBox` | Ink outside this box is cut, as Word cuts a text box's lines between its top and bottom insets. In the line's own UNROTATED frame, so it turns with `rot`; painters push it after the rotation. |
| `editMark?` | `TextStyle` | On an edited story's empty paragraph: the style its mark resolves to, which text typed there takes. Painters never read it; an editor reads it for the caret's format. |
| `editMarker?` | `LayoutRun` | The bullet of an empty paragraph, which PowerPoint shows only while its text is edited. Painters never read it; an editor paints it for the story it edits. |
| `h` | `number` | Vertical advance consumed by this line (includes proportional leading). |
| `highlightBand?` | `{ h: number; top: number }` | Band a highlight fills, from `y`, when the line rule moves it off the runs' own box. |
| `inFrame?` | `true` | With `textbox`: laid in a `w:framePr` frame, so its text belongs to the story around it. |
| `lineEnd?` | `"break" \| "paragraph"` | Why the paragraph's text stops here: an authored `w:br`/`w:cr`, or the paragraph mark. Absent on a soft wrap and on lines that are not paragraph text. Metadata only; painters never read it. |
| `lineNumber?` | `true` | Section line numbering (`w:lnNumType`) in the margin; carets and text readers skip it. |
| `page` | `number` | |
| `rot?` | `{ cx: number; cy: number; deg: number }` | Rotated line (vertical textbox text, `wps:bodyPr` vert/vert270). The line and its runs are stored UNROTATED, in page coords; painters rotate all of the line's ink by `deg` degrees COUNTER-CLOCKWISE on screen (IR is y-down) about the pivot (`cx`,`cy`), also in hmm page coords. |
| `runs` | `LayoutRun[]` | |
| `shapeId?` | `number` | `wp:docPr/@id` of the floating textbox this line was laid inside. Unlike `textbox` it survives a round trip to the authored shape, so an editor can ask where a box's own text ended up. Metadata only. |
| `source?` | `SourceAnchor` | Empty-paragraph lines only: the source paragraph the line was laid for. Lines with runs carry provenance on each run instead. Lets geometry queries resolve a blank paragraph to its laid line box. Metadata only. |
| `story?` | `"header" \| "footer"` | Header/footer mini-flow. Untagged lines are body. Page sketches use this instead of a Y-band heuristic, so body text near the bottom margin keeps its `p:N` address. |
| `storyRel?` | `string` | The story this line was laid from: a header/footer part's relationship id, a note key (`footnote#<id>`) or a textbox key (`textbox#<b>:<n>`). Each story numbers its paragraphs independently, so `source.bodyIndex` alone is ambiguous across them. Metadata only — painters never read it. |
| `textbox?` | `number` | The line was laid inside a floating textbox's inner mini-flow. The value names the box instance (unique per document), so two boxes anchored to the same paragraph stay apart. Metadata only — painters never read it. |
| `textH?` | `number` | |
| `w` | `number` | |
| `watermark?` | `true` | Header VML textpath: above document backgrounds, below all body ink. |
| `wrap?` | `LineWrap` | The band the line breaker filled, as offsets from `x`: `left`/`right` bound this line, `next` is where the paragraph's later lines start. Only on left-to-right lines with no tab and no float beside them, so an editor can tell when a quick refill of the paragraph is safe. Metadata only; painters never read it. |
| `x` | `number` | |
| `y` | `number` | |
| `z?` | `number` | Paint-layer key for content owned by a floating anchor (`wp:anchor@relativeHeight`). Present only for such content: the line leaves the body paint pass and joins the floating layer, interleaved with drawings by `z`. `behind` selects under-body vs over-body (behindDoc). |

## `LayoutLinearGradient`

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `end` | `{ x: number; y: number }` | |
| `kind` | `"linear" \| "radial"` | `radial`: a circle about `start` whose rim passes through `end`. |
| `start` | `{ x: number; y: number }` | Endpoints use the shape path's local hmm coordinates. |
| `stops` | `{ alpha?: number; color: string; offset: number }[]` | |

## `LayoutPage`

`@reductoai/pptx` — PPTX → LayoutDocument. Browser-safe: no node builtins.

Surface: OPC access and the part graph, the raw shape tree, theme context
and the placeholder cascade, geometry and pictures, text layout inside a
shape, DrawingML tables, charts, and SmartArt. File I/O and the system font
scan live in `./node`; the PDF writer in `./pdf`; browser backends in
`./browser`.

Import from `@reductoai/pptx`, `@reductoai/pptx/browser`.

| Name | Type | Description |
| - | - | - |
| `anchors?` | `LayoutAnchor[]` | Floating pictures, absolutely positioned (no flow impact). |
| `background?` | `string` | Full-page fill (CSS hex) painted under everything; left out under `pageColor: "print"`. |
| `bodyBottom?` | `number` | Lowest y a body line may reach, before notes take their share. Metadata only. |
| `columnBands?` | `LayoutColumnBand[]` | Multi-column bands, top to bottom. Each band spans from its `top` to the next band's `top` (the last one to `bottom`). Present only when some band lays more than one column, so text consumers can order content column by column instead of interleaving by y. |
| `height` | `number` | |
| `index` | `number` | |
| `lines` | `LayoutLine[]` | |
| `margin` | `{ bottom: number; left: number; right: number; top: number }` | |
| `pageBorder?` | `LayoutPageBorder` | Section page border, painted behind or in front of document ink. |
| `printedNumber?` | `string` | The string a PAGE field on this page paints (pgNumType format and restarts applied). Provenance for field refresh; painters never read it. |
| `rects?` | `LayoutRect[]` | Paragraph shading / border rects, drawn beneath lines and tables. |
| `review?` | `LayoutReviewLayer` | Word-like print-markup composition, painted outside the base page flow. |
| `sectionIndex?` | `number` | Index of the section (document order, body-level sectPr last) whose page grid laid this page. Provenance for section-scoped geometry queries; painters never read it. |
| `tables` | `LayoutTable[]` | |
| `width` | `number` | |

## `LayoutPageBorder`

Page border emitted from the owning section's w:pgBorders.

Not exported by name. You get it from the API.

```ts theme={null}
type LayoutPageBorder = LayoutRect & { zOrder: "front" | "back" }
```

## `LayoutRect`

A decoration rectangle (paragraph w:shd fill / w:pBdr borders), drawn under
all text and table content. bbox in hmm from the page's top-left.

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `bbox` | `LayoutBBox` | |
| `behind?` | `boolean` | With `z`: under the body flow (`behindDoc`) vs over it (default). |
| `borders?` | `{ bottom?: LayoutBorderSide; left?: LayoutBorderSide; right?: LayoutBorderSide; top?: LayoutBorderSide }` | Drawable border sides only (zero-width sides were dropped upstream). |
| `fill?` | `string` | Background fill (CSS hex). |
| `frame?` | `true` | The authored frame of a floating text box at its resolved position, kept so an editor can select, drag and resize a box that paints no fill or border. Such a rect has neither `fill` nor `borders` and paints nothing. |
| `origin?` | `{ x: number; y: number }` | Frames only: see `LayoutAnchor.origin`. |
| `paragraphFrame?` | `{ from: number; outset?: { b: number; l: number; r: number; t: number }; storyRel?: string; to: number }` | A `w:framePr` frame's paragraphs, body indices `from` to `to` (exclusive) in story `storyRel` (absent: body). |
| `rotDeg?` | `number` | Frames only: the box's `a:xfrm@rot` in degrees; the bbox stays upright and the ink spins. |
| `shapeId?` | `number` | `wp:docPr/@id` when this rect is a floating shape's chrome; provenance only. |
| `story?` | `"header" \| "footer"` | Header/footer mini-flow; untagged rects are body. See `LayoutLine.story`. |
| `storyRel?` | `string` | The textbox story whose frame this rect paints; an editor claims the box from it. |
| `z?` | `number` | Floating paint-layer key; see `LayoutLine.z`. |

## `LayoutReviewLayer`

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `anchorChrome` | `LayoutShapeGeom[]` | Range highlight and end brackets for every anchored comment, in final page coords. Painted under all balloons: a thread shares one decoration, so it cannot hang off an individual balloon. |
| `balloons` | `LayoutCommentBalloon[]` | |
| `contentTransform` | `LayoutReviewTransform` | |
| `gutter` | `LayoutBBox` | |

## `LayoutReviewTransform`

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `dx` | `number` | |
| `dy` | `number` | |
| `scale` | `number` | |

## `LayoutRun`

`@reductoai/pptx` — PPTX → LayoutDocument. Browser-safe: no node builtins.

Surface: OPC access and the part graph, the raw shape tree, theme context
and the placeholder cascade, geometry and pictures, text layout inside a
shape, DrawingML tables, charts, and SmartArt. File I/O and the system font
scan live in `./node`; the PDF writer in `./pdf`; browser backends in
`./browser`.

Import from `@reductoai/pptx`, `@reductoai/pptx/browser`.

| Name | Type | Description |
| - | - | - |
| `anchorOf?` | `number` | Zero-width slot that owns the anchor character of a floating drawing; the value is the `LayoutAnchor.shapeId` it was laid from. Painters skip it. |
| `field?` | `LiveField` | The run paints the live result of this field, not typed text. Fields whose saved result is painted as-is (SECTIONPAGES, PAGEREF, DATE) carry no mark. Metadata only. |
| `h` | `number` | Approximate line box height from font size (+ leading fudge). |
| `image?` | `LayoutImageRef` | Present only on image runs (`text` is empty). Consumers that only know about glyphs draw nothing, which is the pre-image behaviour. |
| `link?` | `{ anchor?: string; href?: string; tooltip?: string }` | The run sits inside a `w:hyperlink` (or a HYPERLINK field). Painters that only draw glyphs ignore it; interactive consumers turn it into a link. `anchor` names a bookmark listed in `LayoutDocument.bookmarks`. |
| `logicalOrder?` | `number` | Line-local source-order position paired with `logicalText`. |
| `logicalText?` | `string` | Source-order text when `text` was reordered for visual RTL painting. Text/API consumers use this; painters deliberately ignore it. |
| `marker?` | `true` | The run paints the GENERATED numbering label (marker glyphs, or the tab that separates it from the body), not the paragraph's own text. A text consumer that emits its own list markers must drop these, or the marker appears twice. |
| `math?` | `{ display?: true; latex?: string }` | Office Math provenance. Present on every run an `m:oMath` object emits (glyph pieces and the zero-width rule anchor). The generated LaTeX rides once, on the object's first run; follower runs carry an empty object so a text consumer can fold the whole equation back into one token. `display` marks `m:oMathPara`. |
| `reviewCommentId?` | `string` | Synthetic review-balloon provenance; never set on document-flow runs. |
| `shapes?` | `LayoutShapeGeom[]` | Vector ink anchored to this run's BASELINE origin: `(x, baseline)`, with +y down, unlike `image.shapes`, which hang off the run's top-left box. An equation's fraction bars and radicals ride here, because only the baseline is a fixed point once the line's height is known. |
| `shapingDirection?` | `"ltr" \| "rtl"` | Resolved direction used to shape this visual run. |
| `source` | `SourceAnchor` | |
| `style` | `TextStyle` | |
| `symbolByte?` | `number` | Raw byte for legacy symbol-font runs; canvas hosts choose their cmap encoding. |
| `text` | `string` | |
| `w` | `number` | Advance width of the run (endX - startX). |
| `x` | `number` | |
| `y` | `number` | |

## `LayoutShapeGeom`

Import from `@reductoai/pptx`, `@reductoai/pptx/browser`.

| Name | Type | Description |
| - | - | - |
| `clipD?` | `string` | Paint only inside this path (same frame as `d`, even-odd): an inner shadow's silhouette. |
| `d` | `string` | |
| `dxHmm` | `number` | |
| `dyHmm` | `number` | |
| `fill?` | `string` | CSS hex fill. Absent on a stroke-only shape (`a:noFill`, or a rule). |
| `fillOpacity?` | `number` | The solid fill's own DrawingML alpha (0..1); multiplies `opacity`. |
| `fillPaint?` | `LayoutLinearGradient` | Takes precedence over the solid fill. |
| `opacity?` | `number` | Fill/shape opacity (0..1), used by legacy VML translucent overlays. |
| `part?` | `string` | The chart element the shape draws (`chartPartAt`); painters never read it. |
| `reflection?` | `{ alpha: number; authored?: { blur: number; offset: number; size: number; transparency: number }; distHmm: number; sy: number }` | `a:effectLst/a:reflection`, approximated as a flipped translucent copy. |
| `stroke?` | `{ cap?: "round" \| "square"; color: string; dash?: "dot" \| "dash"; dashPattern?: number[]; dashPt?: number; headEnd?: LineEndType; headEndSize?: LineEndSize; join?: "round" \| "bevel"; opacity?: number; paint?: LayoutLinearGradient; tailEnd?: LineEndType; tailEndSize?: LineEndSize; widthPt: number }` | `a:ln` outline. Absent when the shape is fill-only. |

## `LayoutTable`

`@reductoai/pptx` — PPTX → LayoutDocument. Browser-safe: no node builtins.

Surface: OPC access and the part graph, the raw shape tree, theme context
and the placeholder cascade, geometry and pictures, text layout inside a
shape, DrawingML tables, charts, and SmartArt. File I/O and the system font
scan live in `./node`; the PDF writer in `./pdf`; browser backends in
`./browser`.

Import from `@reductoai/pptx`, `@reductoai/pptx/browser`.

| Name | Type | Description |
| - | - | - |
| `anchors?` | `LayoutAnchor[]` | Floating pictures anchored to cell paragraphs. Transient: the engine drains these onto the owning page's `anchors` when the chunk is flushed. |
| `bbox` | `LayoutBBox` | |
| `behind?` | `boolean` | The owning floating textbox sits behind the document body. |
| `bodyIndex` | `number` | |
| `cells` | `LayoutTableCell[]` | |
| `cols` | `number` | |
| `headerRows?` | `number` | Leading rows flagged `w:tblHeader` (repeated on continuation pages). Metadata only. |
| `name` | `string` | |
| `page` | `number` | |
| `rows` | `number` | |
| `story?` | `"header" \| "footer"` | |
| `tableIndex` | `number` | |
| `tbLines?` | `LayoutLine[]` | Ink of floating textboxes anchored to cell paragraphs (inner lines and chrome rects). Transient in the same way as `anchors`: drained onto the page when the chunk is flushed, so no consumer ever sees them here. |
| `tbRects?` | `LayoutRect[]` | |
| `textbox?` | `number` | Laid inside a floating textbox; see `LayoutLine.textbox`. |
| `z?` | `number` | Floating textbox paint order (`wp:anchor@relativeHeight` / VML z-index). |

## `LayoutTableCell`

`@reductoai/pptx` — PPTX → LayoutDocument. Browser-safe: no node builtins.

Surface: OPC access and the part graph, the raw shape tree, theme context
and the placeholder cascade, geometry and pictures, text layout inside a
shape, DrawingML tables, charts, and SmartArt. File I/O and the system font
scan live in `./node`; the PDF writer in `./pdf`; browser backends in
`./browser`.

Import from `@reductoai/pptx`, `@reductoai/pptx/browser`.

| Name | Type | Description |
| - | - | - |
| `bbox` | `LayoutBBox` | |
| `borders?` | `{ bottom?: LayoutBorderSide; left?: LayoutBorderSide; right?: LayoutBorderSide; top?: LayoutBorderSide }` | Effective borders after tcPr-over-tblPr resolution; zero-width sides are omitted. |
| `clipContent?` | `boolean` | |
| `col` | `number` | |
| `colSpan?` | `number` | `w:gridSpan` > 1: grid columns this cell covers. Metadata only. |
| `diagonals?` | `{ down?: LayoutBorderSide; up?: LayoutBorderSide }` | Rules from corner to corner: `down` top-left to bottom-right (w:tl2br), `up` bottom-left to top-right. |
| `lines` | `LayoutLine[]` | |
| `name` | `string` | |
| `page` | `number` | |
| `rects?` | `LayoutRect[]` | Paragraph shading / border boxes of the cell's paragraphs, drawn over the fill and under the lines. |
| `row` | `number` | |
| `rowSpan?` | `number` | `w:vMerge` restart spanning > 1 rows; continue cells are not emitted. Metadata only. |
| `shading?` | `string` | Background fill (CSS hex). Absent = transparent. |
| `source` | `Extract<SourceAnchor, { kind: "table-cell" }>` | |
| `text` | `string` | Plain text (concatenated). |

## `LayoutUnit`

Not exported by name. You get it from the API.

```ts theme={null}
type LayoutUnit = "hmm"
```

## `LineEndSize`

`a:headEnd`/`a:tailEnd` `@len` and `@w`; absent is `med`.

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `len?` | `"sm" \| "med" \| "lg"` | |
| `w?` | `"sm" \| "med" \| "lg"` | |

## `LineEndType`

`a:headEnd`/`a:tailEnd` `@type`, less `none` (which is simply absent).

Not exported by name. You get it from the API.

```ts theme={null}
type LineEndType = "triangle" | "stealth" | "diamond" | "oval" | "arrow"
```

## `LineWrap`

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `align` | `"left" \| "center" \| "right" \| "both" \| "distribute" \| "thaiDistribute"` | |
| `gap?` | `number` | Space Word puts between this paragraph and a copy of itself, as Enter makes one. |
| `left` | `number` | |
| `mark?` | `{ h: number; textH: number }` | Line box of an empty copy of this paragraph, sized by its mark. |
| `next` | `number` | |
| `right` | `number` | |

## `LiveField`

A field Word recalculates at layout time: page and section numbers and counts, running heading, paragraph count.

Not exported by name. You get it from the API.

```ts theme={null}
type LiveField = "PAGE" | "NUMPAGES" | "SECTION" | "SECTIONPAGES" | "STYLEREF" | "AUTONUM" | "LISTNUM"
```

## `MeasureText`

Width of `text` when drawn with the run's face and size. Only ratios against
the run's own text are used, so any consistent unit works (canvas px, pt).

Not exported by name. You get it from the API.

```ts theme={null}
type MeasureText = (run: LayoutRun, text: string) => number
```

## `MetafileBackend`

Platform half of the metafile pipeline: rasterise an SVG at `zoom`. Node's
default backend loads @resvg/resvg-js lazily; a browser host injects a wasm
equivalent via `setMetafileBackend`.

Import from `@reductoai/pptx/browser`.

| Name | Type | Description |
| - | - | - |
| `renderMetafile()?` | `(bytes: Uint8Array, opts: { kind: MetafileKind } & RasterBudget) => Promise<Uint8Array<ArrayBufferLike> \| null>` | Run the complete conversion off-thread when the host owns a worker pool. |
| `renderRgba()?` | `(rgba: Uint8Array, opts: { height: number; width: number }) => Promise<Uint8Array<ArrayBufferLike>>` | Encode already-sized RGBA pixels from the bitmap-only Zig/WASM fast path. |
| `renderSvg()` | `(svg: string, opts: { defaultFontFamily: string; zoom: number }) => Promise<Uint8Array<ArrayBufferLike>>` | |

## `MetafileKind`

Metafile flavours we can rasterise, as told by the magic bytes.

Import from `@reductoai/pptx/browser`.

```ts theme={null}
type MetafileKind = "emf" | "wmf"
```

## `MetafileWorkerOptions`

Import from `@reductoai/pptx/browser`.

| Name | Type | Description |
| - | - | - |
| `deflate?` | `(bytes: Uint8Array) => Uint8Array` | |
| `fontAliases?` | `Readonly<Record<string, string>>` | |
| `renderRgba?` | `RgbaEncoder` | RGBA -> PNG encoder; defaults to OffscreenCanvas. |
| `renderSvg` | `SvgRasterizer` | |
| `scope?` | `WorkerScopeLike` | Defaults to this worker's global scope. |

## `PdfPainterCounts`

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `borders` | `number` | |
| `images` | `number` | |
| `runs` | `number` | |
| `shapes` | `number` | |

## `PngDecoder`

Import from `@reductoai/pptx/pdf`.

```ts theme={null}
type PngDecoder = (bytes: Uint8Array) => Promise<DecodedPng | undefined>
```

## `Position`

A caret: `offset` is a UTF-16 index into the target's text. `side` picks one of Word's
stops at an inline content control's edge: "before" joins the text before it, "after"
the text after an empty control.

Import from `@reductoai/pptx/editor`.

| Name | Type | Description |
| - | - | - |
| `offset` | `number` | |
| `side?` | `"before" \| "after"` | |
| `target` | `EditTarget` | |

## `ProgressCallback`

Import from `@reductoai/pptx`, `@reductoai/pptx/browser`.

```ts theme={null}
type ProgressCallback = (ev: ConvertProgress) => void
```

## `RasterBudget`

How many output pixels a metafile may spend per CSS px of its placement.

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `drawnScale?` | `number` | Output pixels per CSS px of `drawPx`. Default RASTER\_DRAWN\_SCALE. |
| `drawPx?` | `number` | Longer axis of the largest placement in the document, in CSS px. |

## `Rect`

Page-local rectangle in hmm (the IR unit); `rot` turns it as the painter turns its line.

Import from `@reductoai/pptx/editor`.

| Name | Type | Description |
| - | - | - |
| `h` | `number` | |
| `page` | `number` | |
| `rot?` | `Turn` | |
| `w` | `number` | |
| `x` | `number` | |
| `y` | `number` | |

## `RenderedPng`

`page` is the source `LayoutPage.index`, numbered as in `RenderPngOptions.pages`.

Import from `@reductoai/pptx/node`.

| Name | Type | Description |
| - | - | - |
| `height` | `number` | |
| `page` | `number` | |
| `png` | `Buffer` | |
| `width` | `number` | |

## `RenderPdfOptions`

Import from `@reductoai/pptx/pdf`.

| Name | Type | Description |
| - | - | - |
| `imageConcurrency?` | `number` | Maximum native PNG decodes/compressions in flight when `pngDecoder` is provided. |
| `nativeImageCompression?` | `boolean` | Use native asynchronous deflate for PNG channels (default: on when supported). |
| `onProgress?` | `ProgressCallback` | Phase transitions and per-page heartbeats; see `progress.ts`. |
| `paintPages?` | `readonly number[]` | 1-based pages to actually paint; every OTHER page is still added, at its true size, but blank. That keeps page numbers (and the rasterizer's page windows) aligned with the full document while skipping the paint + font subsetting cost of the pages nobody asked for — the sxs single-page path. Omitted = paint everything. |
| `pngDecoder?` | `PngDecoder` | Host-specific PNG decoder; Node uses Sharp while browsers retain the isomorphic fallback. |
| `signal?` | `AbortSignal` | Cooperative cancellation, checked between phases and per painted page. |

## `RenderPdfResult`

Import from `@reductoai/pptx/pdf`.

| Name | Type | Description |
| - | - | - |
| `bytes` | `Uint8Array` | |
| `counts` | `PdfPainterCounts` | |
| `rects` | `number` | `p.rects` drawn across all pages; the painter counts the rest. |
| `timings` | `RenderPdfTimings` | |

## `RenderPdfTimings`

Coarse renderer phases, useful for profiling without changing output.

Import from `@reductoai/pptx/pdf`.

| Name | Type | Description |
| - | - | - |
| `annotationsMs` | `number` | |
| `fontsMs` | `number` | |
| `imagesMs` | `number` | |
| `paintMs` | `number` | |
| `saveMs` | `number` | |
| `setupMs` | `number` | |

## `RenderPngOptions`

Import from `@reductoai/pptx/node`.

| Name | Type | Description |
| - | - | - |
| `pages?` | `number[]` | Pages to render, matched on `LayoutPage.index`: 1-based for docx, 0-based slide indices for pptx. Default: all pages in the IR. |
| `registry?` | `FontRegistry` | |
| `scale?` | `number` | Supersampling factor over the logical 96dpi page size (2 = 192dpi output), matching the demo's minimum render scale. Default 2. |

## `RgbaEncoder`

RGBA -> PNG; defaults to OffscreenCanvas when the host omits it.

Import from `@reductoai/pptx/browser`.

```ts theme={null}
type RgbaEncoder = (rgba: Uint8Array, opts: { height: number; width: number }) => Promise<Uint8Array>
```

## `SlideMedia`

A picture's media: a part of the package or an outside address; neither when the link is broken.

Import from `@reductoai/pptx/editor`.

| Name | Type | Description |
| - | - | - |
| `kind` | `"video" \| "audio"` | |
| `part?` | `string` | |
| `url?` | `string` | |

## `SlideObject`

Import from `@reductoai/pptx/editor`.

| Name | Type | Description |
| - | - | - |
| `bbox` | `LayoutBBox` | The unrotated frame, page hmm. |
| `chart?` | `ChartHitSource` | A chart's drawing, tagged by element, in its unrotated frame. |
| `flipH` | `boolean` | |
| `flipV` | `boolean` | |
| `group?` | `string` | Key of the enclosing group. |
| `id?` | `string` | `p:cNvPr@id` and `@name`. |
| `key` | `string` | |
| `kind` | `SlideObjectKind` | |
| `line?` | `true` | A straight line preset. |
| `media?` | `SlideMedia` | The video or sound a picture stands for. |
| `name?` | `string` | |
| `outline?` | `ShapeOutline` | The painted fill and outline in page hmm; a click elsewhere in the frame passes through. |
| `paint?` | `ShapePaint` | The fill and line the shape paints, resolved through its style and theme. |
| `placeholder?` | `{ idx?: number; type?: string }` | |
| `rotDeg` | `number` | Clockwise turn about the frame centre, group turns included. |
| `story?` | `string` | The text story of a shape with a text body; a table names one per cell. |
| `table?` | `TableGrid` | A table's laid grid. |
| `text?` | `true` | The story holds text, so a click anywhere in the frame lands in it. |
| `textFit?` | `TextFit` | Under Resize Shape to Fit Text: the frame its text needs. |

## `SlideObjectKind`

Import from `@reductoai/pptx/editor`.

```ts theme={null}
type SlideObjectKind = "shape" | "picture" | "connector" | "group" | "table" | "chart" | "frame"
```

## `SourceAnchor`

`@reductoai/pptx` — PPTX → LayoutDocument. Browser-safe: no node builtins.

Surface: OPC access and the part graph, the raw shape tree, theme context
and the placeholder cascade, geometry and pictures, text layout inside a
shape, DrawingML tables, charts, and SmartArt. File I/O and the system font
scan live in `./node`; the PDF writer in `./pdf`; browser backends in
`./browser`.

Import from `@reductoai/pptx`, `@reductoai/pptx/browser`.

```ts theme={null}
type SourceAnchor = { bodyIndex: number; kind: "paragraph"; textLength: number; textOffset: number } | { bodyIndex: number; cellName: string; col: number; kind: "table-cell"; path?: CellPathStep[]; row: number; tableIndex: number; tableName: string; textLength: number; textOffset: number }
```

## `SrcRect`

Source-window fractions, each in \[-1, 1); see `LayoutDocument.images`.

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `b` | `number` | |
| `l` | `number` | |
| `r` | `number` | |
| `t` | `number` | |

## `SvgRasterizer`

Platform half a host or worker must supply: SVG -> PNG at `zoom`.

Not exported by name. You get it from the API.

```ts theme={null}
type SvgRasterizer = (svg: string, opts: { defaultFontFamily: string; fontBuffers: Uint8Array[]; zoom: number }) => Promise<Uint8Array>
```

## `TableFaceProvider`

A FaceProvider over a FaceTable, plus the by-family verbs a host needs around it.

Import from `@reductoai/pptx/browser`.

| Name | Type | Description |
| - | - | - |
| `bytes()` | `(id: string) => Uint8Array<ArrayBufferLike> \| null` | Face bytes held here, or an embedded face the registry extracted. |
| `familyFaceIds()` | `(family: string) => Promise<string[]>` | Ids of one family's faces, for a targeted prefetch. |
| `familyFaces()` | `(families: Iterable<string>) => Promise<[string, Uint8Array<ArrayBufferLike>][]>` | The faces of `families`, fetched when missing. For consumers that resolve fonts by name outside the layout trace: the metafile rasterizer, the PDF writer's fallback family. |
| `fetch()` | `(ids: string[], onProgress?: FetchProgress) => Promise<number>` | Pull the faces named by `ids` that are not held yet; returns the bytes pulled. |
| `heldIds()` | `() => string[]` | Ids whose bytes this thread holds; a worker skips these when it ships faces over. |
| `install()` | `() => Promise<void>` | Register every family on `defaultFontRegistry`; face bytes may still be absent. Memoized. |
| `seed()` | `(faces: Iterable<[string, Uint8Array<ArrayBufferLike>]>) => void` | Adopt face bytes another thread fetched, so `bytes` can serve them here. |
| `table()` | `() => Promise<FaceTable>` | The table, after `install`. |

## `TableGrid`

A laid table in page hmm: grid edges (n + 1 each) and the origin cell of every merged area.

Import from `@reductoai/pptx/editor`.

| Name | Type | Description |
| - | - | - |
| `cells` | `{ col: number; colSpan: number; row: number; rowSpan: number }[]` | |
| `cols` | `number[]` | |
| `rows` | `number[]` | |

## `TableStyleName`

Not exported by name. You get it from the API.

```ts theme={null}
type TableStyleName = typeof TABLE_STYLE_NAMES[number]
```

## `Turn`

Turned text: lines are laid upright and painted turned about a pivot (`LayoutLine.rot`).

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `cx` | `number` | |
| `cy` | `number` | |
| `deg` | `number` | |

## `WorkerLike`

Structural `Worker`/`DedicatedWorkerGlobalScope`. The handler slots are
`any`-typed on purpose: a DOM `MessageEvent` handler is only assignable to
a narrower one through `any`, and callers annotate with MessageLike.

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `onerror` | `((event: any) => void) \| null` | |
| `onmessage` | `((event: any) => void) \| null` | |
| `postMessage()` | `(message: unknown, transfer?: unknown[]) => void` | |
| `terminate()` | `() => void` | |

## `WorkerScopeLike`

Not exported by name. You get it from the API.

| Name | Type | Description |
| - | - | - |
| `onmessage` | `((event: any) => void) \| null` | |
| `postMessage()` | `(message: unknown, transfer?: unknown[]) => void` | |
