@pptx-studio/model 0.1.4 → 0.2.1

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
@@ -67,8 +67,10 @@ type ModelErrorCode =
67
67
  */
68
68
  'MODEL_TEXT_BULLET' |
69
69
  /** A paragraph level that is not an integer. */
70
- 'MODEL_TEXT_LEVEL' | 'MODEL_TEXT_TYPEFACE' | 'BLIP_NO_EMBED' | 'BLIP_DUOTONE' | 'BLIP_CLR_CHANGE' | 'BLIP_TILE_ALIGN' | 'BLIP_TILE_FLIP';
71
- declare class ModelError extends Error {
70
+ 'MODEL_TEXT_LEVEL' | 'MODEL_TEXT_TYPEFACE' |
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
+ export declare class ModelError extends Error {
72
74
  readonly name = "ModelError";
73
75
  readonly code: ModelErrorCode;
74
76
  /** The part the failure is about, when there is one. */
@@ -77,8 +79,8 @@ declare class ModelError extends Error {
77
79
  readonly detail: string | null;
78
80
  constructor(code: ModelErrorCode, message: string, partName?: string | null, detail?: string | null);
79
81
  }
80
- declare function isModelError(value: unknown): value is ModelError;
81
- declare const MODEL_ERROR_CODES: readonly ModelErrorCode[];
82
+ export declare function isModelError(value: unknown): value is ModelError;
83
+ export declare const MODEL_ERROR_CODES: readonly ModelErrorCode[];
82
84
  //#endregion
83
85
  //#region src/parse/geometry.d.ts
84
86
  /**
@@ -104,7 +106,7 @@ type ShapeGeometry = {
104
106
  * not chosen to be a rectangle, it has said nothing, and `resolve` is what turns
105
107
  * that into the layout's answer.
106
108
  */
107
- declare function parseGeometry(spPr: XElement | undefined, partName: string): ShapeGeometry | undefined;
109
+ export declare function parseGeometry(spPr: XElement | undefined, partName: string): ShapeGeometry | undefined;
108
110
  //#endregion
109
111
  //#region src/text.d.ts
110
112
  /** `ST_TextAlignType`. */
@@ -165,7 +167,7 @@ type ThemeFontRef = {
165
167
  readonly script: 'latin' | 'ea' | 'cs';
166
168
  };
167
169
  /** `+mn-lt` and its five siblings, or `null` for a real typeface name. */
168
- declare function themeFontRef(typeface: string): ThemeFontRef | null;
170
+ export declare function themeFontRef(typeface: string): ThemeFontRef | null;
169
171
  /**
170
172
  * `CT_TextCharacterProperties` - `a:rPr`, `a:defRPr` and `a:endParaRPr`.
171
173
  *
@@ -328,7 +330,7 @@ interface ListStyle {
328
330
  readonly node: XElement;
329
331
  }
330
332
  /** The number of levels a `CT_TextListStyle` holds, and `@lvl`'s range plus one. */
331
- declare const LEVELS = 9;
333
+ export declare const LEVELS = 9;
332
334
  /** `a:r`: a run of text with its own properties. */
333
335
  interface TextRun {
334
336
  readonly kind: 'run';
@@ -450,6 +452,115 @@ interface TextStyles {
450
452
  readonly node: XElement;
451
453
  }
452
454
  //#endregion
455
+ //#region src/table.d.ts
456
+ /** `a:graphicData/@uri` of a table. */
457
+ export declare const TABLE_URI = "http://schemas.openxmlformats.org/drawingml/2006/table";
458
+ /** The column PowerPoint invents for a grid that declares none, empty: two margins and 2 pt. */
459
+ export declare const INVENTED_COLUMN_WIDTH = 208280;
460
+ /** `a:tblPr`. The seven flags are the file's own and inherit from nothing, so absent is false. */
461
+ interface TableProps {
462
+ readonly rtl: boolean;
463
+ readonly firstRow: boolean;
464
+ readonly firstCol: boolean;
465
+ readonly lastRow: boolean;
466
+ readonly lastCol: boolean;
467
+ readonly bandRow: boolean;
468
+ readonly bandCol: boolean;
469
+ readonly fill: Fill | undefined;
470
+ readonly effects: readonly Effect[] | undefined;
471
+ readonly style: TableStyleRef | undefined;
472
+ readonly node: XElement;
473
+ }
474
+ /** `a:tableStyleId`, a GUID resolved in 4.2, or an inline `a:tableStyle`, parsed in 4.3. */
475
+ type TableStyleRef = {
476
+ readonly kind: 'id';
477
+ readonly id: string;
478
+ } | {
479
+ readonly kind: 'inline';
480
+ readonly node: XElement;
481
+ };
482
+ /** `a:gridCol`. */
483
+ interface TableColumn {
484
+ /** `@w` in EMU. */
485
+ readonly w: number;
486
+ readonly node: XElement;
487
+ }
488
+ /** `a:tr`. */
489
+ interface TableRow {
490
+ /** `@h` in EMU: the least the row is drawn at, never the most. */
491
+ readonly h: number;
492
+ readonly cells: readonly TableCell[];
493
+ readonly node: XElement;
494
+ }
495
+ /** `a:tc`: an absent span reads as 1 and an absent flag as false; `tableGrid` says what they mean. */
496
+ interface TableCell {
497
+ readonly gridSpan: number;
498
+ readonly rowSpan: number;
499
+ readonly hMerge: boolean;
500
+ readonly vMerge: boolean;
501
+ /** `@id`, which `a:headers` in other cells name. */
502
+ readonly id: string | null;
503
+ readonly text: TextBody | undefined;
504
+ readonly props: TableCellProps | undefined;
505
+ readonly node: XElement;
506
+ }
507
+ /** The six `a:tcPr` borders, each an `a:ln` under another name. */
508
+ interface TableCellBorders {
509
+ readonly left: Line | undefined;
510
+ readonly right: Line | undefined;
511
+ readonly top: Line | undefined;
512
+ readonly bottom: Line | undefined;
513
+ readonly tlToBr: Line | undefined;
514
+ readonly blToTr: Line | undefined;
515
+ }
516
+ /** `a:tcPr`. Margins are EMU as written; the schema's defaults are 91440 and 45720. */
517
+ interface TableCellProps {
518
+ readonly marL: number | undefined;
519
+ readonly marR: number | undefined;
520
+ readonly marT: number | undefined;
521
+ readonly marB: number | undefined;
522
+ readonly vert: VerticalText | undefined;
523
+ readonly anchor: TextAnchor | undefined;
524
+ readonly anchorCtr: boolean | undefined;
525
+ readonly horzOverflow: HorzOverflow | undefined;
526
+ readonly borders: TableCellBorders;
527
+ readonly fill: Fill | undefined;
528
+ /** `a:headers/a:header`, the ids of the cells that head this one. */
529
+ readonly headers: readonly string[];
530
+ readonly node: XElement;
531
+ }
532
+ interface Table {
533
+ readonly props: TableProps | undefined;
534
+ readonly columns: readonly TableColumn[];
535
+ readonly rows: readonly TableRow[];
536
+ readonly node: XElement;
537
+ }
538
+ /** A grid position's owner: the anchor cell, its clamped span, and the `a:tc` there. */
539
+ interface GridCell {
540
+ readonly row: number;
541
+ readonly col: number;
542
+ readonly rows: number;
543
+ readonly cols: number;
544
+ /** `null` for a position no `a:tc` reached, which PowerPoint draws empty. */
545
+ readonly cell: TableCell | null;
546
+ }
547
+ /** The grid as drawn: `positions[r][c]` is the owner of (r, c); `anchors` lists each owner once. */
548
+ interface TableGrid {
549
+ readonly rows: number;
550
+ readonly cols: number;
551
+ /** Column widths in EMU. */
552
+ readonly widths: readonly number[];
553
+ /** Row heights in EMU, each the least its row is drawn at. */
554
+ readonly heights: readonly number[];
555
+ readonly positions: readonly (readonly GridCell[])[];
556
+ readonly anchors: readonly GridCell[];
557
+ }
558
+ /**
559
+ * The occupancy C7 measured, 76/76 against 52/76 for the flags: each `a:tc` takes the next
560
+ * column, a claimed position is covered whatever it says, a span stops at the edge or a claim.
561
+ */
562
+ export declare function tableGrid(table: Table): TableGrid;
563
+ //#endregion
453
564
  //#region src/types.d.ts
454
565
  /** `a:off` and `a:ext` together, in EMU, plus the three transform attributes. */
455
566
  interface Xfrm {
@@ -481,9 +592,9 @@ interface Xfrm {
481
592
  * stock master.
482
593
  */
483
594
  type PlaceholderType = 'title' | 'body' | 'ctrTitle' | 'subTitle' | 'obj' | 'chart' | 'tbl' | 'clipArt' | 'dgm' | 'media' | 'sldImg' | 'pic' | 'sldNum' | 'hdr' | 'ftr' | 'dt';
484
- declare const PLACEHOLDER_TYPES: readonly PlaceholderType[];
595
+ export declare const PLACEHOLDER_TYPES: readonly PlaceholderType[];
485
596
  /** The six a slide master may carry. Measured; see `PlaceholderType`. */
486
- declare const MASTER_PLACEHOLDER_TYPES: readonly PlaceholderType[];
597
+ export declare const MASTER_PLACEHOLDER_TYPES: readonly PlaceholderType[];
487
598
  /** `@sz`, a sizing hint. Recorded, and not part of matching - measured. */
488
599
  type PlaceholderSize = 'full' | 'half' | 'quarter';
489
600
  interface Placeholder {
@@ -571,6 +682,8 @@ interface Shape {
571
682
  * is one level of the text cascade; the paragraphs are the text itself.
572
683
  */
573
684
  readonly text: TextBody | undefined;
685
+ /** The `a:tbl` of a `p:graphicFrame` whose graphic data is a table. */
686
+ readonly table: Table | undefined;
574
687
  /** Children, for a `grpSp`. Empty for everything else. */
575
688
  readonly children: readonly Shape[];
576
689
  /** The element this was read from. Edits go here, never to the fields above. */
@@ -734,16 +847,16 @@ interface Resolved<T> {
734
847
  //#endregion
735
848
  //#region src/parse/paint.d.ts
736
849
  /** One of the six `EG_ColorChoice` members. */
737
- declare function parseColorElement(element: XElement): Color;
850
+ export declare function parseColorElement(element: XElement): Color;
738
851
  /** The first colour child of a wrapper such as `a:solidFill` or `a:fillRef`. */
739
- declare function parseColorChild(parent: XElement | undefined): Color | null;
852
+ export declare function parseColorChild(parent: XElement | undefined): Color | null;
740
853
  /** One member of `EG_FillProperties`. */
741
- declare function parseFillElement(element: XElement, partName: string): Fill;
854
+ export declare function parseFillElement(element: XElement, partName: string): Fill;
742
855
  /** The fill a container declares, or `undefined` when it declares none. */
743
- declare function parseFill(parent: XElement, partName: string): Fill | undefined;
856
+ export declare function parseFill(parent: XElement, partName: string): Fill | undefined;
744
857
  /** `a:ln`, lazily: every field is `null` when the attribute was absent. */
745
- declare function parseLineElement(element: XElement, partName: string): Line;
746
- declare function parseLine(parent: XElement, partName: string): Line | undefined;
858
+ export declare function parseLineElement(element: XElement, partName: string): Line;
859
+ export declare function parseLine(parent: XElement, partName: string): Line | undefined;
747
860
  /**
748
861
  * `a:effectLst`, in the order the file wrote it.
749
862
  *
@@ -755,7 +868,7 @@ declare function parseLine(parent: XElement, partName: string): Line | undefined
755
868
  * rather than approximated. PowerPoint writes none but does render one:
756
869
  * measured on `a04-effects-03`, where it composites a glow over the fill.
757
870
  */
758
- declare function parseEffects(parent: XElement): readonly Effect[] | undefined;
871
+ export declare function parseEffects(parent: XElement): readonly Effect[] | undefined;
759
872
  //#endregion
760
873
  //#region src/parse/sheet.d.ts
761
874
  /**
@@ -765,13 +878,13 @@ declare function parseEffects(parent: XElement): readonly Effect[] | undefined;
765
878
  * rather than a partial opinion, and there is nothing sensible to default the
766
879
  * missing one to.
767
880
  */
768
- declare function parseClrMap(element: XElement, partName: string): ClrMap;
769
- declare function parseTheme(root: XElement, partName: string): Theme;
881
+ export declare function parseClrMap(element: XElement, partName: string): ClrMap;
882
+ export declare function parseTheme(root: XElement, partName: string): Theme;
770
883
  /**
771
884
  * One part into one sheet. The parent and the theme are filled in by
772
885
  * `document.ts`, which is the only thing that can follow a relationship.
773
886
  */
774
- declare function parseSheet(root: XElement, partName: string): Omit<Sheet, 'parent' | 'theme'>;
887
+ export declare function parseSheet(root: XElement, partName: string): Omit<Sheet, 'parent' | 'theme'>;
775
888
  //#endregion
776
889
  //#region src/resolve/placeholder.d.ts
777
890
  /**
@@ -784,11 +897,11 @@ declare function parseSheet(root: XElement, partName: string): Omit<Sheet, 'pare
784
897
  * and `body` is already there. They agree, and it is worth knowing why rather
785
898
  * than by luck.
786
899
  */
787
- declare const DEFAULT_PLACEHOLDER_TYPE: PlaceholderType;
900
+ export declare const DEFAULT_PLACEHOLDER_TYPE: PlaceholderType;
788
901
  /** The `@idx` of a `p:ph` that has none. */
789
- declare const DEFAULT_PLACEHOLDER_IDX = 0;
902
+ export declare const DEFAULT_PLACEHOLDER_IDX = 0;
790
903
  /** Supply the two defaults, so a comparison has something to compare. */
791
- declare function normalizePlaceholder(ph: Placeholder): NormalPlaceholder;
904
+ export declare function normalizePlaceholder(ph: Placeholder): NormalPlaceholder;
792
905
  /**
793
906
  * The type a placeholder presents when it asks a master for its parent.
794
907
  *
@@ -798,9 +911,9 @@ declare function normalizePlaceholder(ph: Placeholder): NormalPlaceholder;
798
911
  * because a master cannot hold them either and `body` is the only remaining
799
912
  * content type.
800
913
  */
801
- declare function masterPlaceholderType(type: PlaceholderType): PlaceholderType;
914
+ export declare function masterPlaceholderType(type: PlaceholderType): PlaceholderType;
802
915
  /** Every placeholder in a sheet's top-level shape tree, in document order. */
803
- declare function placeholders(sheet: Sheet): readonly Shape[];
916
+ export declare function placeholders(sheet: Sheet): readonly Shape[];
804
917
  /**
805
918
  * Slide to layout: the first placeholder whose `@idx` agrees.
806
919
  *
@@ -808,9 +921,9 @@ declare function placeholders(sheet: Sheet): readonly Shape[];
808
921
  * which PowerPoint accepts without repairing; the first in the shape tree is
809
922
  * the one that wins.
810
923
  */
811
- declare function matchInLayout(ph: Placeholder, layout: Sheet): Shape | null;
924
+ export declare function matchInLayout(ph: Placeholder, layout: Sheet): Shape | null;
812
925
  /** Layout to master: the first placeholder of the folded type. */
813
- declare function matchInMaster(ph: Placeholder, master: Sheet): Shape | null;
926
+ export declare function matchInMaster(ph: Placeholder, master: Sheet): Shape | null;
814
927
  /** One link of the chain: a shape, the sheet it is on, and how it was reached. */
815
928
  interface ChainLink {
816
929
  readonly shape: Shape;
@@ -826,7 +939,7 @@ interface ChainLink {
826
939
  * with the placeholder of the sheet it is leaving, which is why the layout's
827
940
  * `@type` and not the slide's decides the second hop.
828
941
  */
829
- declare function inheritanceChain(shape: Shape, sheet: Sheet): readonly ChainLink[];
942
+ export declare function inheritanceChain(shape: Shape, sheet: Sheet): readonly ChainLink[];
830
943
  /**
831
944
  * A placeholder that reached no parent and states no geometry of its own.
832
945
  *
@@ -835,7 +948,7 @@ declare function inheritanceChain(shape: Shape, sheet: Sheet): readonly ChainLin
835
948
  * Measured on four probes: a title where the layout has none, a body at an index
836
949
  * nobody has, and both against a layout with no placeholders at all.
837
950
  */
838
- declare const ORPHAN_RECT: {
951
+ export declare const ORPHAN_RECT: {
839
952
  readonly x: 0;
840
953
  readonly y: 0;
841
954
  readonly cx: 0;
@@ -851,7 +964,7 @@ declare const ORPHAN_RECT: {
851
964
  * conflating that with silence is how an explicit `a:noFill` gets overwritten by
852
965
  * an inherited colour.
853
966
  */
854
- declare function resolve<T>(shape: Shape, sheet: Sheet, pick: (shape: Shape) => T | undefined): Resolved<T> | undefined;
967
+ export declare function resolve<T>(shape: Shape, sheet: Sheet, pick: (shape: Shape) => T | undefined): Resolved<T> | undefined;
855
968
  /**
856
969
  * The rectangle a shape occupies, and which sheet stated it.
857
970
  *
@@ -861,11 +974,11 @@ declare function resolve<T>(shape: Shape, sheet: Sheet, pick: (shape: Shape) =>
861
974
  * whole resolved rectangle is baked in at once. So an absent `xfrm` is the
862
975
  * statement "still bound to my layout", and it is what Change Layout reads.
863
976
  */
864
- declare function resolveXfrm(shape: Shape, sheet: Sheet): Resolved<Xfrm> | undefined;
977
+ export declare function resolveXfrm(shape: Shape, sheet: Sheet): Resolved<Xfrm> | undefined;
865
978
  /** Every sheet from this one up to its master, nearest first. */
866
- declare function sheetChain(sheet: Sheet): readonly Sheet[];
979
+ export declare function sheetChain(sheet: Sheet): readonly Sheet[];
867
980
  /** The master at the top of a sheet's chain, or `null` if the chain is broken. */
868
- declare function masterOf(sheet: Sheet): Sheet | null;
981
+ export declare function masterOf(sheet: Sheet): Sheet | null;
869
982
  /**
870
983
  * The theme a sheet resolves against.
871
984
  *
@@ -880,8 +993,8 @@ declare function masterOf(sheet: Sheet): Sheet | null;
880
993
  * one is repaired on open, so a shared theme is a broken file rather than an
881
994
  * economy.
882
995
  */
883
- declare function themeOf(sheet: Sheet): Theme | null;
884
- declare function schemeOf(sheet: Sheet): ClrScheme | undefined;
996
+ export declare function themeOf(sheet: Sheet): Theme | null;
997
+ export declare function schemeOf(sheet: Sheet): ClrScheme | undefined;
885
998
  /**
886
999
  * The colour map in force on a sheet.
887
1000
  *
@@ -892,7 +1005,7 @@ declare function schemeOf(sheet: Sheet): ClrScheme | undefined;
892
1005
  * its layout's. The element is named for the sheet it usually ends at rather
893
1006
  * than for the one it asks.
894
1007
  */
895
- declare function colorMapOf(sheet: Sheet): ClrMap | undefined;
1008
+ export declare function colorMapOf(sheet: Sheet): ClrMap | undefined;
896
1009
  /**
897
1010
  * Everything `resolveColor` needs, for a colour written on this sheet.
898
1011
  *
@@ -901,7 +1014,7 @@ declare function colorMapOf(sheet: Sheet): ClrMap | undefined;
901
1014
  * `schemeClr val="phClr"` reached any other way throws rather than painting
902
1015
  * black.
903
1016
  */
904
- declare function colorContextOf(sheet: Sheet, phClr?: Rgba): ColorContext;
1017
+ export declare function colorContextOf(sheet: Sheet, phClr?: Rgba): ColorContext;
905
1018
  //#endregion
906
1019
  //#region src/style.d.ts
907
1020
  /**
@@ -913,7 +1026,7 @@ declare function colorContextOf(sheet: Sheet, phClr?: Rgba): ColorContext;
913
1026
  * agreed between the two elements, and `idx="0"` and `idx="1000"` both painted
914
1027
  * nothing.
915
1028
  */
916
- declare const STYLE_MATRIX_OFFSET = 1000;
1029
+ export declare const STYLE_MATRIX_OFFSET = 1000;
917
1030
  /** Which of the two lists an index reaches, and where in it. */
918
1031
  type StyleMatrixTarget = {
919
1032
  readonly list: 'none';
@@ -932,18 +1045,18 @@ type StyleMatrixTarget = {
932
1045
  * entry: PowerPoint clamps, opens the file without repairing it, and a renderer
933
1046
  * that throws here refuses a deck PowerPoint shows.
934
1047
  */
935
- declare function styleMatrixTarget(idx: number): StyleMatrixTarget;
1048
+ export declare function styleMatrixTarget(idx: number): StyleMatrixTarget;
936
1049
  /** The fill a `fillRef`/`bgRef` index names, or `null` for none. */
937
- declare function styleMatrixFill(ref: StyleRef, theme: Theme): Fill | null;
1050
+ export declare function styleMatrixFill(ref: StyleRef, theme: Theme): Fill | null;
938
1051
  /**
939
1052
  * The line an `lnRef` index names, or `null` for none.
940
1053
  *
941
1054
  * `a:lnStyleLst` has no background counterpart, so an index above 1000 clamps
942
1055
  * into the same list rather than reaching a second one.
943
1056
  */
944
- declare function styleMatrixLine(ref: StyleRef, theme: Theme): Line | null;
1057
+ export declare function styleMatrixLine(ref: StyleRef, theme: Theme): Line | null;
945
1058
  /** The effects an `effectRef` index names. Empty for none. */
946
- declare function styleMatrixEffects(ref: StyleRef, theme: Theme): readonly Effect[];
1059
+ export declare function styleMatrixEffects(ref: StyleRef, theme: Theme): readonly Effect[];
947
1060
  /**
948
1061
  * The colour a style reference invokes its entry with.
949
1062
  *
@@ -953,7 +1066,7 @@ declare function styleMatrixEffects(ref: StyleRef, theme: Theme): readonly Effec
953
1066
  * its forty-two entries, so `phClr` is a fully transformed colour and not a
954
1067
  * theme slot name.
955
1068
  */
956
- declare function phClrOf(ref: StyleRef, sheet: Sheet): Rgba | null;
1069
+ export declare function phClrOf(ref: StyleRef, sheet: Sheet): Rgba | null;
957
1070
  /** What a shape paints, and where each half of the answer came from. */
958
1071
  interface ResolvedAppearance {
959
1072
  /** `null` means nothing is painted: no fill was declared and no style names one. */
@@ -976,7 +1089,7 @@ interface ResolvedAppearance {
976
1089
  * the whole inheritance chain first, and only if no level declared one does the
977
1090
  * `p:style` - itself inherited down the same chain - get consulted.
978
1091
  */
979
- declare function resolveAppearance(shape: Shape, sheet: Sheet): ResolvedAppearance;
1092
+ export declare function resolveAppearance(shape: Shape, sheet: Sheet): ResolvedAppearance;
980
1093
  /**
981
1094
  * A shape's fill as a single colour, when it is one.
982
1095
  *
@@ -984,9 +1097,9 @@ declare function resolveAppearance(shape: Shape, sheet: Sheet): ResolvedAppearan
984
1097
  * ground-truth fixture is in: PowerPoint's object model reports one RGB per
985
1098
  * shape, so this is what a measurement can be compared against.
986
1099
  */
987
- declare function resolveSolidFill(shape: Shape, sheet: Sheet): Rgba | null;
1100
+ export declare function resolveSolidFill(shape: Shape, sheet: Sheet): Rgba | null;
988
1101
  /** Resolve any colour written on a sheet, with an optional `phClr` in scope. */
989
- declare function resolveOnSheet(color: Color, sheet: Sheet, phClr?: Rgba): Rgba;
1102
+ export declare function resolveOnSheet(color: Color, sheet: Sheet, phClr?: Rgba): Rgba;
990
1103
  //#endregion
991
1104
  //#region src/resolve/background.d.ts
992
1105
  /** A background, with the sheet that declared it and how it was expressed. */
@@ -1002,7 +1115,7 @@ interface ResolvedBackground {
1002
1115
  readonly phClr: Rgba | null;
1003
1116
  }
1004
1117
  /** Which sheet's `p:bg` applies, without unpacking it. */
1005
- declare function backgroundSheet(sheet: Sheet): {
1118
+ export declare function backgroundSheet(sheet: Sheet): {
1006
1119
  sheet: Sheet;
1007
1120
  background: Background;
1008
1121
  } | null;
@@ -1012,9 +1125,9 @@ declare function backgroundSheet(sheet: Sheet): {
1012
1125
  * `null` when no sheet in the chain declares one, which is a legal file: a deck
1013
1126
  * whose master has no `p:bg` paints nothing behind its slides.
1014
1127
  */
1015
- declare function resolveBackground(sheet: Sheet): ResolvedBackground | null;
1128
+ export declare function resolveBackground(sheet: Sheet): ResolvedBackground | null;
1016
1129
  /** The background as one colour, when it is a solid. `null` otherwise. */
1017
- declare function resolveBackgroundColor(sheet: Sheet): Rgba | null;
1130
+ export declare function resolveBackgroundColor(sheet: Sheet): Rgba | null;
1018
1131
  //#endregion
1019
1132
  //#region src/document.d.ts
1020
1133
  /** One thing wrong with the package that did not stop the load. */
@@ -1059,13 +1172,13 @@ interface Document {
1059
1172
  };
1060
1173
  sheet(partName: string): Sheet | undefined;
1061
1174
  }
1062
- declare function loadDocument(store: PartStore): Document;
1175
+ export declare function loadDocument(store: PartStore): Document;
1063
1176
  //#endregion
1064
1177
  //#region src/parse/text.d.ts
1065
1178
  /** `a:rPr`, `a:defRPr` or `a:endParaRPr` - one type under three names. */
1066
- declare function parseRunProps(element: XElement, partName: string): RunProps;
1179
+ export declare function parseRunProps(element: XElement, partName: string): RunProps;
1067
1180
  /** `a:pPr`, `a:defPPr` or any `a:lvlNpPr` - one type under eleven names. */
1068
- declare function parseParaProps(element: XElement, partName: string): ParaProps;
1181
+ export declare function parseParaProps(element: XElement, partName: string): ParaProps;
1069
1182
  /**
1070
1183
  * `a:lstStyle`, or a `p:txStyles` bucket, which is the same type unwrapped.
1071
1184
  *
@@ -1074,15 +1187,15 @@ declare function parseParaProps(element: XElement, partName: string): ParaProps;
1074
1187
  * third to the master. So a level nobody declared stays `undefined` rather than
1075
1188
  * falling back to level one, and the resolver asks per level.
1076
1189
  */
1077
- declare function parseListStyle(element: XElement, partName: string): ListStyle;
1190
+ export declare function parseListStyle(element: XElement, partName: string): ListStyle;
1078
1191
  /** `p:txStyles` on a master. */
1079
- declare function parseTextStyles(element: XElement, partName: string): TextStyles;
1192
+ export declare function parseTextStyles(element: XElement, partName: string): TextStyles;
1080
1193
  /** `p:defaultTextStyle` on `ppt/presentation.xml`, which is a `CT_TextListStyle`. */
1081
- declare function parseDefaultTextStyle(presentation: XElement, partName: string): ListStyle | undefined;
1194
+ export declare function parseDefaultTextStyle(presentation: XElement, partName: string): ListStyle | undefined;
1082
1195
  /** A `p:txBody` or an `a:txBody`. */
1083
- declare function parseTextBody(element: XElement, partName: string): TextBody;
1196
+ export declare function parseTextBody(element: XElement, partName: string): TextBody;
1084
1197
  /** The `p:txBody` of a shape, when it has one. */
1085
- declare function parseTextBodyChild(parent: XElement, partName: string): TextBody | undefined;
1198
+ export declare function parseTextBodyChild(parent: XElement, partName: string): TextBody | undefined;
1086
1199
  //#endregion
1087
1200
  //#region src/builtin-text-styles.d.ts
1088
1201
  /**
@@ -1126,7 +1239,7 @@ interface BuiltinLevel {
1126
1239
  readonly typeface: string | null;
1127
1240
  }
1128
1241
  /** The three buckets, nine levels each, level 1 first. */
1129
- declare const BUILTIN_TEXT_STYLES: {
1242
+ export declare const BUILTIN_TEXT_STYLES: {
1130
1243
  readonly title: readonly BuiltinLevel[];
1131
1244
  readonly body: readonly BuiltinLevel[];
1132
1245
  readonly other: readonly BuiltinLevel[];
@@ -1150,11 +1263,11 @@ declare const BUILTIN_TEXT_STYLES: {
1150
1263
  *
1151
1264
  * The typeface is the minor face on all 6 probes that reach a silent cascade.
1152
1265
  */
1153
- declare const TEXT_FLOOR: BuiltinLevel;
1266
+ export declare const TEXT_FLOOR: BuiltinLevel;
1154
1267
  //#endregion
1155
1268
  //#region src/resolve/text.d.ts
1156
1269
  /** Which `p:txStyles` bucket a placeholder type reads, or `null` for none. */
1157
- declare function bucketOf(type: string): 'title' | 'body' | null;
1270
+ export declare function bucketOf(type: string): 'title' | 'body' | null;
1158
1271
  /**
1159
1272
  * Everything the cascade needs that is not on the shape.
1160
1273
  *
@@ -1185,7 +1298,7 @@ interface Level {
1185
1298
  * compatibility scoring - needs the same list the resolver walks, not a second
1186
1299
  * opinion about it.
1187
1300
  */
1188
- declare function textLevels(context: TextContext): readonly Level[];
1301
+ export declare function textLevels(context: TextContext): readonly Level[];
1189
1302
  /**
1190
1303
  * The values left when every level has been asked and none of them said.
1191
1304
  *
@@ -1197,7 +1310,7 @@ declare function textLevels(context: TextContext): readonly Level[];
1197
1310
  * separate probes precisely because the two are easy to conflate and differ on
1198
1311
  * every partially-specified master.
1199
1312
  */
1200
- declare function floorOf(context: TextContext, level: number): BuiltinLevel;
1313
+ export declare function floorOf(context: TextContext, level: number): BuiltinLevel;
1201
1314
  /**
1202
1315
  * A paragraph property, from the paragraph's own `a:pPr` or up the walk.
1203
1316
  *
@@ -1206,7 +1319,7 @@ declare function floorOf(context: TextContext, level: number): BuiltinLevel;
1206
1319
  * reason: a level may legitimately declare a `null`, and conflating that with
1207
1320
  * silence is how an explicit value gets overwritten by an inherited one.
1208
1321
  */
1209
- declare function resolveParagraph<T>(context: TextContext, paragraph: Paragraph, pick: (props: ParaProps) => T | undefined): Resolved<T> | undefined;
1322
+ export declare function resolveParagraph<T>(context: TextContext, paragraph: Paragraph, pick: (props: ParaProps) => T | undefined): Resolved<T> | undefined;
1210
1323
  /**
1211
1324
  * A run property, from the run's own `a:rPr` and then every `a:defRPr` above it.
1212
1325
  *
@@ -1214,7 +1327,7 @@ declare function resolveParagraph<T>(context: TextContext, paragraph: Paragraph,
1214
1327
  * between the run and the shape's `a:lstStyle`, which the ladder pinned by
1215
1328
  * declaring a different size at each and reading back which one won.
1216
1329
  */
1217
- declare function resolveRun<T>(context: TextContext, paragraph: Paragraph, run: TextContent | undefined, pick: (props: RunProps) => T | undefined): Resolved<T> | undefined;
1330
+ export declare function resolveRun<T>(context: TextContext, paragraph: Paragraph, run: TextContent | undefined, pick: (props: RunProps) => T | undefined): Resolved<T> | undefined;
1218
1331
  /**
1219
1332
  * The font size of a run, in hundredths of a point, always.
1220
1333
  *
@@ -1224,7 +1337,7 @@ declare function resolveRun<T>(context: TextContext, paragraph: Paragraph, run:
1224
1337
  * `schemaDefault` when it does and the bucket said nothing - two different
1225
1338
  * numbers on the same slide, and the field says which was used.
1226
1339
  */
1227
- declare function resolveSize(context: TextContext, paragraph: Paragraph, run: TextContent | undefined): Resolved<number>;
1340
+ export declare function resolveSize(context: TextContext, paragraph: Paragraph, run: TextContent | undefined): Resolved<number>;
1228
1341
  /**
1229
1342
  * The Latin typeface of a run, with any theme reference followed.
1230
1343
  *
@@ -1232,11 +1345,11 @@ declare function resolveSize(context: TextContext, paragraph: Paragraph, run: Te
1232
1345
  * some face, and the face when nothing named one is measured rather than
1233
1346
  * chosen - the theme's minor, on all six probes reaching a silent cascade.
1234
1347
  */
1235
- declare function resolveLatinTypeface(context: TextContext, paragraph: Paragraph, run: TextContent | undefined): Resolved<string>;
1348
+ export declare function resolveLatinTypeface(context: TextContext, paragraph: Paragraph, run: TextContent | undefined): Resolved<string>;
1236
1349
  /** `@marL` in EMU. Measured to be 0 when nothing declares it, not 347663. */
1237
- declare function resolveMarginLeft(context: TextContext, paragraph: Paragraph): Resolved<number>;
1350
+ export declare function resolveMarginLeft(context: TextContext, paragraph: Paragraph): Resolved<number>;
1238
1351
  /** `@indent` in EMU. Measured to be 0 when nothing declares it, not -342900. */
1239
- declare function resolveIndent(context: TextContext, paragraph: Paragraph): Resolved<number>;
1352
+ export declare function resolveIndent(context: TextContext, paragraph: Paragraph): Resolved<number>;
1240
1353
  /**
1241
1354
  * The bullet, merged the way T5 measured it: five slots, each on its own.
1242
1355
  *
@@ -1253,13 +1366,13 @@ declare function resolveIndent(context: TextContext, paragraph: Paragraph): Reso
1253
1366
  * Nothing here supplies a default, because a paragraph with no bullet anywhere
1254
1367
  * in its chain genuinely has none.
1255
1368
  */
1256
- declare function resolveBulletKind(context: TextContext, paragraph: Paragraph): Resolved<BulletKind> | undefined;
1369
+ export declare function resolveBulletKind(context: TextContext, paragraph: Paragraph): Resolved<BulletKind> | undefined;
1257
1370
  /** `a:buChar/@char`, as written. The symbol mapping belongs to the renderer. */
1258
- declare function resolveBulletChar(context: TextContext, paragraph: Paragraph): Resolved<string> | undefined;
1371
+ export declare function resolveBulletChar(context: TextContext, paragraph: Paragraph): Resolved<string> | undefined;
1259
1372
  /** `a:buAutoNum`, type and start value together, since one is meaningless alone. */
1260
- declare function resolveBulletAutoNum(context: TextContext, paragraph: Paragraph): Resolved<BulletAutoNum> | undefined;
1373
+ export declare function resolveBulletAutoNum(context: TextContext, paragraph: Paragraph): Resolved<BulletAutoNum> | undefined;
1261
1374
  /** `a:buBlip/a:blip/@r:embed`, which the caller resolves against the part's rels. */
1262
- declare function resolveBulletBlip(context: TextContext, paragraph: Paragraph): Resolved<string> | undefined;
1375
+ export declare function resolveBulletBlip(context: TextContext, paragraph: Paragraph): Resolved<string> | undefined;
1263
1376
  /**
1264
1377
  * `a:buFont` or `a:buFontTx`.
1265
1378
  *
@@ -1270,11 +1383,11 @@ declare function resolveBulletBlip(context: TextContext, paragraph: Paragraph):
1270
1383
  * numbers. The resolver still reports it, because the file says it and 1.3 has
1271
1384
  * to write it back; the renderer is where it is ignored.
1272
1385
  */
1273
- declare function resolveBulletFont(context: TextContext, paragraph: Paragraph): Resolved<BulletFont> | undefined;
1386
+ export declare function resolveBulletFont(context: TextContext, paragraph: Paragraph): Resolved<BulletFont> | undefined;
1274
1387
  /** `a:buSzPct`, `a:buSzPts` or `a:buSzTx`; a percentage is of the first run's size. */
1275
- declare function resolveBulletSize(context: TextContext, paragraph: Paragraph): Resolved<BulletSize> | undefined;
1388
+ export declare function resolveBulletSize(context: TextContext, paragraph: Paragraph): Resolved<BulletSize> | undefined;
1276
1389
  /** `a:buClr` or `a:buClrTx`. Unlike the font, this one *does* reach an autonumber. */
1277
- declare function resolveBulletColor(context: TextContext, paragraph: Paragraph): Resolved<BulletColor> | undefined;
1390
+ export declare function resolveBulletColor(context: TextContext, paragraph: Paragraph): Resolved<BulletColor> | undefined;
1278
1391
  //#endregion
1279
1392
  //#region src/resolve/body.d.ts
1280
1393
  /**
@@ -1296,25 +1409,31 @@ interface ResolvedInsets {
1296
1409
  * `pick` returns `undefined` for "this level did not say", the same contract the
1297
1410
  * text cascade uses.
1298
1411
  */
1299
- declare function resolveBody<T>(shape: Shape, sheet: Sheet, pick: (props: BodyProps) => T | undefined): Resolved<T> | undefined;
1300
- declare function resolveAnchor(shape: Shape, sheet: Sheet): Resolved<TextAnchor> | undefined;
1301
- declare function resolveAnchorCtr(shape: Shape, sheet: Sheet): Resolved<boolean> | undefined;
1302
- declare function resolveVertical(shape: Shape, sheet: Sheet): Resolved<VerticalText> | undefined;
1303
- declare function resolveWrap(shape: Shape, sheet: Sheet): Resolved<TextWrap> | undefined;
1304
- declare function resolveColumns(shape: Shape, sheet: Sheet): Resolved<number> | undefined;
1412
+ export declare function resolveBody<T>(shape: Shape, sheet: Sheet, pick: (props: BodyProps) => T | undefined): Resolved<T> | undefined;
1413
+ export declare function resolveAnchor(shape: Shape, sheet: Sheet): Resolved<TextAnchor> | undefined;
1414
+ export declare function resolveAnchorCtr(shape: Shape, sheet: Sheet): Resolved<boolean> | undefined;
1415
+ export declare function resolveVertical(shape: Shape, sheet: Sheet): Resolved<VerticalText> | undefined;
1416
+ export declare function resolveWrap(shape: Shape, sheet: Sheet): Resolved<TextWrap> | undefined;
1417
+ export declare function resolveColumns(shape: Shape, sheet: Sheet): Resolved<number> | undefined;
1305
1418
  /**
1306
1419
  * The four insets, in points, each falling back on its own.
1307
1420
  *
1308
1421
  * A frame stating only `lIns` still gets 3.6 above and below, so this resolves
1309
1422
  * four times rather than once.
1310
1423
  */
1311
- declare function resolveInsets(shape: Shape, sheet: Sheet): ResolvedInsets;
1424
+ export declare function resolveInsets(shape: Shape, sheet: Sheet): ResolvedInsets;
1312
1425
  //#endregion
1313
1426
  //#region src/parse/body.d.ts
1314
1427
  /** Parse an `a:bodyPr`. Lengths stay in EMU and angles in 60000ths of a degree. */
1315
- declare function parseBodyProps(element: XElement, partName: string): BodyProps;
1428
+ export declare function parseBodyProps(element: XElement, partName: string): BodyProps;
1316
1429
  /** The `a:bodyPr` of a `p:txBody`, when it has one. */
1317
- declare function parseBodyPropsChild(parent: XElement, partName: string): BodyProps | undefined;
1430
+ export declare function parseBodyPropsChild(parent: XElement, partName: string): BodyProps | undefined;
1431
+ //#endregion
1432
+ //#region src/parse/table.d.ts
1433
+ /** An `a:tbl`. */
1434
+ export declare function parseTable(element: XElement, part: string): Table;
1435
+ /** The table of a `p:graphicFrame`, when its `a:graphicData` carries one. */
1436
+ export declare function parseTableChild(frame: XElement, part: string): Table | undefined;
1318
1437
  //#endregion
1319
1438
  //#region src/resolve/typeface.d.ts
1320
1439
  /** The four slots a `CT_TextCharacterProperties` can name. */
@@ -1325,16 +1444,16 @@ type ScriptSlot = 'latin' | 'ea' | 'cs' | 'sym';
1325
1444
  * `undefined` means the reference resolved to a collection entry the theme
1326
1445
  * leaves empty, which is not the same as the theme naming nothing.
1327
1446
  */
1328
- declare function resolveTypeface(typeface: string, scheme: FontScheme): string | undefined;
1447
+ export declare function resolveTypeface(typeface: string, scheme: FontScheme): string | undefined;
1329
1448
  /** The same, for a whole `CT_TextFont`. */
1330
- declare function resolveTypefaceOf(font: Typeface, scheme: FontScheme): string | undefined;
1449
+ export declare function resolveTypefaceOf(font: Typeface, scheme: FontScheme): string | undefined;
1331
1450
  /**
1332
1451
  * Every distinct typeface a set of runs asks for, theme references followed.
1333
1452
  *
1334
1453
  * This is what `fontReport` is given: a report keyed on `+mn-lt` would name a
1335
1454
  * token no user recognises and would collapse two themes into one row.
1336
1455
  */
1337
- declare function requestedTypefaces(fonts: Iterable<Typeface | undefined>, scheme: FontScheme): readonly string[];
1456
+ export declare function requestedTypefaces(fonts: Iterable<Typeface | undefined>, scheme: FontScheme): readonly string[];
1338
1457
  //#endregion
1339
- 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, 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, TEXT_FLOOR, 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, 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, textLevels, themeFontRef, themeOf };
1458
+ export { type Background, type BuiltinLevel, 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 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 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 };
1340
1459
  //# sourceMappingURL=index.d.ts.map