@pptx-studio/model 0.2.0 → 0.3.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.
package/dist/index.d.ts CHANGED
@@ -69,8 +69,10 @@ type ModelErrorCode =
69
69
  /** A paragraph level that is not an integer. */
70
70
  'MODEL_TEXT_LEVEL' | 'MODEL_TEXT_TYPEFACE' |
71
71
  /** A table attribute missing where the schema requires it, or not of the type it names. */
72
- 'MODEL_TABLE_ATTR' | 'BLIP_NO_EMBED' | 'BLIP_DUOTONE' | 'BLIP_CLR_CHANGE' | 'BLIP_TILE_ALIGN' | 'BLIP_TILE_FLIP';
73
- declare class ModelError extends Error {
72
+ 'MODEL_TABLE_ATTR' |
73
+ /** A table-style edge with neither `a:ln` nor `a:lnRef`, or an `a:fill` holding no fill. */
74
+ 'MODEL_TABLE_STYLE' | 'BLIP_NO_EMBED' | 'BLIP_DUOTONE' | 'BLIP_CLR_CHANGE' | 'BLIP_TILE_ALIGN' | 'BLIP_TILE_FLIP';
75
+ export declare class ModelError extends Error {
74
76
  readonly name = "ModelError";
75
77
  readonly code: ModelErrorCode;
76
78
  /** The part the failure is about, when there is one. */
@@ -79,8 +81,8 @@ declare class ModelError extends Error {
79
81
  readonly detail: string | null;
80
82
  constructor(code: ModelErrorCode, message: string, partName?: string | null, detail?: string | null);
81
83
  }
82
- declare function isModelError(value: unknown): value is ModelError;
83
- declare const MODEL_ERROR_CODES: readonly ModelErrorCode[];
84
+ export declare function isModelError(value: unknown): value is ModelError;
85
+ export declare const MODEL_ERROR_CODES: readonly ["MODEL_PART_MISSING", "MODEL_PART_KIND", "MODEL_NO_PRESENTATION", "MODEL_NO_PARENT", "MODEL_NO_THEME", "MODEL_CLRMAP_INCOMPLETE", "MODEL_CLRMAP_SLOT", "MODEL_PLACEHOLDER_IDX", "MODEL_XFRM_NUMBER", "MODEL_GEOMETRY", "MODEL_STYLE_IDX", "MODEL_FONT_COLLECTION", "MODEL_NO_STYLE_MATRIX", "MODEL_STYLE_LIST_EMPTY", "MODEL_SHEET_CYCLE", "MODEL_FOREIGN_SHEET", "MODEL_TEXT_ATTR", "MODEL_TEXT_FIELD", "MODEL_TEXT_LEVEL", "MODEL_TEXT_BULLET", "MODEL_TEXT_TYPEFACE", "MODEL_TABLE_ATTR", "MODEL_TABLE_STYLE", "BLIP_NO_EMBED", "BLIP_DUOTONE", "BLIP_CLR_CHANGE", "BLIP_TILE_ALIGN", "BLIP_TILE_FLIP"];
84
86
  //#endregion
85
87
  //#region src/parse/geometry.d.ts
86
88
  /**
@@ -106,7 +108,7 @@ type ShapeGeometry = {
106
108
  * not chosen to be a rectangle, it has said nothing, and `resolve` is what turns
107
109
  * that into the layout's answer.
108
110
  */
109
- declare function parseGeometry(spPr: XElement | undefined, partName: string): ShapeGeometry | undefined;
111
+ export declare function parseGeometry(spPr: XElement | undefined, partName: string): ShapeGeometry | undefined;
110
112
  //#endregion
111
113
  //#region src/text.d.ts
112
114
  /** `ST_TextAlignType`. */
@@ -167,7 +169,7 @@ type ThemeFontRef = {
167
169
  readonly script: 'latin' | 'ea' | 'cs';
168
170
  };
169
171
  /** `+mn-lt` and its five siblings, or `null` for a real typeface name. */
170
- declare function themeFontRef(typeface: string): ThemeFontRef | null;
172
+ export declare function themeFontRef(typeface: string): ThemeFontRef | null;
171
173
  /**
172
174
  * `CT_TextCharacterProperties` - `a:rPr`, `a:defRPr` and `a:endParaRPr`.
173
175
  *
@@ -330,7 +332,7 @@ interface ListStyle {
330
332
  readonly node: XElement;
331
333
  }
332
334
  /** The number of levels a `CT_TextListStyle` holds, and `@lvl`'s range plus one. */
333
- declare const LEVELS = 9;
335
+ export declare const LEVELS = 9;
334
336
  /** `a:r`: a run of text with its own properties. */
335
337
  interface TextRun {
336
338
  readonly kind: 'run';
@@ -454,9 +456,9 @@ interface TextStyles {
454
456
  //#endregion
455
457
  //#region src/table.d.ts
456
458
  /** `a:graphicData/@uri` of a table. */
457
- declare const TABLE_URI = "http://schemas.openxmlformats.org/drawingml/2006/table";
459
+ export declare const TABLE_URI = "http://schemas.openxmlformats.org/drawingml/2006/table";
458
460
  /** The column PowerPoint invents for a grid that declares none, empty: two margins and 2 pt. */
459
- declare const INVENTED_COLUMN_WIDTH = 208280;
461
+ export declare const INVENTED_COLUMN_WIDTH = 208280;
460
462
  /** `a:tblPr`. The seven flags are the file's own and inherit from nothing, so absent is false. */
461
463
  interface TableProps {
462
464
  readonly rtl: boolean;
@@ -471,12 +473,13 @@ interface TableProps {
471
473
  readonly style: TableStyleRef | undefined;
472
474
  readonly node: XElement;
473
475
  }
474
- /** `a:tableStyleId`, a GUID resolved in 4.2, or an inline `a:tableStyle`, parsed in 4.3. */
476
+ /** `a:tableStyleId`, or an inline `a:tableStyle`, which PowerPoint resolves by its `@styleId` alone. */
475
477
  type TableStyleRef = {
476
478
  readonly kind: 'id';
477
479
  readonly id: string;
478
480
  } | {
479
481
  readonly kind: 'inline';
482
+ readonly id: string;
480
483
  readonly node: XElement;
481
484
  };
482
485
  /** `a:gridCol`. */
@@ -559,7 +562,62 @@ interface TableGrid {
559
562
  * The occupancy C7 measured, 76/76 against 52/76 for the flags: each `a:tc` takes the next
560
563
  * column, a claimed position is covered whatever it says, a span stops at the edge or a claim.
561
564
  */
562
- declare function tableGrid(table: Table): TableGrid;
565
+ export declare function tableGrid(table: Table): TableGrid;
566
+ /** `ST_OnOffStyleType`. */
567
+ type OnOffStyle = 'on' | 'off' | 'def';
568
+ /** A value written out, or a reference into the theme: the `EG_Themeable*` choices. */
569
+ type Themeable<T, Ref = StyleRef> = {
570
+ readonly kind: 'value';
571
+ readonly value: T;
572
+ } | {
573
+ readonly kind: 'ref';
574
+ readonly ref: Ref;
575
+ };
576
+ /** `a:tcTxStyle`. */
577
+ interface TableStyleText {
578
+ readonly b: OnOffStyle | undefined;
579
+ readonly i: OnOffStyle | undefined;
580
+ readonly font: Themeable<FontCollection, FontRef> | undefined;
581
+ readonly color: Color | undefined;
582
+ }
583
+ /** `a:tcBdr`; `tl2br` and `tr2bl` take the names `TableCellBorders` gives the diagonals. */
584
+ interface TableStyleBorders {
585
+ readonly left: Themeable<Line> | undefined;
586
+ readonly right: Themeable<Line> | undefined;
587
+ readonly top: Themeable<Line> | undefined;
588
+ readonly bottom: Themeable<Line> | undefined;
589
+ readonly insideH: Themeable<Line> | undefined;
590
+ readonly insideV: Themeable<Line> | undefined;
591
+ readonly tlToBr: Themeable<Line> | undefined;
592
+ readonly blToTr: Themeable<Line> | undefined;
593
+ }
594
+ /** `a:tcStyle`. */
595
+ interface TableStyleCell {
596
+ readonly borders: TableStyleBorders | undefined;
597
+ readonly fill: Themeable<Fill> | undefined;
598
+ /** `a:cell3D`, kept as written. */
599
+ readonly cell3D: XElement | undefined;
600
+ }
601
+ /** One of a style's thirteen parts. */
602
+ interface TableStylePart {
603
+ readonly text: TableStyleText | undefined;
604
+ readonly cell: TableStyleCell | undefined;
605
+ }
606
+ /** `a:tblBg`. An `a:effect` holding an `a:effectDag` reads as `undefined`, as `parseEffects` does. */
607
+ interface TableBackground {
608
+ readonly fill: Themeable<Fill> | undefined;
609
+ readonly effect: Themeable<readonly Effect[] | undefined> | undefined;
610
+ }
611
+ /** The thirteen parts in schema order, which is not the order they compose in. */
612
+ type TableStylePartName = 'wholeTbl' | 'band1H' | 'band2H' | 'band1V' | 'band2V' | 'lastCol' | 'firstCol' | 'lastRow' | 'seCell' | 'swCell' | 'firstRow' | 'neCell' | 'nwCell';
613
+ /** `CT_TableStyle`: an `a:tblStyle`, or an inline `a:tableStyle`. Nothing absent is defaulted. */
614
+ interface TableStyle {
615
+ readonly id: string;
616
+ readonly name: string;
617
+ readonly background: TableBackground | undefined;
618
+ readonly parts: Readonly<Partial<Record<TableStylePartName, TableStylePart>>>;
619
+ readonly node: XElement;
620
+ }
563
621
  //#endregion
564
622
  //#region src/types.d.ts
565
623
  /** `a:off` and `a:ext` together, in EMU, plus the three transform attributes. */
@@ -592,9 +650,9 @@ interface Xfrm {
592
650
  * stock master.
593
651
  */
594
652
  type PlaceholderType = 'title' | 'body' | 'ctrTitle' | 'subTitle' | 'obj' | 'chart' | 'tbl' | 'clipArt' | 'dgm' | 'media' | 'sldImg' | 'pic' | 'sldNum' | 'hdr' | 'ftr' | 'dt';
595
- declare const PLACEHOLDER_TYPES: readonly PlaceholderType[];
653
+ export declare const PLACEHOLDER_TYPES: readonly PlaceholderType[];
596
654
  /** The six a slide master may carry. Measured; see `PlaceholderType`. */
597
- declare const MASTER_PLACEHOLDER_TYPES: readonly PlaceholderType[];
655
+ export declare const MASTER_PLACEHOLDER_TYPES: readonly PlaceholderType[];
598
656
  /** `@sz`, a sizing hint. Recorded, and not part of matching - measured. */
599
657
  type PlaceholderSize = 'full' | 'half' | 'quarter';
600
658
  interface Placeholder {
@@ -847,16 +905,16 @@ interface Resolved<T> {
847
905
  //#endregion
848
906
  //#region src/parse/paint.d.ts
849
907
  /** One of the six `EG_ColorChoice` members. */
850
- declare function parseColorElement(element: XElement): Color;
908
+ export declare function parseColorElement(element: XElement): Color;
851
909
  /** The first colour child of a wrapper such as `a:solidFill` or `a:fillRef`. */
852
- declare function parseColorChild(parent: XElement | undefined): Color | null;
910
+ export declare function parseColorChild(parent: XElement | undefined): Color | null;
853
911
  /** One member of `EG_FillProperties`. */
854
- declare function parseFillElement(element: XElement, partName: string): Fill;
912
+ export declare function parseFillElement(element: XElement, partName: string): Fill;
855
913
  /** The fill a container declares, or `undefined` when it declares none. */
856
- declare function parseFill(parent: XElement, partName: string): Fill | undefined;
914
+ export declare function parseFill(parent: XElement, partName: string): Fill | undefined;
857
915
  /** `a:ln`, lazily: every field is `null` when the attribute was absent. */
858
- declare function parseLineElement(element: XElement, partName: string): Line;
859
- declare function parseLine(parent: XElement, partName: string): Line | undefined;
916
+ export declare function parseLineElement(element: XElement, partName: string): Line;
917
+ export declare function parseLine(parent: XElement, partName: string): Line | undefined;
860
918
  /**
861
919
  * `a:effectLst`, in the order the file wrote it.
862
920
  *
@@ -868,7 +926,7 @@ declare function parseLine(parent: XElement, partName: string): Line | undefined
868
926
  * rather than approximated. PowerPoint writes none but does render one:
869
927
  * measured on `a04-effects-03`, where it composites a glow over the fill.
870
928
  */
871
- declare function parseEffects(parent: XElement): readonly Effect[] | undefined;
929
+ export declare function parseEffects(parent: XElement): readonly Effect[] | undefined;
872
930
  //#endregion
873
931
  //#region src/parse/sheet.d.ts
874
932
  /**
@@ -878,13 +936,13 @@ declare function parseEffects(parent: XElement): readonly Effect[] | undefined;
878
936
  * rather than a partial opinion, and there is nothing sensible to default the
879
937
  * missing one to.
880
938
  */
881
- declare function parseClrMap(element: XElement, partName: string): ClrMap;
882
- declare function parseTheme(root: XElement, partName: string): Theme;
939
+ export declare function parseClrMap(element: XElement, partName: string): ClrMap;
940
+ export declare function parseTheme(root: XElement, partName: string): Theme;
883
941
  /**
884
942
  * One part into one sheet. The parent and the theme are filled in by
885
943
  * `document.ts`, which is the only thing that can follow a relationship.
886
944
  */
887
- declare function parseSheet(root: XElement, partName: string): Omit<Sheet, 'parent' | 'theme'>;
945
+ export declare function parseSheet(root: XElement, partName: string): Omit<Sheet, 'parent' | 'theme'>;
888
946
  //#endregion
889
947
  //#region src/resolve/placeholder.d.ts
890
948
  /**
@@ -897,11 +955,11 @@ declare function parseSheet(root: XElement, partName: string): Omit<Sheet, 'pare
897
955
  * and `body` is already there. They agree, and it is worth knowing why rather
898
956
  * than by luck.
899
957
  */
900
- declare const DEFAULT_PLACEHOLDER_TYPE: PlaceholderType;
958
+ export declare const DEFAULT_PLACEHOLDER_TYPE: PlaceholderType;
901
959
  /** The `@idx` of a `p:ph` that has none. */
902
- declare const DEFAULT_PLACEHOLDER_IDX = 0;
960
+ export declare const DEFAULT_PLACEHOLDER_IDX = 0;
903
961
  /** Supply the two defaults, so a comparison has something to compare. */
904
- declare function normalizePlaceholder(ph: Placeholder): NormalPlaceholder;
962
+ export declare function normalizePlaceholder(ph: Placeholder): NormalPlaceholder;
905
963
  /**
906
964
  * The type a placeholder presents when it asks a master for its parent.
907
965
  *
@@ -911,9 +969,9 @@ declare function normalizePlaceholder(ph: Placeholder): NormalPlaceholder;
911
969
  * because a master cannot hold them either and `body` is the only remaining
912
970
  * content type.
913
971
  */
914
- declare function masterPlaceholderType(type: PlaceholderType): PlaceholderType;
972
+ export declare function masterPlaceholderType(type: PlaceholderType): PlaceholderType;
915
973
  /** Every placeholder in a sheet's top-level shape tree, in document order. */
916
- declare function placeholders(sheet: Sheet): readonly Shape[];
974
+ export declare function placeholders(sheet: Sheet): readonly Shape[];
917
975
  /**
918
976
  * Slide to layout: the first placeholder whose `@idx` agrees.
919
977
  *
@@ -921,9 +979,9 @@ declare function placeholders(sheet: Sheet): readonly Shape[];
921
979
  * which PowerPoint accepts without repairing; the first in the shape tree is
922
980
  * the one that wins.
923
981
  */
924
- declare function matchInLayout(ph: Placeholder, layout: Sheet): Shape | null;
982
+ export declare function matchInLayout(ph: Placeholder, layout: Sheet): Shape | null;
925
983
  /** Layout to master: the first placeholder of the folded type. */
926
- declare function matchInMaster(ph: Placeholder, master: Sheet): Shape | null;
984
+ export declare function matchInMaster(ph: Placeholder, master: Sheet): Shape | null;
927
985
  /** One link of the chain: a shape, the sheet it is on, and how it was reached. */
928
986
  interface ChainLink {
929
987
  readonly shape: Shape;
@@ -939,7 +997,7 @@ interface ChainLink {
939
997
  * with the placeholder of the sheet it is leaving, which is why the layout's
940
998
  * `@type` and not the slide's decides the second hop.
941
999
  */
942
- declare function inheritanceChain(shape: Shape, sheet: Sheet): readonly ChainLink[];
1000
+ export declare function inheritanceChain(shape: Shape, sheet: Sheet): readonly ChainLink[];
943
1001
  /**
944
1002
  * A placeholder that reached no parent and states no geometry of its own.
945
1003
  *
@@ -948,7 +1006,7 @@ declare function inheritanceChain(shape: Shape, sheet: Sheet): readonly ChainLin
948
1006
  * Measured on four probes: a title where the layout has none, a body at an index
949
1007
  * nobody has, and both against a layout with no placeholders at all.
950
1008
  */
951
- declare const ORPHAN_RECT: {
1009
+ export declare const ORPHAN_RECT: {
952
1010
  readonly x: 0;
953
1011
  readonly y: 0;
954
1012
  readonly cx: 0;
@@ -964,7 +1022,7 @@ declare const ORPHAN_RECT: {
964
1022
  * conflating that with silence is how an explicit `a:noFill` gets overwritten by
965
1023
  * an inherited colour.
966
1024
  */
967
- declare function resolve<T>(shape: Shape, sheet: Sheet, pick: (shape: Shape) => T | undefined): Resolved<T> | undefined;
1025
+ export declare function resolve<T>(shape: Shape, sheet: Sheet, pick: (shape: Shape) => T | undefined): Resolved<T> | undefined;
968
1026
  /**
969
1027
  * The rectangle a shape occupies, and which sheet stated it.
970
1028
  *
@@ -974,11 +1032,11 @@ declare function resolve<T>(shape: Shape, sheet: Sheet, pick: (shape: Shape) =>
974
1032
  * whole resolved rectangle is baked in at once. So an absent `xfrm` is the
975
1033
  * statement "still bound to my layout", and it is what Change Layout reads.
976
1034
  */
977
- declare function resolveXfrm(shape: Shape, sheet: Sheet): Resolved<Xfrm> | undefined;
1035
+ export declare function resolveXfrm(shape: Shape, sheet: Sheet): Resolved<Xfrm> | undefined;
978
1036
  /** Every sheet from this one up to its master, nearest first. */
979
- declare function sheetChain(sheet: Sheet): readonly Sheet[];
1037
+ export declare function sheetChain(sheet: Sheet): readonly Sheet[];
980
1038
  /** The master at the top of a sheet's chain, or `null` if the chain is broken. */
981
- declare function masterOf(sheet: Sheet): Sheet | null;
1039
+ export declare function masterOf(sheet: Sheet): Sheet | null;
982
1040
  /**
983
1041
  * The theme a sheet resolves against.
984
1042
  *
@@ -993,8 +1051,8 @@ declare function masterOf(sheet: Sheet): Sheet | null;
993
1051
  * one is repaired on open, so a shared theme is a broken file rather than an
994
1052
  * economy.
995
1053
  */
996
- declare function themeOf(sheet: Sheet): Theme | null;
997
- declare function schemeOf(sheet: Sheet): ClrScheme | undefined;
1054
+ export declare function themeOf(sheet: Sheet): Theme | null;
1055
+ export declare function schemeOf(sheet: Sheet): ClrScheme | undefined;
998
1056
  /**
999
1057
  * The colour map in force on a sheet.
1000
1058
  *
@@ -1005,7 +1063,7 @@ declare function schemeOf(sheet: Sheet): ClrScheme | undefined;
1005
1063
  * its layout's. The element is named for the sheet it usually ends at rather
1006
1064
  * than for the one it asks.
1007
1065
  */
1008
- declare function colorMapOf(sheet: Sheet): ClrMap | undefined;
1066
+ export declare function colorMapOf(sheet: Sheet): ClrMap | undefined;
1009
1067
  /**
1010
1068
  * Everything `resolveColor` needs, for a colour written on this sheet.
1011
1069
  *
@@ -1014,7 +1072,7 @@ declare function colorMapOf(sheet: Sheet): ClrMap | undefined;
1014
1072
  * `schemeClr val="phClr"` reached any other way throws rather than painting
1015
1073
  * black.
1016
1074
  */
1017
- declare function colorContextOf(sheet: Sheet, phClr?: Rgba): ColorContext;
1075
+ export declare function colorContextOf(sheet: Sheet, phClr?: Rgba): ColorContext;
1018
1076
  //#endregion
1019
1077
  //#region src/style.d.ts
1020
1078
  /**
@@ -1026,7 +1084,7 @@ declare function colorContextOf(sheet: Sheet, phClr?: Rgba): ColorContext;
1026
1084
  * agreed between the two elements, and `idx="0"` and `idx="1000"` both painted
1027
1085
  * nothing.
1028
1086
  */
1029
- declare const STYLE_MATRIX_OFFSET = 1000;
1087
+ export declare const STYLE_MATRIX_OFFSET = 1000;
1030
1088
  /** Which of the two lists an index reaches, and where in it. */
1031
1089
  type StyleMatrixTarget = {
1032
1090
  readonly list: 'none';
@@ -1045,18 +1103,18 @@ type StyleMatrixTarget = {
1045
1103
  * entry: PowerPoint clamps, opens the file without repairing it, and a renderer
1046
1104
  * that throws here refuses a deck PowerPoint shows.
1047
1105
  */
1048
- declare function styleMatrixTarget(idx: number): StyleMatrixTarget;
1106
+ export declare function styleMatrixTarget(idx: number): StyleMatrixTarget;
1049
1107
  /** The fill a `fillRef`/`bgRef` index names, or `null` for none. */
1050
- declare function styleMatrixFill(ref: StyleRef, theme: Theme): Fill | null;
1108
+ export declare function styleMatrixFill(ref: StyleRef, theme: Theme): Fill | null;
1051
1109
  /**
1052
1110
  * The line an `lnRef` index names, or `null` for none.
1053
1111
  *
1054
1112
  * `a:lnStyleLst` has no background counterpart, so an index above 1000 clamps
1055
1113
  * into the same list rather than reaching a second one.
1056
1114
  */
1057
- declare function styleMatrixLine(ref: StyleRef, theme: Theme): Line | null;
1115
+ export declare function styleMatrixLine(ref: StyleRef, theme: Theme): Line | null;
1058
1116
  /** The effects an `effectRef` index names. Empty for none. */
1059
- declare function styleMatrixEffects(ref: StyleRef, theme: Theme): readonly Effect[];
1117
+ export declare function styleMatrixEffects(ref: StyleRef, theme: Theme): readonly Effect[];
1060
1118
  /**
1061
1119
  * The colour a style reference invokes its entry with.
1062
1120
  *
@@ -1066,7 +1124,7 @@ declare function styleMatrixEffects(ref: StyleRef, theme: Theme): readonly Effec
1066
1124
  * its forty-two entries, so `phClr` is a fully transformed colour and not a
1067
1125
  * theme slot name.
1068
1126
  */
1069
- declare function phClrOf(ref: StyleRef, sheet: Sheet): Rgba | null;
1127
+ export declare function phClrOf(ref: StyleRef, sheet: Sheet): Rgba | null;
1070
1128
  /** What a shape paints, and where each half of the answer came from. */
1071
1129
  interface ResolvedAppearance {
1072
1130
  /** `null` means nothing is painted: no fill was declared and no style names one. */
@@ -1089,7 +1147,7 @@ interface ResolvedAppearance {
1089
1147
  * the whole inheritance chain first, and only if no level declared one does the
1090
1148
  * `p:style` - itself inherited down the same chain - get consulted.
1091
1149
  */
1092
- declare function resolveAppearance(shape: Shape, sheet: Sheet): ResolvedAppearance;
1150
+ export declare function resolveAppearance(shape: Shape, sheet: Sheet): ResolvedAppearance;
1093
1151
  /**
1094
1152
  * A shape's fill as a single colour, when it is one.
1095
1153
  *
@@ -1097,9 +1155,9 @@ declare function resolveAppearance(shape: Shape, sheet: Sheet): ResolvedAppearan
1097
1155
  * ground-truth fixture is in: PowerPoint's object model reports one RGB per
1098
1156
  * shape, so this is what a measurement can be compared against.
1099
1157
  */
1100
- declare function resolveSolidFill(shape: Shape, sheet: Sheet): Rgba | null;
1158
+ export declare function resolveSolidFill(shape: Shape, sheet: Sheet): Rgba | null;
1101
1159
  /** Resolve any colour written on a sheet, with an optional `phClr` in scope. */
1102
- declare function resolveOnSheet(color: Color, sheet: Sheet, phClr?: Rgba): Rgba;
1160
+ export declare function resolveOnSheet(color: Color, sheet: Sheet, phClr?: Rgba): Rgba;
1103
1161
  //#endregion
1104
1162
  //#region src/resolve/background.d.ts
1105
1163
  /** A background, with the sheet that declared it and how it was expressed. */
@@ -1115,7 +1173,7 @@ interface ResolvedBackground {
1115
1173
  readonly phClr: Rgba | null;
1116
1174
  }
1117
1175
  /** Which sheet's `p:bg` applies, without unpacking it. */
1118
- declare function backgroundSheet(sheet: Sheet): {
1176
+ export declare function backgroundSheet(sheet: Sheet): {
1119
1177
  sheet: Sheet;
1120
1178
  background: Background;
1121
1179
  } | null;
@@ -1125,9 +1183,9 @@ declare function backgroundSheet(sheet: Sheet): {
1125
1183
  * `null` when no sheet in the chain declares one, which is a legal file: a deck
1126
1184
  * whose master has no `p:bg` paints nothing behind its slides.
1127
1185
  */
1128
- declare function resolveBackground(sheet: Sheet): ResolvedBackground | null;
1186
+ export declare function resolveBackground(sheet: Sheet): ResolvedBackground | null;
1129
1187
  /** The background as one colour, when it is a solid. `null` otherwise. */
1130
- declare function resolveBackgroundColor(sheet: Sheet): Rgba | null;
1188
+ export declare function resolveBackgroundColor(sheet: Sheet): Rgba | null;
1131
1189
  //#endregion
1132
1190
  //#region src/document.d.ts
1133
1191
  /** One thing wrong with the package that did not stop the load. */
@@ -1172,13 +1230,13 @@ interface Document {
1172
1230
  };
1173
1231
  sheet(partName: string): Sheet | undefined;
1174
1232
  }
1175
- declare function loadDocument(store: PartStore): Document;
1233
+ export declare function loadDocument(store: PartStore): Document;
1176
1234
  //#endregion
1177
1235
  //#region src/parse/text.d.ts
1178
1236
  /** `a:rPr`, `a:defRPr` or `a:endParaRPr` - one type under three names. */
1179
- declare function parseRunProps(element: XElement, partName: string): RunProps;
1237
+ export declare function parseRunProps(element: XElement, partName: string): RunProps;
1180
1238
  /** `a:pPr`, `a:defPPr` or any `a:lvlNpPr` - one type under eleven names. */
1181
- declare function parseParaProps(element: XElement, partName: string): ParaProps;
1239
+ export declare function parseParaProps(element: XElement, partName: string): ParaProps;
1182
1240
  /**
1183
1241
  * `a:lstStyle`, or a `p:txStyles` bucket, which is the same type unwrapped.
1184
1242
  *
@@ -1187,17 +1245,17 @@ declare function parseParaProps(element: XElement, partName: string): ParaProps;
1187
1245
  * third to the master. So a level nobody declared stays `undefined` rather than
1188
1246
  * falling back to level one, and the resolver asks per level.
1189
1247
  */
1190
- declare function parseListStyle(element: XElement, partName: string): ListStyle;
1248
+ export declare function parseListStyle(element: XElement, partName: string): ListStyle;
1191
1249
  /** `p:txStyles` on a master. */
1192
- declare function parseTextStyles(element: XElement, partName: string): TextStyles;
1250
+ export declare function parseTextStyles(element: XElement, partName: string): TextStyles;
1193
1251
  /** `p:defaultTextStyle` on `ppt/presentation.xml`, which is a `CT_TextListStyle`. */
1194
- declare function parseDefaultTextStyle(presentation: XElement, partName: string): ListStyle | undefined;
1252
+ export declare function parseDefaultTextStyle(presentation: XElement, partName: string): ListStyle | undefined;
1195
1253
  /** A `p:txBody` or an `a:txBody`. */
1196
- declare function parseTextBody(element: XElement, partName: string): TextBody;
1254
+ export declare function parseTextBody(element: XElement, partName: string): TextBody;
1197
1255
  /** The `p:txBody` of a shape, when it has one. */
1198
- declare function parseTextBodyChild(parent: XElement, partName: string): TextBody | undefined;
1256
+ export declare function parseTextBodyChild(parent: XElement, partName: string): TextBody | undefined;
1199
1257
  //#endregion
1200
- //#region src/builtin-text-styles.d.ts
1258
+ //#region src/builtin/text-styles.d.ts
1201
1259
  /**
1202
1260
  * PowerPoint's own `p:txStyles`, substituted when a master declares none.
1203
1261
  *
@@ -1239,7 +1297,7 @@ interface BuiltinLevel {
1239
1297
  readonly typeface: string | null;
1240
1298
  }
1241
1299
  /** The three buckets, nine levels each, level 1 first. */
1242
- declare const BUILTIN_TEXT_STYLES: {
1300
+ export declare const BUILTIN_TEXT_STYLES: {
1243
1301
  readonly title: readonly BuiltinLevel[];
1244
1302
  readonly body: readonly BuiltinLevel[];
1245
1303
  readonly other: readonly BuiltinLevel[];
@@ -1263,11 +1321,26 @@ declare const BUILTIN_TEXT_STYLES: {
1263
1321
  *
1264
1322
  * The typeface is the minor face on all 6 probes that reach a silent cascade.
1265
1323
  */
1266
- declare const TEXT_FLOOR: BuiltinLevel;
1324
+ export declare const TEXT_FLOOR: BuiltinLevel;
1325
+ //#endregion
1326
+ //#region src/builtin/table-styles.d.ts
1327
+ /**
1328
+ * PowerPoint's 74 built-in table styles, each `a:tblStyle` byte for byte as PowerPoint writes it.
1329
+ * GENERATED by tools/ground-truth/model/tables/styles/write-tables.ts from
1330
+ * corpus/ground-truth/table-styles.json. Do not edit: table.test.ts re-derives it.
1331
+ */
1332
+ interface BuiltinTableStyle {
1333
+ readonly id: string;
1334
+ readonly name: string;
1335
+ /** The `a:tblStyle` PowerPoint writes into `ppt/tableStyles.xml` for this style. */
1336
+ readonly xml: string;
1337
+ }
1338
+ /** In the order of PowerPoint's Table Styles gallery. */
1339
+ export declare const BUILTIN_TABLE_STYLES: readonly BuiltinTableStyle[];
1267
1340
  //#endregion
1268
1341
  //#region src/resolve/text.d.ts
1269
1342
  /** Which `p:txStyles` bucket a placeholder type reads, or `null` for none. */
1270
- declare function bucketOf(type: string): 'title' | 'body' | null;
1343
+ export declare function bucketOf(type: string): 'title' | 'body' | null;
1271
1344
  /**
1272
1345
  * Everything the cascade needs that is not on the shape.
1273
1346
  *
@@ -1298,7 +1371,7 @@ interface Level {
1298
1371
  * compatibility scoring - needs the same list the resolver walks, not a second
1299
1372
  * opinion about it.
1300
1373
  */
1301
- declare function textLevels(context: TextContext): readonly Level[];
1374
+ export declare function textLevels(context: TextContext): readonly Level[];
1302
1375
  /**
1303
1376
  * The values left when every level has been asked and none of them said.
1304
1377
  *
@@ -1310,7 +1383,7 @@ declare function textLevels(context: TextContext): readonly Level[];
1310
1383
  * separate probes precisely because the two are easy to conflate and differ on
1311
1384
  * every partially-specified master.
1312
1385
  */
1313
- declare function floorOf(context: TextContext, level: number): BuiltinLevel;
1386
+ export declare function floorOf(context: TextContext, level: number): BuiltinLevel;
1314
1387
  /**
1315
1388
  * A paragraph property, from the paragraph's own `a:pPr` or up the walk.
1316
1389
  *
@@ -1319,7 +1392,7 @@ declare function floorOf(context: TextContext, level: number): BuiltinLevel;
1319
1392
  * reason: a level may legitimately declare a `null`, and conflating that with
1320
1393
  * silence is how an explicit value gets overwritten by an inherited one.
1321
1394
  */
1322
- declare function resolveParagraph<T>(context: TextContext, paragraph: Paragraph, pick: (props: ParaProps) => T | undefined): Resolved<T> | undefined;
1395
+ export declare function resolveParagraph<T>(context: TextContext, paragraph: Paragraph, pick: (props: ParaProps) => T | undefined): Resolved<T> | undefined;
1323
1396
  /**
1324
1397
  * A run property, from the run's own `a:rPr` and then every `a:defRPr` above it.
1325
1398
  *
@@ -1327,7 +1400,7 @@ declare function resolveParagraph<T>(context: TextContext, paragraph: Paragraph,
1327
1400
  * between the run and the shape's `a:lstStyle`, which the ladder pinned by
1328
1401
  * declaring a different size at each and reading back which one won.
1329
1402
  */
1330
- declare function resolveRun<T>(context: TextContext, paragraph: Paragraph, run: TextContent | undefined, pick: (props: RunProps) => T | undefined): Resolved<T> | undefined;
1403
+ export declare function resolveRun<T>(context: TextContext, paragraph: Paragraph, run: TextContent | undefined, pick: (props: RunProps) => T | undefined): Resolved<T> | undefined;
1331
1404
  /**
1332
1405
  * The font size of a run, in hundredths of a point, always.
1333
1406
  *
@@ -1337,7 +1410,7 @@ declare function resolveRun<T>(context: TextContext, paragraph: Paragraph, run:
1337
1410
  * `schemaDefault` when it does and the bucket said nothing - two different
1338
1411
  * numbers on the same slide, and the field says which was used.
1339
1412
  */
1340
- declare function resolveSize(context: TextContext, paragraph: Paragraph, run: TextContent | undefined): Resolved<number>;
1413
+ export declare function resolveSize(context: TextContext, paragraph: Paragraph, run: TextContent | undefined): Resolved<number>;
1341
1414
  /**
1342
1415
  * The Latin typeface of a run, with any theme reference followed.
1343
1416
  *
@@ -1345,11 +1418,11 @@ declare function resolveSize(context: TextContext, paragraph: Paragraph, run: Te
1345
1418
  * some face, and the face when nothing named one is measured rather than
1346
1419
  * chosen - the theme's minor, on all six probes reaching a silent cascade.
1347
1420
  */
1348
- declare function resolveLatinTypeface(context: TextContext, paragraph: Paragraph, run: TextContent | undefined): Resolved<string>;
1421
+ export declare function resolveLatinTypeface(context: TextContext, paragraph: Paragraph, run: TextContent | undefined): Resolved<string>;
1349
1422
  /** `@marL` in EMU. Measured to be 0 when nothing declares it, not 347663. */
1350
- declare function resolveMarginLeft(context: TextContext, paragraph: Paragraph): Resolved<number>;
1423
+ export declare function resolveMarginLeft(context: TextContext, paragraph: Paragraph): Resolved<number>;
1351
1424
  /** `@indent` in EMU. Measured to be 0 when nothing declares it, not -342900. */
1352
- declare function resolveIndent(context: TextContext, paragraph: Paragraph): Resolved<number>;
1425
+ export declare function resolveIndent(context: TextContext, paragraph: Paragraph): Resolved<number>;
1353
1426
  /**
1354
1427
  * The bullet, merged the way T5 measured it: five slots, each on its own.
1355
1428
  *
@@ -1366,13 +1439,13 @@ declare function resolveIndent(context: TextContext, paragraph: Paragraph): Reso
1366
1439
  * Nothing here supplies a default, because a paragraph with no bullet anywhere
1367
1440
  * in its chain genuinely has none.
1368
1441
  */
1369
- declare function resolveBulletKind(context: TextContext, paragraph: Paragraph): Resolved<BulletKind> | undefined;
1442
+ export declare function resolveBulletKind(context: TextContext, paragraph: Paragraph): Resolved<BulletKind> | undefined;
1370
1443
  /** `a:buChar/@char`, as written. The symbol mapping belongs to the renderer. */
1371
- declare function resolveBulletChar(context: TextContext, paragraph: Paragraph): Resolved<string> | undefined;
1444
+ export declare function resolveBulletChar(context: TextContext, paragraph: Paragraph): Resolved<string> | undefined;
1372
1445
  /** `a:buAutoNum`, type and start value together, since one is meaningless alone. */
1373
- declare function resolveBulletAutoNum(context: TextContext, paragraph: Paragraph): Resolved<BulletAutoNum> | undefined;
1446
+ export declare function resolveBulletAutoNum(context: TextContext, paragraph: Paragraph): Resolved<BulletAutoNum> | undefined;
1374
1447
  /** `a:buBlip/a:blip/@r:embed`, which the caller resolves against the part's rels. */
1375
- declare function resolveBulletBlip(context: TextContext, paragraph: Paragraph): Resolved<string> | undefined;
1448
+ export declare function resolveBulletBlip(context: TextContext, paragraph: Paragraph): Resolved<string> | undefined;
1376
1449
  /**
1377
1450
  * `a:buFont` or `a:buFontTx`.
1378
1451
  *
@@ -1383,11 +1456,11 @@ declare function resolveBulletBlip(context: TextContext, paragraph: Paragraph):
1383
1456
  * numbers. The resolver still reports it, because the file says it and 1.3 has
1384
1457
  * to write it back; the renderer is where it is ignored.
1385
1458
  */
1386
- declare function resolveBulletFont(context: TextContext, paragraph: Paragraph): Resolved<BulletFont> | undefined;
1459
+ export declare function resolveBulletFont(context: TextContext, paragraph: Paragraph): Resolved<BulletFont> | undefined;
1387
1460
  /** `a:buSzPct`, `a:buSzPts` or `a:buSzTx`; a percentage is of the first run's size. */
1388
- declare function resolveBulletSize(context: TextContext, paragraph: Paragraph): Resolved<BulletSize> | undefined;
1461
+ export declare function resolveBulletSize(context: TextContext, paragraph: Paragraph): Resolved<BulletSize> | undefined;
1389
1462
  /** `a:buClr` or `a:buClrTx`. Unlike the font, this one *does* reach an autonumber. */
1390
- declare function resolveBulletColor(context: TextContext, paragraph: Paragraph): Resolved<BulletColor> | undefined;
1463
+ export declare function resolveBulletColor(context: TextContext, paragraph: Paragraph): Resolved<BulletColor> | undefined;
1391
1464
  //#endregion
1392
1465
  //#region src/resolve/body.d.ts
1393
1466
  /**
@@ -1409,31 +1482,42 @@ interface ResolvedInsets {
1409
1482
  * `pick` returns `undefined` for "this level did not say", the same contract the
1410
1483
  * text cascade uses.
1411
1484
  */
1412
- declare function resolveBody<T>(shape: Shape, sheet: Sheet, pick: (props: BodyProps) => T | undefined): Resolved<T> | undefined;
1413
- declare function resolveAnchor(shape: Shape, sheet: Sheet): Resolved<TextAnchor> | undefined;
1414
- declare function resolveAnchorCtr(shape: Shape, sheet: Sheet): Resolved<boolean> | undefined;
1415
- declare function resolveVertical(shape: Shape, sheet: Sheet): Resolved<VerticalText> | undefined;
1416
- declare function resolveWrap(shape: Shape, sheet: Sheet): Resolved<TextWrap> | undefined;
1417
- declare function resolveColumns(shape: Shape, sheet: Sheet): Resolved<number> | undefined;
1485
+ export declare function resolveBody<T>(shape: Shape, sheet: Sheet, pick: (props: BodyProps) => T | undefined): Resolved<T> | undefined;
1486
+ export declare function resolveAnchor(shape: Shape, sheet: Sheet): Resolved<TextAnchor> | undefined;
1487
+ export declare function resolveAnchorCtr(shape: Shape, sheet: Sheet): Resolved<boolean> | undefined;
1488
+ export declare function resolveVertical(shape: Shape, sheet: Sheet): Resolved<VerticalText> | undefined;
1489
+ export declare function resolveWrap(shape: Shape, sheet: Sheet): Resolved<TextWrap> | undefined;
1490
+ export declare function resolveColumns(shape: Shape, sheet: Sheet): Resolved<number> | undefined;
1418
1491
  /**
1419
1492
  * The four insets, in points, each falling back on its own.
1420
1493
  *
1421
1494
  * A frame stating only `lIns` still gets 3.6 above and below, so this resolves
1422
1495
  * four times rather than once.
1423
1496
  */
1424
- declare function resolveInsets(shape: Shape, sheet: Sheet): ResolvedInsets;
1497
+ export declare function resolveInsets(shape: Shape, sheet: Sheet): ResolvedInsets;
1425
1498
  //#endregion
1426
1499
  //#region src/parse/body.d.ts
1427
1500
  /** Parse an `a:bodyPr`. Lengths stay in EMU and angles in 60000ths of a degree. */
1428
- declare function parseBodyProps(element: XElement, partName: string): BodyProps;
1501
+ export declare function parseBodyProps(element: XElement, partName: string): BodyProps;
1429
1502
  /** The `a:bodyPr` of a `p:txBody`, when it has one. */
1430
- declare function parseBodyPropsChild(parent: XElement, partName: string): BodyProps | undefined;
1503
+ export declare function parseBodyPropsChild(parent: XElement, partName: string): BodyProps | undefined;
1431
1504
  //#endregion
1432
1505
  //#region src/parse/table.d.ts
1433
1506
  /** An `a:tbl`. */
1434
- declare function parseTable(element: XElement, part: string): Table;
1507
+ export declare function parseTable(element: XElement, part: string): Table;
1435
1508
  /** The table of a `p:graphicFrame`, when its `a:graphicData` carries one. */
1436
- declare function parseTableChild(frame: XElement, part: string): Table | undefined;
1509
+ export declare function parseTableChild(frame: XElement, part: string): Table | undefined;
1510
+ /** An `a:tblStyle` or an inline `a:tableStyle`: `CT_TableStyle`. */
1511
+ export declare function parseTableStyle(element: XElement, part: string): TableStyle;
1512
+ //#endregion
1513
+ //#region src/resolve/table.d.ts
1514
+ /** One of PowerPoint's 74 built-ins by GUID, in any case, parsed afresh; `undefined` for any other. */
1515
+ export declare function builtinTableStyle(id: string): TableStyle | undefined;
1516
+ /**
1517
+ * The built-in style a table is drawn with, or `null` for PowerPoint's default: a 1-pt black
1518
+ * grid and no fill, whatever the theme and whatever the package defines.
1519
+ */
1520
+ export declare function tableStyleOf(table: Table): TableStyle | null;
1437
1521
  //#endregion
1438
1522
  //#region src/resolve/typeface.d.ts
1439
1523
  /** The four slots a `CT_TextCharacterProperties` can name. */
@@ -1444,16 +1528,16 @@ type ScriptSlot = 'latin' | 'ea' | 'cs' | 'sym';
1444
1528
  * `undefined` means the reference resolved to a collection entry the theme
1445
1529
  * leaves empty, which is not the same as the theme naming nothing.
1446
1530
  */
1447
- declare function resolveTypeface(typeface: string, scheme: FontScheme): string | undefined;
1531
+ export declare function resolveTypeface(typeface: string, scheme: FontScheme): string | undefined;
1448
1532
  /** The same, for a whole `CT_TextFont`. */
1449
- declare function resolveTypefaceOf(font: Typeface, scheme: FontScheme): string | undefined;
1533
+ export declare function resolveTypefaceOf(font: Typeface, scheme: FontScheme): string | undefined;
1450
1534
  /**
1451
1535
  * Every distinct typeface a set of runs asks for, theme references followed.
1452
1536
  *
1453
1537
  * This is what `fontReport` is given: a report keyed on `+mn-lt` would name a
1454
1538
  * token no user recognises and would collapse two themes into one row.
1455
1539
  */
1456
- declare function requestedTypefaces(fonts: Iterable<Typeface | undefined>, scheme: FontScheme): readonly string[];
1540
+ export declare function requestedTypefaces(fonts: Iterable<Typeface | undefined>, scheme: FontScheme): readonly string[];
1457
1541
  //#endregion
1458
- export { BUILTIN_TEXT_STYLES, type Background, type BuiltinLevel, type BulletAutoNum, type BulletColor, type BulletFont, type BulletKind, type BulletSize, COLOR_TRANSFORM_OPS, type Caps, type ChainLink, type ColorMapOverride, DEFAULT_PLACEHOLDER_IDX, DEFAULT_PLACEHOLDER_TYPE, type Document, type DocumentProblem, type FontAlign, type FontCollection, type FontRef, type FontScheme, type FormatScheme, type GridCell, INVENTED_COLUMN_WIDTH, LEVELS, type ListStyle, MASTER_PLACEHOLDER_TYPES, MODEL_ERROR_CODES, ModelError, type ModelErrorCode, type NormalPlaceholder, ORPHAN_RECT, type Origin, PLACEHOLDER_TYPES, type ParaProps, type Paragraph, type Placeholder, type PlaceholderSize, type PlaceholderType, type Resolved, type ResolvedAppearance, type ResolvedBackground, type ResolvedInsets, type RunProps, STYLE_MATRIX_OFFSET, type ScriptSlot, type Shape, type ShapeGeometry, type ShapeKind, type ShapeStyle, type Sheet, type SheetKind, type Spacing, type Strike, type StyleMatrixTarget, type StyleRef, TABLE_URI, TEXT_FLOOR, type Table, type TableCell, type TableCellBorders, type TableCellProps, type TableColumn, type TableGrid, type TableProps, type TableRow, type TableStyleRef, type TextAlign, type TextAnchor, type TextBody, type TextBreak, type TextContent, type TextContext, type TextField, type TextRun, type TextStyleBucket, type TextStyles, type Theme, type ThemeFontRef, type Typeface, type Underline, type VerticalText, type Xfrm, backgroundSheet, bucketOf, colorContextOf, colorMapOf, floorOf, inheritanceChain, isModelError, loadDocument, masterOf, masterPlaceholderType, matchInLayout, matchInMaster, normalizePlaceholder, parseBodyProps, parseBodyPropsChild, parseClrMap, parseColorChild, parseColorElement, parseDefaultTextStyle, parseEffects, parseFill, parseFillElement, parseGeometry, parseLine, parseLineElement, parseListStyle, parseParaProps, parseRunProps, parseSheet, parseTable, parseTableChild, parseTextBody, parseTextBodyChild, parseTextStyles, parseTheme, phClrOf, placeholders, requestedTypefaces, resolve, resolveAnchor, resolveAnchorCtr, resolveAppearance, resolveBackground, resolveBackgroundColor, resolveBody, resolveBulletAutoNum, resolveBulletBlip, resolveBulletChar, resolveBulletColor, resolveBulletFont, resolveBulletKind, resolveBulletSize, resolveColumns, resolveIndent, resolveInsets, resolveLatinTypeface, resolveMarginLeft, resolveOnSheet, resolveParagraph, resolveRun, resolveSize, resolveSolidFill, resolveTypeface, resolveTypefaceOf, resolveVertical, resolveWrap, resolveXfrm, schemeOf, sheetChain, styleMatrixEffects, styleMatrixFill, styleMatrixLine, styleMatrixTarget, tableGrid, textLevels, themeFontRef, themeOf };
1542
+ export { type Background, type BuiltinLevel, type BuiltinTableStyle, type BulletAutoNum, type BulletColor, type BulletFont, type BulletKind, type BulletSize, COLOR_TRANSFORM_OPS, type Caps, type ChainLink, type ColorMapOverride, type Document, type DocumentProblem, type FontAlign, type FontCollection, type FontRef, type FontScheme, type FormatScheme, type GridCell, type ListStyle, type ModelErrorCode, type NormalPlaceholder, type OnOffStyle, type Origin, type ParaProps, type Paragraph, type Placeholder, type PlaceholderSize, type PlaceholderType, type Resolved, type ResolvedAppearance, type ResolvedBackground, type ResolvedInsets, type RunProps, type ScriptSlot, type Shape, type ShapeGeometry, type ShapeKind, type ShapeStyle, type Sheet, type SheetKind, type Spacing, type Strike, type StyleMatrixTarget, type StyleRef, type Table, type TableBackground, type TableCell, type TableCellBorders, type TableCellProps, type TableColumn, type TableGrid, type TableProps, type TableRow, type TableStyle, type TableStyleBorders, type TableStyleCell, type TableStylePart, type TableStylePartName, type TableStyleRef, type TableStyleText, type TextAlign, type TextAnchor, type TextBody, type TextBreak, type TextContent, type TextContext, type TextField, type TextRun, type TextStyleBucket, type TextStyles, type Theme, type ThemeFontRef, type Themeable, type Typeface, type Underline, type VerticalText, type Xfrm };
1459
1543
  //# sourceMappingURL=index.d.ts.map