@openpresentation/opf 0.30.0 → 0.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/README.md +1 -1
  2. package/dist/browser.js +18 -18
  3. package/dist/{catalog-schemas-CC1d_h8s.d.ts → catalog-schemas-LdqOPebq.d.ts} +2 -2
  4. package/dist/{chart-data-Ci9s_NDN.d.ts → chart-data-oIZQlFGi.d.ts} +4 -2
  5. package/dist/{chunk-UKWNHK62.js → chunk-2E6CDYL2.js} +23 -6
  6. package/dist/{chunk-I6G32TB5.js → chunk-56J345KE.js} +5 -5
  7. package/dist/{chunk-AFYXG3IB.js → chunk-7U3TJBXE.js} +100 -16
  8. package/dist/chunk-AQEAZDL2.js +9 -0
  9. package/dist/{chunk-HRKV43GC.js → chunk-BBVW5ZC2.js} +3 -3
  10. package/dist/{chunk-7UO6H32I.js → chunk-CLRYHWQN.js} +162 -22
  11. package/dist/chunk-DGS47ONG.js +1 -0
  12. package/dist/{chunk-F5QC7E2O.js → chunk-F7DN33UL.js} +28 -8
  13. package/dist/{chunk-KELC4K62.js → chunk-HKUV7NEN.js} +1 -1
  14. package/dist/{chunk-XG4JKFZ6.js → chunk-IT7FQKED.js} +6 -6
  15. package/dist/{chunk-SYCHWS7C.js → chunk-J63CIRIV.js} +4 -4
  16. package/dist/{chunk-5Q4IYLMW.js → chunk-LEF4X4KI.js} +274 -33
  17. package/dist/{chunk-5OMZW44K.js → chunk-NEJ32O7X.js} +1 -1
  18. package/dist/chunk-NVAJASOD.js +14764 -0
  19. package/dist/{chunk-M7YZU3DX.js → chunk-OXLA4HXQ.js} +615 -58
  20. package/dist/{chunk-P5E3FNYO.js → chunk-PB7ME64J.js} +1 -1
  21. package/dist/{chunk-ARFAQNOH.js → chunk-SW676APJ.js} +2 -2
  22. package/dist/{chunk-W7KPMUJF.js → chunk-XFHXQCXL.js} +58 -5
  23. package/dist/{chunk-KOCXV7H3.js → chunk-XQO2CT6Q.js} +2 -2
  24. package/dist/{chunk-WHDOOLIO.js → chunk-YFJIIIOL.js} +3 -3
  25. package/dist/composition-DRqNGHJV.d.ts +5620 -0
  26. package/dist/composition.d.ts +2 -2
  27. package/dist/composition.js +1 -1
  28. package/dist/{conversion-jdVnvct4.d.ts → conversion-Cadul8Mu.d.ts} +56 -9
  29. package/dist/conversion-J3YPDS7C.js +24 -0
  30. package/dist/convert.d.ts +2 -2
  31. package/dist/convert.js +7 -7
  32. package/dist/data.d.ts +2 -2
  33. package/dist/data.js +2 -2
  34. package/dist/{deck-report-DQMsvyBI.d.ts → deck-report-BA3IPJAV.d.ts} +2 -2
  35. package/dist/deck.d.ts +5 -5
  36. package/dist/deck.js +11 -11
  37. package/dist/diagram-engine-eager.js +6 -0
  38. package/dist/diagram-engine-lazy.js +2 -0
  39. package/dist/diff.js +4 -4
  40. package/dist/docs.js +26 -20
  41. package/dist/examples.js +4759 -995
  42. package/dist/format.js +2 -2
  43. package/dist/ids.js +4 -4
  44. package/dist/index.d.ts +16 -13
  45. package/dist/index.js +24 -23
  46. package/dist/markdown.d.ts +2 -2
  47. package/dist/markdown.js +8 -8
  48. package/dist/node-engine.d.ts +8 -10
  49. package/dist/node-engine.js +22 -22
  50. package/dist/{pagination-DyAKYpXu.d.ts → pagination-DwEkdJ6s.d.ts} +74 -4
  51. package/dist/pagination.d.ts +3 -3
  52. package/dist/pagination.js +4 -4
  53. package/dist/patch.js +3 -3
  54. package/dist/precompiled.js +2 -2
  55. package/dist/{presentation-8jLSTFqL.d.ts → presentation-DnD7mfmf.d.ts} +106 -27
  56. package/dist/repo-readme.js +1 -1
  57. package/dist/schema-engine-ajv.js +1 -1
  58. package/dist/schema-engine-precompiled.js +2 -2
  59. package/dist/schema.d.ts +1 -1
  60. package/dist/schema.js +3 -3
  61. package/dist/schemas.d.ts +6 -0
  62. package/dist/schemas.js +1 -1
  63. package/dist/source.d.ts +4 -3
  64. package/dist/source.js +10 -10
  65. package/dist/spec/schemas/layout.schema.json +58 -8
  66. package/dist/spec/schemas/narrative.schema.json +2 -1
  67. package/dist/spec/schemas/opf.schema.json +122 -23
  68. package/dist/spec/schemas/theme.schema.json +9 -3
  69. package/dist/types.d.ts +69 -18
  70. package/dist/{validation-types-mNmfcY9A.d.ts → validation-types-vVah_PEv.d.ts} +1 -1
  71. package/dist/validator.d.ts +4 -4
  72. package/dist/validator.js +3 -3
  73. package/dist/yaml.d.ts +2 -2
  74. package/dist/yaml.js +7 -7
  75. package/package.json +15 -6
  76. package/dist/chunk-W3SEWSO5.js +0 -8043
  77. package/dist/chunk-Z7XNHIW7.js +0 -16
  78. package/dist/chunk-ZROVYWGU.js +0 -1
  79. package/dist/composition-C-hd_Ci3.d.ts +0 -3207
  80. package/dist/conversion-FUOYO726.js +0 -24
@@ -1,3207 +0,0 @@
1
- import { R as ResolvedChartData } from './chart-data-Ci9s_NDN.js';
2
- import { b as CatalogOptions } from './catalog-refs-kAefsZWT.js';
3
-
4
- /** Canonical table grid. No renderer, fonts, DOM or network dependencies. */
5
- interface TableBorder {
6
- color: string;
7
- width: number;
8
- dash?: 'solid' | 'dash' | 'dot';
9
- }
10
- interface TableCellStyle {
11
- fill?: string;
12
- color?: string;
13
- bold?: boolean;
14
- align?: 'left' | 'center' | 'right';
15
- verticalAlign?: 'top' | 'middle' | 'bottom';
16
- padding?: Partial<Record<'top' | 'right' | 'bottom' | 'left', number>>;
17
- borders?: Partial<Record<'top' | 'right' | 'bottom' | 'left', TableBorder>>;
18
- }
19
- interface TableGridCell {
20
- input: unknown;
21
- value: unknown;
22
- style: TableCellStyle;
23
- row: number;
24
- column: number;
25
- rowSpan: number;
26
- colSpan: number;
27
- header: boolean;
28
- path: string;
29
- valuePath: string;
30
- }
31
- interface TableGridIssue {
32
- path: string;
33
- message: string;
34
- }
35
- interface TableGrid {
36
- rows: TableGridCell[][];
37
- columnCount: number;
38
- rowCount: number;
39
- hasHeaders: boolean;
40
- /** Anchor at each covered position; covered positions are not additional cells. */
41
- owners: (TableGridCell | undefined)[][];
42
- issues: TableGridIssue[];
43
- }
44
- declare function tableGrid(value: unknown, path?: string): TableGrid;
45
- /** Row boundaries that preserve every vertical merge, used by pagination. */
46
- declare function tableRowBoundaries(value: unknown): number[];
47
-
48
- /** The ticks of an automatic value axis: `ticks` runs from `min` to `max` in steps of `step`. */
49
- interface ChartScale {
50
- min: number;
51
- max: number;
52
- step: number;
53
- ticks: number[];
54
- }
55
- /**
56
- * The value axis of a chart: the bounds and the major unit (the distance between gridlines) in data units. A percent-stacked chart's axis
57
- * is a fraction (`max: 1` is 100%) and has `percent: true`, as PowerPoint stores it.
58
- */
59
- interface ChartValueAxis {
60
- min: number;
61
- max: number;
62
- majorUnit: number;
63
- percent?: true;
64
- }
65
- /**
66
- * RR-90: the chart text size a roomy chart asks for, in slide pixels at the 1280 x 720 reference (before the slide scale). It was 14,
67
- * floored to the 16 px (12 pt) minimum, beside 24 pt bullets; 20 px (15 pt) keeps the 4:5 ratio to the 25 px table body.
68
- */
69
- declare const CHART_TEXT_PX = 20;
70
- /** WI-5: the smallest chart text a box that has room for it draws, in slide pixels at the 1280 x 720 reference (it was the 16 px minimum). */
71
- declare const CHART_TEXT_FLOOR_PX = 18;
72
- /** WI-5: value-axis intervals are at least this far apart (reference pixels), so a short axis shows fewer ticks instead of a crowded scale. */
73
- declare const CHART_MIN_TICK_SPACING_PX = 48;
74
- /** WI-5: a value axis has at most this many intervals (nine labels), however long it is: 0 to 100% in fives is a scale, 0 to 90% in tens is a ruler. */
75
- declare const CHART_MAX_INTERVALS = 8;
76
- /**
77
- * RR-90: the unscaled chart text size for a chart box: {@link CHART_TEXT_PX}, shrunk only when the box is small (the text is at most
78
- * 1/18 of the box height and 1/30 of its width, whole pixels) and never below `minFontSize` (default 16). WI-5: a box with room for it
79
- * (at least 216 x 288 reference pixels) keeps {@link CHART_TEXT_FLOOR_PX} (18) as its floor, so a three-column or dashboard chart draws 18 px text
80
- * where it drew 16. `width` and `height` are the box in
81
- * canvas pixels and `scale` is `min(slide width, slide height) / 720`. The preview and the axis density both call it, so the
82
- * axis core computes matches the text the preview draws.
83
- */
84
- declare function chartTextSize(geometry: {
85
- width: number;
86
- height: number;
87
- scale: number;
88
- minFontSize?: number;
89
- }): number;
90
- /**
91
- * Office-like automatic value axis: include zero unless every value sits in the top sixth of the range, add 5% headroom, then choose
92
- * the smallest 1/2/5 x 10^k major unit that fits `maxIntervals` (default 10, at least 1). `percent` is the 100% stacked axis: 0 to 1 in
93
- * steps of 0.1, 0.2, 0.25, 0.5 or 1 (from -1 when a value is negative). Non-finite data bounds fall back to 0 to 1.
94
- */
95
- declare function niceScale(dataMin: number, dataMax: number, maxIntervals?: number, { percent }?: {
96
- percent?: boolean;
97
- }): ChartScale;
98
- /** How many intervals a value axis `length` pixels long can carry when each tick label needs `labelExtent` pixels: 1 to 10. */
99
- declare function maxIntervalsFor(length: number, labelExtent: number): number;
100
- /**
101
- * WI-5 (P19): how many intervals a chart's value axis `length` pixels long carries: {@link maxIntervalsFor} with a label extent of at least
102
- * {@link CHART_MIN_TICK_SPACING_PX} at the slide `scale`, and at most {@link CHART_MAX_INTERVALS}. A chart beside a text column
103
- * or one of three peer columns, whose axis is a few hundred pixels long, then draws 0 to 100% in steps of 20 and not 0 to 90% in steps of 10.
104
- */
105
- declare function chartIntervalsFor(length: number, labelExtent: number, scale: number): number;
106
- /**
107
- * Plotted extents per series point. Bars stack positive and negative values separately; lines and areas accumulate the signed sum.
108
- * 100% groupings divide by the category's sum of absolute values first. Throws a RangeError when a total leaves the finite range.
109
- */
110
- declare function stackCategoryValues(series: readonly {
111
- values: readonly (number | null)[];
112
- }[], count: number, kind: string, grouping: string, path?: string): ({
113
- value: number;
114
- from: number;
115
- to: number;
116
- } | null)[][];
117
- /** The slide geometry the axis density follows. All lengths are slide pixels. */
118
- interface ChartAxisGeometry {
119
- /** The chart box (after any caption band). */
120
- width: number;
121
- height: number;
122
- /** `min(slide width, slide height) / 720`. */
123
- scale: number;
124
- /** The composition's `minFontSize` (default 16), which the chart text never goes below. */
125
- minFontSize?: number;
126
- }
127
- /**
128
- * The value axis of a column, bar, line or area chart (`chart` is the chart object, `resolved` its `resolveChartData`), or undefined for any other type (or data with no plotted series).
129
- *
130
- * The axis is `niceScale` of the plotted extents (bars and areas include zero) with at most `maxIntervalsFor(length, label)` intervals.
131
- * `length` is the plot's extent along the value axis, estimated from the box the way the preview lays a chart with one line of
132
- * horizontal category labels out:
133
- *
134
- * - column, line, area: box height - 2 x pad - 1.5 x line height (the top margin plus the category labels), less one line height
135
- * for a category axis title and one line height plus a pad for a top or bottom legend (a one-row legend), over intervals
136
- * 1.2 line heights tall ({@link chartIntervalsFor}: at least 48 reference pixels, at most 8 intervals);
137
- * - bar: the width left of a category gutter of 30% of the box, minus the padding, over labels `4 x text size` wide.
138
- *
139
- * with pad = 10 x scale, text size = {@link chartTextSize} x scale and line height = 1.5 x text size. Rotated or
140
- * wrapped category labels, a wider tick label and a legend of several rows make the preview's plot shorter than this estimate; for
141
- * the usual chart (a plot of ten tick labels or more) all of them give the same ten intervals.
142
- */
143
- declare function chartValueAxis(chart: unknown, resolved: ResolvedChartData, geometry: ChartAxisGeometry): ChartValueAxis | undefined;
144
-
145
- /** The `design` keys that a layout record, the deck and a slide all share and that composition resolves per key. */
146
- declare const DESIGN_HINT_KEYS: readonly ["titleAlignment", "contentAlignment", "contentBox", "contentDirection", "chartPrimary", "imageFit", "listBullet", "mirror"];
147
- type DesignHintKey = typeof DESIGN_HINT_KEYS[number];
148
- /** The design keys a theme record may carry (`theme.design`), so a house style such as boxed content is set once. */
149
- declare const THEME_DESIGN_KEYS: readonly ["titleAlignment", "contentAlignment", "contentBox", "contentDirection", "imageFit", "listBullet"];
150
- /** Where an effective design hint came from: the slide's own `design`, the deck's `design`, the resolved theme record, or the slide's layout record. */
151
- type DesignHintSource = 'slide' | 'deck' | 'theme' | 'layout';
152
- /** The effective value of every shared design key. A key nobody sets is absent, so the engine default applies. */
153
- interface DesignHints {
154
- titleAlignment?: 'left' | 'center' | 'right';
155
- contentAlignment?: 'left' | 'center' | 'right';
156
- contentBox?: boolean;
157
- contentDirection?: 'horizontal' | 'vertical';
158
- chartPrimary?: 'none' | 'top' | 'bottom' | 'left' | 'right';
159
- imageFit?: 'cover' | 'contain' | 'stretch';
160
- listBullet?: 'character' | 'image' | 'none';
161
- /** A layout template drawn mirrored: each row's cells and the column sizes reversed (OPF 0.19). Logical, so a right-to-left deck mirrors on top. */
162
- mirror?: boolean;
163
- }
164
- /** The effective hints plus which level supplied each key and the document path that names it. */
165
- interface ResolvedDesignHints extends DesignHints {
166
- /** The level that supplied each key that is set. */
167
- sources: {
168
- [K in DesignHintKey]?: DesignHintSource;
169
- };
170
- /** Path of the supplying value: `slides.N.design.key`, `design.key`, for a theme the reference that selected it (`slides.N.design.theme` or `design.theme`), or for a layout `slides.N.layout` (the reference that selected the record). */
171
- paths: {
172
- [K in DesignHintKey]?: string;
173
- };
174
- }
175
- interface ResolveDesignHintsOptions {
176
- /** The slide, for its own `design`. */
177
- slide?: unknown;
178
- /** The slide's resolved layout record, for its `design`. */
179
- layout?: unknown;
180
- /** The slide's resolved theme record, for its `design` (THEME_DESIGN_KEYS only). */
181
- theme?: unknown;
182
- /** The document, for the deck's `design`. */
183
- presentation?: unknown;
184
- /** Index used in the reported paths; defaults to 0. */
185
- slideIndex?: number;
186
- /** Host-resolved deck-level values. They rank with the deck's `design`, above it, and below the slide's. */
187
- deck?: DesignHints;
188
- }
189
- /**
190
- * Resolves the shared design keys with one merge, per key, the slide winning: the slide's `design`, then the
191
- * deck's `design` (or the host's `deck` values), then the resolved theme record's `design` (THEME_DESIGN_KEYS only;
192
- * new in 0.19), then the resolved layout record's `design`. A key none of them
193
- * sets stays absent. A value the schema does not allow for its key is skipped, so the next level answers. Composition, the renderer, the PPTX exporter and the audit all take their values from here
194
- * (`SlideComposition.design`), so they cannot disagree.
195
- */
196
- declare function resolveDesignHints(options?: ResolveDesignHintsOptions): ResolvedDesignHints;
197
-
198
- /**
199
- * OPF layout templates (`opf-layout/v2`, FA-33): a layout record is one ordered list of regions, nested for two
200
- * dimensions. `direction` says whether the record's `regions` are placed side by side (`row`) or stacked (`column`); an
201
- * entry is a region (`name`, `size`, the content rules) or a split (`direction`, `regions`, `size`) that lays its own
202
- * regions out the other way. The list is the reading order. This module parses and checks a record and compiles the tree
203
- * into the grid the engine composes with (rows, columns, a cell grid of area names and the region rules); binding content
204
- * to regions is `bindRegions` (bind-regions.ts) and the geometry is `composeSlide`.
205
- *
206
- * A record is a template when it has `regions`.
207
- */
208
- /** The content kinds a region can accept: the body content kinds and `group` for a content group. */
209
- declare const REGION_KINDS: readonly ["text", "list", "image", "video", "chart", "table", "code", "metric", "quote", "timeline", "group"];
210
- type RegionKind = typeof REGION_KINDS[number];
211
- /** Which content a region wants first (content binding, step 2). */
212
- declare const REGION_ROLES: readonly ["primary", "secondary", "media", "supporting"];
213
- type RegionRole = typeof REGION_ROLES[number];
214
- /** How several blocks share a region. */
215
- declare const REGION_FLOWS: readonly ["none", "grid", "column", "auto"];
216
- type RegionFlow = typeof REGION_FLOWS[number];
217
- declare const REGION_ANCHORS: readonly ["top", "middle", "bottom"];
218
- type RegionAnchor = typeof REGION_ANCHORS[number];
219
- /** The two heading regions. They hold the slide's headings, take only a `size`, and have no content rules. */
220
- declare const HEADING_AREAS: readonly ["title", "subtitle"];
221
- /**
222
- * Names a body region may not take: the heading words, `auto`, and the six promoted-region words, so `region=` in the
223
- * Markdown dialect stays unambiguous. `title` and `subtitle` name the heading regions.
224
- */
225
- declare const RESERVED_REGION_NAMES: readonly ["title", "subtitle", "tag", "auto", "left", "center", "right", "top", "middle", "bottom"];
226
- /** The compiled grid has at most this many rows and this many columns. */
227
- declare const MAX_TEMPLATE_TRACKS = 12;
228
- /** A list of regions (the record's, or a split's) holds at most this many entries. */
229
- declare const MAX_REGION_ENTRIES = 12;
230
- /** Region lists nest at most this deep: the record's own list is level 1, a split's list level 2, a split inside it level 3. */
231
- declare const MAX_REGION_DEPTH = 3;
232
- /** A region holds at most this many blocks on one slide. */
233
- declare const MAX_REGION_BLOCKS = 12;
234
- /** The layout id no catalog may define: `layout: "auto"` is automatic composition. */
235
- declare const AUTO_LAYOUT = "auto";
236
- /** One region of a template with every default applied (an inherited `anchor` included). */
237
- interface LayoutRegion {
238
- name: string;
239
- accepts: RegionKind[];
240
- role: RegionRole;
241
- flow: RegionFlow;
242
- /** Blocks the region holds on one slide (1 for `flow: "none"`, else 6 unless set). */
243
- max: number;
244
- bleed: boolean;
245
- listColumns: 'auto' | 1;
246
- anchor: RegionAnchor;
247
- empty: 'collapse' | 'keep';
248
- }
249
- /** One named area of the compiled grid: its top-left cell and its span, in logical (left-to-right) columns. */
250
- interface LayoutArea {
251
- name: string;
252
- row: number;
253
- column: number;
254
- rowSpan: number;
255
- columnSpan: number;
256
- /** `title` or `subtitle`. */
257
- heading: boolean;
258
- }
259
- /** A parsed, checked and compiled template. */
260
- interface LayoutTemplate {
261
- /** Row track sizes: relative numbers, or `auto` for the height the row's content needs. */
262
- rows: (number | 'auto')[];
263
- /** Column track sizes, relative. */
264
- columns: number[];
265
- /** The cell grid: `grid[row][column]` is an area name. */
266
- grid: string[][];
267
- /** Every area, headings included, in reading order (the order of the record's region list, depth first). */
268
- areas: LayoutArea[];
269
- /** The body regions in reading order, with defaults applied. */
270
- regions: LayoutRegion[];
271
- /**
272
- * Where content no region accepts goes: `overflowRegion`, else the first primary region whose flow is not `none`.
273
- * Absent when the record names none and has no such region (the slide then draws it in an implicit row below the grid).
274
- */
275
- overflowRegion?: string;
276
- /** Whether the template has a `title` region and a `subtitle` region. */
277
- title: boolean;
278
- subtitle: boolean;
279
- /**
280
- * The record's `anchor` when it places the whole stack: the record is a column whose entries are all sized `auto` and its
281
- * `anchor` is `middle` or `bottom`. The stack, headings included, then sits in the content box's leftover height. Absent
282
- * otherwise (including `top`, where the stack starts at the top as it always did).
283
- */
284
- stack?: 'middle' | 'bottom';
285
- }
286
- /** A problem with a template: `layout-template` for the tree itself, `layout-region` for the regions. */
287
- interface LayoutTemplateIssue {
288
- code: 'layout-template' | 'layout-region';
289
- /** JSON Pointer inside the record (`/regions/1/regions/0/size`). */
290
- path: string;
291
- message: string;
292
- }
293
- /** Thrown by `layoutTemplate` (and so by `composeSlide`) for a record with a `layout-template` or `layout-region` finding. */
294
- declare class OPFLayoutTemplateError extends RangeError {
295
- readonly issues: LayoutTemplateIssue[];
296
- readonly code = "layout-template";
297
- constructor(issues: LayoutTemplateIssue[]);
298
- }
299
- /** Whether a layout record is a template (it has a `regions` list). */
300
- declare function isLayoutTemplate(layout: unknown): boolean;
301
- /** The region of `name` with every default applied; `value` is its entry in a `regions` list, `inherited` the `anchor` of the record or split it sits in. */
302
- declare function layoutRegion(name: string, value: unknown, inherited?: RegionAnchor): LayoutRegion;
303
- /** A region of the record in reading order, as `layoutEntries` lists it. */
304
- interface LayoutEntry {
305
- name: string;
306
- /** `title` or `subtitle`. */
307
- heading: boolean;
308
- /** The body region with its defaults and inherited `anchor` applied; absent for a heading. */
309
- region?: LayoutRegion;
310
- }
311
- /**
312
- * The regions of a record in reading order, read without checking the record (a tolerant walk for tools that describe a
313
- * record): headings and body regions with their rules, `anchor` inherited from the record and its splits.
314
- */
315
- declare function layoutEntries(layout: unknown): LayoutEntry[];
316
- /**
317
- * The problems `validate` reports for a template record (`opf/layout-template`, `opf/layout-region`): a `regions` list
318
- * that is not 1 to 12 entries, an entry that is neither a region nor a split, a bad `direction` or `size`, `auto` outside
319
- * a column, splits nested too deep, regions that compile to more than 12 rows or columns; a name used twice, a reserved
320
- * name, a heading region with content rules, a `subtitle` without `title`, `flow: "none"` with `max` other than 1,
321
- * a region that accepts nothing, an `overflowRegion` that is not a region. Empty for a valid template and for a record
322
- * that is not a template.
323
- */
324
- declare function layoutTemplateIssues(layout: unknown): LayoutTemplateIssue[];
325
- /** Parse, check and compile a template record. Throws OPFLayoutTemplateError for a record with a `layout-template` or `layout-region` issue. */
326
- declare function layoutTemplate(layout: unknown): LayoutTemplate;
327
-
328
- /**
329
- * Metric trend mark (RR-07, FA-06): the arrow and colour that show `metric.trend` and
330
- * `metric.sentiment` in the SVG preview and the PPTX export. Core's metric layout places the trend word (up, down, flat) as ordinary
331
- * text; this derives, from that accepted line geometry, one arrow beside it so both engines draw
332
- * the same shape in the same place and colour. The word stays the text alternative: the arrow
333
- * adds a visual cue and an `ariaLabel`, never rewritten source text. The arrow always points the
334
- * way the trend does; its colour (and the trend and delta text colour) follows the sentiment, which
335
- * defaults to the conventional reading of the trend (up positive, down negative, flat neutral).
336
- */
337
-
338
- type MetricTrend = 'up' | 'down' | 'flat';
339
- /** Whether a change is good news: the colour of the trend mark. */
340
- type MetricSentiment = 'positive' | 'negative' | 'neutral';
341
- /** The DrawingML preset geometry that draws each trend (`a:prstGeom prst`). */
342
- declare const METRIC_TREND_SHAPES: Readonly<Record<MetricTrend, 'upArrow' | 'downArrow' | 'rightArrow'>>;
343
- declare const METRIC_TREND_MIN_CONTRAST = 4.5;
344
- /** WI-5 (P18, decision D3): the contrast a metric value keeps on a dark surface when it takes its colour from the scheme. */
345
- declare const METRIC_VALUE_MIN_CONTRAST = 4.5;
346
- /**
347
- * The colour a metric value draws in: `color` (the scheme's primary), lifted with {@link legible} to {@link METRIC_VALUE_MIN_CONTRAST}
348
- * (4.5:1) against `background` when the background is dark ({@link isDarkColor}) and the colour falls short. A light surface and a colour that
349
- * already reaches 4.5:1 return `color` unchanged, and so does a value that is not an opaque hex (the palette is kept; only the
350
- * default blue on the default navy, 3.42:1, was in question). A metric value never has an explicit colour of its own, so the preview and the PPTX
351
- * export both call this for every value, with the same two inputs.
352
- */
353
- declare function metricValueColor(color: string, background: string): string;
354
- interface MetricTrendColorOptions {
355
- /** The slide background the metric text sits on. */
356
- background: string;
357
- /** Neutral colour for a neutral sentiment (the deck's muted text). */
358
- neutral?: string;
359
- /** Whether the change is good news; absent, the trend's default (up positive, down negative, flat neutral). */
360
- sentiment?: MetricSentiment;
361
- }
362
- /** The colour of a trend (or, with `options.sentiment`, of its sentiment), kept at >= 4.5:1 against the slide background. */
363
- declare function metricTrendColor(trend: MetricTrend, options: MetricTrendColorOptions): string;
364
- interface MetricTrendMark {
365
- trend: MetricTrend;
366
- /** The sentiment the colour follows: the metric's own, else the default for the trend. */
367
- sentiment: MetricSentiment;
368
- /** DrawingML preset name for native export. */
369
- shape: 'upArrow' | 'downArrow' | 'rightArrow';
370
- /** Arrow bounding box in layout pixels (96 per inch). */
371
- box: {
372
- x: number;
373
- y: number;
374
- width: number;
375
- height: number;
376
- };
377
- /** The arrow outline as polygon points in layout pixels: the preset geometry at default adjustments. */
378
- points: [number, number][];
379
- color: string;
380
- /** Text alternative for the arrow. */
381
- ariaLabel: string;
382
- /** Path of the trend field the mark belongs to. */
383
- path: string;
384
- }
385
- /** Outline of the DrawingML upArrow, downArrow or rightArrow preset (adj1 = adj2 = 50000) in `box`. */
386
- declare function metricTrendPoints(shape: MetricTrendMark['shape'], box: MetricTrendMark['box']): [number, number][];
387
- /**
388
- * The arrow for a laid-out metric, or undefined when the metric has no (visible) trend or the
389
- * arrow has no room. It is square, as tall as the trend word's capitals, on the baseline, and
390
- * sits after the word for left-aligned metrics and before it for centred or right-aligned ones,
391
- * so it grows away from the alignment edge. It never leaves the trend field's box. The colour
392
- * follows `options.sentiment`, else the layout's own (`metric.sentiment`), else the trend's default.
393
- */
394
- declare function metricTrendMark(layout: MetricLayout, options: MetricTrendColorOptions): MetricTrendMark | undefined;
395
-
396
- /** A positioned thing whose reading position is wanted. */
397
- interface ReadingBox {
398
- box: {
399
- x: number;
400
- y: number;
401
- width: number;
402
- height: number;
403
- };
404
- }
405
- /**
406
- * Visual reading order: rows from top to bottom, and within a row from the start to the end of the line.
407
- *
408
- * Items whose vertical centre falls inside an existing row's vertical extent join that row (so a full-height
409
- * item shares one row with everything beside it and the row reads left to right). Rows are ordered by their
410
- * top edge. Ties keep the input order, so the result is deterministic.
411
- *
412
- * The boxes are read as given: pass them in logical (unmirrored) coordinates and the order is the reading
413
- * order of both a left-to-right and a right-to-left deck, because mirroring a deck moves where an item is
414
- * drawn and where a line starts together. For boxes that are already mirrored, pass `direction: 'rtl'` to
415
- * order each row from right to left. composeSlide uses this for promoted regions and `opf/reading-order` uses it to
416
- * check the composed order, so the two cannot drift apart.
417
- */
418
- declare function visualReadingOrder<T extends ReadingBox>(items: readonly T[], direction?: 'ltr' | 'rtl'): T[];
419
-
420
- /**
421
- * Intrinsic aspect ratio (width / height) of an image source, read without fetching: an embedded
422
- * `data:` URI (PNG, JPEG, GIF, WebP, SVG), or an `asset:<id>` reference to one in `assets`.
423
- * Any other source (a URL or file path) has no readable dimensions here and returns undefined;
424
- * hosts resolve those themselves.
425
- *
426
- * Only a bounded prefix of the payload is decoded (never the whole of a multi-megabyte logo): 64 KiB, which
427
- * holds every PNG, GIF and WebP header and the root `<svg>` tag of any real SVG, then 1 MiB for a JPEG whose
428
- * start-of-frame segment sits behind large EXIF or ICC data. A JPEG whose frame header is still not inside
429
- * 1 MiB, or an SVG whose root tag is not inside 64 KiB, has no readable proportions (undefined, so a square
430
- * box). Results are memoized per source string, so a deck's repeated header image is read once.
431
- */
432
- type Dimensions = {
433
- width: number;
434
- height: number;
435
- };
436
- /** Whether the value is an embedded raster or SVG image whose size is readable, and its pixel size (SVG: its user-unit size). */
437
- declare function intrinsicImageSize(value: unknown, assets?: unknown): (Dimensions & {
438
- svg: boolean;
439
- }) | undefined;
440
- /** Width / height of an embedded image, following `asset:<id>` references through `assets`; undefined when unreadable. */
441
- declare function intrinsicImageAspect(value: unknown, assets?: unknown): number | undefined;
442
-
443
- /**
444
- * Text direction primitives shared by composition, the renderer and the PPTX exporter (RR-05).
445
- * Pure: no fonts, DOM or catalogs. Deck direction comes from the presentation language's script
446
- * (script-fonts.ts); a paragraph's own direction comes from its first strong character.
447
- */
448
- /** Paragraph base direction. */
449
- type TextDirection = "ltr" | "rtl";
450
- /**
451
- * The base direction of one paragraph in a deck, shared by the renderer and
452
- * the PPTX exporter so preview and export agree. In a right-to-left deck a
453
- * paragraph is right-to-left when its first strong character is
454
- * right-to-left, or when it has no strong character (digits, punctuation or
455
- * empty text); a paragraph whose first strong character is left-to-right
456
- * (for example an English quote or code) stays left-to-right. In a
457
- * left-to-right deck every paragraph is left-to-right.
458
- *
459
- * Strong characters follow UAX #9 rule P2: text inside directional isolates
460
- * (LRI, RLI or FSI up to the matching PDI) is skipped. Letters count as
461
- * strong; RTL letters are those of right-to-left scripts. The result does not
462
- * depend on locale data, only on the JavaScript engine's Unicode tables.
463
- */
464
- declare function paragraphDirection(text: string, deckDirection: TextDirection | string | undefined): TextDirection;
465
- /** Horizontal alignment as drawn: the physical left, centre or right of the text box. */
466
- type PhysicalAlignment = "left" | "center" | "right";
467
- /**
468
- * Authored alignment is logical for right-to-left text (RR-05): `left` means the start edge and
469
- * `right` the end edge, so in a right-to-left paragraph `left` is drawn at the right edge and
470
- * `right` at the left edge. `center` is unchanged, and so is every left-to-right paragraph.
471
- */
472
- declare function physicalAlignment(alignment: PhysicalAlignment | undefined, direction: TextDirection | undefined): PhysicalAlignment;
473
- /**
474
- * The base direction at a UTF-16 offset of `text`, where paragraphs are the segments between hard
475
- * line breaks (CR, LF or CRLF). Every wrapped line of a paragraph shares its direction, so a
476
- * line made only of Latin words or digits never changes the paragraph it belongs to.
477
- */
478
- declare function paragraphDirectionAt(text: string, deckDirection: TextDirection | string | undefined): (offset: number) => TextDirection;
479
-
480
- /**
481
- * Language/script font model (font-fidelity-everywhere FF-18).
482
- *
483
- * Resolves, for a presentation's language and effective font scheme, the font
484
- * family for each OOXML script slot (`a:latin`, `a:ea`, `a:cs`) of the major
485
- * (heading) and minor (body) theme fonts, plus the language tags and base
486
- * direction. Pure: no DOM, fonts, network or mutation. Font-scheme references
487
- * resolve like every content reference (the document's catalogs groups, then the
488
- * registered catalogs); nothing is fetched.
489
- *
490
- * The language is an engine vocabulary: tags the vocabulary knows resolve
491
- * deterministically from vendored tables. Only a tag outside it may consult the
492
- * runtime's ICU likely subtags (`Intl.Locale#maximize`) to find its script.
493
- *
494
- * Design: docs/programs/font-fidelity-everywhere/script-font-model.md.
495
- */
496
- /** OOXML script slot a writing system uses: `a:latin`, `a:ea` or `a:cs`. */
497
- type ScriptRole = "latin" | "eastAsian" | "complexScript";
498
- /** FontScheme.languageFamily as written: the short OOXML names and the long slot names are one value. */
499
- type LanguageFamilyName = "latin" | "ea" | "cs" | "eastAsian" | "complexScript";
500
- /**
501
- * Read a FontScheme `languageFamily` as one of three values. `eastAsian` is `ea` and `complexScript` is
502
- * `cs`; anything that is not one of the five names returns undefined.
503
- */
504
- declare function normalizeLanguageFamily(value: unknown): "latin" | "ea" | "cs" | undefined;
505
- /** Target application whose language font-scheme defaults apply. */
506
- type ScriptFontApp = "powerpoint" | "google-slides";
507
- /** Font family per OOXML script slot for one theme font (major or minor). */
508
- interface ScriptFontSlots {
509
- latin: string;
510
- eastAsian: string;
511
- complexScript: string;
512
- }
513
- /**
514
- * Where a resolved eastAsian/complexScript family came from:
515
- * - `fontScheme`: an explicit `eastAsian`/`complexScript` slot on the effective design font scheme.
516
- * - `schemeFamily`: the design font scheme's own major/minor, because its `languageFamily` names this
517
- * slot and its `languages` list is empty or names the presentation language.
518
- * - `language`: the presentation language's font scheme (`fontScheme`, or `googleFontScheme` for Google Slides).
519
- * - `latin`: no script-specific choice exists, so the slot repeats the latin family.
520
- */
521
- type ScriptFontSource = "fontScheme" | "schemeFamily" | "language" | "latin";
522
- /** A per-script supplemental theme font, as in OOXML `<a:font script="Jpan" typeface="..."/>`. */
523
- interface ScriptFontSupplement {
524
- /** OOXML theme script tag (ISO 15924, except Korean uses `Hang`). */
525
- script: string;
526
- heading: string;
527
- body: string;
528
- }
529
- interface ResolveScriptFontsOptions extends CatalogOptions {
530
- /** Which language font default applies. Defaults to `powerpoint` (`language.fontScheme`, else the vocabulary default); `google-slides` prefers `language.googleFontScheme`. */
531
- app?: ScriptFontApp;
532
- /** Merge `slides[slideIndex].design` over the deck design, per field, before resolving the font scheme. */
533
- slideIndex?: number;
534
- /** Language to resolve instead of the document's `language` (a BCP-47 tag or a Language object). */
535
- language?: unknown;
536
- /** Language tag used when neither the document nor `options.language` names a resolvable language. Defaults to `en-US`. */
537
- defaultLanguage?: string;
538
- }
539
- interface ResolvedScriptFonts extends ScriptFontSlots {
540
- /**
541
- * Tag for OOXML `a:rPr/@lang` (and `a:endParaRPr/@lang`): an authored tag that carries a region,
542
- * else the curated `ooxmlLang` of the language vocabulary, else the canonical BCP-47 tag.
543
- */
544
- lang: string;
545
- /** Canonically cased BCP-47 tag for HTML/SVG `lang`: the authored tag. */
546
- bcp47: string;
547
- /** `default` when the tag came from `defaultLanguage` because no language resolved. */
548
- languageSource: "document" | "option" | "default";
549
- /** ISO 15924 script (`Zzzz` when it cannot be determined). */
550
- script: string;
551
- /** Script slot the language's own text uses. */
552
- scriptRole: ScriptRole;
553
- direction: "ltr" | "rtl";
554
- rtl: boolean;
555
- /** Major (heading) theme font slots. */
556
- heading: ScriptFontSlots;
557
- /** Minor (body) theme font slots. The top-level latin/eastAsian/complexScript repeat these. */
558
- body: ScriptFontSlots;
559
- /**
560
- * Supplemental theme font for the language's script. Present only when an explicit slot, the
561
- * design scheme's own script family or the language's font scheme supplies one; absent for
562
- * Latin, Cyrillic, Greek and for scripts with no script font. For Armenian, Georgian and
563
- * Ethiopic (latin slot) an explicit `complexScript` slot or a design `cs` scheme that serves the
564
- * language replaces the language's own font scheme.
565
- */
566
- supplement?: ScriptFontSupplement;
567
- sources: {
568
- eastAsian: ScriptFontSource;
569
- complexScript: ScriptFontSource;
570
- };
571
- }
572
- /**
573
- * One slide's script profile, as a host's script planner reads it (`TextMeasurement.forScripts`): the heading and
574
- * body families per script slot, where a slot whose `resolveScriptFonts` source is `latin` or `schemeFamily` names
575
- * the slide's latin role family, and the language fields of `resolveScriptFonts`. Without a resolvable language
576
- * only the slots (all latin), `script: "Zzzz"`, `rtl` and `serif` are present.
577
- */
578
- interface ScriptMeasurementProfile {
579
- heading: ScriptFontSlots;
580
- body: ScriptFontSlots;
581
- supplement?: ScriptFontSupplement;
582
- script: string;
583
- scriptRole?: ScriptRole;
584
- bcp47?: string;
585
- lang?: string;
586
- languageSource?: ResolvedScriptFonts["languageSource"];
587
- direction?: "ltr" | "rtl";
588
- rtl: boolean;
589
- /** The slide's font scheme is a serif scheme (`type: "serif"`): script runs prefer serif replacements. */
590
- serif: boolean;
591
- }
592
-
593
- /** The OOXML script slot for an ISO 15924 script code. Unknown scripts use the latin slot. */
594
- declare function scriptFontRole(script: string): ScriptRole;
595
- /**
596
- * Resolve the per-script theme fonts, language tags and direction for a
597
- * presentation (or a `{ design, language, catalogs }` subset of one).
598
- *
599
- * The latin slot follows the effective design font scheme exactly as
600
- * `resolveFontFamilies` does; when nothing names a font scheme it falls back to
601
- * the engine default font scheme. Each of the eastAsian and complexScript slots
602
- * takes, in order: the design font scheme's explicit slot; the scheme's own
603
- * families when its `languageFamily` names the slot and its `languages` list
604
- * is empty or names the language; the language's font scheme when the
605
- * language's script uses the slot; otherwise the latin family.
606
- */
607
- declare function resolveScriptFonts(input: unknown, options?: ResolveScriptFontsOptions): ResolvedScriptFonts;
608
- /**
609
- * The deck base direction composition lays a slide out in: the direction of the presentation language's script
610
- * (`rtl` for Arabic, Hebrew and the other right-to-left scripts), `ltr` when the document names no language or
611
- * the language does not resolve. Layout, preview and export all read this one value (RR-05).
612
- */
613
- declare function resolveSlideDirection(presentation: unknown, slideIndex?: number): "ltr" | "rtl";
614
-
615
- /**
616
- * Engine defaults and engine vocabularies (OPF 0.15, FA-20/21). Small tables of values every engine must know to
617
- * draw, compiled from spec/reference/engine-defaults.json and spec/reference/engine-vocabularies.json. None of
618
- * this is catalog data: a document never references these records, and no catalog lookup reaches them.
619
- */
620
- type Rec = Readonly<Record<string, unknown>>;
621
- /** The drawing fields of the theme engines use when a document names none, or its theme resolves nowhere. */
622
- declare const ENGINE_DEFAULT_THEME: Rec;
623
- /** The twelve slots engines use when neither the design nor the theme names a resolvable colour scheme. */
624
- declare const ENGINE_DEFAULT_COLOR_SCHEME: Rec;
625
- /** The font pair engines use when neither the design nor the theme names a resolvable font scheme. */
626
- declare const ENGINE_DEFAULT_FONT_SCHEME: Rec;
627
- /** Chart types in the order an engine offers them when it must pick one. */
628
- declare const ENGINE_DEFAULT_CHART_TYPES: readonly string[];
629
- /** Every `chart.type` value: an engine vocabulary, validated directly. */
630
- declare const CHART_TYPES: readonly string[];
631
- /** How an engine links a handle on one social platform. */
632
- interface SocialPlatformVocabulary {
633
- readonly baseUrl?: string;
634
- /** URL of a person's profile, with `{handle}` standing for the handle. */
635
- readonly profileUrlPattern?: string;
636
- /** URL of an organization's page, when the platform has a separate one. */
637
- readonly companyUrlPattern?: string;
638
- /** Prefix a handle is written with (`@` on X). */
639
- readonly handlePrefix?: string;
640
- }
641
- /** The keys of `Organization.socials` and `Speaker.socials`: an engine vocabulary, validated directly. */
642
- declare const SOCIAL_PLATFORMS: Readonly<Record<string, SocialPlatformVocabulary>>;
643
- /** What engines know about one language tag. */
644
- interface LanguageVocabulary {
645
- /** BCP-47 tag, canonically cased. */
646
- readonly tag: string;
647
- /** ISO 15924 script. */
648
- readonly script: string;
649
- readonly direction: 'ltr' | 'rtl';
650
- /** Curated OOXML culture tag (`ja-JP` for `ja`). */
651
- readonly ooxmlLang: string;
652
- /** Default script fonts (major/minor) per target application. */
653
- readonly fonts: {
654
- readonly powerpoint: {
655
- readonly major: string;
656
- readonly minor: string;
657
- };
658
- readonly google: {
659
- readonly major: string;
660
- readonly minor: string;
661
- };
662
- };
663
- }
664
- /** The language tags engines know the script, direction, OOXML tag and default script fonts of. */
665
- declare const LANGUAGES: readonly LanguageVocabulary[];
666
-
667
- /**
668
- * Numbered lists: the `numbering` field of `items` and `bullets` payloads.
669
- *
670
- * Pure helpers shared by composition (marker text and hanging indent), the validator, pagination and the
671
- * exporters, so the preview and the native PowerPoint export number every entry identically. Nothing here
672
- * measures text or reads a document beyond the items it is given.
673
- */
674
- /** The five number styles OPF supports; each maps to a native PowerPoint auto-number scheme. */
675
- declare const NUMBERING_STYLES: readonly ["arabic", "roman-upper", "roman-lower", "alpha-upper", "alpha-lower"];
676
- type NumberingStyleName = typeof NUMBERING_STYLES[number];
677
- /** `period` draws `1.`, `paren` draws `1)` and `paren-both` draws `(1)`. */
678
- declare const NUMBERING_SUFFIXES: readonly ["period", "paren", "paren-both"];
679
- type NumberingSuffix = typeof NUMBERING_SUFFIXES[number];
680
- /** Object form of one level's numbering. Every field is optional. */
681
- interface Numbering {
682
- /** Default `arabic`. */
683
- style?: NumberingStyleName;
684
- /** First number of the level, an integer from 1 to 32767 (the native `startAt` range). Default 1. */
685
- start?: number;
686
- /** Default `period`. */
687
- suffix?: NumberingSuffix;
688
- }
689
- /**
690
- * The `numbering` field: one style name, one {@link Numbering} object (both apply to every level) or an array with
691
- * one entry per list level (index = level; the last entry repeats for deeper levels).
692
- */
693
- type NumberingInput = NumberingStyleName | Numbering | readonly (NumberingStyleName | Numbering)[];
694
- /** One level's numbering with every default applied. */
695
- interface ResolvedNumbering {
696
- style: NumberingStyleName;
697
- start: number;
698
- suffix: NumberingSuffix;
699
- }
700
- /** Largest value a native auto-number can start at (`a:buAutoNum@startAt`, ST_TextStartAt). */
701
- declare const MAX_NUMBERING_VALUE = 32767;
702
- /** Largest value drawn as a Roman numeral; larger values are drawn in arabic. */
703
- declare const MAX_ROMAN_VALUE = 3999;
704
- /** Deepest list level a native paragraph can carry (`a:pPr@lvl` is 0 to 8). */
705
- declare const MAX_NUMBERING_LEVELS = 9;
706
- /**
707
- * Resolve a `numbering` value to one entry per authored level (a single entry when it applies to every level).
708
- * Use {@link numberingAtLevel} to read the entry for a level. Throws on a value the schema rejects.
709
- */
710
- declare function resolveNumbering(input: NumberingInput): ResolvedNumbering[];
711
- /** The numbering of one list level: the entry at that index, else the last entry. */
712
- declare function numberingAtLevel(levels: readonly ResolvedNumbering[], level: number): ResolvedNumbering;
713
- /** Whether `style` can draw `value` as that style (Roman numerals stop at 3999). */
714
- declare function numberingStyleDraws(style: NumberingStyleName, value: number): boolean;
715
- /**
716
- * Format a list number as the preview draws it and PowerPoint's matching `a:buAutoNum` scheme draws it:
717
- * `formatListNumber(4, 'roman-lower')` is `iv.`, `(3, 'alpha-upper', 'paren')` is `C)` and `(27, 'alpha-lower')` is `aa.`.
718
- * Roman values above 3999 fall back to arabic (see {@link listNumbers} for the reported adaptation).
719
- */
720
- declare function formatListNumber(value: number, style?: NumberingStyleName, suffix?: NumberingSuffix): string;
721
- /** The number of one list entry. */
722
- interface ListNumber {
723
- /** Position of the entry in the list. */
724
- index: number;
725
- level: number;
726
- /** The counted number (1 or more). */
727
- value: number;
728
- /** The style actually drawn: `arabic` when the authored style cannot draw `value`. */
729
- style: NumberingStyleName;
730
- suffix: NumberingSuffix;
731
- /** The drawn marker, for example `iv.`. */
732
- text: string;
733
- /** Why the drawn style differs from the authored one: Roman numerals stop at 3999. */
734
- adapted?: 'roman-range';
735
- }
736
- /**
737
- * The numbers of a list, counted as PowerPoint counts them: consecutive entries of one level count up from that
738
- * level's `start`; an entry of a shallower level restarts every deeper level; deeper entries between two entries of
739
- * one level do not interrupt it. An object item's own `start` (an integer from 1 to 32767) restarts the count at that
740
- * entry. Items are read for their `level` and `start` only.
741
- */
742
- declare function listNumbers(items: readonly unknown[], numbering: NumberingInput): ListNumber[];
743
- /**
744
- * The slice `items[from, to)` of a numbered list as the items of a continuation, with `start` set on every entry whose
745
- * number would otherwise change, so a paginated list keeps the numbers of the whole list.
746
- */
747
- declare function sliceNumberedItems<T>(items: readonly T[], numbering: NumberingInput, from: number, to?: number): T[];
748
-
749
- /**
750
- * Deterministic header/footer field formatting. Nothing here consults a clock,
751
- * the host locale or the host time zone: dates are calendar dates supplied by the
752
- * document or the host, and month/weekday names are fixed English names.
753
- */
754
- /** A live field inside displayed furniture text, as half-open UTF-16 offsets into the part's `text`. */
755
- interface FurnitureField {
756
- type: 'slideNumber' | 'date';
757
- start: number;
758
- end: number;
759
- /** Resolved date pattern for a current (`date: true`) date. */
760
- format?: string;
761
- }
762
- /** PowerPoint's first Insert > Date and Time choice for en-US (`datetime1`). */
763
- declare const DEFAULT_FURNITURE_DATE_FORMAT = "M/d/yyyy";
764
- /** Format an ISO calendar date with an LDML-style pattern. Returns an error message when either input is unsupported. */
765
- declare function formatFurnitureDate(iso: string, pattern: string): {
766
- text: string;
767
- } | {
768
- error: string;
769
- };
770
-
771
- /**
772
- * Organization logos (RR-71, OPF 0.18): every logo lives on an organization, in up to four shapes, each optionally
773
- * split by the background it is drawn on. One resolution rule for every consumer: the cover and section logo, picture
774
- * bullets, and the slide-scoped built-in references `var:organization.logo[.<shape>]` and
775
- * `var:organization.<id>.logo[.<shape>]` in any image field (zone `image`, image blocks, slide `image`).
776
- * Pure: no I/O; colors are never inspected (the host's dark-background test picks `onDark`).
777
- * See docs/templates-and-variables.md and docs/design-resolution.md.
778
- */
779
- /** The logo shapes an organization can provide, in picker order. */
780
- declare const LOGO_SHAPES: readonly ["full", "stacked", "icon", "wordmark"];
781
- type LogoShape = (typeof LOGO_SHAPES)[number];
782
- /** Which value of a shape was drawn: `onLight` or `onDark` from a split shape, `default` for a single asset. */
783
- type LogoVariant = "onLight" | "onDark" | "default";
784
- /** A logo asset chosen by resolveLogo. */
785
- interface ResolvedLogo {
786
- /** The asset as authored (a string or an Asset object). */
787
- source: unknown;
788
- /** OPF path of the chosen value: `organization.logo`, `organization.1.logo.icon`, `organization.logo.full.onDark`. */
789
- path: string;
790
- /** The shape that was asked for (after a `design.logo` override); `path` shows the shape that supplied it. */
791
- shape: LogoShape;
792
- variant: LogoVariant;
793
- /** The canonical slide-scoped reference for this logo: `var:organization.logo`, `var:organization.beta.logo.icon`. */
794
- reference: string;
795
- /** The `design.logo` override that chose the organization or shape (`design.logo`, `slides.3.design.logo`), when one did. */
796
- designPath?: string;
797
- }
798
- interface ResolveLogoOptions {
799
- /** The shape the consumer draws when no override names one; defaults to `full` (covers). Picture bullets ask for `icon`. */
800
- shape?: LogoShape;
801
- /** True on a dark background (host luminance test): `onDark` values first, then `onLight`. */
802
- onDark?: boolean;
803
- /** Index used in the `slides.N.design.logo` path of a slide-level override; defaults to 0. */
804
- slideIndex?: number;
805
- /** Resolve this reference (`var:organization.beta.logo.icon`, with or without `var:`) instead of the design.logo chain. */
806
- reference?: string;
807
- }
808
- /**
809
- * Resolve the logo a slide should draw, the same way in every engine (OPF 0.18, RR-71). Logos live on the
810
- * organization (`Organization.logo`: one asset, or `{ full, stacked, icon, wordmark }`, each an asset or
811
- * `{ onLight, onDark }`). Which one:
812
- *
813
- * 1. `options.reference`, when given (`var:organization.beta.logo.icon`);
814
- * 2. else the slide's `design.logo`, then the deck's: `false` draws no logo, and a logo reference
815
- * (`var:organization.beta.logo`, `var:organization.logo.wordmark`) picks the organization and, when it names one,
816
- * the shape (a named shape wins over `options.shape`);
817
- * 3. else the primary organization (`role: 'primary'`, else the first).
818
- *
819
- * The shape is `options.shape` (default `full`) unless the reference names one; a missing shape falls back to `full`,
820
- * and `full` to the first defined of `wordmark`, `stacked`, `icon`. Within a shape, `onDark` is preferred on a dark
821
- * background and `onLight` otherwise, and a missing one uses the other. Returns null when no logo resolves (including
822
- * an override that names an organization without a logo: the override never falls back to another organization).
823
- */
824
- declare function resolveLogo(presentation: unknown, slide: unknown, options?: ResolveLogoOptions): ResolvedLogo | null;
825
-
826
- /** Normalize a literal hex color to uppercase #RRGGBB. */
827
- declare function normalizeHexColor(value: unknown): string | undefined;
828
- type ResolveColorRefRoles = Partial<Record<'primary' | 'secondary' | 'accent' | 'background' | 'surface' | 'surfaceAlt' | 'text' | 'textSecondary', string>>;
829
- interface ResolveColorRefOptions {
830
- /** Effective color scheme after design resolution (OOXML slots plus optional role hex overrides). */
831
- colorScheme: Record<string, unknown>;
832
- /** Optional resolved chrome colors (e.g. renderer `design.colors` with `textSecondary` mapped to `mutedText`). */
833
- roles?: ResolveColorRefRoles;
834
- /** Top-level presentation `variables` map. */
835
- variables?: Record<string, unknown>;
836
- /** Theme text color returned when a reference cannot be resolved. */
837
- fallback: string;
838
- }
839
- /** Resolve a ColorRef or TextRun.color string to a literal hex color. */
840
- declare function resolveColorRef(reference: string, options: ResolveColorRefOptions): string;
841
- /** WCAG relative luminance below which a slide background counts as dark (the point where white and black text contrast equally). */
842
- declare const DARK_BACKGROUND_LUMINANCE = 0.179;
843
- /** True when text on this color should be light: its relative luminance is under {@link DARK_BACKGROUND_LUMINANCE}. An unreadable color is not dark. */
844
- declare function isDarkColor(color: unknown): boolean;
845
- /**
846
- * The slide background a color scheme implies when the design names no single-color background: the scheme's
847
- * `background` role override, else its light1 slot, else white. Gradient and picture backgrounds use it too.
848
- */
849
- declare function defaultSlideBackground(colorScheme: Record<string, unknown>): string;
850
- /** The four slots a variant can use as the slide background. */
851
- type ColorVariantBackground = 'light1' | 'light2' | 'dark1' | 'dark2';
852
- type ColorAccentSlot = 'accent1' | 'accent2' | 'accent3' | 'accent4' | 'accent5' | 'accent6';
853
- /**
854
- * A variant of the deck's single colour scheme: which slot is the background (and so which are the text and the alternate surface),
855
- * and optionally the order of the accents. It is a mapping over the scheme's twelve slots, as PowerPoint's `clrMap` is, never a second
856
- * scheme: nothing in it is a colour.
857
- */
858
- interface ColorVariant {
859
- background: ColorVariantBackground;
860
- /** A permutation of `accent1` to `accent6`: entry `i` is the scheme slot drawn as accent `i + 1`. Default: the scheme's own order. */
861
- accents?: readonly ColorAccentSlot[];
862
- }
863
- /** The slots the roles bg1, tx1, bg2 and tx2 and the six accents point at (OOXML `clrMap`, with `lt1` named `light1` and so on). */
864
- interface ColorMap {
865
- bg1: ColorVariantBackground;
866
- tx1: ColorVariantBackground;
867
- bg2: ColorVariantBackground;
868
- tx2: ColorVariantBackground;
869
- accents: readonly ColorAccentSlot[];
870
- }
871
- /** A variant as authored: the background slot alone (`"dark1"`, the same as `{ "background": "dark1" }`), or the object form, which is needed only for an accent order. */
872
- type ColorVariantInput = ColorVariantBackground | ColorVariant;
873
- /** The variant an authored value stands for, always the normalized object form, or undefined for a value that is not a variant: a background slot string, or an object with a background slot and, when given, a permutation of the six accent slots. */
874
- declare function normalizeColorVariant(value: unknown): ColorVariant | undefined;
875
- /** True for a well formed variant in either form (see {@link normalizeColorVariant}). */
876
- declare function isColorVariant(value: unknown): value is ColorVariantInput;
877
- /**
878
- * The map a variant stands for: `light1` is the default map (bg1 = light1, tx1 = dark1, bg2 = light2, tx2 = dark2); `dark1` swaps
879
- * light and dark; `light2` and `dark2` make that slot both the background and the alternate surface (bg2, as a slide with that theme
880
- * background has always had it, which keeps the default theme's dark2 background unchanged), with the text of the family's side. No variant is `light1`.
881
- */
882
- declare function colorMapFor(variant?: ColorVariantInput): ColorMap;
883
- /**
884
- * The attributes of PowerPoint's `<p:clrMap>` for a map (`bg1="lt1" tx1="dk1" bg2="lt2" tx2="dk2" accent1="accent1" ...` and the two
885
- * hyperlink slots unchanged), so the PPTX export writes the master map and a slide's `clrMapOvr` from the same data the preview reads.
886
- */
887
- declare function clrMapAttributes(map: ColorMap): Record<string, string>;
888
- /**
889
- * A scheme colour as the PPTX export writes it and the preview draws it: `slot` is the colour role or slot (`tx1`, `bg1`, `bg2`, `tx2`,
890
- * `accent1` ...), `lumMod` and `lumOff` are DrawingML luminance transforms in thousandths of a percent (`lumMod 15000, lumOff 85000` is
891
- * 15% of the slot's luminance plus 85%), `alpha` an opacity in the same unit, and `hex` is the colour the transforms give for the
892
- * resolved scheme, so a preview that draws `hex` and a PPTX that writes `<a:schemeClr val={slot}>` with the transforms show the same colour.
893
- */
894
- interface SchemeColor {
895
- slot: string;
896
- hex: string;
897
- lumMod?: number;
898
- lumOff?: number;
899
- alpha?: number;
900
- }
901
- /** The colour a `lumMod`/`lumOff` pair (thousandths of a percent) makes of `hex`: its HSL luminance times `lumMod`, plus `lumOff`. */
902
- declare function applyLuminance(hex: string, lumMod?: number, lumOff?: number): string;
903
- /** Shares of the text colour (tx1) mixed into the background (bg1) for the neutrals, PowerPoint's chart-style values. */
904
- declare const NEUTRAL_SHARES: {
905
- readonly border: 0.2;
906
- readonly gridline: 0.15;
907
- readonly axisLine: 0.25;
908
- readonly chartText: 0.65;
909
- readonly codeComment: 0.65;
910
- };
911
- /**
912
- * The colours OPF draws that are neither text nor an accent, all derived from the scheme through the variant's map, so a dark variant
913
- * gets light lines and a change of variant or background style in PowerPoint recolours them.
914
- */
915
- interface SchemeNeutrals {
916
- /** Quiet structural rules, card borders and table borders: tx1 at {@link NEUTRAL_SHARES}.border over bg1. */
917
- border: SchemeColor;
918
- /** Chart gridlines: tx1 at 15%. */
919
- gridline: SchemeColor;
920
- /** Chart axis lines: tx1 at 25%. */
921
- axisLine: SchemeColor;
922
- /** Chart axis labels and legend text where the chart does not use the slide text colour: tx1 at 65%. */
923
- chartText: SchemeColor;
924
- /** Pie and treemap outlines, the video play icon and anything drawn on top of a mark: bg1. */
925
- outline: SchemeColor;
926
- /** The neutral metric trend (no good or bad news): tx2. */
927
- trendNeutral: SchemeColor;
928
- /** The code panel: tx1 (a dark panel) on a light variant, bg2 on a dark one, so a code block is a dark card on either. */
929
- codePanel: SchemeColor;
930
- /** Plain code text: bg1 or tx1, whichever reads better on the panel. */
931
- codeText: SchemeColor;
932
- /** Code comments and line numbers: the code text at 65% over the panel. */
933
- codeComment: SchemeColor;
934
- }
935
- interface ResolvedColorRoles {
936
- /** Role override, else the first accent of the variant (accent1 by default). */
937
- primary: string;
938
- /** Role override, else the second accent of the variant (accent2 by default). */
939
- secondary: string;
940
- /** Role override, else the third accent of the variant (accent3 by default). */
941
- accent: string;
942
- /** The slide background: the resolved single-color background of the slide, else the variant's bg1 (light1 by default; see {@link defaultSlideBackground}). */
943
- background: string;
944
- /** Role override, else bg2 of the variant (light2 on a light slide, dark2 on a dark one). */
945
- surface: string;
946
- /** The alternate surface of banded table rows: {@link surfaceAltColor} of `surface` and `text`, always distinguishable from `surface`. */
947
- surfaceAlt: string;
948
- /** Default text: tx1 of the variant (light1 on a dark background). On a light background the `text` role override, else dark1. */
949
- text: string;
950
- /** Role override, else tx2 of the variant (light2 on a dark background and dark2 on a light one). */
951
- textSecondary: string;
952
- /** The color of a link run that sets no color of its own: the scheme's hyperlink slot (OOXML hlink), unless that has under 4.5:1 contrast against the slide background, then the slide `text` color. */
953
- hyperlink: string;
954
- /** Followed-hyperlink slot (OOXML folHlink). */
955
- followedHyperlink: string;
956
- /** Quiet structural rules/cards: `neutrals.border.hex`, tx1 mixed into bg1. Authored borders still resolve their own ColorRef. */
957
- border: string;
958
- /** Whether the slide background is dark; text, surface and textSecondary defaults follow it. */
959
- dark: boolean;
960
- /** The variant these roles were resolved with: the one given, else the one the background's luminance (or tone) implies. */
961
- variant: ColorVariant;
962
- /** The map behind the roles (bg1, tx1, bg2, tx2 and the accent order), for PPTX `clrMap` and `clrMapOvr` ({@link clrMapAttributes}). */
963
- map: ColorMap;
964
- /** The six accent colours in the variant's order (primary, secondary and accent are the first three unless overridden). */
965
- accents: string[];
966
- /** Every neutral derived from the scheme, with its slot and luminance transform for `schemeClr` export. */
967
- neutrals: SchemeNeutrals;
968
- }
969
- interface ResolveColorRolesOptions {
970
- /** The slide's resolved single-color background (solid, theme-slot or pattern background color). Omit for a gradient, picture or no background. */
971
- background?: string | null;
972
- /** The slide's variant (RR-96), as authored (`"dark1"` or the object form). It sets the map; without it the background's luminance (or `tone`) chooses light1 or dark1. */
973
- variant?: ColorVariantInput;
974
- /** `dark` or `light` for a picture or gradient background that names its tone: it chooses dark1 or light1 when there is no `variant`. */
975
- tone?: 'dark' | 'light';
976
- }
977
- /**
978
- * Resolve a color scheme's abstract roles for one slide: the single definition the opf-render preview, the
979
- * PPTX export and the audit share, so the same deck draws the same colors in all three.
980
- *
981
- * RR-96: the roles come from the variant's map over the scheme's slots, as PowerPoint's roles do: background is bg1, text tx1,
982
- * textSecondary tx2, surface bg2, and primary, secondary and accent the first three accents in the variant's order. Without
983
- * `options.variant` the map is chosen from the slide: `options.tone` for a picture or gradient that names one, else the luminance of
984
- * `options.background` ({@link isDarkColor}; dark1 when dark, light1 otherwise), which is the earlier behavior. Role overrides on the
985
- * scheme (`primary`, `secondary`, `accent`, `background`, `surface`, `text`, `textSecondary`) win over the slots they default to; a
986
- * `text` override applies only on a light background, so a dark slide always gets readable light text. `roles.neutrals` holds every
987
- * line and quiet color derived from the same map, each with the slot and luminance transform the PPTX export writes.
988
- * Values are uppercase #RRGGBB, or #RRGGBBAA where the scheme color carries an alpha byte.
989
- */
990
- declare function resolveColorRoles(colorScheme: Record<string, unknown>, options?: ResolveColorRolesOptions): ResolvedColorRoles;
991
- /**
992
- * The scheme color, bg1 or tx1 of the roles, that reads best on `fill`: for table header text, text on a mark and anything else that
993
- * sits on a color the scheme does not name. Returned as a {@link SchemeColor} (slot `bg1` or `tx1`) so the export can write a theme color.
994
- */
995
- declare function readableSchemeColor(fill: string, roles: Pick<ResolvedColorRoles, 'neutrals' | 'text' | 'background'>): SchemeColor;
996
- declare function colorContrast(foreground: string, background: string): number | undefined;
997
- /** Keep an inherited text color at >=4.5:1; otherwise select black or white.
998
- * Callers must preserve explicit text-color overrides before using this fallback.
999
- * An unresolved/translucent fill preserves the preferred color, without a contrast claim.
1000
- */
1001
- declare function textColorForFill(fill: string, preferred: string): string;
1002
- /** Keep an inherited chart mark at >=3:1 against its opaque panel. Otherwise
1003
- * mix toward black or white in bounded 1/255 steps, choosing the first passing
1004
- * step (higher contrast breaks a tie). This retains a recognizable palette;
1005
- * it does not establish distinction between adjacent series or colorblind safety.
1006
- * Explicit mark overrides belong to the caller; unresolved alpha is preserved.
1007
- */
1008
- declare function chartColorForFill(fill: string, preferred: string): string;
1009
- /** Smallest CIE L* step kept between neighbouring series (a printed or greyscale chart tells them apart by lightness alone). */
1010
- declare const CHART_SERIES_MIN_LIGHTNESS_STEP = 11;
1011
- /** Smallest CIE76 colour difference kept between any two series that were at least that far apart before the surface adjustment. */
1012
- declare const CHART_SERIES_MIN_DIFFERENCE = 12;
1013
- /** Series are placed in tiers of this many: a colour is kept apart from the colours of its own and earlier tiers only (see {@link chartPaletteForFill}). */
1014
- declare const CHART_SERIES_TIER_SIZE = 6;
1015
- /** WI-5 (P18, D3): the contrast series 1 reaches on a dark chart surface when it comes from the scheme (see {@link ChartPaletteOptions.legibleLead}). */
1016
- declare const CHART_LEAD_MIN_CONTRAST = 4.5;
1017
- interface ChartPaletteOptions {
1018
- /**
1019
- * Lift series 1 to {@link CHART_LEAD_MIN_CONTRAST} (4.5:1) on a dark `fill` (WI-5, P18, decision D3). Pass it only when series 1 comes from the
1020
- * deck scheme: {@link chartLeadFromScheme}. An authored `chart.colors[0]` and a host palette keep their colour.
1021
- */
1022
- legibleLead?: boolean;
1023
- }
1024
- /** Series colours for a chart drawn on `fill`: the palette in order, each colour adjusted for contrast
1025
- * (`chartColorForFill`) without letting the adjustment merge series.
1026
- *
1027
- * Lifting or darkening a colour for a dark or mid-tone surface moves every failing colour towards the same
1028
- * few lightness values, so two blues that differ on white can end up identical on a dark card. Colours that
1029
- * already have >= 3:1 contrast against `fill` are kept exactly. A colour the contrast adjustment would move is
1030
- * placed again on the lightness axis, keeping its hue and as much of its chroma as sRGB allows, subject to
1031
- * >= 3:1 contrast against `fill` and these separations from the other series (each capped at the separation
1032
- * that pair had in `palette`, so a pair the palette itself made close is not asked to be far apart):
1033
- *
1034
- * - a colour difference (CIE76) of at least {@link CHART_SERIES_MIN_DIFFERENCE} from every other series;
1035
- * - a lightness step of at least {@link CHART_SERIES_MIN_LIGHTNESS_STEP} (CIE L*) from the neighbouring
1036
- * series, which is what keeps neighbours apart on a greyscale print;
1037
- * - the same lightness step from the remaining series, as a weaker aim.
1038
- *
1039
- * Series are placed in order against the kept colours and the colours placed before them. The palette is read in tiers of
1040
- * {@link CHART_SERIES_TIER_SIZE} (series 1 to 6, 7 to 12, ...): a colour is separated from the colours of its own and earlier tiers only,
1041
- * so the later tiers (the tints of `chartSeriesPalette`) are placed around the first six without ever pulling them towards a lightness
1042
- * the tints already hold. A palette of six colours or fewer is one tier. The placement
1043
- * with the lowest cost wins: its distance (in L*) from the contrast-adjusted colour plus a penalty for
1044
- * every point it falls short of those separations, so a colour that is already clear of the others is
1045
- * simply the adjusted colour, a near miss is not worth a large change, and a collision is resolved at the
1046
- * nearest lightness that clears it. The result is deterministic and in series order. An unresolved or
1047
- * translucent fill or colour is passed through, like `chartColorForFill`.
1048
- *
1049
- * It depends only on the surface and the palette, so every chart on a surface gets the same series colours,
1050
- * and preview and export (which both call this function) draw the same ones.
1051
- */
1052
- declare function chartPaletteForFill(fill: string, palette: readonly string[], options?: ChartPaletteOptions): string[];
1053
- /** Share of white mixed into each accent to make the extended tints of {@link chartSeriesPalette} (series 7 to 12). */
1054
- declare const CHART_SERIES_TINT_MIX = 0.4;
1055
- /**
1056
- * The series colours of a chart before the per-surface adjustment: twelve opaque #RRGGBB colours in series order, taken from the deck's
1057
- * resolved colour scheme (`design.colorScheme` after the theme, the record and any inline overrides are applied).
1058
- *
1059
- * - 1 to 6: `accent1` to `accent6`. A slot the scheme leaves out takes the engine default scheme's slot.
1060
- * - 7 to 12: the same six accents mixed {@link CHART_SERIES_TINT_MIX} of the way towards white, in the same order (a tint of `accent1`
1061
- * is series 7), for charts with more than six series.
1062
- *
1063
- * Pass the result to {@link chartPaletteForFill} with the chart panel colour for the colours a chart draws and writes: contrast against
1064
- * the panel without letting two series merge. Series `i` takes colour `i`; a pie, doughnut, treemap or funnel takes colour `i` for
1065
- * category `i`. The colours depend on the scheme only, so the preview, the PPTX export and the colour-blind rule draw the same ones.
1066
- * The role overrides (`primary`, `secondary`, `accent`) do not change the list: series 1 to 3 are always `accent1` to `accent3`, the
1067
- * theme slots the PPTX export writes as `schemeClr accentN`.
1068
- *
1069
- * RR-89: `colors` is the chart's own `chart.colors` (positional ColorRefs). Entry `i` replaces palette colour `i`; an entry that cannot
1070
- * be resolved ({@link resolveChartColors}) keeps the scheme colour, and entries past the twelfth extend the list. `context` carries the
1071
- * deck's roles and `variables` for entries that name them.
1072
- */
1073
- declare function chartSeriesPalette(colorScheme?: Record<string, unknown>, colors?: unknown, context?: ChartColorContext): string[];
1074
- /**
1075
- * Whether series 1 of a chart comes from the deck scheme (accent1 of the variant) rather than from an authored `chart.colors[0]`:
1076
- * the series {@link chartPaletteForFill} may lift with `legibleLead`. Pass the chart's own `colors` and the same scheme and context as {@link chartSeriesPalette}.
1077
- */
1078
- declare function chartLeadFromScheme(colors: unknown, colorScheme?: Record<string, unknown>, context?: ChartColorContext): boolean;
1079
- /** What a `chart.colors` entry resolves against: the deck's role colours and `variables`, as for any ColorRef. */
1080
- interface ChartColorContext {
1081
- /** RR-96: the variant's accent order (`roles.map.accents`): series 1 to 6 take these slots in this order. Default: accent1 to accent6. */
1082
- accents?: readonly ColorAccentSlot[];
1083
- roles?: ResolveColorRefRoles;
1084
- variables?: Record<string, unknown>;
1085
- }
1086
- /**
1087
- * The opaque #RRGGBB colour of each `chart.colors` entry (a hex colour, a colour-scheme slot or role, or a `var:<id>` variable), in
1088
- * order; undefined for an entry that is not a string or cannot be resolved (an unknown variable, a name that is not a colour). Alpha is
1089
- * dropped. `colors` that is not an array resolves to an empty list.
1090
- */
1091
- declare function resolveChartColors(colors: unknown, colorScheme?: Record<string, unknown>, context?: ChartColorContext): (string | undefined)[];
1092
- /** Share of the text colour mixed into the surface to make the muted colour of a highlighted chart. */
1093
- declare const CHART_HIGHLIGHT_MUTED_MIX = 0.3;
1094
- /** Smallest contrast the muted colour keeps against the surface: recessive, but still a visible mark. */
1095
- declare const CHART_HIGHLIGHT_MUTED_MIN_CONTRAST = 1.6;
1096
- /**
1097
- * The two colours of a chart that highlights marks (`chart.highlight`), derived from the theme only: `accent` for the highlighted
1098
- * marks, `muted` for every other mark.
1099
- *
1100
- * - `accent` is the deck's primary colour, kept at >= 3:1 against the surface by `chartColorForFill` (a primary that already has
1101
- * that contrast is returned unchanged).
1102
- * - `muted` is the surface mixed {@link CHART_HIGHLIGHT_MUTED_MIX} of the way towards the text colour: a light grey on a light surface
1103
- * and a dim grey on a dark one, in the surface's own hue. When that falls below {@link CHART_HIGHLIGHT_MUTED_MIN_CONTRAST} against
1104
- * the surface (a surface and text that are close together) the mix moves towards the text colour until it holds.
1105
- *
1106
- * Pure arithmetic on opaque colours: the preview and the PPTX export both call it with the chart panel, the primary and the label
1107
- * colour, so they draw and write the same two colours. An unresolved colour is replaced by white (surface), the surface's own
1108
- * best contrast partner (text) or black (primary).
1109
- */
1110
- declare function chartHighlightColors(surface: string, primary: string, text: string): {
1111
- accent: string;
1112
- muted: string;
1113
- };
1114
- /** Share of the text colour mixed into the surface for the `surfaceAlt` role. */
1115
- declare const SURFACE_ALT_MIX = 0.1;
1116
- /** Smallest contrast `surfaceAlt` keeps against `surface`, so a band is visible next to a plain row. */
1117
- declare const SURFACE_ALT_MIN_CONTRAST = 1.1;
1118
- /**
1119
- * The `surfaceAlt` colour role: the fill of the banded rows of a table whose other body rows take `surface`. It is the surface
1120
- * mixed {@link SURFACE_ALT_MIX} of the way towards the text colour (a slightly darker band on a light table, a slightly lighter one
1121
- * on a dark table), moved further until it differs from the surface by {@link SURFACE_ALT_MIN_CONTRAST}, while the text keeps
1122
- * 4.5:1 on it. When mixing towards the text cannot keep both (a surface and text that are close together), the band moves the
1123
- * other way, away from the text, which only raises the text contrast. Pure arithmetic on opaque colours, so the preview and
1124
- * the PPTX export, which both resolve the `surfaceAlt` ColorRef from their own `surface` and `text` roles, draw and write the
1125
- * same colour. An unresolved surface is white; an unresolved text colour is the surface's best contrast partner.
1126
- */
1127
- declare function surfaceAltColor(surface: string, text: string): string;
1128
-
1129
- /** The quotation marks that wrap a quote body. Each is one UTF-16 code unit, so a quote's source offsets shift by exactly one. */
1130
- interface QuoteMarks {
1131
- readonly open: string;
1132
- readonly close: string;
1133
- }
1134
- /**
1135
- * Typographic quotation marks by BCP-47 tag, lower-cased: the full tag (`zh-tw`) is tried before its primary subtag (`zh`). A
1136
- * language that is not listed draws the plain ASCII `"` pair (`ASCII_QUOTE_MARKS`). French guillemets are not padded with
1137
- * spaces: a padded mark would shift quote source offsets by more than one.
1138
- */
1139
- declare const QUOTE_MARKS: Readonly<Record<string, QuoteMarks>>;
1140
- /** What a language with no entry draws. */
1141
- declare const ASCII_QUOTE_MARKS: QuoteMarks;
1142
- /** The marks for a BCP-47 tag; a missing tag reads as the engine default language (en-US), an unknown one draws ASCII. */
1143
- declare function quoteMarksFor(tag?: string): QuoteMarks;
1144
- /** The deck language a slide's quotes are marked for: the presentation's `language` tag, `undefined` when it names none. */
1145
- declare function quoteLanguage(presentation: unknown, slideIndex?: number): string | undefined;
1146
- /** True when `text` starts and ends with the opening and closing mark of one known pair: the wrapping `layoutQuote` adds. */
1147
- declare function isWrappedInQuoteMarks(text: string): boolean;
1148
- /** A quote body without the opening and closing mark of any known pair (the mark pair an exported quote body carries); other text is returned as it is. */
1149
- declare function unwrapQuoteMarks(text: string): string;
1150
-
1151
- /**
1152
- * Deterministic syntax highlighting shared by the SVG preview and the PPTX export (RR-07).
1153
- *
1154
- * `tokenizeCode(source, language)` returns coloured token ranges over the exact source
1155
- * string; everything between tokens is plain. `codeSyntaxPalette` derives one colour per
1156
- * token kind from the deck theme and keeps each at WCAG contrast >= 4.5:1 against the code
1157
- * panel. The scanner is a small hand-written one (no dependency, no network, no locale or
1158
- * clock input): it recognises comments, strings, numbers, keywords, definition names, calls,
1159
- * capitalised types and the structure of JSON, YAML, TOML, HTML/XML and CSS. It never edits
1160
- * the text: callers colour ranges of `code.source` and the concatenated runs equal the source.
1161
- * An unknown or missing language yields no tokens (plain text).
1162
- */
1163
- type CodeTokenKind = 'comment' | 'keyword' | 'string' | 'number' | 'function' | 'type' | 'property';
1164
- interface CodeToken {
1165
- start: number;
1166
- end: number;
1167
- kind: CodeTokenKind;
1168
- }
1169
- /** A slice of one source line: `kind` is absent for plain text. */
1170
- interface CodeRun {
1171
- start: number;
1172
- end: number;
1173
- kind?: CodeTokenKind;
1174
- }
1175
- type CodeSyntaxPalette = Record<CodeTokenKind | 'plain', string>;
1176
- /** Source longer than this is left plain: highlighting must stay bounded. */
1177
- declare const CODE_HIGHLIGHT_MAX_LENGTH = 200000;
1178
- /** Contrast the palette keeps against the code panel. */
1179
- declare const CODE_SYNTAX_MIN_CONTRAST = 4.5;
1180
- /** The code panel colour the preview and the PPTX export both draw. */
1181
- declare const CODE_PANEL_BACKGROUND = "#111827";
1182
- declare const CODE_PANEL_FOREGROUND = "#E5E7EB";
1183
- /** Language ids with a scanner (the keys the aliases resolve to). */
1184
- declare const CODE_HIGHLIGHT_LANGUAGES: readonly string[];
1185
- /** The scanner id for a `code.language` value, or undefined when the language is not highlighted. */
1186
- declare function resolveCodeLanguage(language: unknown): string | undefined;
1187
- /**
1188
- * Token ranges of `source` for a `code.language` value, sorted and non-overlapping. Empty for
1189
- * an unknown language, a missing language, or source longer than CODE_HIGHLIGHT_MAX_LENGTH.
1190
- */
1191
- declare function tokenizeCode(source: string, language?: unknown): CodeToken[];
1192
- /**
1193
- * The runs of one source line `[start, end)`: consecutive slices that cover the line exactly.
1194
- * A token that crosses the line boundary is clipped, so each native text line can be coloured
1195
- * on its own while concatenating the runs returns the line text unchanged. With `source`, a tab
1196
- * character is always its own plain run, as in the preview where a tab is a measured segment: a
1197
- * token (a multi-line string, say) never colours a tab stop.
1198
- */
1199
- declare function codeLineRuns(tokens: readonly CodeToken[], start: number, end: number, source?: string): CodeRun[];
1200
- interface CodeSyntaxPaletteOptions {
1201
- background?: string;
1202
- foreground?: string;
1203
- minimumContrast?: number;
1204
- }
1205
- interface CodeSyntaxPaletteTheme {
1206
- primary?: string;
1207
- secondary?: string;
1208
- accent?: string;
1209
- mutedText?: string;
1210
- }
1211
- /**
1212
- * One colour per token kind from the deck theme: keyword = primary, string = accent,
1213
- * number = secondary, comment = a fixed slate; function, type and property take fixed hues
1214
- * (blue, cyan, pink) rotated away from any theme colour they would collide with. Every
1215
- * colour is lightened until it keeps `minimumContrast` (4.5:1) against the code panel, so a
1216
- * dark theme colour is raised rather than dropped. Deterministic for a given theme.
1217
- */
1218
- declare function codeSyntaxPalette(theme?: CodeSyntaxPaletteTheme, options?: CodeSyntaxPaletteOptions): CodeSyntaxPalette;
1219
- /**
1220
- * The palette for a resolved colour scheme record (`primary`, `secondary`, `accent`, or the
1221
- * `accent1` to `accent3` slots they default to). The preview and the PPTX export both call this
1222
- * with the scheme they resolved, so they cannot disagree on the inputs.
1223
- */
1224
- declare function codeSyntaxPaletteForScheme(scheme: unknown, options?: CodeSyntaxPaletteOptions): CodeSyntaxPalette;
1225
- /**
1226
- * RR-96: the palette for a slide's resolved roles. The code panel, the plain text and the comment colour come from the scheme through the
1227
- * variant's map (`roles.neutrals.codePanel`, `codeText`, `codeComment`), and keyword, string and number take the first three accents of the
1228
- * variant, so a dark variant or a re-ordered accent list restyles the code block with the rest of the slide. Preview and export call this with
1229
- * the roles they resolved; `scheme` supplies `primary`, `secondary` and `accent` overrides the same way {@link codeSyntaxPaletteForScheme} does.
1230
- */
1231
- declare function codeSyntaxPaletteForRoles(roles: {
1232
- primary: string;
1233
- secondary: string;
1234
- accent: string;
1235
- neutrals: {
1236
- codePanel: {
1237
- hex: string;
1238
- };
1239
- codeText: {
1240
- hex: string;
1241
- };
1242
- codeComment: {
1243
- hex: string;
1244
- };
1245
- };
1246
- }, options?: CodeSyntaxPaletteOptions): CodeSyntaxPalette;
1247
-
1248
- /**
1249
- * Timeline event status (FA-11): how a `done`, `current` or `planned` event looks in the SVG
1250
- * preview and in the PPTX export. Core's timeline layout places the markers and the text and
1251
- * records each event's status on them (see `TimelineLayout.markers` and `TimelineTextPart.status`).
1252
- * This derives, from that geometry and the deck's colors, the shapes and text colors to draw, so
1253
- * both engines draw the same marker in the same place and colors.
1254
- *
1255
- * - no status, `done`: a filled marker in the primary color, normal text (today's marker).
1256
- * - `current` ("we are here"): the same filled marker inside a ring, and the label is bold
1257
- * (layout sets the weight, so the measured line breaks already include it).
1258
- * - `planned`: a hollow marker (primary-color outline over the slide background) and muted text.
1259
- *
1260
- * Text colors are kept at 4.5:1 against the slide background, outlines and rings at 3:1.
1261
- */
1262
-
1263
- declare const TIMELINE_STATUSES: readonly ["done", "current", "planned"];
1264
- declare const TIMELINE_TEXT_MIN_CONTRAST = 4.5;
1265
- declare const TIMELINE_OUTLINE_MIN_CONTRAST = 3;
1266
- interface TimelineStatusColors {
1267
- /** The slide background the timeline sits on. */
1268
- background: string;
1269
- /** The marker color (the deck's primary color). */
1270
- primary: string;
1271
- /** The color of normal timeline text. */
1272
- text: string;
1273
- /** The muted color of planned events' text (the deck's secondary text). */
1274
- mutedText: string;
1275
- }
1276
- interface TimelineMarkerShape {
1277
- /** `marker` is the event's dot (or hollow circle), `ring` the circle around a current event's dot. */
1278
- role: 'marker' | 'ring';
1279
- /** DrawingML preset name for native export. */
1280
- shape: 'ellipse';
1281
- cx: number;
1282
- cy: number;
1283
- /** Radius of the drawn ellipse (the marker's `radius`, or the ring's `ring.radius`, 1.6 times it). An outline is centered on the edge, so it reaches half its width beyond. */
1284
- radius: number;
1285
- /** Fill color; undefined means no fill (nothing draws inside the shape). */
1286
- fill?: string;
1287
- /** Outline; undefined means no outline. */
1288
- stroke?: {
1289
- color: string;
1290
- width: number;
1291
- };
1292
- }
1293
- /** The shapes of one marker from `layout.markers`, back to front: the ring (current only), then the marker. */
1294
- declare function timelineMarkerShapes(marker: TimelineLayout['markers'][number], colors: TimelineStatusColors): TimelineMarkerShape[];
1295
- /** The color of one timeline text part: muted for a planned event, the normal text color otherwise, kept at >= 4.5:1. */
1296
- declare function timelineTextColor(part: Pick<TimelineTextPart, 'status'>, colors: TimelineStatusColors): string;
1297
-
1298
- /**
1299
- * Line emphasis for code blocks (`code.highlight`), shared by the SVG preview, the PPTX export and the
1300
- * validator so they cannot disagree.
1301
- *
1302
- * `code.highlight` lists 1-based source lines: a line number or an inclusive `[start, end]` range.
1303
- * Lines are counted by line break in `code.source`, so a soft-wrapped line is still one line and every
1304
- * displayed line of it takes the same number (`codeLineNumbers`). Engines draw one band behind each
1305
- * run of marked displayed lines (`codeHighlightBands`) and set the unmarked lines in a slightly dimmed
1306
- * colour (`codeHighlightColors`); both colour sets keep WCAG contrast >= 4.5:1 against what they sit on.
1307
- * Everything here is deterministic: no clock, locale or network.
1308
- */
1309
-
1310
- /** One `code.highlight` entry: a line number or an inclusive `[start, end]` range. */
1311
- type CodeHighlightEntry = number | [number, number];
1312
- interface CodeHighlightIssue {
1313
- code: 'code-highlight-out-of-range' | 'code-highlight-range-reversed' | 'code-highlight-invalid';
1314
- /** Index of the entry in `code.highlight`. */
1315
- index: number;
1316
- message: string;
1317
- }
1318
- interface CodeHighlightLines {
1319
- /** Lines in the source (a final empty line after a trailing line break is not counted). */
1320
- lineCount: number;
1321
- /** The marked lines inside the source, ascending and unique. Empty when nothing is marked. */
1322
- lines: number[];
1323
- /** Entries that are ignored: past the last line, written end before start, or not line numbers. */
1324
- issues: CodeHighlightIssue[];
1325
- }
1326
- /** Resolve `code.highlight` against its source: the marked lines, and the entries that are ignored. */
1327
- declare function codeHighlightLines(highlight: unknown, source: string): CodeHighlightLines;
1328
- /** The source line number (from 1) of every displayed line; wrapped lines repeat their line's number. */
1329
- declare function codeLineNumbers(sourceLines: readonly {
1330
- boundary: 'soft' | 'hard' | 'end';
1331
- }[]): number[];
1332
- /** A run of consecutive displayed lines (indexes into `sourceLines`, inclusive) whose source lines are marked. */
1333
- interface CodeHighlightBand {
1334
- first: number;
1335
- last: number;
1336
- }
1337
- /** One band per run of consecutive displayed lines that belong to a marked line. */
1338
- declare function codeHighlightBands(sourceLines: readonly {
1339
- boundary: 'soft' | 'hard' | 'end';
1340
- }[], lines: readonly number[]): CodeHighlightBand[];
1341
- interface CodeHighlightColors {
1342
- /** The band behind marked lines: the panel colour tinted with the theme's primary colour. */
1343
- band: string;
1344
- /** Marked lines: the syntax palette, each colour at least 4.5:1 on `band`. */
1345
- lit: CodeSyntaxPalette;
1346
- /** Unmarked lines: the syntax palette moved toward the panel, never below 4.5:1 on it. */
1347
- dim: CodeSyntaxPalette;
1348
- }
1349
- /**
1350
- * The highlight colours for a resolved colour scheme record. The band takes the scheme's `primary`
1351
- * (or `accent1`); the palette is `codeSyntaxPaletteForScheme(scheme)` so highlighted lines keep their syntax
1352
- * colours. Preview and export call this with the scheme they resolved. `panel` is the code panel colour the band and the dimmed
1353
- * lines sit on (RR-96: `roles.neutrals.codePanel.hex`, derived from the scheme); the default is the fixed {@link CODE_PANEL_BACKGROUND}.
1354
- */
1355
- declare function codeHighlightColors(scheme: unknown, palette?: CodeSyntaxPalette, panel?: string): CodeHighlightColors;
1356
-
1357
- /**
1358
- * Geometry of a text watermark (`design.watermark = { text, opacity }`), shared by the SVG preview and the
1359
- * PPTX export so both draw the same stamp.
1360
- *
1361
- * The stamp is one line of text, centered on the slide and rotated 30 degrees counterclockwise (rising to
1362
- * the right), the usual diagonal DRAFT or CONFIDENTIAL mark. It is sized so the line spans at most 70% of the
1363
- * slide width and its height is at most 30% of the shorter slide edge, which keeps the rotated line inside
1364
- * every preset from 9:16 portrait to 16:9 widescreen.
1365
- */
1366
-
1367
- interface WatermarkTextOptions {
1368
- /** The heading family of the design. Defaults to `sans-serif`. */
1369
- fontFamily?: string;
1370
- /** Defaults to 700. */
1371
- fontWeight?: number;
1372
- textMeasurement?: TextMeasurement;
1373
- }
1374
- interface WatermarkTextLayout {
1375
- /** The text as drawn: line breaks become spaces and the ends are trimmed. */
1376
- text: string;
1377
- fontFamily: string;
1378
- fontWeight: number;
1379
- /** The resolved text style (the host's font registry may rename the family). */
1380
- style: TextStyle;
1381
- /** In the unit of the size passed in (reference pixels for a composed slide). */
1382
- fontSize: number;
1383
- /** Measured width of the line at `fontSize`. */
1384
- textWidth: number;
1385
- /** The unrotated text box, centered on the slide; PPTX rotates it about its center. */
1386
- box: {
1387
- x: number;
1388
- y: number;
1389
- width: number;
1390
- height: number;
1391
- };
1392
- /** Rotation about the slide center in degrees, clockwise positive. */
1393
- rotation: number;
1394
- }
1395
- /** Lay out a text watermark on a slide of `size`; undefined when the text is empty. */
1396
- declare function layoutWatermark(text: unknown, size: {
1397
- width: number;
1398
- height: number;
1399
- }, options?: WatermarkTextOptions): WatermarkTextLayout | undefined;
1400
-
1401
- /**
1402
- * DrawingML preset pattern fills (ECMA-376 20.1.10.51 ST_PresetPatternVal) as 8x8 bitmaps,
1403
- * shared by the SVG preview (RR-07) and the PPTX export, which writes the same names as native
1404
- * `a:pattFill prst="..."`.
1405
- *
1406
- * ECMA-376 names the 54 presets but does not define their pixels. These tiles are MEASURED from
1407
- * desktop PowerPoint (Office 365, Windows, 2026-10-01): each preset was exported as a full-slide
1408
- * pattern background (black on white) to a 1280 x 720 PNG and opf-render's
1409
- * `scripts/derive-pattern-bitmaps.mjs` voted every pixel into its (x mod 8, y mod 8) cell; every
1410
- * tile was uniform across all repeats (confidence 1.00) at one image pixel per pattern pixel, so a
1411
- * pattern pixel is one 1/96 inch unit. The tile is anchored at the slide's top-left corner (the
1412
- * phase of the line, grid and diagonal presets matched at no shift). Measured pixel data is
1413
- * committed as data; no third-party table was used. A tile is one row per line, '#' = foreground,
1414
- * '.' = background, top to bottom, left to right.
1415
- */
1416
- /** ST_PresetPatternVal, in specification order. */
1417
- declare const PATTERN_PRESETS: readonly string[];
1418
- /** Engine ids that are not DrawingML names, with the preset they draw and export as. */
1419
- declare const PATTERN_PRESET_ALIASES: Readonly<Record<string, string>>;
1420
- /** The pattern size PowerPoint tiles: 8 x 8 units, one unit per 1/96 inch. */
1421
- declare const PATTERN_TILE_SIZE = 8;
1422
- /** The DrawingML preset a pattern id draws as: a preset name, an alias (diagStripe), or undefined. */
1423
- declare function resolvePatternPreset(preset: unknown): string | undefined;
1424
- /** Eight row bytes, top to bottom, most significant bit = leftmost pixel; undefined for an unknown id. */
1425
- declare function patternBitmap(preset: unknown): readonly number[] | undefined;
1426
- /** Horizontal runs of set pixels (`x`, `y`, `width` in tile units), in reading order. */
1427
- declare function patternRuns(preset: unknown): {
1428
- x: number;
1429
- y: number;
1430
- width: number;
1431
- }[] | undefined;
1432
-
1433
- /**
1434
- * Footnotes, citations and captions (RR-34).
1435
- *
1436
- * - A TextRun may `cite` one or more ids of the deck's top-level `references`, or carry an inline
1437
- * `footnote`. Markers are numbered per deck in reading order of first use (slides: the heading group tag, title, subtitle, then regions,
1438
- * blocks and runs); the same reference id keeps its number, every footnote takes a new one. A run's
1439
- * marker is a superscript fragment drawn directly after the run (`1`, or `1,2` for several ids);
1440
- * `richTextLayouter` emits it from `RichTextOptions.citationMarker`, so it wraps with its word and
1441
- * never shifts run indexes or source offsets.
1442
- * - A slide that carries markers gets a footnote area directly above the footer band: `layoutFootnotes`
1443
- * lists `<n> <text>` for the slide's markers in number order, and `composeSlide` shrinks the content
1444
- * area by exactly its height. Slides without markers are unchanged.
1445
- * - `caption` on an image, chart, table or video payload reserves a caption band inside the block's
1446
- * region (`layoutCaption`): the media keeps the rest. Captions use the body family at the caption size
1447
- * (0.6 of the body size, clamped to the readable floor) in the muted text colour.
1448
- *
1449
- * Geometry is shared: renderers and exporters only draw what these functions return.
1450
- */
1451
- type CaptionPosition = 'below' | 'above';
1452
- type CaptionAlignment = 'left' | 'center' | 'right';
1453
- type RichText = string | readonly (string | RichTextRun)[];
1454
- interface CaptionObject {
1455
- text: RichText;
1456
- position?: CaptionPosition;
1457
- align?: CaptionAlignment;
1458
- }
1459
- type Caption = RichText | CaptionObject;
1460
- interface Reference {
1461
- id: string;
1462
- text: RichText;
1463
- url?: string;
1464
- }
1465
- interface CaptionSettings {
1466
- text: RichText;
1467
- position: CaptionPosition;
1468
- align: CaptionAlignment;
1469
- }
1470
- /**
1471
- * A marker is exported as a superscript run at the marked run's own size with DrawingML `baseline="30000"`, the way a user ticks
1472
- * Superscript. PowerPoint then draws the glyph at 2/3 of that nominal size and raises it by baseline x nominal size. Measured in
1473
- * PowerPoint 365 on Windows on 2026-10-01 with probe-superscript.pptx (Roboto and Aptos, 10 to 44 pt, digit ink height of a
1474
- * superscript run against a plain run of the same size): ratio 0.655 to 0.69, mean 0.667, independent of face and size; raise
1475
- * 0.30 of the nominal size at every size (baseline 30000). An explicit smaller sz on top is reduced again (0.7 x sz drew at about
1476
- * 0.47 of the run), which is why the exporter does not write one. The preview composes the same glyph size and raise.
1477
- *
1478
- * The drawn marker glyph is this fraction of the nominal size (the marked run's size), snapped to the 0.01 pt grid.
1479
- */
1480
- declare const CITATION_MARKER_SCALE: number;
1481
- /** The raise as a fraction of the NOMINAL size (the marked run's size): DrawingML `baseline="30000"`. */
1482
- declare const CITATION_MARKER_RAISE = 0.3;
1483
- /** Caption text size as a fraction of the body size, before the readable floor. */
1484
- declare const CAPTION_FONT_RATIO = 0.6;
1485
- /** A caption band takes at most this fraction of its block region. */
1486
- declare const CAPTION_MAX_RATIO = 0.35;
1487
- /** A footnote area takes at most this fraction of the span between heading top and footer band. */
1488
- declare const FOOTNOTE_MAX_RATIO = 0.35;
1489
- /** Payload fields whose blocks may carry a caption. */
1490
- declare const CAPTIONABLE_FIELDS: readonly string[];
1491
- /** Flatten a string or TextRun[] to its plain text. */
1492
- declare function annotationText(value: unknown): string;
1493
- /** Normalize a Caption value to its text, position and alignment. */
1494
- declare function captionSettings(value: unknown): CaptionSettings | undefined;
1495
- /** A run that cites or carries a footnote, with its dotted OPF path (`slides.0.blocks.1.text.2`). */
1496
- interface AnnotatedRun {
1497
- path: string;
1498
- run: RichTextRun;
1499
- cite: string[];
1500
- footnote?: RichText;
1501
- }
1502
- /**
1503
- * Visit every rich-text run of a slide that can carry a citation (the slide tag, title and subtitle, then
1504
- * text, bullets, list item and quote runs), in reading order: the heading group first (tag, title, subtitle),
1505
- * then promoted regions (sorted keys), then blocks (recursively), then the root payload.
1506
- * `basePath` is the slide's dotted path (`slides.3`).
1507
- */
1508
- declare function walkCitationRuns(slide: unknown, basePath: string, visit: (entry: AnnotatedRun) => void): void;
1509
- /** One numbered note: a cited reference (by id) or an inline footnote. */
1510
- interface CitationNote {
1511
- number: number;
1512
- kind: 'reference' | 'footnote';
1513
- /** Reference id for `kind: 'reference'`. */
1514
- id?: string;
1515
- /** Note text: the reference text (its id when the references list does not resolve it) or the footnote. */
1516
- text: RichText;
1517
- /** `references.N` for a reference, the marked run's path for a footnote. */
1518
- sourcePath: string;
1519
- url?: string;
1520
- /** False when a cited id has no references entry. */
1521
- resolved: boolean;
1522
- }
1523
- /** A marked run on a slide and the numbers its marker shows. */
1524
- interface CitationMarker {
1525
- path: string;
1526
- numbers: number[];
1527
- text: string;
1528
- }
1529
- interface SlideCitations {
1530
- /** Marker text by run path, in reading order. */
1531
- markers: Map<string, string>;
1532
- /** Every marked run on the slide, in reading order. */
1533
- marked: CitationMarker[];
1534
- /** The notes the slide's markers use, in number order (each number once). */
1535
- notes: CitationNote[];
1536
- }
1537
- interface DeckCitations {
1538
- /** Every note of the deck in number order. */
1539
- notes: CitationNote[];
1540
- /** Cited references in number order (inline footnotes excluded). */
1541
- references: CitationNote[];
1542
- /** Per slide index. Slides without markers are absent. */
1543
- slides: Map<number, SlideCitations>;
1544
- /** Reference ids no run cites, in references order. */
1545
- unused: string[];
1546
- }
1547
- /** Marker text for a set of numbers: `1`, or `1,2` for several ids. */
1548
- declare const citationMarkerText: (numbers: readonly number[]) => string;
1549
- /**
1550
- * Number every marker of a deck in reading order. Slides are read from `presentation.slides`; a
1551
- * hidden slide still takes part so numbers do not change when it is shown.
1552
- */
1553
- declare function collectCitations(presentation: unknown): DeckCitations;
1554
- /**
1555
- * Citations of one slide with the deck's numbering: the markers of `presentation.slides[0..slideIndex-1]`
1556
- * are counted first, then the runs of `slide` itself (which may be a paginated page or a copy of the
1557
- * document's slide). Without a presentation the slide's own markers start at 1 and reference texts
1558
- * cannot be resolved (`resolved: false`).
1559
- */
1560
- declare function slideCitations(slide: unknown, slideIndex: number, presentation?: unknown): SlideCitations | undefined;
1561
- /** Fits a string or TextRun[] into a box at a requested size (composeSlide supplies its placed fitter). */
1562
- type AnnotationFitter = (value: RichText, box: LayoutBox, requestedSize: number, minFontSize: number, path: string, alignment: CaptionAlignment) => TextFit | RichTextFit;
1563
- interface AnnotationLayoutOptions {
1564
- scale: number;
1565
- minFontSize: number;
1566
- fit: AnnotationFitter;
1567
- textStyle: (path: string) => TextStyle;
1568
- }
1569
- /** A composed caption band inside a block region. */
1570
- interface ComposedCaption {
1571
- /** Dotted path of the caption field (`slides.0.blocks.1.caption`). */
1572
- path: string;
1573
- value: Caption;
1574
- text: RichText;
1575
- position: CaptionPosition;
1576
- alignment: CaptionAlignment;
1577
- /** The caption band. */
1578
- box: LayoutBox;
1579
- /** The media box after the band is reserved; `ComposedItem.box` equals it. */
1580
- mediaBox: LayoutBox;
1581
- fit: TextFit | RichTextFit;
1582
- textStyle: TextStyle;
1583
- fontSize: number;
1584
- overflow: boolean;
1585
- diagnostics: LayoutDiagnostic[];
1586
- }
1587
- /** Reserve a caption band in `box` (the payload box) and return the band and the media box. */
1588
- declare function layoutCaption(value: unknown, box: LayoutBox, path: string, options: AnnotationLayoutOptions): ComposedCaption | undefined;
1589
- /** One listed note in a slide's footnote area. */
1590
- interface ComposedFootnoteEntry {
1591
- number: number;
1592
- kind: 'reference' | 'footnote';
1593
- id?: string;
1594
- /** `references.N` or the marked run's path. */
1595
- sourcePath: string;
1596
- /** The listed value: `<n> <text>` as a string, or runs starting with the number. */
1597
- value: RichText;
1598
- text: RichText;
1599
- box: LayoutBox;
1600
- fit: TextFit | RichTextFit;
1601
- textStyle: TextStyle;
1602
- url?: string;
1603
- overflow: boolean;
1604
- }
1605
- /** The footnote area of a slide: a rule, then the slide's notes in number order. */
1606
- interface ComposedFootnotes {
1607
- algorithm: 'footnote-area-v1';
1608
- /** Dotted slide path (`slides.3`). */
1609
- path: string;
1610
- box: LayoutBox;
1611
- /** Thin rule along the top of the area. */
1612
- rule: {
1613
- x: number;
1614
- y: number;
1615
- width: number;
1616
- thickness: number;
1617
- };
1618
- entries: ComposedFootnoteEntry[];
1619
- /** Marked runs of the slide with their marker text. */
1620
- markers: CitationMarker[];
1621
- fontSize: number;
1622
- overflow: boolean;
1623
- diagnostics: LayoutDiagnostic[];
1624
- }
1625
- interface FootnoteLayoutOptions extends AnnotationLayoutOptions {
1626
- /** Left edge and width of the content area. */
1627
- x: number;
1628
- width: number;
1629
- /** The area's bottom edge (the top of the footer band gap). */
1630
- bottom: number;
1631
- /** Largest height the area may take. */
1632
- maxHeight: number;
1633
- /** Slide path for the area (`slides.3`). */
1634
- path: string;
1635
- }
1636
- /** List a slide's notes in a footnote area whose bottom sits at `options.bottom`. */
1637
- declare function layoutFootnotes(citations: SlideCitations, options: FootnoteLayoutOptions): ComposedFootnotes;
1638
- interface ReferencesSlideOptions {
1639
- title?: string;
1640
- }
1641
- /**
1642
- * An ordinary list slide of the deck's cited references in marker order (`n. text`, linked to the
1643
- * reference url when there is one). Inline footnotes are not listed. A deck that cites nothing gets
1644
- * a slide with the title only.
1645
- */
1646
- declare function referencesSlide(presentation: unknown, options?: ReferencesSlideOptions): Record<string, unknown>;
1647
-
1648
- /** The chart constructs the engines draw. Every catalog chart type id resolves to one (see `chartOptionTarget`). */
1649
- /** `combo` (FA-15) draws clustered columns and line series in one plot, the lines optionally on a secondary value axis. */
1650
- type ChartOptionKind = 'bar' | 'line' | 'area' | 'pie' | 'doughnut' | 'scatter' | 'radar' | 'treemap' | 'histogram' | 'pareto' | 'box' | 'waterfall' | 'funnel' | 'map' | 'combo';
1651
- interface ChartOptionTarget {
1652
- kind: ChartOptionKind;
1653
- /** Stacked and 100% stacked columns, bars, lines and areas: their data labels have no outside-end position. */
1654
- stacked?: boolean;
1655
- }
1656
- type ChartLegendPosition = 'none' | 'top' | 'bottom' | 'left' | 'right';
1657
- type ChartLabelContent = 'category' | 'value' | 'percent';
1658
- type ChartLabelPosition = 'center' | 'inside-end' | 'inside-base' | 'outside-end' | 'above' | 'below' | 'left' | 'right';
1659
- interface ChartOptionDiagnostic {
1660
- code: 'chart-option-adapted';
1661
- /** The option that was adapted: `axisTitles.category`, `axisTitles.value`, `axisTitles.secondary`, `legend`, `dataLabels`, `dataLabels.content`, `dataLabels.position`, `dataLabels.separator`, `line`, `secondaryAxis`, `highlight.series` or `highlight.categories`. */
1662
- option: string;
1663
- reason: 'unsupported-type' | 'unsupported-content' | 'unsupported-position';
1664
- message: string;
1665
- }
1666
- interface ResolvedChartDataLabels {
1667
- /** Canonical order: category, value, percent. Never empty. */
1668
- content: ChartLabelContent[];
1669
- /** The concrete position, or null for a construct whose labels have no position choice (area, doughnut, radar, treemap). On a combo chart, the column series' position. */
1670
- position: ChartLabelPosition | null;
1671
- /** Combo charts only: the concrete position of the line series' labels (`position` is the column series' one). */
1672
- linePosition?: ChartLabelPosition;
1673
- separator: string;
1674
- }
1675
- /** FA-14: the series and category names `chart.highlight` keeps for a chart type (what the type cannot highlight is dropped, with a diagnostic). */
1676
- interface ResolvedChartHighlight {
1677
- /** Series (column) names whose marks take the accent colour. */
1678
- series: string[];
1679
- /** Category (row label) names whose marks take the accent colour. */
1680
- categories: string[];
1681
- }
1682
- interface ResolvedChartOptions {
1683
- /** True when the chart carries at least one option (after adaptation); false means every engine keeps today's output. */
1684
- active: boolean;
1685
- /** `secondary` titles the secondary value axis of a combo chart. */
1686
- axisTitles: {
1687
- category?: string;
1688
- value?: string;
1689
- secondary?: string;
1690
- };
1691
- /** Undefined = no legend option: each engine keeps its default (a right legend on multi-series, pie and doughnut charts). */
1692
- legend?: ChartLegendPosition;
1693
- dataLabels?: ResolvedChartDataLabels;
1694
- /** True when `dataLabels: false` switches off the labels a construct draws by default (funnel values, treemap category names). */
1695
- dataLabelsOff?: boolean;
1696
- /**
1697
- * FA-14: the names `chart.highlight` keeps; undefined when the chart has no highlight or its type can highlight nothing it names.
1698
- * It does not make `active` true: a highlight changes the colours of marks, never the geometry or the reserved space.
1699
- */
1700
- highlight?: ResolvedChartHighlight;
1701
- diagnostics: ChartOptionDiagnostic[];
1702
- }
1703
- interface ChartOptionSupport {
1704
- /** `secondary`: the construct can have a secondary value axis (a combo chart whose `secondaryAxis` names a line series). */
1705
- axisTitles: {
1706
- category: boolean;
1707
- value: boolean;
1708
- secondary: boolean;
1709
- };
1710
- legend: boolean;
1711
- /** FA-14: what `chart.highlight` can name: series (a whole series' marks) and categories (one category's marks, or a pie slice). */
1712
- highlight: {
1713
- series: boolean;
1714
- categories: boolean;
1715
- };
1716
- dataLabels: {
1717
- supported: boolean;
1718
- content: readonly ChartLabelContent[];
1719
- /** Empty when labels have no position choice. A combo chart lists the column positions, then the line-only ones. */
1720
- positions: readonly ChartLabelPosition[];
1721
- /** The position `auto` resolves to; null with no positions. */
1722
- defaultPosition: ChartLabelPosition | null;
1723
- /** True for the constructs that label their marks by default (funnel, treemap): `dataLabels: false` removes those labels. */
1724
- defaultOn: boolean;
1725
- };
1726
- }
1727
- /** What a chart construct can show. The table the docs, the validator, the preview and the exporter all follow. */
1728
- declare function chartOptionSupport(target: ChartOptionTarget): ChartOptionSupport;
1729
- /** The option target for a catalog chart type id; undefined for an id outside the catalog. */
1730
- declare function chartOptionTarget(typeId: unknown): ChartOptionTarget | undefined;
1731
- declare const DEFAULT_CHART_LABEL_SEPARATOR = ", ";
1732
- /**
1733
- * Normalise a chart's `axisTitles`, `legend` and `dataLabels` against what its type can show. `target` is undefined for a chart type
1734
- * outside the catalog: nothing is adapted then (the engines fall back to their legacy output for such charts anyway).
1735
- */
1736
- declare function resolveChartOptions(chart: unknown, target?: ChartOptionTarget): ResolvedChartOptions;
1737
- /** A General-format number as a label: at most twelve significant digits, no exponent unless the value needs one. */
1738
- declare function formatChartLabelNumber(value: number): string;
1739
- /** A share as PowerPoint's `0%` label. */
1740
- declare function formatChartLabelPercent(share: number): string;
1741
- /** The label text: the selected parts in the fixed order category, value, percent, joined by the separator. */
1742
- declare function chartLabelText(parts: {
1743
- category?: string;
1744
- value?: string;
1745
- percent?: string;
1746
- }, content: readonly ChartLabelContent[], separator?: string): string;
1747
- /** Which marks of a chart a highlight names, in the order of the resolved chart data. */
1748
- interface ChartHighlightMarks {
1749
- /** One flag per plotted series (the columns after the category and X columns): its marks are highlighted. */
1750
- series: boolean[];
1751
- /** One flag per data row: the marks of that category are highlighted. */
1752
- categories: boolean[];
1753
- }
1754
- /**
1755
- * FA-14: which series and categories of a chart are highlighted. `highlight` is `resolveChartOptions(...).highlight` and `data` the
1756
- * chart's `resolveChartData` result (its `columns`, `hasX` and `rows`). A mark is highlighted when its series OR its category is
1757
- * named: a column or bar of series s in row i takes the accent colour when `series[s] || categories[i]`; every other mark takes the muted
1758
- * colour (`chartHighlightColors`). Category names match the row labels as text (a number label `2024` matches `"2024"`, an empty label
1759
- * matches `""`), every row that carries the label. Returns undefined when there is no highlight or it names nothing the chart plots (a
1760
- * name that matches no column or label is the `chart-highlight-unknown-name` validation error), so the engines then draw the chart as if
1761
- * it had none.
1762
- */
1763
- declare function chartHighlightMarks(highlight: ResolvedChartHighlight | undefined, data: {
1764
- columns: readonly string[];
1765
- hasX?: boolean;
1766
- rows: readonly (readonly unknown[])[];
1767
- }): ChartHighlightMarks | undefined;
1768
-
1769
- /** Body content kinds accepted by template regions. */
1770
- declare const LAYOUT_BODY_KINDS: readonly ["text", "list", "image", "video", "chart", "table", "code", "metric", "quote", "timeline"];
1771
- type LayoutBodyKind = typeof LAYOUT_BODY_KINDS[number];
1772
- /** What a layout template holds, derived from its regions. */
1773
- interface LayoutContent {
1774
- /** First non-group kind accepted by its first primary region, or title without body regions. */
1775
- kind: LayoutBodyKind | 'title';
1776
- /** Number of body regions. */
1777
- count: number;
1778
- /** Heading fields the template has areas for. */
1779
- heading: {
1780
- title: boolean;
1781
- subtitle: boolean;
1782
- tag: boolean;
1783
- };
1784
- }
1785
- /** The template areas in reading order, with each body's flow and accepted kinds. */
1786
- declare function layoutStructure(layout: unknown): string;
1787
- /** Derive the body kind, region count and headings from a template record. */
1788
- declare function layoutContent(layout: unknown): LayoutContent;
1789
-
1790
- /** A diagnostic of content binding, in the `LayoutDiagnostic` shape composition reports. */
1791
- interface RegionBindingDiagnostic {
1792
- /** `region-unknown`, `region-kind` or `region-full` for an ignored pin; `layout-unplaced` for a block drawn beyond every region's room. */
1793
- code: 'region-unknown' | 'region-kind' | 'region-full' | 'layout-unplaced';
1794
- path: string;
1795
- message: string;
1796
- /** The region the block was drawn in (`layout-unplaced`), or the pinned region (the pin codes). */
1797
- region?: string;
1798
- }
1799
- /** One root node of the slide as binding sees it. */
1800
- interface BoundBlock {
1801
- /** OPF path of the node: `slides.N.blocks.I` for a block, `slides.N.<field>` for a root payload field. */
1802
- path: string;
1803
- /** Its content kind; a content group is `group`. */
1804
- kind: RegionKind;
1805
- /** The block's index in `blocks`; absent for a root payload. */
1806
- block?: number;
1807
- /** Root payload fields the node holds (a root payload only). */
1808
- fields?: string[];
1809
- /** The block named this region with `region` and the pin was honoured. */
1810
- pinned?: boolean;
1811
- }
1812
- interface RegionBinding {
1813
- /** The region's name. */
1814
- name: string;
1815
- /** The blocks bound to the region within its `max`, in source order. */
1816
- blocks: BoundBlock[];
1817
- /** Blocks no region had room for, drawn here beyond `max` (the overflow region only). */
1818
- overflow: BoundBlock[];
1819
- }
1820
- interface RegionBindingResult {
1821
- /** Every region of the template in reading order, with what it holds. */
1822
- regions: RegionBinding[];
1823
- /** Blocks drawn in an implicit row below the grid: the layout has no overflow region. */
1824
- below: BoundBlock[];
1825
- diagnostics: RegionBindingDiagnostic[];
1826
- }
1827
- interface BindRegionsOptions {
1828
- /** Index used in the reported paths; defaults to 0. */
1829
- slideIndex?: number;
1830
- }
1831
- /** The content kind of a block: `group` for a content group, else its `type` or the kind of its first payload field. */
1832
- declare function blockKind(block: unknown): RegionKind;
1833
- /** Whether a region takes a block: its kind is accepted, or a group whose every leaf kind is accepted. */
1834
- declare function regionAccepts(region: {
1835
- readonly accepts: readonly string[];
1836
- }, block: unknown): boolean;
1837
- /**
1838
- * The top-level image blocks that take a band of their own (`placement`): the first on each edge. They never occupy a
1839
- * region. Composition places exactly these.
1840
- */
1841
- declare function placedImageBlocks(slide: unknown): Set<number>;
1842
- /**
1843
- * The slide's root nodes in source order, as content binding reads them: each block of `blocks` that is not a placed
1844
- * image (a content group is one node of kind `group`), or the fields of a root payload (`bullets` with `text` are one node).
1845
- * Empty payloads draw nothing and are not nodes.
1846
- */
1847
- declare function rootNodes(slide: unknown, slideIndex?: number): (BoundBlock & {
1848
- value: Record<string, any>;
1849
- })[];
1850
- /** Role rank of a region for a block kind (content binding, step 2): pictures prefer media regions, everything else primary ones. */
1851
- declare function regionRoleRank(role: LayoutRegion['role'], kind: RegionKind): number;
1852
- /**
1853
- * Bind a slide's content to the regions of a template layout (OPF 0.19, design section 3). Pure: no geometry.
1854
- *
1855
- * 1. **Pins.** A block with `region: "<name>"` goes to that region, in source order, when the region exists, accepts the
1856
- * block's kind and has room; otherwise the pin is ignored with `region-unknown`, `region-kind` or `region-full` and the
1857
- * block joins step 2.
1858
- * 2. **Everything else, in source order.** Of the regions that accept the block and have room, the block goes to the one
1859
- * with the lowest role rank (`regionRoleRank`), then the first in reading order.
1860
- * 3. **No candidate.** The block goes to the overflow region whatever its `accepts` while it has room; beyond that it is
1861
- * drawn there anyway (`layout-unplaced`, which `paginate` resolves with a continuation slide). A layout with no overflow
1862
- * region draws it in an implicit row below the grid (`layout-unplaced` too).
1863
- *
1864
- * A slide with promoted regions (`left`, `top:left`, ...) composes them as in 0.18 and binds nothing.
1865
- */
1866
- declare function bindRegions(slide: unknown, layout: unknown, options?: BindRegionsOptions): RegionBindingResult;
1867
-
1868
- /**
1869
- * Pure geometry of OPF 0.19 layout templates: the grid sequence of a flowing region, track sizing, the collapse of empty
1870
- * areas and the column breaks of a long list. `composeSlide` measures content and calls these; nothing here measures text.
1871
- */
1872
-
1873
- /** How a region's blocks are arranged on one slide. */
1874
- interface FlowShape {
1875
- /** Columns of the full rows. */
1876
- columns: number;
1877
- rows: number;
1878
- /** Blocks in each row, top to bottom; only the last row can be short. */
1879
- perRow: number[];
1880
- }
1881
- /**
1882
- * The `grid` flow by block count. In a landscape region: 1 fills it; 2 side by side; 3 in a row; 4 as 2 x 2; 5 as 3 + 2;
1883
- * 6 as 3 x 2; 7 to 12 in four columns. In a portrait region (taller than wide) rows and columns swap: 2 and 3 stacked,
1884
- * 4 as 2 x 2, 5 as 2 + 2 + 1, 6 as 2 x 3, 7 to 12 in three rows.
1885
- */
1886
- declare function gridFlowShape(count: number, landscape: boolean): FlowShape;
1887
- /**
1888
- * Column breaks of a list laid out in `count` columns: indexes where a column starts after the first, chosen between
1889
- * items (never inside one, and never before a nested item, which stays with its parent) so the tallest column is as short
1890
- * as possible. `heights` are the items' heights in one column; `levels` their nesting levels.
1891
- */
1892
- declare function listColumnBreaks(heights: readonly number[], levels: readonly number[], count: number): number[];
1893
- /** What a row of a slide's grid holds, for `allocateRows`. */
1894
- interface RowDemand {
1895
- size: number | 'auto';
1896
- /** The height the row's content needs at the starting size (0 for an empty row). */
1897
- need: number;
1898
- /** The height it needs at the smallest size it may take (WI-1); 0 or absent: it can shrink to nothing. */
1899
- floor?: number;
1900
- /** `heading`: an auto row sized by a heading area; `below`: the implicit row of content no region took; `body`: anything else. */
1901
- kind: 'heading' | 'body' | 'below';
1902
- }
1903
- /**
1904
- * Row heights of a slide's template grid, so that no row with content is squeezed to nothing (RR-79, RR-81 review):
1905
- * 1. A heading `auto` row takes what its headings need, at most half the content box.
1906
- * 2. The numeric rows keep at least what their content needs, up to half of the space under the headings.
1907
- * 3. The other `auto` rows take what they need from what is left (WI-1: no fixed cap, so dense content in an `auto` row
1908
- * keeps its starting size while the space is there); when that is not enough they shrink together, each giving up the
1909
- * same fraction of what it can give up above its floor (shareHeights), so a one-line note keeps nearly its need beside
1910
- * a dense neighbour and no row overflows while the floors fit.
1911
- * 4. The numeric rows share the rest in proportion to their sizes. An `auto` row with nothing in it has no height and no gap.
1912
- */
1913
- declare function allocateRows(rows: readonly RowDemand[], total: number, gap: number): number[];
1914
- /**
1915
- * Heights for lengths that share `total` (WI-1): `needs[i]` is what entry i needs at its starting size and `floors[i]` what
1916
- * it needs at the smallest size it may take (missing floors are 0). When the needs fit, each entry takes its need and the
1917
- * rest is left over. Otherwise every entry gives up the same fraction of what it can give up (need minus floor), so no
1918
- * entry is squeezed below its floor while the floors fit, and an entry that cannot shrink (a one-line note) keeps nearly
1919
- * its need. When even the floors do not fit, the entries share `total` in proportion to their floors.
1920
- */
1921
- declare function shareHeights(needs: readonly number[], floors: readonly number[], total: number): number[];
1922
-
1923
- /** Portable layout geometry. No fonts, DOM, renderer, or network dependencies. */
1924
- interface Composition {
1925
- mode?: "auto" | "grid" | "row" | "column";
1926
- columns?: number;
1927
- gap?: number;
1928
- padding?: number;
1929
- weights?: number[];
1930
- minFontSize?: number;
1931
- overflow?: "warn" | "error";
1932
- }
1933
- declare const MAX_COMPOSITION_DEPTH = 32;
1934
- interface LayoutBox {
1935
- x: number;
1936
- y: number;
1937
- width: number;
1938
- height: number;
1939
- }
1940
- interface LayoutDiagnostic {
1941
- /**
1942
- * OPF 0.19 adds the content-binding codes of template layouts: `region-unknown`, `region-kind` and `region-full` for an
1943
- * ignored `region` pin, and `layout-unplaced` for a block no region had room for (drawn anyway; `paginate` moves it).
1944
- */
1945
- code: "text-overflow" | "small-cell" | "unresolved-content" | "unsupported-image-treatment" | "numbering-adapted" | "region-unknown" | "region-kind" | "region-full" | "layout-unplaced";
1946
- path: string;
1947
- message: string;
1948
- /**
1949
- * OPF 0.19, `layout-unplaced`: the overflow region the block was drawn in beyond its `max` (`paginate` moves it to a
1950
- * continuation slide). Absent when the layout has no overflow region and the block is drawn below the grid, which a
1951
- * continuation cannot change. The pin codes name the pinned region.
1952
- */
1953
- region?: string;
1954
- }
1955
- /** Physical legacy-family selection supplied by a font provider, independently of its numeric weight. */
1956
- interface FontFaceSelection {
1957
- family: string;
1958
- bold: boolean;
1959
- italic: boolean;
1960
- }
1961
- interface TextStyle {
1962
- fontFamily: string;
1963
- fontWeight: number;
1964
- italic?: boolean;
1965
- path?: string;
1966
- fontFace?: FontFaceSelection;
1967
- /** BCP-47 tag of a run that overrides the deck language (`TextRun.lang`); absent when the deck language applies. */
1968
- lang?: string;
1969
- }
1970
- /** Role families. `accent` is present only when the scheme defines an accent role; the slide tag and quote body use it. */
1971
- interface FontFamilies {
1972
- heading: string;
1973
- body: string;
1974
- code: string;
1975
- accent?: string;
1976
- }
1977
- /** Resolve role families from an already-merged font scheme (the resolved record plus design overrides).
1978
- * A scheme that names no heading or body family gets the engine default families (Aptos Display, Aptos).
1979
- * `code` comes from the scheme's `code` role, which catalog records such as consolas and courier-new
1980
- * carry; otherwise it is Roboto Mono. Heading and body families are never reused for code.
1981
- * `accent` is returned only when the scheme defines an `accent` role (a family name string);
1982
- * the slide tag and the quote body use it in place of the body and heading families. */
1983
- declare function resolveFontFamilies(input: unknown): FontFamilies;
1984
- interface TextMeasurement {
1985
- measure: (text: string, fontSize: number, style: TextStyle) => number;
1986
- resolveStyle?: (style: TextStyle) => TextStyle;
1987
- /** Shaped vector ink relative to the left baseline origin (positive y down).
1988
- * Null means no outline. These are not hinted/antialiased raster bounds. */
1989
- outlineBounds?: (text: string, fontSize: number, style: TextStyle) => LayoutBox | null;
1990
- /**
1991
- * Script planning: a measurement that measures each script run of a string with the face of its script slot in
1992
- * `profile` (and the host's glyph fallback), as the host's engines draw it. The renderer's `loadFonts()` measurement
1993
- * provides it with its script planner. `validate` and `paginate` call it with each slide's profile, and with a run language's own
1994
- * profile for a run that names one, so they measure script text the way preview and export do.
1995
- */
1996
- forScripts?: (profile: ScriptMeasurementProfile) => TextMeasurement;
1997
- }
1998
- /**
1999
- * The fonts handle every deck-level verb takes as `{ fonts }`. Core reads only `textMeasurement`: how wide the
2000
- * host's real fonts draw a string. The renderer's `loadFonts()` returns a richer handle (embedded fonts, font
2001
- * files, registry, manifest) that extends this one, so the same object goes to every verb.
2002
- */
2003
- interface Fonts {
2004
- textMeasurement?: TextMeasurement;
2005
- }
2006
- type MeasureTextWidth = (text: string, fontSize: number) => number;
2007
- declare function resolveTextStyle(style: TextStyle, measurement?: TextMeasurement): TextStyle;
2008
- declare function textWidthMeasurer(style: TextStyle, measurement?: TextMeasurement): MeasureTextWidth;
2009
- /** Validate an optional host outline measurement without inventing raster coverage. */
2010
- declare function measureTextOutline(text: string, fontSize: number, style: TextStyle, measurement?: TextMeasurement): LayoutBox | null | undefined;
2011
- interface TextLineInk {
2012
- width: number;
2013
- y: number;
2014
- baseline: number;
2015
- height: number;
2016
- outline: LayoutBox | null;
2017
- }
2018
- interface TextPlacementLine {
2019
- x: number;
2020
- y: number;
2021
- baseline: number;
2022
- height: number;
2023
- width: number;
2024
- outline: LayoutBox | null;
2025
- /** Physical alignment this line was placed with. Present only in a right-to-left deck, where `left` and `right` are logical start and end. */
2026
- alignment?: PhysicalAlignment;
2027
- }
2028
- interface TextPlacement {
2029
- alignment: 'left' | 'center' | 'right';
2030
- /** Reference-pixel clearance around vector outlines; not a universal raster guarantee. */
2031
- rasterPadding: number;
2032
- lines: TextPlacementLine[];
2033
- height: number;
2034
- overflow: boolean;
2035
- }
2036
- interface TextFit {
2037
- lines: string[];
2038
- fontSize: number;
2039
- lineHeight: number;
2040
- overflow: boolean;
2041
- placement?: TextPlacement;
2042
- /**
2043
- * Base direction of the paragraph each line belongs to, in line order. Present only when the fit was
2044
- * made for a right-to-left deck; every wrapped line shares its paragraph's direction (RR-05).
2045
- */
2046
- directions?: TextDirection[];
2047
- }
2048
- /** Place complete measured lines, preserving alignment where it leaves room for ink.
2049
- * Move following baselines together when outlines need more vertical separation. */
2050
- declare function placeTextLines(lines: readonly TextLineInk[], box: LayoutBox, alignment?: TextPlacement['alignment'], rasterPadding?: number, directions?: readonly TextDirection[]): TextPlacement;
2051
- /** RR-92: what composition computes for a chart item beyond its box. */
2052
- interface ComposedChart {
2053
- valueAxis?: ChartValueAxis;
2054
- }
2055
- interface ComposedItem {
2056
- path: string;
2057
- field: string;
2058
- type: string;
2059
- value: unknown;
2060
- payload: Record<string, unknown>;
2061
- box: LayoutBox;
2062
- /** Optional visible card allocation; box and all accepted internals occupy its padded interior. */
2063
- frameBox?: LayoutBox;
2064
- text?: TextFit | RichTextFit | ListFit | CodeTextFit;
2065
- textStyle?: TextStyle;
2066
- /** Complete accepted quote internals; consumers must reuse these fits and styles. */
2067
- quoteLayout?: QuoteLayout;
2068
- /** Complete accepted code internals, including source lines and literal tab positions. */
2069
- codeLayout?: CodeLayout;
2070
- /** Complete shared metric geometry, including its unit, label and metadata. */
2071
- metricLayout?: MetricLayout;
2072
- /** Complete timeline fields, markers and connector accepted by composition. */
2073
- timelineLayout?: TimelineLayout;
2074
- /**
2075
- * Picture bullet for `items`/`bullets` payloads when the effective `design.listBullet` is `image`
2076
- * and the deck's icon logo resolves. Every entry marker in `text.listEntries` carries the same value.
2077
- */
2078
- bulletImage?: ListBulletImage;
2079
- /**
2080
- * Caption band of an image, chart, table or video payload that carries `caption` (RR-34). `box` is
2081
- * the media box after the band is reserved; `caption.box` is the band inside the same region.
2082
- */
2083
- caption?: ComposedCaption;
2084
- /** Picture geometry and treatments of an image item (`field` image); absent on every other item. */
2085
- image?: ComposedImage;
2086
- /**
2087
- * RR-92: the value axis of a column, bar, line or area chart (`field` chart), computed from the chart box (`chartValueAxis`). The preview
2088
- * draws it and the PPTX export writes it as `c:min`, `c:max` and `c:majorUnit`, so both show the same axis. Absent for every other chart
2089
- * type (combo, scatter, pie and the rest keep the engines' own axis) and for charts whose data does not resolve.
2090
- */
2091
- chart?: ComposedChart;
2092
- /** Effective container settings, including inherited readability constraints. */
2093
- composition: Composition;
2094
- /**
2095
- * Resolved horizontal text alignment for this item: titleAlignment for the title, the tag and a subtitle that sits in
2096
- * the title area (not a layout's own 'subtitle' region), contentAlignment for every other item (slide design, deck design
2097
- * or host, theme design, layout design, then center for metrics or left for other items). Engines anchor native and preview text to this value.
2098
- */
2099
- alignment: 'left' | 'center' | 'right';
2100
- /**
2101
- * OPF 0.19: the layout template region the item was drawn in (`SlideComposition.regions[].name`); absent on headings,
2102
- * placed images and slides without a template layout. The PPTX exporter tags the shape with it.
2103
- */
2104
- region?: string;
2105
- /**
2106
- * OPF 0.19: a list laid out in columns (a lone list in a region with `listColumns: "auto"`, or a list payload with
2107
- * `columns`): one entry per column, in reading order, each with its cell, the half-open range of the payload's items it
2108
- * holds and its own fit at the shared font size. Numbering continues across columns. The item's `text` is the whole list:
2109
- * every entry of every column at its column's position (one ListFit, `overflow` when any column overflows), so a consumer
2110
- * that ignores `listColumns` still draws every item; `box` is the whole list's cell.
2111
- */
2112
- listColumns?: ComposedListColumn[];
2113
- }
2114
- /** One column of a list laid out in columns (`ComposedItem.listColumns`). */
2115
- interface ComposedListColumn {
2116
- box: LayoutBox;
2117
- /** First item of the payload in this column. */
2118
- start: number;
2119
- /** One past the last item. */
2120
- end: number;
2121
- text: ListFit;
2122
- }
2123
- /**
2124
- * OPF 0.19: one body region of the slide's layout template, as composed for this slide (`SlideComposition.regions`), so
2125
- * editors can draw drop targets and exporters can place layout placeholders and tag shapes. Every region of the template
2126
- * is listed, in reading order, filled or not.
2127
- */
2128
- interface ComposedRegion {
2129
- /** The region's name (its key in the record's `regions`). */
2130
- name: string;
2131
- /**
2132
- * The region's cell on this slide, after mirroring and bleed: a bled region's outer edges that lie on the content box
2133
- * reach the slide edge. A collapsed region keeps the cell of its own area (possibly zero high), which another area
2134
- * has taken over.
2135
- */
2136
- box: LayoutBox;
2137
- accepts: RegionKind[];
2138
- role: RegionRole;
2139
- /** The record's `flow`. */
2140
- flow: RegionFlow;
2141
- max: number;
2142
- anchor: RegionAnchor;
2143
- /**
2144
- * How the blocks were arranged: `grid` (the grid sequence by count), `row`, `column`, or `composition` when the
2145
- * slide's own `composition.mode`, `columns` or `weights` arranged its first primary flowing region. Absent when empty.
2146
- */
2147
- arrangement?: 'grid' | 'row' | 'column' | 'composition';
2148
- /** OPF paths of the content bound to the region within `max`, in source order: root blocks (`slides.N.blocks.I`) or root payload fields (`slides.N.text`). */
2149
- content: string[];
2150
- /** Content no region had room for, drawn here beyond `max` (`opf/layout-unplaced`; `paginate` moves it to a continuation slide). */
2151
- overflow?: string[];
2152
- /** The region received no content and its cells joined a neighbour on this slide. */
2153
- collapsed?: true;
2154
- bleed?: true;
2155
- /** A bled region's cell inside the content box, before bleed. */
2156
- areaBox?: LayoutBox;
2157
- }
2158
- /** OPF 0.19: a heading area of the slide's layout template (`title`, or `subtitle` when the template has one). */
2159
- interface ComposedHeadingArea {
2160
- name: 'title' | 'subtitle';
2161
- box: LayoutBox;
2162
- /** The slide has no heading for it and its cells joined a neighbour. */
2163
- collapsed?: true;
2164
- /** The template has no `title` area: an `auto` row on top that holds the slide's headings. */
2165
- implicit?: true;
2166
- /**
2167
- * The title area of a template without a `subtitle` area, split where the stacked heading group puts the subtitle: `title`
2168
- * runs from the area's top to the bottom of the title (with the tag above it), `subtitle` from the subtitle's top (where it
2169
- * would start, half a gap under the title, when the slide has none) to the area's bottom. PowerPoint's ctrTitle and
2170
- * subTitle placeholders use these boxes. Absent when the slide has no headings in the area.
2171
- */
2172
- parts?: {
2173
- title: LayoutBox;
2174
- subtitle: LayoutBox;
2175
- };
2176
- }
2177
- /** How a picture fills its frame: cover crops around the focus, contain shows all of it, stretch scales it to the frame. */
2178
- type ImageFit = 'cover' | 'contain' | 'stretch';
2179
- /** A background also tiles: the picture repeats at its own size from the canvas's top-left corner. */
2180
- type BackgroundImageFit = ImageFit | 'tile';
2181
- /** A slide or frame edge, physical (already mirrored in a right-to-left deck). */
2182
- type ImageEdge = 'left' | 'right' | 'top' | 'bottom';
2183
- /** A point of a picture as fractions of its width and height from the top-left corner; the default is { x: 0.5, y: 0.5 }. */
2184
- interface ImageFocus {
2185
- x: number;
2186
- y: number;
2187
- }
2188
- /** A frame mask. path follows the ECMA-376 preset formula for preset/adjust exactly, in reference pixels. */
2189
- interface ImageShape {
2190
- kind: 'rectangle' | 'rounded' | 'circle' | 'hexagon';
2191
- preset: 'rect' | 'roundRect' | 'ellipse' | 'hexagon';
2192
- /** DrawingML avLst guide values (for example adj and vf), in 1/100000 units. */
2193
- adjust: Record<string, number>;
2194
- path: string;
2195
- }
2196
- /** One overlay, shared by image backgrounds and image blocks: drawn directly above its picture, beneath content. */
2197
- interface ComposedOverlay {
2198
- /** OPF path of the overlay value, for example `slides.3.design.background.overlay` or `slides.3.blocks.0.overlay`. */
2199
- path: string;
2200
- /** ColorRef as authored (hex, eight-digit hex alpha, scheme slot or role, `var:<id>`); engines resolve it. */
2201
- color: unknown;
2202
- /** Fill opacity, 0 to 1, multiplied with any eight-digit hex alpha. */
2203
- opacity: number;
2204
- /** Physical edge of a band overlay; absent when the overlay covers the whole frame. */
2205
- edge?: ImageEdge;
2206
- /** Area covered: the whole frame, or the edge band. */
2207
- box: LayoutBox;
2208
- /** Outline to fill: the frame's shape for a whole-frame overlay, a rectangle for a band. */
2209
- shape: ImageShape;
2210
- }
2211
- /** Where the whole picture lands for a fit, for a picture whose aspect ratio is known (see `fitImage`). */
2212
- interface ImageFitPlacement {
2213
- /** The whole picture's rectangle in slide coordinates: past the frame for cover, inside it for contain, the frame for stretch. */
2214
- image: LayoutBox;
2215
- /** DrawingML srcRect insets as fractions of the picture (positive crops, negative pads); all 0 for stretch. */
2216
- crop: {
2217
- left: number;
2218
- top: number;
2219
- right: number;
2220
- bottom: number;
2221
- };
2222
- }
2223
- /** A placed image block's band (FA-22): the image bleeds to `edge` and the rest of the slide composes beside it. */
2224
- interface ComposedPlacement {
2225
- /** Physical edge: in a right-to-left deck an authored `left` (the start side) is `right` here. */
2226
- edge: ImageEdge;
2227
- /** Share of the slide width (left, right) or height (top, bottom), 0.1 to 0.9. */
2228
- size: number;
2229
- /** True when the frame sits inside the slide padding instead of edge to edge. */
2230
- inset: boolean;
2231
- /** Where the placement is written: `slides.N.blocks.I.placement`. */
2232
- path: string;
2233
- }
2234
- /**
2235
- * Resolved picture geometry of an image item (FA-22): every composed item with `field` 'image' carries one. Engines
2236
- * draw the picture in `box` with `fit` and `focus`, clipped to `shape`, with `recolor` and `opacity` on its pixels
2237
- * only, then the `border` on the shape outline, then the `overlay`. This is the paint order and the treatment code
2238
- * 0.14's slide image used.
2239
- */
2240
- interface ComposedImage {
2241
- /** Allocated region, equal to the item's box: the flow cell (after any card padding and caption band) or the placement band. */
2242
- region: LayoutBox;
2243
- /** Picture frame inside the region: the band inside the slide padding for an inset placement, then the largest centered box with `aspectRatio` (a circle uses 1). */
2244
- box: LayoutBox;
2245
- /** The block's own fit, else the effective design.imageFit, else cover. */
2246
- fit: ImageFit;
2247
- focus: ImageFocus;
2248
- /** Mask on the frame: a DrawingML preset with its guide values, and the same outline as an SVG path. */
2249
- shape: ImageShape;
2250
- /** Line centered on the shape outline; width in reference pixels, already scaled to the canvas. */
2251
- border?: {
2252
- color: unknown;
2253
- width: number;
2254
- };
2255
- /** Picture opacity below 1; the border and overlay are not affected. */
2256
- opacity?: number;
2257
- /** Luminance-based recolor (Rec. 601 weights on sRGB values). */
2258
- recolor?: {
2259
- type: 'grayscale';
2260
- } | {
2261
- type: 'duotone';
2262
- dark: unknown;
2263
- light: unknown;
2264
- };
2265
- overlay?: ComposedOverlay;
2266
- /** Present on a placed block: the band along a slide edge that `region` is. */
2267
- placement?: ComposedPlacement;
2268
- /** Present when core reads the picture's aspect ratio (a data URI, or an `asset:` reference to one); otherwise call `fitImage` with the host's. */
2269
- picture?: ImageFitPlacement;
2270
- }
2271
- /**
2272
- * The slide's picture background (FA-22): the effective `design.background` (the slide's, then the deck's, then
2273
- * `ComposeSlideOptions.themeBackground`) when it is an image, in object form or as an image-source string. It fills
2274
- * the whole canvas behind everything and never moves content. Paint order: the colour scheme's default slide
2275
- * background, the picture (with `recolor` and `opacity` on its pixels), the overlay, then furniture and content.
2276
- */
2277
- interface ComposedBackgroundImage {
2278
- /** Where the background is written: `slides.N.design.background`, `design.background`, or `theme` (ComposeSlideOptions.themeBackground). */
2279
- path: string;
2280
- /** Image source as authored: `asset:<id>`, an https URL, a data URI or a relative path. */
2281
- src: string;
2282
- alt?: string;
2283
- fit: BackgroundImageFit;
2284
- focus: ImageFocus;
2285
- /** The whole canvas. */
2286
- box: LayoutBox;
2287
- /** Picture opacity below 1; the overlay keeps its own. */
2288
- opacity?: number;
2289
- /** Luminance-based recolor of the pixels (Rec. 601 weights on sRGB values), as on an image block. */
2290
- recolor?: {
2291
- type: 'grayscale';
2292
- } | {
2293
- type: 'duotone';
2294
- dark: unknown;
2295
- light: unknown;
2296
- };
2297
- overlay?: ComposedOverlay;
2298
- /** Present when core reads the picture's aspect ratio and the fit is not tile; otherwise call `fitImage` with the host's. */
2299
- picture?: ImageFitPlacement;
2300
- }
2301
- /**
2302
- * The deck logo drawn on a cover or section slide, at the top-left of the free area and above the
2303
- * centered heading group: the primary organization's full logo, or the `design.logo` override. Consumers fit the
2304
- * image inside `box` preserving its aspect ratio, anchored left and vertically centered; content slides never carry one.
2305
- * `shape`, `variant` and `reference` are those of `resolveLogo`.
2306
- */
2307
- interface ComposedLogo {
2308
- box: LayoutBox;
2309
- shape: LogoShape;
2310
- path: string;
2311
- source: unknown;
2312
- variant: LogoVariant;
2313
- reference: string;
2314
- anchor: 'left' | 'right';
2315
- }
2316
- /** Picture bullet source for list markers: the deck's icon logo and the OPF path it was read from. */
2317
- interface ListBulletImage {
2318
- source: unknown;
2319
- path: string;
2320
- }
2321
- interface ComposedGroup {
2322
- path: string;
2323
- box: LayoutBox;
2324
- contentBox: LayoutBox;
2325
- composition: Composition;
2326
- }
2327
- interface CompositionTrack {
2328
- offset: number;
2329
- size: number;
2330
- }
2331
- /** Resolved flow geometry, including empty reserved slots. Promoted regions are not flows. */
2332
- interface ComposedFlow {
2333
- path: string;
2334
- box: LayoutBox;
2335
- composition: Composition;
2336
- columns: CompositionTrack[];
2337
- rows: CompositionTrack[];
2338
- gap: number;
2339
- itemCount: number;
2340
- slotCount: number;
2341
- }
2342
- /** Additive penalties in grid-score-v9; lower is preferred. These are not quality percentages. */
2343
- interface CompositionPenalties {
2344
- cellProportions: number;
2345
- fontReduction: number;
2346
- textOverflow: number;
2347
- tableOverflow: number;
2348
- smallCells: number;
2349
- emptySlots: number;
2350
- }
2351
- interface CompositionCandidate {
2352
- columns: number;
2353
- rows: number;
2354
- score: number;
2355
- penalties: CompositionPenalties;
2356
- }
2357
- interface CompositionDecision {
2358
- path: string;
2359
- mode: NonNullable<Composition['mode']> | 'regions';
2360
- /** `chart-primary`: the root split a primary chart from a synthetic container of the other nodes (design.chartPrimary). */
2361
- reason: 'lowest-score' | 'configured-mode' | 'promoted-regions' | 'chart-primary';
2362
- selectedColumns?: number;
2363
- /** Only candidates actually evaluated by automatic selection, in tie-break order. */
2364
- candidates: CompositionCandidate[];
2365
- }
2366
- interface CompositionExplanation {
2367
- algorithm: 'grid-score-v9';
2368
- /** Provided widths do not establish shaping, glyph coverage or native fidelity. */
2369
- textMeasurement: 'estimated' | 'provided';
2370
- /** Optional vector coverage for headings and scalar/rich text, not every payload. */
2371
- textOutlines: 'provided' | 'unavailable';
2372
- /** Effective body-text reference pixels; furniture reports its own placement padding. Not a universal raster tolerance. */
2373
- textRasterPadding: number;
2374
- decisions: CompositionDecision[];
2375
- /** Payloads whose complete internal fit is not covered by this scoring model. */
2376
- unmeasuredPayloads: string[];
2377
- }
2378
- interface SlideComposition {
2379
- width: number;
2380
- height: number;
2381
- /**
2382
- * The body's frame: the canvas minus padding, header and footer bands, the footnote area and placed-image bands, below
2383
- * the headings on an automatic slide. For a template layout (OPF 0.19) it is the whole template frame, the title area
2384
- * included (`headingAreas` and `regions` lie inside it, except where a bled region reaches the slide edge).
2385
- */
2386
- contentBox: LayoutBox;
2387
- items: ComposedItem[];
2388
- groups: ComposedGroup[];
2389
- flows: ComposedFlow[];
2390
- /** OPF 0.19: every body region of the slide's layout template, in reading order; present only for a template layout. */
2391
- regions?: ComposedRegion[];
2392
- /** OPF 0.19: the template's heading areas (`title`, `subtitle`) with their boxes; present only for a template layout. */
2393
- headingAreas?: ComposedHeadingArea[];
2394
- diagnostics: LayoutDiagnostic[];
2395
- composition: Composition;
2396
- /** Repeated furniture is measured separately from body pagination leaves. */
2397
- furniture?: FurnitureLayout;
2398
- /**
2399
- * Effective shared design hints of this slide: slide design, then deck design, then the layout record's design,
2400
- * per key. Renderers and exporters read titleAlignment, contentAlignment, contentBox and
2401
- * listBullet here instead of re-deriving them from the document; image items carry their resolved fit in `image.fit`.
2402
- */
2403
- design: ResolvedDesignHints;
2404
- /** Picture background of this slide; absent when the effective background is not an image. */
2405
- backgroundImage?: ComposedBackgroundImage;
2406
- /** Deck logo on a cover or section slide; absent on content slides and when no logo resolves. */
2407
- logo?: ComposedLogo;
2408
- /**
2409
- * Footnote area of a slide whose runs cite references or carry footnotes (RR-34): directly above the
2410
- * footer band, the content area is shrunk by exactly its height. Absent on slides without markers.
2411
- */
2412
- footnotes?: ComposedFootnotes;
2413
- /** `rtl` when the slide was composed for a right-to-left deck (mirrored arrangement); absent for left-to-right decks. */
2414
- direction?: 'rtl';
2415
- explanation?: CompositionExplanation;
2416
- }
2417
- interface ComposeSlideOptions {
2418
- /** Context for inherited furniture, generated organization names, social profiles, logos, layout hints, references and marker numbering. */
2419
- presentation?: {
2420
- language?: unknown;
2421
- design?: {
2422
- header?: unknown;
2423
- footer?: unknown;
2424
- background?: unknown;
2425
- imageFit?: unknown;
2426
- logo?: unknown;
2427
- contentDirection?: unknown;
2428
- chartPrimary?: unknown;
2429
- listBullet?: unknown;
2430
- titleAlignment?: unknown;
2431
- contentAlignment?: unknown;
2432
- contentBox?: unknown;
2433
- mirror?: unknown;
2434
- };
2435
- organization?: unknown;
2436
- speaker?: unknown;
2437
- slides?: unknown;
2438
- catalogs?: unknown;
2439
- references?: unknown;
2440
- datasets?: unknown;
2441
- };
2442
- /**
2443
- * OPF 0.19: the resolved theme record's `design` (titleAlignment, contentAlignment, contentBox, contentDirection,
2444
- * imageFit, listBullet). It ranks below the deck's design and above the layout record's. `resolveSlideContext` passes it.
2445
- */
2446
- themeDesign?: unknown;
2447
- /**
2448
- * Whether the slide background is dark, by the host's own luminance test. Selects each logo's
2449
- * `onDark` value (cover logo, `var:organization.logo.*` in zone images, picture bullets). Core never inspects colors.
2450
- */
2451
- darkBackground?: boolean;
2452
- /**
2453
- * The resolved theme's `background`, the lowest level of the background chain (the slide's design.background, then
2454
- * the deck's, then this). Only an image background produces geometry (`SlideComposition.backgroundImage`).
2455
- * `resolveSlideContext` passes it.
2456
- */
2457
- themeBackground?: unknown;
2458
- /** One-based displayed number for `{{slide.number}}` in header/footer text; source paths still use slideIndex. */
2459
- slideNumber?: number;
2460
- /** Displayed slide count for `{{deck.slideCount}}` in header/footer text. Defaults to `presentation.slides.length`. */
2461
- slideCount?: number;
2462
- /**
2463
- * Host-supplied current calendar date (ISO YYYY-MM-DD) for `date: true` furniture. Core never
2464
- * consults a clock; without this option a current date is reported as unresolved content.
2465
- */
2466
- date?: string;
2467
- fontFamilies?: Partial<FontFamilies>;
2468
- /**
2469
- * Deck base direction (RR-05). Defaults to the direction of the presentation language's script. In a right-to-left deck
2470
- * composition mirrors the arrangement (the first column or `left` region is drawn at the right, slide images, logos and
2471
- * header/footer zones swap sides, tables run right to left), lists put their markers at the right, and every text fit
2472
- * reports each paragraph's direction. Alignment stays logical: `left` is the start edge.
2473
- */
2474
- direction?: TextDirection;
2475
- /** Deck-level alignment a host resolved itself. It ranks with `presentation.design`, above the layout record's design and below the slide's own design; hosts normally omit it because composition reads `presentation.design` and the layout. */
2476
- contentAlignment?: 'left' | 'center' | 'right';
2477
- titleAlignment?: 'left' | 'center' | 'right';
2478
- /** Unscaled reference pixels around provided vector outlines; defaults to 1 for body text and 2 for furniture. Explicit values apply to both. */
2479
- textRasterPadding?: number;
2480
- /** Deck-level body cards a host resolved itself, ranked like contentAlignment. A slide's explicit design.contentBox overrides this value. */
2481
- contentBox?: boolean;
2482
- textMeasurement?: TextMeasurement;
2483
- width?: number;
2484
- height?: number;
2485
- slideIndex?: number;
2486
- layout?: Record<string, unknown>;
2487
- /** Return candidate scores and coverage without changing the selected geometry. */
2488
- explain?: boolean;
2489
- }
2490
- declare class OPFCompositionError extends Error {
2491
- readonly diagnostics: LayoutDiagnostic[];
2492
- readonly code = "layout-overflow";
2493
- readonly explanation?: CompositionExplanation;
2494
- constructor(diagnostics: LayoutDiagnostic[], explanation?: CompositionExplanation);
2495
- }
2496
- /**
2497
- * Outline of a DrawingML preset in a box, following the ECMA-376 presetShapeDefinitions formulas:
2498
- * roundRect (adj; ss = min(w,h), radius = ss*adj/100000), ellipse, and hexagon (adj, vf).
2499
- */
2500
- declare function imageShape(kind: ImageShape['kind'], box: LayoutBox, cornerRadius?: number): ImageShape;
2501
- /**
2502
- * The shared fit math every engine uses (FA-22). `aspect` is the picture's width / height. cover scales the picture
2503
- * to cover the frame and centers the focus point in the frame as far as the picture still covers it, so the focus
2504
- * point always stays in view ({0.5, 0.5} is a center crop, {0, 0} keeps the top-left corner). contain scales it to
2505
- * fit and centers it; stretch fills the frame exactly. Focus applies to cover only. `crop` holds the DrawingML
2506
- * srcRect insets as fractions of the picture: positive insets crop, negative insets pad.
2507
- */
2508
- declare function fitImage(frame: LayoutBox, fit: ImageFit, aspect: number, focus?: ImageFocus): ImageFitPlacement;
2509
- /** The background a value describes when it is an image: the object form, or an image-source string (a cover image). */
2510
- declare function imageBackground(value: unknown): {
2511
- src: string;
2512
- alt?: string;
2513
- fit: BackgroundImageFit;
2514
- focus: ImageFocus;
2515
- opacity?: number;
2516
- recolor?: unknown;
2517
- overlay?: unknown;
2518
- } | undefined;
2519
- interface FurniturePartBase {
2520
- kind: 'header' | 'footer';
2521
- zone: 'left' | 'center' | 'right';
2522
- field: 'text' | 'image' | 'socials' | 'date';
2523
- /** Literal field or controlling flag, with the actual inherited/local path. */
2524
- path: string;
2525
- /** String/asset source, when different from a generated field's flag; for a logo reference, the organization logo value drawn. */
2526
- sourcePath?: string;
2527
- generated: boolean;
2528
- /**
2529
- * The part's own box. A zone lays its parts out in one row, in the order image, text, socials, date (mirrored in a
2530
- * right-to-left deck), aligned to the zone's edge with FURNITURE_GAP between parts and each part vertically centered
2531
- * in the row. A zone with one part keeps the full zone width for text. The zones sit on the content inset
2532
- * (`composition.padding`); a zone beside empty zones takes their width (FURNITURE_ZONE_GUTTER between occupied zones).
2533
- */
2534
- box: LayoutBox;
2535
- alignment: 'left' | 'center' | 'right';
2536
- }
2537
- interface FurnitureTextPart extends FurniturePartBase {
2538
- type: 'text';
2539
- text: string;
2540
- style: TextStyle;
2541
- requestedFontSize: number;
2542
- minFontSize: number;
2543
- fit: SourceTextFit;
2544
- /**
2545
- * Live values inside `text`: every substituted `{{slide.number}}` of a `text` part (type
2546
- * `slideNumber`), and a whole current (`date: true`) date (type `date`), as half-open UTF-16
2547
- * offsets into `text`. Hosts such as PPTX may emit them as native fields; all other text,
2548
- * including `{{deck.slideCount}}`, `{{slide.section}}` and formatted fixed dates, is fixed.
2549
- */
2550
- fields?: FurnitureField[];
2551
- /**
2552
- * Generated `socials` only: one entry per explicit source line of `text`, in
2553
- * order. A part may carry both `fields` and `links`; hosts apply each link to
2554
- * its whole source line and each field range within it.
2555
- */
2556
- links?: FurnitureSocialLink[];
2557
- }
2558
- /** Optional generated metadata for one furniture text part (live fields and/or social links). */
2559
- interface FurnitureTextExtras {
2560
- fields?: FurnitureField[];
2561
- links?: FurnitureSocialLink[];
2562
- }
2563
- interface SocialProfile {
2564
- /** Single-line display text: the profile URL without an `https://` scheme, or the raw value. */
2565
- text: string;
2566
- /** Full http(s) URL when the value is one or its platform record formats one. */
2567
- href?: string;
2568
- /** Whether the platform's URL pattern formatted a handle. */
2569
- resolved: boolean;
2570
- }
2571
- interface FurnitureSocialLink extends SocialProfile {
2572
- /** Socials key (platform id). */
2573
- platform: string;
2574
- /** Authored value path, such as `organization.socials.x`. */
2575
- sourcePath: string;
2576
- }
2577
- /**
2578
- * Format one Socials value through the engine's social-platform vocabulary (SOCIAL_PLATFORMS), deterministically and
2579
- * without network access. `owner` selects companyUrlPattern for organizations.
2580
- * URLs pass through; unknown platforms and unformattable values stay raw.
2581
- */
2582
- declare function resolveSocialProfile(platform: string, value: string, owner?: 'organization' | 'speaker'): SocialProfile;
2583
- interface FurnitureImagePart extends FurniturePartBase {
2584
- type: 'image';
2585
- /** The asset to draw: the zone `image` as written, or the organization logo a logo reference resolved to for this slide. */
2586
- image: unknown;
2587
- /** The slide-scoped logo reference the zone wrote (`var:organization.logo.icon`), when `image` came from one. */
2588
- reference?: string;
2589
- }
2590
- type FurniturePart = FurnitureTextPart | FurnitureImagePart;
2591
- interface FurnitureLayout {
2592
- algorithm: 'furniture-flow-v2';
2593
- /** Includes explicitly empty definitions, which override inherited furniture. */
2594
- configured: boolean;
2595
- textMeasurement: 'estimated' | 'provided';
2596
- textOutlines: 'provided' | 'unavailable';
2597
- parts: FurniturePart[];
2598
- /** Outer occupied edges; composeSlide adds its normal content gap. */
2599
- headerBottom: number;
2600
- footerTop: number;
2601
- diagnostics: LayoutDiagnostic[];
2602
- overflow: boolean;
2603
- }
2604
- /** Gap between the parts of one header/footer zone row, in reference pixels (scaled with the canvas's short edge). */
2605
- declare const FURNITURE_GAP = 12;
2606
- /** Gap between the three header/footer zones, as a share of the canvas width. An empty zone's column is lent to its occupied neighbours. */
2607
- declare const FURNITURE_ZONE_GUTTER = 0.02;
2608
- /** In a zone with other parts, an image is at most this share of the zone's width, so a wide logo cannot starve the text. */
2609
- declare const FURNITURE_IMAGE_SHARE = 0.4;
2610
- /** Resolve and measure repeated fields without mutating metadata or consulting a clock. */
2611
- declare function layoutFurniture(input: unknown, options?: ComposeSlideOptions): FurnitureLayout;
2612
- /**
2613
- * WI-4: the type roles of the content scale, in reference pixels (a 13.333 x 7.5 in slide is 1280 x 720). Prose and a subtitle ask for 28 px
2614
- * (21 pt) and a list item for 32 px; a lone short block uses the 32 px lead size. Each fits down to the readability floor
2615
- * (`composition.minFontSize`, 16 px by default) and an explicit run size wins.
2616
- */
2617
- declare const PROSE_NOMINAL_SIZE = 28;
2618
- declare const LIST_NOMINAL_SIZE = 32;
2619
- declare const LEAD_NOMINAL_SIZE = 32;
2620
- declare const TABLE_NOMINAL_SIZE = 25;
2621
- /** WI-4: a quote body asks for 40 px and fits down (to 28 px and below); a code body asks for 22 px and fits down to the floor. */
2622
- declare const QUOTE_NOMINAL_SIZE = 40;
2623
- declare const CODE_NOMINAL_SIZE = 22;
2624
- /** Joins a quote's attribution and source (an en dash with a space on each side); import reads the older ' - ' too. */
2625
- declare const QUOTE_SOURCE_SEPARATOR = " \u2013 ";
2626
- /** Deterministic estimate, not a font shaping engine. Spacing marks outside Latin/CJK contribute; nonspacing/enclosing marks do not. */
2627
- declare function measureText(text: string, fontSize: number): number;
2628
- declare function wrapText(text: string, width: number, fontSize: number, measure?: MeasureTextWidth): string[];
2629
- declare function fitText(text: string, box: LayoutBox, requestedSize?: number, minFontSize?: number, measure?: MeasureTextWidth, direction?: TextDirection, balance?: boolean): SourceTextFit;
2630
- /**
2631
- * PowerPoint stores a run size (`sz`) in hundredths of a point, and composition pixels are CSS pixels (96 per
2632
- * inch, so a point is 4/3 px). Every composed font size is therefore a whole multiple of 0.01 pt, which is
2633
- * 1/75 px: the preview then measures, breaks and draws exactly the size the export writes (RR-16).
2634
- * The tolerance absorbs binary rounding noise (a size already on the grid must not drop a step).
2635
- */
2636
- declare const FONT_SIZE_GRID_PER_PX = 75;
2637
- /** Largest grid size not above `px`. Rounding down keeps a size that fit before snapping fitting. */
2638
- declare function snapFontSizeDown(px: number): number;
2639
- /** Smallest grid size not below `px`. Used for readability floors, so a floor is never undercut. */
2640
- declare function snapFontSizeUp(px: number): number;
2641
- /** `text` is a string or TextRun[] (FA-10); attribution, role and source stay plain strings. */
2642
- interface QuoteContent {
2643
- text: string | readonly (string | RichTextRun)[];
2644
- attribution?: string;
2645
- role?: string;
2646
- photo?: unknown;
2647
- source?: string;
2648
- }
2649
- /** Source and displayed-text ranges are half-open UTF-16 offsets. Added punctuation has no source range. */
2650
- interface QuoteTextSource {
2651
- path: string;
2652
- start: number;
2653
- end: number;
2654
- outputStart: number;
2655
- outputEnd: number;
2656
- }
2657
- interface QuoteTextPart {
2658
- role: 'body' | 'footer';
2659
- path: string;
2660
- text: string;
2661
- sources: QuoteTextSource[];
2662
- /** Available space, before fitting. Invalid dimensions remain visible in failed results. */
2663
- box: LayoutBox;
2664
- requestedFontSize: number;
2665
- minFontSize: number;
2666
- requestedStyle: TextStyle;
2667
- style: TextStyle;
2668
- /**
2669
- * The displayed runs of a rich quote body (FA-10): the quote's TextRun[] with the quotation marks joined to its first and
2670
- * last run, so a run's index and a citation marker's position never shift. Absent for a string body and for the footer.
2671
- */
2672
- runs?: (string | RichTextRun)[];
2673
- /** Absent when the available box is invalid; never fit against an invented one-pixel box. A rich body reports a RichTextFit. */
2674
- fit?: TextFit | RichTextFit;
2675
- }
2676
- interface QuoteLayoutDiagnostic extends LayoutDiagnostic {
2677
- reason: 'invalid-part-box' | 'part-outside-cell' | 'text-fit' | 'part-overlap' | 'photo-fit';
2678
- parts: QuoteTextPart['role'][];
2679
- }
2680
- /**
2681
- * The attributed person's headshot (FA-12): a circle at the start edge of the footer row, beside the
2682
- * attribution and role lines (the left in a left-to-right deck, the right in a right-to-left one). Its diameter is
2683
- * three times the footer font size, so it follows the text when the footer shrinks toward the readability floor.
2684
- */
2685
- interface QuotePhoto {
2686
- /** Path of the photo value, `<quote path>.photo`. */
2687
- path: string;
2688
- /** Asset value (string or Asset object) that engines resolve like any other image; crop to cover the frame. */
2689
- value: unknown;
2690
- /** Square frame, in reference pixels. */
2691
- box: LayoutBox;
2692
- /** Circle mask: the `ellipse` DrawingML preset and the same outline as an SVG path, as an image block's shape 'circle'. */
2693
- shape: ImageShape;
2694
- }
2695
- interface QuoteLayout {
2696
- /** Measured vertical content envelope at the allocated width, including the photo. */
2697
- bounds: LayoutBox;
2698
- algorithm: 'quote-flow-v1';
2699
- textMeasurement: 'estimated' | 'provided';
2700
- parts: QuoteTextPart[];
2701
- /** Present when the quote has a photo; absent otherwise, and then the layout is the footer-only layout. */
2702
- photo?: QuotePhoto;
2703
- diagnostics: QuoteLayoutDiagnostic[];
2704
- overflow: boolean;
2705
- }
2706
- interface QuoteLayoutOptions {
2707
- /** Canvas short edge divided by 720. Insets retain the current 18 reference-pixel contract. */
2708
- scale?: number;
2709
- fontFamilies?: Partial<FontFamilies>;
2710
- /** Readability floor in reference pixels, before canvas scaling. */
2711
- minFontSize?: number;
2712
- overflow?: Composition['overflow'];
2713
- path?: string;
2714
- textMeasurement?: TextMeasurement;
2715
- /** Deck direction; in a right-to-left deck every part fit reports its paragraphs' directions (RR-05). */
2716
- direction?: TextDirection;
2717
- /** Marker text for a rich body run by its dotted path (`<path>.text.<runIndex>`); composeSlide supplies the deck numbering. */
2718
- citationMarker?: (runPath: string) => string | undefined;
2719
- /** BCP-47 tag of the deck language: it picks the quotation marks (`quoteMarksFor`). Without one the marks are English (“…”). */
2720
- language?: string;
2721
- }
2722
- /**
2723
- * Allocate and measure quote body/footer space for composition, rendering and export. Callers must
2724
- * check overflow before accepting the parts. Line boxes are not shaped glyph or native raster bounds.
2725
- */
2726
- declare function layoutQuote(value: string | QuoteContent, box: LayoutBox, options?: QuoteLayoutOptions): QuoteLayout;
2727
- interface MetricContent {
2728
- value: string | number;
2729
- label?: string;
2730
- description?: string;
2731
- unit?: string;
2732
- delta?: string | number;
2733
- trend?: 'up' | 'down' | 'flat';
2734
- /** Whether the change is good news; colours the trend arrow, trend word and delta text (see metricTrendColor). */
2735
- sentiment?: MetricSentiment;
2736
- }
2737
- /** The text fields of a metric, each laid out as its own part. `sentiment` is metadata, not text. */
2738
- type MetricTextRole = Exclude<keyof MetricContent, 'sentiment'>;
2739
- /** Ranges address String(sourceValue), not the numeric token spelling in serialized JSON. */
2740
- interface MetricTextSource {
2741
- path: string;
2742
- value: string | number;
2743
- start: number;
2744
- end: number;
2745
- }
2746
- interface MetricTextPart {
2747
- role: MetricTextRole;
2748
- path: string;
2749
- text: string;
2750
- sources: MetricTextSource[];
2751
- /** Empty optional fields retain their source mapping but occupy no visible space. */
2752
- visible: boolean;
2753
- /** Accepted absolute origin/baseline for each fit.sourceLines entry, including blank lines. */
2754
- linePositions: {
2755
- x: number;
2756
- baseline: number;
2757
- }[];
2758
- box: LayoutBox;
2759
- requestedFontSize: number;
2760
- minFontSize: number;
2761
- requestedStyle: TextStyle;
2762
- style: TextStyle;
2763
- /** Source-preserving line/segment representation shared with code, with proportional fonts. */
2764
- fit?: CodeTextFit;
2765
- }
2766
- interface MetricLayoutDiagnostic extends LayoutDiagnostic {
2767
- reason: 'invalid-part-box' | 'part-outside-cell' | 'text-fit' | 'part-overlap';
2768
- parts: MetricTextPart['role'][];
2769
- }
2770
- interface MetricLayout {
2771
- /** Measured vertical value/metadata envelope at the allocated width. */
2772
- bounds: LayoutBox;
2773
- algorithm: 'metric-flow-v1';
2774
- alignment: 'left' | 'center' | 'right';
2775
- textMeasurement: 'estimated' | 'provided';
2776
- arrangement: 'inline-unit' | 'stacked';
2777
- /** The metric's `sentiment`, passed through for metricTrendMark; omitted when the content has none. */
2778
- sentiment?: MetricSentiment;
2779
- /** At most 48 arrangements; value fitting is bounded by 77 reference-size trials per arrangement. */
2780
- attempts: number;
2781
- parts: MetricTextPart[];
2782
- diagnostics: MetricLayoutDiagnostic[];
2783
- overflow: boolean;
2784
- }
2785
- interface MetricLayoutOptions extends QuoteLayoutOptions {
2786
- /** Horizontal alignment of the complete metric; defaults to center. */
2787
- align?: 'left' | 'center' | 'right';
2788
- /** Unscaled clearance around available vector outlines; defaults to one reference pixel. */
2789
- textRasterPadding?: number;
2790
- }
2791
- /**
2792
- * Measure every metric field before accepting geometry. Short single-line values and units can
2793
- * share a baseline; longer values or units stack. No locale formatting, trend icons or rewritten
2794
- * source text are invented here: the trend stays its word, and metricTrendMark derives the arrow
2795
- * beside it from these accepted parts. Consumers must reuse these accepted parts and source ranges.
2796
- */
2797
- declare function layoutMetric(value: string | number | MetricContent, box: LayoutBox, options?: MetricLayoutOptions): MetricLayout;
2798
- /** Progress of a timeline event (FA-11). Engines draw it from the deck's colors; see `timelineMarkerShapes`. */
2799
- type TimelineStatus = 'done' | 'current' | 'planned';
2800
- interface TimelineEvent {
2801
- when?: string;
2802
- what: string;
2803
- description?: string;
2804
- status?: TimelineStatus;
2805
- }
2806
- interface TimelineContent {
2807
- name?: string;
2808
- description?: string;
2809
- events: TimelineEvent[];
2810
- }
2811
- interface TimelineTextPart {
2812
- role: 'name' | 'description' | 'when' | 'what' | 'event-description';
2813
- eventIndex?: number;
2814
- /** The event's status; absent for metadata parts and for events without a status. */
2815
- status?: TimelineStatus;
2816
- path: string;
2817
- text: string;
2818
- sources: {
2819
- path: string;
2820
- start: number;
2821
- end: number;
2822
- }[];
2823
- box: LayoutBox;
2824
- /** Logical alignment: `left` is the start edge, which a right-to-left line draws at the right (see `fit.directions`). */
2825
- alignment: 'left' | 'center';
2826
- requestedFontSize: number;
2827
- minFontSize: number;
2828
- requestedStyle: TextStyle;
2829
- style: TextStyle;
2830
- fit?: SourceTextFit;
2831
- }
2832
- interface TimelineLayoutDiagnostic extends LayoutDiagnostic {
2833
- reason: 'text-fit' | 'part-outside-cell' | 'event-space';
2834
- }
2835
- interface TimelineLayout {
2836
- algorithm: 'timeline-flow-v1';
2837
- arrangement: 'alternating' | 'vertical';
2838
- attempts: number;
2839
- textMeasurement: 'provided' | 'estimated';
2840
- textOutlines: 'provided' | 'unavailable';
2841
- parts: TimelineTextPart[];
2842
- /**
2843
- * One marker per event. `radius` is the marker's own radius; `status` repeats the event's status
2844
- * (absent without one). A 'current' marker also has `ring.radius`, 1.6 times `radius`, and a
2845
- * 'current' or 'planned' marker has the `strokeWidth` of its outline and ring. Every radius is that
2846
- * of the drawn ellipse; an outline is centered on the ellipse edge, so it reaches half a stroke beyond.
2847
- */
2848
- markers: {
2849
- path: string;
2850
- eventIndex: number;
2851
- x: number;
2852
- y: number;
2853
- radius: number;
2854
- status?: TimelineStatus;
2855
- ring?: {
2856
- radius: number;
2857
- };
2858
- strokeWidth?: number;
2859
- }[];
2860
- connector: {
2861
- x1: number;
2862
- y1: number;
2863
- x2: number;
2864
- y2: number;
2865
- };
2866
- diagnostics: TimelineLayoutDiagnostic[];
2867
- overflow: boolean;
2868
- }
2869
- interface TimelineLayoutOptions extends QuoteLayoutOptions {
2870
- textRasterPadding?: number;
2871
- }
2872
- /** Preserve event order and field boundaries while trying at most 50 readable arrangements. */
2873
- declare function layoutTimeline(value: readonly TimelineEvent[] | TimelineContent, box: LayoutBox, options?: TimelineLayoutOptions): TimelineLayout;
2874
- interface CodeContent {
2875
- source: string;
2876
- language?: string;
2877
- filename?: string;
2878
- }
2879
- interface TextLineSegment {
2880
- kind: 'text' | 'tab';
2881
- start: number;
2882
- end: number;
2883
- /** Measured position relative to this displayed line's origin, in reference pixels. */
2884
- x: number;
2885
- width: number;
2886
- }
2887
- /** Exact half-open UTF-16 offsets into the part text, including consumed hard line breaks. */
2888
- interface TextLineSource {
2889
- start: number;
2890
- end: number;
2891
- nextStart: number;
2892
- boundary: 'soft' | 'hard' | 'end';
2893
- width: number;
2894
- /** Explicit tab placement is required in SVG; CSS tab-size alone does not implement it. */
2895
- segments: TextLineSegment[];
2896
- }
2897
- interface SourceTextFit extends TextFit {
2898
- sourceLines: TextLineSource[];
2899
- /** Tabs advance to the next multiple of four measured spaces from each displayed line's origin. */
2900
- tabSize: 4;
2901
- tabWidth: number;
2902
- }
2903
- /** Compatibility names for the shared source-preserving line contract. */
2904
- type CodeLineSegment = TextLineSegment;
2905
- type CodeLineSource = TextLineSource;
2906
- interface CodeTextFit extends SourceTextFit {
2907
- }
2908
- interface CodeTextPart {
2909
- role: 'filename' | 'language' | 'body';
2910
- path: string;
2911
- /** Original text, without case conversion, whitespace normalization or discarded newlines. */
2912
- text: string;
2913
- sources: {
2914
- path: string;
2915
- start: number;
2916
- end: number;
2917
- }[];
2918
- generated: boolean;
2919
- box: LayoutBox;
2920
- requestedFontSize: number;
2921
- minFontSize: number;
2922
- requestedStyle: TextStyle;
2923
- style: TextStyle;
2924
- fit?: CodeTextFit;
2925
- }
2926
- interface CodeLayoutDiagnostic extends LayoutDiagnostic {
2927
- reason: 'invalid-part-box' | 'part-outside-cell' | 'text-fit' | 'part-overlap';
2928
- parts: CodeTextPart['role'][];
2929
- }
2930
- interface CodeLayout {
2931
- /** The panel the code needs at the allocated width: the cell's width and as much height as the insets, metadata and source lines take (at most the cell). */
2932
- bounds: LayoutBox;
2933
- algorithm: 'code-flow-v1';
2934
- textMeasurement: 'estimated' | 'provided';
2935
- parts: CodeTextPart[];
2936
- diagnostics: CodeLayoutDiagnostic[];
2937
- overflow: boolean;
2938
- }
2939
- interface CodeLayoutOptions extends QuoteLayoutOptions {
2940
- }
2941
- /** Shared filename/language/body allocation. Consumers must reuse the accepted fits and styles. */
2942
- declare function layoutCode(value: string | CodeContent, box: LayoutBox, options?: CodeLayoutOptions): CodeLayout;
2943
- interface RichTextRun {
2944
- text: string;
2945
- bold?: boolean;
2946
- italic?: boolean;
2947
- underline?: boolean;
2948
- strikethrough?: boolean;
2949
- color?: string;
2950
- fontSize?: number;
2951
- fontFamily?: string;
2952
- link?: string;
2953
- superscript?: boolean;
2954
- subscript?: boolean;
2955
- /** Inline code: the run takes the design's code font (`RichTextOptions.codeFontFamily`) unless it names its own `fontFamily`. */
2956
- code?: boolean;
2957
- /** BCP-47 tag that overrides the deck language for this run; it reaches the fragment style as `style.lang`. */
2958
- lang?: string;
2959
- /** RR-34: reference ids this run cites (a marker follows the run; the deck's `references` list resolves them). */
2960
- cite?: string | string[];
2961
- /** RR-34: an inline footnote for this run (a marker follows the run; the note is listed in the slide's footnote area). */
2962
- footnote?: string | (string | RichTextRun)[];
2963
- }
2964
- interface RichTextFragment {
2965
- /**
2966
- * Tabs are source-preserving layout controls with a fixed advance, not glyph text. A marker is the
2967
- * superscript citation/footnote number drawn after a run that cites or carries a footnote (RR-34): it
2968
- * has no source range (`start === end === run.text.length`), so run indexes and offsets never shift.
2969
- */
2970
- kind?: 'tab' | 'marker';
2971
- text: string;
2972
- runIndex: number;
2973
- start: number;
2974
- end: number;
2975
- x: number;
2976
- width: number;
2977
- fontSize: number;
2978
- baselineShift: number;
2979
- /** A marker only: the size the exporter writes (the marked run's size); `fontSize` is the glyph PowerPoint draws for it (2/3). */
2980
- nominalSize?: number;
2981
- style: TextStyle;
2982
- run: RichTextRun;
2983
- }
2984
- interface RichTextLine {
2985
- fragments: RichTextFragment[];
2986
- width: number;
2987
- y: number;
2988
- baseline: number;
2989
- height: number;
2990
- }
2991
- interface RichTextFit extends TextFit {
2992
- richLines: RichTextLine[];
2993
- height: number;
2994
- }
2995
- interface RichTextOptions {
2996
- style: TextStyle;
2997
- /** The design's code family for runs with `code: true`; `monospace` when absent. */
2998
- codeFontFamily?: string;
2999
- textMeasurement?: TextMeasurement;
3000
- /** Use one measured line advance for every line, as native table cells do. */
3001
- uniformLineHeight?: boolean;
3002
- /** Deck direction. In a right-to-left deck every line reports its paragraph's direction in `directions`. */
3003
- direction?: TextDirection;
3004
- /**
3005
- * Marker text (`1`, `1,2`) for a run by its dotted path (`${style.path}.${runIndex}`), or undefined.
3006
- * composeSlide supplies the deck numbering from `slideCitations`; a marker fragment is emitted after the run.
3007
- */
3008
- citationMarker?: (runPath: string) => string | undefined;
3009
- /**
3010
- * WI-4: balance the wrapped lines of a heading: after the greedy wrap, keep its size and line count and choose the break set that
3011
- * minimizes the variance of the line widths (a line that ends a sentence or clause is favored), so the last line is not a
3012
- * stranded word. Explicit line breaks stay; a size is never reduced to balance, and a heading that would need another line stays greedy.
3013
- */
3014
- balance?: boolean;
3015
- }
3016
- /** Fit mixed styles without flattening font metrics. Run fontSize is in points. */
3017
- declare function fitRichText(input: readonly (string | RichTextRun)[], box: LayoutBox, requestedSize?: number, minFontSize?: number, options?: RichTextOptions): RichTextFit;
3018
- type ListText = string | readonly (string | RichTextRun)[];
3019
- type ListValue = ListText | {
3020
- text: ListText;
3021
- description?: ListText;
3022
- level?: number;
3023
- start?: number;
3024
- };
3025
- interface ListEntryLayout {
3026
- index: number;
3027
- level: number;
3028
- textPath?: string;
3029
- descriptionPath?: string;
3030
- value: ListText;
3031
- descriptionValue?: ListText;
3032
- text: RichTextFit;
3033
- description?: RichTextFit;
3034
- textBox: LayoutBox;
3035
- descriptionBox?: LayoutBox;
3036
- /**
3037
- * `x` is the marker's left edge, or its right edge when `anchor` is `end` (a right-to-left entry, whose marker sits at the right and
3038
- * whose text box is the column to its left).
3039
- * The entry marker: the bullet glyph, or for a numbered list (`numbering`) the formatted number such as `iv.`.
3040
- * A numbered marker also carries `number` and its measured `width`; its `style` is the list style with the weight and
3041
- * slant of the entry's first run, as PowerPoint draws an auto-number in the first run's character formatting.
3042
- * With `design.listBullet: "none"` (and no numbering) the marker draws nothing: `none` is true, `text` is empty and `indent` is 0;
3043
- * `x`, `y` and `style` still say where the entry's first baseline and font are.
3044
- */
3045
- marker: {
3046
- text: string;
3047
- x: number;
3048
- y: number;
3049
- fontSize: number;
3050
- style: TextStyle;
3051
- indent: number;
3052
- number?: ListNumber;
3053
- width?: number;
3054
- anchor?: 'end';
3055
- none?: true;
3056
- };
3057
- /** Paragraph direction of this entry. Present only when the list was fitted for a right-to-left deck. */
3058
- direction?: TextDirection;
3059
- /** Picture bullet replacing the marker glyph; drawn in `bulletBox`. Marker geometry is unchanged. */
3060
- bulletImage?: ListBulletImage;
3061
- /**
3062
- * Where the picture bullet draws: a square of side `marker.fontSize * PICTURE_BULLET_SCALE` whose
3063
- * bottom sits on the marker baseline (`marker.y`) and whose left edge is `marker.x` (right edge when `marker.anchor` is `end`).
3064
- * Present with `bulletImage`.
3065
- */
3066
- bulletBox?: LayoutBox;
3067
- }
3068
- /**
3069
- * Side of a picture bullet as a fraction of the list font size. Desktop PowerPoint sizes an `a:buBlip` at
3070
- * `a:buSzPct 100000` (what opf-pptx writes) as a square about 0.65 times the run's font size, bottom on the
3071
- * text baseline and left at the bullet position, in every typeface: measured widths of 10, 15, 16, 20 and 31
3072
- * pixels at font sizes of 16, 24, 25, 32 and 48 pixels (0.625 to 0.646; heights run about a pixel more from
3073
- * anti-aliasing, so the true side is about 0.65). The export needs no size: PowerPoint sizes the bullet itself.
3074
- */
3075
- declare const PICTURE_BULLET_SCALE = 0.65;
3076
- interface ListFit extends TextFit {
3077
- listEntries: ListEntryLayout[];
3078
- height: number;
3079
- }
3080
- interface ListFitOptions extends RichTextOptions {
3081
- /**
3082
- * Number the entries instead of bulleting them (the payload's `numbering` field). The hanging indent becomes the larger of
3083
- * 1.1 em and the widest marker plus 0.3 em, so wide markers never touch their text; unnumbered lists are unchanged.
3084
- */
3085
- numbering?: NumberingInput;
3086
- /** Picture bullet for every entry (effective `design.listBullet: "image"` with a resolved icon logo). */
3087
- bulletImage?: ListBulletImage;
3088
- /**
3089
- * `'none'` (effective `design.listBullet: "none"`): no marker and no hanging indent, so each entry starts at the left edge of
3090
- * the list box and the marker of every entry is `{ none: true, text: '', indent: 0 }`. Nested levels still step in by 1.1 em.
3091
- * A numbered list ignores it and keeps its numbers.
3092
- */
3093
- bullet?: 'none';
3094
- }
3095
- /** Shared hanging indents, mixed-run fitting and description spacing for list payloads. */
3096
- declare function fitList(input: readonly ListValue[], box: LayoutBox, requestedSize?: number, minFontSize?: number, options?: ListFitOptions): ListFit;
3097
- interface TableLayoutOptions {
3098
- /** Explicit resolved design alignment; absent uses typed numeric right/text left defaults. Cell style.align wins. */
3099
- alignment?: 'left' | 'center' | 'right';
3100
- scale?: number;
3101
- minFontSize?: number;
3102
- fontFamily?: string;
3103
- /** The design's code family for cell runs with `code: true`. */
3104
- codeFontFamily?: string;
3105
- textMeasurement?: TextMeasurement;
3106
- path?: string;
3107
- /** RR-54: the document, for a dataset-backed table (`{ dataset }`): its headers, rows and column formats come from `datasets`. */
3108
- presentation?: {
3109
- datasets?: unknown;
3110
- };
3111
- /**
3112
- * Deck direction. A right-to-left deck lays the columns out right to left: the first column is the rightmost
3113
- * and each cell's text reports its paragraph direction (RR-05).
3114
- */
3115
- direction?: TextDirection;
3116
- }
3117
- interface TableCellLayout {
3118
- /** Logical alignment, shared by preview and native export. Numeric default resolves to the physical right even in RTL. */
3119
- alignment: 'left' | 'center' | 'right';
3120
- value: unknown;
3121
- input: unknown;
3122
- sourcePath: string;
3123
- style: TableCellStyle;
3124
- row: number;
3125
- column: number;
3126
- rowSpan: number;
3127
- colSpan: number;
3128
- path: string;
3129
- header: boolean;
3130
- rich: boolean;
3131
- box: LayoutBox;
3132
- textBox: LayoutBox;
3133
- textStyle: TextStyle;
3134
- fit: TextFit | RichTextFit;
3135
- /** Paragraph direction of the cell text; present only in a right-to-left deck. */
3136
- direction?: TextDirection;
3137
- }
3138
- interface TableRowLayout {
3139
- box: LayoutBox;
3140
- cells: TableCellLayout[];
3141
- }
3142
- interface TableLayout {
3143
- rows: TableRowLayout[];
3144
- columnCount: number;
3145
- height: number;
3146
- overflow: boolean;
3147
- /**
3148
- * WI-5 (P20): the width of each grid column in canvas pixels, in logical column order (the first column is the rightmost in a right-to-left
3149
- * deck). They sum to the table's width. Each column is as wide as its content asks, but never narrower than its longest unbreakable
3150
- * word at the table's type size, and the preview and the PPTX export draw the same widths.
3151
- */
3152
- columnWidths: number[];
3153
- /** WI-5: true when a word is wider than its cell at the type size the table settled on (the last resort of a table that cannot fit), so a line breaks inside the word. */
3154
- splitsWords: boolean;
3155
- }
3156
- /** Shared cell geometry and font fitting for SVG, native PPTX and pagination.
3157
- * Short rows retain their 54px preferred height. Multiline rows use the space
3158
- * their text needs; constrained tables consume row padding before readable text.
3159
- * All dimensions are canvas pixels; minFontSize is an unscaled canvas size.
3160
- */
3161
- declare function layoutTable(value: unknown, box: LayoutBox, options?: TableLayoutOptions): TableLayout;
3162
- /** Options of `composeLayoutAreas`: those of composeSlide (canvas, deck, theme, direction, ...) plus the layout's own. */
3163
- interface LayoutAreasOptions extends Omit<ComposeSlideOptions, 'layout' | 'explain'> {
3164
- /** Draw the layout mirrored (design.mirror). Default: the deck's design.mirror, then the layout's. */
3165
- mirror?: boolean;
3166
- /** A bled region reaches the slide edge, as on a composed slide. Default true; false gives its cell inside the content box. */
3167
- bleed?: boolean;
3168
- /** Placed-image bands the slide layout reserves, as image blocks with these placements would. */
3169
- placements?: readonly {
3170
- edge: ImageEdge;
3171
- size?: number;
3172
- inset?: boolean;
3173
- }[];
3174
- }
3175
- /** One area of a template on the empty layout. */
3176
- interface ComposedLayoutArea {
3177
- name: string;
3178
- /** `title` or `subtitle`. */
3179
- heading: boolean;
3180
- box: LayoutBox;
3181
- /** On the `title` area of a template without a `subtitle` area: the ctrTitle and subTitle sub-boxes (ComposedHeadingArea.parts). */
3182
- parts?: {
3183
- title: LayoutBox;
3184
- subtitle: LayoutBox;
3185
- };
3186
- }
3187
- /**
3188
- * The areas of a template composed for an empty slide, nothing collapsed: where a PowerPoint slide layout puts a
3189
- * placeholder per area (design section 8). It is composeSlide's own geometry for a slide with a one-line title and
3190
- * subtitle and every region kept (`empty: "keep"`, so an empty auto row holds two lines of body text), with the deck's
3191
- * header and footer (`presentation`), the given placed-image bands and bleed, so the placeholders land on the boxes a
3192
- * slide composes to wherever its content does not resize an auto row.
3193
- */
3194
- declare function composeLayoutAreas(layout: unknown, options?: LayoutAreasOptions): {
3195
- contentBox: LayoutBox;
3196
- areas: ComposedLayoutArea[];
3197
- };
3198
- /** Compose a validated Slide. Layout resolution remains the caller's responsibility. */
3199
- declare function composeSlide(input: unknown, options?: ComposeSlideOptions): SlideComposition;
3200
- /** Canonical physical slide size, converted to reference pixels at 96 pixels/inch. */
3201
- declare function resolveCanvasDimensions(input: unknown): {
3202
- width: number;
3203
- height: number;
3204
- };
3205
-
3206
- export { CODE_SYNTAX_MIN_CONTRAST as $, ASCII_QUOTE_MARKS as A, CHART_HIGHLIGHT_MUTED_MIX as D, ENGINE_DEFAULT_CHART_TYPES as E, CHART_LEAD_MIN_CONTRAST as G, CHART_MAX_INTERVALS as H, CHART_MIN_TICK_SPACING_PX as I, CHART_SERIES_MIN_DIFFERENCE as J, CHART_SERIES_MIN_LIGHTNESS_STEP as K, CHART_SERIES_TIER_SIZE as N, CHART_SERIES_TINT_MIX as O, CHART_TEXT_FLOOR_PX as P, CHART_TEXT_PX as Q, SOCIAL_PLATFORMS as S, CITATION_MARKER_RAISE as U, CITATION_MARKER_SCALE as V, CODE_HIGHLIGHT_LANGUAGES as W, CODE_HIGHLIGHT_MAX_LENGTH as X, CODE_NOMINAL_SIZE as Y, CODE_PANEL_BACKGROUND as Z, CODE_PANEL_FOREGROUND as _, CHART_TYPES as b, DARK_BACKGROUND_LUMINANCE as b2, DEFAULT_CHART_LABEL_SEPARATOR as b3, DEFAULT_FURNITURE_DATE_FORMAT as b4, DESIGN_HINT_KEYS as b5, MAX_COMPOSITION_DEPTH as bP, MAX_NUMBERING_LEVELS as bQ, MAX_NUMBERING_VALUE as bR, MAX_REGION_BLOCKS as bS, MAX_REGION_DEPTH as bT, MAX_REGION_ENTRIES as bU, MAX_ROMAN_VALUE as bV, MAX_TEMPLATE_TRACKS as bW, METRIC_TREND_MIN_CONTRAST as bX, METRIC_TREND_SHAPES as bY, METRIC_VALUE_MIN_CONTRAST as bZ, FONT_SIZE_GRID_PER_PX as ba, FOOTNOTE_MAX_RATIO as bb, FURNITURE_GAP as bc, FURNITURE_IMAGE_SHARE as bd, FURNITURE_ZONE_GUTTER as be, HEADING_AREAS as bq, LAYOUT_BODY_KINDS as bw, LEAD_NOMINAL_SIZE as bx, LIST_NOMINAL_SIZE as by, ENGINE_DEFAULT_COLOR_SCHEME as c, NEUTRAL_SHARES as c8, NUMBERING_STYLES as c9, REGION_KINDS as cA, REGION_ROLES as cB, RESERVED_REGION_NAMES as cC, NUMBERING_SUFFIXES as ca, OPFCompositionError as cf, OPFLayoutTemplateError as cg, PATTERN_PRESETS as ch, PATTERN_PRESET_ALIASES as ci, PATTERN_TILE_SIZE as cj, PICTURE_BULLET_SCALE as ck, PROSE_NOMINAL_SIZE as cl, QUOTE_MARKS as cn, QUOTE_NOMINAL_SIZE as co, QUOTE_SOURCE_SEPARATOR as cp, REGION_ANCHORS as cy, REGION_FLOWS as cz, ENGINE_DEFAULT_FONT_SCHEME as d, chartOptionTarget as d$, SURFACE_ALT_MIN_CONTRAST as d3, SURFACE_ALT_MIX as d4, allocateRows as dO, annotationText as dP, applyLuminance as dQ, bindRegions as dR, blockKind as dS, captionSettings as dT, chartColorForFill as dU, chartHighlightColors as dV, chartHighlightMarks as dW, chartIntervalsFor as dX, chartLabelText as dY, chartLeadFromScheme as dZ, chartOptionSupport as d_, TABLE_NOMINAL_SIZE as dh, THEME_DESIGN_KEYS as di, TIMELINE_OUTLINE_MIN_CONTRAST as dj, TIMELINE_STATUSES as dk, TIMELINE_TEXT_MIN_CONTRAST as dl, ENGINE_DEFAULT_THEME as e, normalizeHexColor as e$, chartPaletteForFill as e0, chartSeriesPalette as e1, chartTextSize as e2, chartValueAxis as e3, citationMarkerText as e4, clrMapAttributes as e5, codeHighlightBands as e6, codeHighlightColors as e7, codeHighlightLines as e8, codeLineNumbers as e9, isWrappedInQuoteMarks as eA, layoutCaption as eB, layoutCode as eC, layoutContent as eD, layoutEntries as eE, layoutFootnotes as eF, layoutFurniture as eG, layoutMetric as eH, layoutQuote as eI, layoutRegion as eJ, layoutStructure as eK, layoutTable as eL, layoutTemplate as eM, layoutTemplateIssues as eN, layoutTimeline as eO, layoutWatermark as eP, listColumnBreaks as eQ, listNumbers as eR, maxIntervalsFor as eS, measureText as eT, measureTextOutline as eU, metricTrendColor as eV, metricTrendMark as eW, metricTrendPoints as eX, metricValueColor as eY, niceScale as eZ, normalizeColorVariant as e_, codeLineRuns as ea, codeSyntaxPalette as eb, codeSyntaxPaletteForRoles as ec, codeSyntaxPaletteForScheme as ed, collectCitations as ee, colorContrast as ef, colorMapFor as eg, composeLayoutAreas as eh, composeSlide as ei, defaultSlideBackground as ej, fitImage as ek, fitList as el, fitRichText as em, fitText as en, formatChartLabelNumber as eo, formatChartLabelPercent as ep, formatFurnitureDate as eq, formatListNumber as er, gridFlowShape as es, imageBackground as et, imageShape as eu, intrinsicImageAspect as ev, intrinsicImageSize as ew, isColorVariant as ex, isDarkColor as ey, isLayoutTemplate as ez, LANGUAGES as f, numberingAtLevel as f0, numberingStyleDraws as f1, paragraphDirection as f2, paragraphDirectionAt as f3, patternBitmap as f4, patternRuns as f5, physicalAlignment as f6, placeTextLines as f7, placedImageBlocks as f8, quoteLanguage as f9, snapFontSizeUp as fA, stackCategoryValues as fB, surfaceAltColor as fC, tableGrid as fD, tableRowBoundaries as fE, textColorForFill as fF, textWidthMeasurer as fG, timelineMarkerShapes as fH, timelineTextColor as fI, tokenizeCode as fJ, unwrapQuoteMarks as fK, visualReadingOrder as fL, walkCitationRuns as fM, wrapText as fN, quoteMarksFor as fa, readableSchemeColor as fb, referencesSlide as fc, regionAccepts as fd, regionRoleRank as fe, resolveCanvasDimensions as ff, resolveChartColors as fg, resolveChartOptions as fh, resolveCodeLanguage as fi, resolveColorRef as fj, resolveColorRoles as fk, resolveDesignHints as fl, resolveFontFamilies as fm, resolveLogo as fn, resolveNumbering as fo, resolvePatternPreset as fp, resolveScriptFonts as fq, resolveSlideDirection as fr, resolveSocialProfile as fs, resolveTextStyle as ft, rootNodes as fu, scriptFontRole as fv, shareHeights as fw, sliceNumberedItems as fx, slideCitations as fy, snapFontSizeDown as fz, LOGO_SHAPES as g, normalizeLanguageFamily as p, AUTO_LAYOUT as q, CAPTIONABLE_FIELDS as w, CAPTION_FONT_RATIO as x, CAPTION_MAX_RATIO as y, CHART_HIGHLIGHT_MUTED_MIN_CONTRAST as z };
3207
- export type { BackgroundImageFit as B, ComposeSlideOptions as C, Fonts as F, LayoutDiagnostic as L, MeasureTextWidth as M, ResolvedColorRoles as R, TextMeasurement as T, FontFamilies as a, CompositionExplanation as a$, Caption as a0, CaptionAlignment as a1, CaptionObject as a2, CaptionPosition as a3, CaptionSettings as a4, ChartAxisGeometry as a5, ChartColorContext as a6, ChartHighlightMarks as a7, ChartLabelContent as a8, ChartLabelPosition as a9, CodeTextPart as aA, CodeToken as aB, CodeTokenKind as aC, ColorAccentSlot as aD, ColorMap as aE, ColorVariant as aF, ColorVariantBackground as aG, ColorVariantInput as aH, ComposedBackgroundImage as aI, ComposedCaption as aJ, ComposedChart as aK, ComposedFlow as aL, ComposedFootnoteEntry as aM, ComposedFootnotes as aN, ComposedGroup as aO, ComposedHeadingArea as aP, ComposedImage as aQ, ComposedItem as aR, ComposedLayoutArea as aS, ComposedListColumn as aT, ComposedLogo as aU, ComposedOverlay as aV, ComposedPlacement as aW, ComposedRegion as aX, Composition as aY, CompositionCandidate as aZ, CompositionDecision as a_, ChartLegendPosition as aa, ChartOptionDiagnostic as ab, ChartOptionKind as ac, ChartOptionSupport as ad, ChartOptionTarget as ae, ChartPaletteOptions as af, ChartScale as ag, ChartValueAxis as ah, CitationMarker as ai, CitationNote as aj, CodeContent as ak, CodeHighlightBand as al, CodeHighlightColors as am, CodeHighlightEntry as an, CodeHighlightIssue as ao, CodeHighlightLines as ap, CodeLayout as aq, CodeLayoutDiagnostic as ar, CodeLayoutOptions as as, CodeLineSegment as at, CodeLineSource as au, CodeRun as av, CodeSyntaxPalette as aw, CodeSyntaxPaletteOptions as ax, CodeSyntaxPaletteTheme as ay, CodeTextFit as az, MetricLayout as b$, CompositionPenalties as b0, CompositionTrack as b1, DeckCitations as b6, DesignHintKey as b7, DesignHintSource as b8, DesignHints as b9, LayoutAreasOptions as bA, LayoutBodyKind as bB, LayoutBox as bC, LayoutContent as bD, LayoutEntry as bE, LayoutRegion as bF, LayoutTemplate as bG, LayoutTemplateIssue as bH, ListBulletImage as bI, ListEntryLayout as bJ, ListFit as bK, ListFitOptions as bL, ListNumber as bM, ListText as bN, ListValue as bO, MetricContent as b_, FlowShape as bf, FontFaceSelection as bg, FootnoteLayoutOptions as bh, FurnitureField as bi, FurnitureImagePart as bj, FurnitureLayout as bk, FurniturePart as bl, FurniturePartBase as bm, FurnitureSocialLink as bn, FurnitureTextExtras as bo, FurnitureTextPart as bp, ImageEdge as br, ImageFit as bs, ImageFitPlacement as bt, ImageFocus as bu, ImageShape as bv, LayoutArea as bz, RichTextLine as c$, MetricLayoutDiagnostic as c0, MetricLayoutOptions as c1, MetricSentiment as c2, MetricTextPart as c3, MetricTextSource as c4, MetricTrend as c5, MetricTrendColorOptions as c6, MetricTrendMark as c7, ReadingBox as cD, Reference as cE, ReferencesSlideOptions as cF, RegionAnchor as cG, RegionBinding as cH, RegionBindingDiagnostic as cI, RegionBindingResult as cJ, RegionFlow as cK, RegionKind as cL, RegionRole as cM, ResolveColorRefOptions as cN, ResolveColorRefRoles as cO, ResolveColorRolesOptions as cP, ResolveDesignHintsOptions as cQ, ResolveScriptFontsOptions as cR, ResolvedChartDataLabels as cS, ResolvedChartHighlight as cT, ResolvedChartOptions as cU, ResolvedDesignHints as cV, ResolvedNumbering as cW, ResolvedScriptFonts as cX, RichText as cY, RichTextFit as cZ, RichTextFragment as c_, Numbering as cb, NumberingInput as cc, NumberingStyleName as cd, NumberingSuffix as ce, PhysicalAlignment as cm, QuoteContent as cq, QuoteLayout as cr, QuoteLayoutDiagnostic as cs, QuoteLayoutOptions as ct, QuoteMarks as cu, QuotePhoto as cv, QuoteTextPart as cw, QuoteTextSource as cx, RichTextOptions as d0, RichTextRun as d1, RowDemand as d2, SchemeColor as d5, SchemeNeutrals as d6, ScriptFontApp as d7, ScriptFontSlots as d8, ScriptFontSource as d9, TextLineSource as dA, TextPlacement as dB, TextPlacementLine as dC, TimelineContent as dD, TimelineEvent as dE, TimelineLayout as dF, TimelineLayoutDiagnostic as dG, TimelineLayoutOptions as dH, TimelineMarkerShape as dI, TimelineStatus as dJ, TimelineStatusColors as dK, TimelineTextPart as dL, WatermarkTextLayout as dM, WatermarkTextOptions as dN, ScriptFontSupplement as da, ScriptMeasurementProfile as db, ScriptRole as dc, SlideCitations as dd, SlideComposition as de, SocialProfile as df, SourceTextFit as dg, TableBorder as dm, TableCellLayout as dn, TableCellStyle as dp, TableGrid as dq, TableGridCell as dr, TableGridIssue as ds, TableLayout as dt, TableLayoutOptions as du, TableRowLayout as dv, TextDirection as dw, TextFit as dx, TextLineInk as dy, TextLineSegment as dz, LanguageFamilyName as h, LanguageVocabulary as i, LogoShape as j, LogoVariant as k, ResolveLogoOptions as l, ResolvedLogo as m, SocialPlatformVocabulary as n, TextStyle as o, AnnotatedRun as r, AnnotationFitter as s, AnnotationLayoutOptions as t, BindRegionsOptions as u, BoundBlock as v };