@shbernal/ts-pptx 1.0.0 → 3.0.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/README.md +10 -3
- package/dist/{autopage-tmfjRzL4.js → autopage-MxulehqQ.js} +3 -4
- package/dist/{autopage-tmfjRzL4.js.map → autopage-MxulehqQ.js.map} +1 -1
- package/dist/browser.d.ts +14 -6
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +12 -4
- package/dist/browser.js.map +1 -1
- package/dist/{diagnostics-DzY9Tyfm.d.ts → diagnostics-BqBTmA3a.d.ts} +95 -23
- package/dist/diagnostics-BqBTmA3a.d.ts.map +1 -0
- package/dist/{enums-D3aF4QGb.d.ts → enums-oLLeaSW3.d.ts} +2 -1
- package/dist/{enums-D3aF4QGb.d.ts.map → enums-oLLeaSW3.d.ts.map} +1 -1
- package/dist/{errors-DRLpOpgQ.d.ts → errors-BENA-Xuw.d.ts} +3 -3
- package/dist/{errors-DRLpOpgQ.d.ts.map → errors-BENA-Xuw.d.ts.map} +1 -1
- package/dist/errors-DGE9zh3U.js.map +1 -1
- package/dist/{fit-CbxyHN69.js → fit-DGSwMMNs.js} +0 -0
- package/dist/{fit-CbxyHN69.js.map → fit-DGSwMMNs.js.map} +1 -1
- package/dist/{html-dom-wVa3TiG7.js → html-dom--J-Xuucf.js} +19 -5
- package/dist/html-dom--J-Xuucf.js.map +1 -0
- package/dist/html.d.ts +3 -3
- package/dist/html.d.ts.map +1 -1
- package/dist/html.js +6 -3
- package/dist/html.js.map +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/inspect.d.ts +1 -1
- package/dist/inspect.js +2 -2
- package/dist/inspect.js.map +1 -1
- package/dist/math.d.ts +1 -1
- package/dist/math.js +2 -1
- package/dist/math.js.map +1 -1
- package/dist/measure.d.ts +2 -2
- package/dist/measure.js +1 -1
- package/dist/node.d.ts +14 -6
- package/dist/node.d.ts.map +1 -1
- package/dist/node.js +11 -3
- package/dist/node.js.map +1 -1
- package/dist/{pres-5x1bjCzk.d.ts → pres-2WsBGimU.d.ts} +3 -3
- package/dist/{pres-5x1bjCzk.d.ts.map → pres-2WsBGimU.d.ts.map} +1 -1
- package/dist/{presentation-RGOiun5P.d.ts → presentation-CTVPpiwP.d.ts} +912 -485
- package/dist/presentation-CTVPpiwP.d.ts.map +1 -0
- package/dist/{presentation-B0JWdTN1.js → presentation-DAcOfzsP.js} +880 -366
- package/dist/presentation-DAcOfzsP.js.map +1 -0
- package/dist/read.d.ts +4 -4
- package/dist/read.d.ts.map +1 -1
- package/dist/read.js +2 -2
- package/dist/script.d.ts +2 -2
- package/dist/script.d.ts.map +1 -1
- package/dist/script.js +0 -0
- package/dist/script.js.map +1 -1
- package/dist/{shapes-BZU8UTW2.js → shapes-BWifcHDV.js} +1520 -996
- package/dist/shapes-BWifcHDV.js.map +1 -0
- package/dist/{slide-B6mDaM-P.d.ts → slide-YuSCGa45.d.ts} +409 -103
- package/dist/slide-YuSCGa45.d.ts.map +1 -0
- package/dist/{image-size-C5Z1sKof.js → st-enums-CgadEyPM.js} +235 -4
- package/dist/st-enums-CgadEyPM.js.map +1 -0
- package/dist/{text-WRUbOy2r.js → text-120VFSDm.js} +1027 -369
- package/dist/text-120VFSDm.js.map +1 -0
- package/dist/{units-internal-7JcMfYti.js → units-internal-CiFWZWk4.js} +2 -1
- package/dist/units-internal-CiFWZWk4.js.map +1 -0
- package/dist/zip.d.ts +2 -2
- package/dist/zip.js.map +1 -1
- package/package.json +38 -36
- package/dist/diagnostics-DzY9Tyfm.d.ts.map +0 -1
- package/dist/html-dom-wVa3TiG7.js.map +0 -1
- package/dist/image-size-C5Z1sKof.js.map +0 -1
- package/dist/presentation-B0JWdTN1.js.map +0 -1
- package/dist/presentation-RGOiun5P.d.ts.map +0 -1
- package/dist/shapes-BZU8UTW2.js.map +0 -1
- package/dist/slide-B6mDaM-P.d.ts.map +0 -1
- package/dist/text-WRUbOy2r.js.map +0 -1
- package/dist/units-internal-7JcMfYti.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as TextAnchor, f as SHAPE_NAME, g as TableStyle, h as SlideObjectType, i as CHART_NAME, l as PLACEHOLDER_TYPE, t as AlignH } from "./enums-
|
|
1
|
+
import { _ as TextAnchor, f as SHAPE_NAME, g as TableStyle, h as SlideObjectType, i as CHART_NAME, l as PLACEHOLDER_TYPE, t as AlignH } from "./enums-oLLeaSW3.js";
|
|
2
2
|
//#region src/types/text.d.ts
|
|
3
3
|
interface TextBaseProps {
|
|
4
4
|
/**
|
|
@@ -1475,6 +1475,72 @@ interface ChartOpts extends ChartPropsAxisCat, ChartPropsAxisSer, ChartPropsAxis
|
|
|
1475
1475
|
metadata?: Record<string, string>;
|
|
1476
1476
|
}
|
|
1477
1477
|
//#endregion
|
|
1478
|
+
//#region src/ooxml/st-enums.d.ts
|
|
1479
|
+
/**
|
|
1480
|
+
* `ST_` simple-type enumerations from ECMA-376, declared once as the single source of both the
|
|
1481
|
+
* TypeScript union a caller is checked against and the runtime list a value is validated against.
|
|
1482
|
+
*
|
|
1483
|
+
* **The problem this solves.** Each of these used to exist twice: a hand-written string union in
|
|
1484
|
+
* `src/types/` (what the compiler enforces) and a hand-written array in `src/gen/` or `src/read/`
|
|
1485
|
+
* (what the validator checks at run time). Nothing tied the two together, so adding a member to
|
|
1486
|
+
* one and not the other produced either a value TypeScript accepts and the validator drops, or a
|
|
1487
|
+
* value the validator passes and the type rejects. Two of them had already diverged in *order*,
|
|
1488
|
+
* which is harmless, but nothing would have caught a divergence in *content*.
|
|
1489
|
+
*
|
|
1490
|
+
* **The shape.** Every entry is a `readonly` tuple declared `as const`, with its union derived via
|
|
1491
|
+
* `(typeof X)[number]`. Widening the tuple widens the union in the same edit — they cannot drift.
|
|
1492
|
+
* This is the idiom already used for `EMBEDDED_FONT_SLOTS` and `EXTRA_SHAPE_PRESETS`; this module
|
|
1493
|
+
* brings the stragglers onto it.
|
|
1494
|
+
*
|
|
1495
|
+
* **Why this module is neither `gen/` nor `read/`.** `src/types/` needs the unions for the public
|
|
1496
|
+
* write API, `src/gen/` needs the tuples to vet a value before emitting it, and `src/read/` needs
|
|
1497
|
+
* them to vet a value before writing it into a loaded part. It is a fact about the schema, so it
|
|
1498
|
+
* belongs to none of the three.
|
|
1499
|
+
*
|
|
1500
|
+
* Values are listed in **schema declaration order**, which is the order the diagnostics print
|
|
1501
|
+
* when they tell a caller what is legal.
|
|
1502
|
+
*/
|
|
1503
|
+
/**
|
|
1504
|
+
* `ST_BevelPresetType` — the bevel profile applied to a 3-D edge.
|
|
1505
|
+
* @see ECMA-376 Part 1 §20.1.10.9
|
|
1506
|
+
*/
|
|
1507
|
+
declare const BEVEL_PRESETS: readonly ["relaxedInset", "circle", "slope", "cross", "angle", "softRound", "convex", "coolSlant", "divot", "riblet", "hardEdge", "artDeco"];
|
|
1508
|
+
type BevelPresetType = (typeof BEVEL_PRESETS)[number];
|
|
1509
|
+
/**
|
|
1510
|
+
* `ST_PresetMaterialType` — how a 3-D surface responds to light.
|
|
1511
|
+
* @see ECMA-376 Part 1 §20.1.10.50
|
|
1512
|
+
*/
|
|
1513
|
+
declare const PRESET_MATERIALS: readonly ["legacyMatte", "legacyPlastic", "legacyMetal", "legacyWireframe", "matte", "plastic", "metal", "warmMatte", "translucentPowder", "powder", "dkEdge", "softEdge", "clear", "flat", "softmetal"];
|
|
1514
|
+
type PresetMaterialType = (typeof PRESET_MATERIALS)[number];
|
|
1515
|
+
/**
|
|
1516
|
+
* `ST_LightRigType` — the preset lighting scene.
|
|
1517
|
+
* @see ECMA-376 Part 1 §20.1.10.35
|
|
1518
|
+
*/
|
|
1519
|
+
declare const LIGHT_RIGS: readonly ["legacyFlat1", "legacyFlat2", "legacyFlat3", "legacyFlat4", "legacyNormal1", "legacyNormal2", "legacyNormal3", "legacyNormal4", "legacyHarsh1", "legacyHarsh2", "legacyHarsh3", "legacyHarsh4", "threePt", "balanced", "soft", "harsh", "flood", "contrasting", "morning", "sunrise", "sunset", "chilly", "freezing", "flat", "twoPt", "glow", "brightRoom"];
|
|
1520
|
+
type LightRigType = (typeof LIGHT_RIGS)[number];
|
|
1521
|
+
/**
|
|
1522
|
+
* `ST_LightRigDirection` — where the light rig sits relative to the scene.
|
|
1523
|
+
* @see ECMA-376 Part 1 §20.1.10.33
|
|
1524
|
+
*/
|
|
1525
|
+
declare const LIGHT_RIG_DIRECTIONS: readonly ["tl", "t", "tr", "l", "r", "bl", "b", "br"];
|
|
1526
|
+
type LightRigDirection = (typeof LIGHT_RIG_DIRECTIONS)[number];
|
|
1527
|
+
/**
|
|
1528
|
+
* `ST_TextVerticalType` — `a:bodyPr/@vert` and `a:tcPr/@vert`.
|
|
1529
|
+
* @see ECMA-376 Part 1 §20.1.10.83
|
|
1530
|
+
*/
|
|
1531
|
+
declare const TEXT_VERTICAL: readonly ["horz", "vert", "vert270", "wordArtVert", "eaVert", "mongolianVert", "wordArtVertRtl"];
|
|
1532
|
+
type TextVerticalType = (typeof TEXT_VERTICAL)[number];
|
|
1533
|
+
/**
|
|
1534
|
+
* `ST_PresetLineDashVal` — the dash pattern of a line or border (`a:prstDash/@val`).
|
|
1535
|
+
*
|
|
1536
|
+
* The `sys*` members are the "system" dashes whose exact dot/gap ratio the renderer picks; the
|
|
1537
|
+
* rest are defined by the spec. Both `BorderProps.dashType` and `ShapeLineProps.dashType` accept
|
|
1538
|
+
* this whole set, so a caller who knows one knows the other.
|
|
1539
|
+
* @see ECMA-376 Part 1 §20.1.10.49
|
|
1540
|
+
*/
|
|
1541
|
+
declare const PRESET_LINE_DASHES: readonly ["solid", "dot", "dash", "lgDash", "dashDot", "lgDashDot", "lgDashDotDot", "sysDash", "sysDot", "sysDashDot", "sysDashDotDot"];
|
|
1542
|
+
type PresetLineDashVal = (typeof PRESET_LINE_DASHES)[number];
|
|
1543
|
+
//#endregion
|
|
1478
1544
|
//#region src/types/style.d.ts
|
|
1479
1545
|
interface BorderProps {
|
|
1480
1546
|
/**
|
|
@@ -1482,6 +1548,21 @@ interface BorderProps {
|
|
|
1482
1548
|
* @default solid
|
|
1483
1549
|
*/
|
|
1484
1550
|
type?: 'none' | 'dash' | 'solid';
|
|
1551
|
+
/**
|
|
1552
|
+
* Dash pattern, using the same vocabulary as {@link ShapeLineProps.dashType}.
|
|
1553
|
+
*
|
|
1554
|
+
* `type` is only a coarse three-way switch, so every dashed border it can express
|
|
1555
|
+
* collapses onto `sysDash`. Set this to pick the exact `a:prstDash` preset instead:
|
|
1556
|
+
* `dashType: 'lgDashDot'` emits `<a:prstDash val="lgDashDot"/>`.
|
|
1557
|
+
*
|
|
1558
|
+
* **Precedence.** When both are set, `dashType` wins over `type` for the dash pattern —
|
|
1559
|
+
* `{ type: 'solid', dashType: 'sysDot' }` draws a dotted rule. The one exception is
|
|
1560
|
+
* `type: 'none'`, which suppresses the border entirely and is decided before any dash
|
|
1561
|
+
* pattern is chosen. An unrecognized value warns and falls back to what `type` implies.
|
|
1562
|
+
* @default (derived from `type`: `sysDash` for `'dash'`, else `solid`)
|
|
1563
|
+
* @example { type: 'solid', color: '999999', dashType: 'lgDash' }
|
|
1564
|
+
*/
|
|
1565
|
+
dashType?: ShapeLineProps['dashType'];
|
|
1485
1566
|
/**
|
|
1486
1567
|
* Border color (hex)
|
|
1487
1568
|
* @example 'FF3399'
|
|
@@ -1631,10 +1712,11 @@ interface ShapeLineProps extends ShapeFillProps {
|
|
|
1631
1712
|
*/
|
|
1632
1713
|
width?: number;
|
|
1633
1714
|
/**
|
|
1634
|
-
* Dash type
|
|
1715
|
+
* Dash type — the full `ST_PresetLineDashVal` set, so any dash a source deck can
|
|
1716
|
+
* carry can also be authored and replicated.
|
|
1635
1717
|
* @default 'solid'
|
|
1636
1718
|
*/
|
|
1637
|
-
dashType?:
|
|
1719
|
+
dashType?: PresetLineDashVal;
|
|
1638
1720
|
/**
|
|
1639
1721
|
* Line end cap style
|
|
1640
1722
|
* @default 'flat'
|
|
@@ -1922,7 +2004,7 @@ type VAlign = 'top' | 'middle' | 'bottom';
|
|
|
1922
2004
|
* Text body `vert` attribute — flow/rotation direction of the text within its box.
|
|
1923
2005
|
* Maps to `<a:bodyPr vert="…">` (ECMA-376 `ST_TextVerticalType`).
|
|
1924
2006
|
*/
|
|
1925
|
-
type TextVertType =
|
|
2007
|
+
type TextVertType = TextVerticalType;
|
|
1926
2008
|
/**
|
|
1927
2009
|
* A single node of a freeform (`custGeom`) path.
|
|
1928
2010
|
* - coordinates are authored in the object's own inch/EMU space (0..width, 0..height), not slide-relative and not normalized
|
|
@@ -2149,9 +2231,15 @@ interface ImageBaseProps extends PositionProps, ObjectNameProps {
|
|
|
2149
2231
|
* - When a `data` (base64) image is supplied and `w`/`h` are omitted, the natural pixel
|
|
2150
2232
|
* size is read from the image header (PNG/JPEG/GIF/BMP/WebP) and used at 96 DPI
|
|
2151
2233
|
* (natural pixels / 96 = inches).
|
|
2152
|
-
* - When only one of `w`/`h` is given, the other is derived from the natural aspect ratio
|
|
2153
|
-
*
|
|
2154
|
-
*
|
|
2234
|
+
* - When only one of `w`/`h` is given, the other is derived from the natural aspect ratio —
|
|
2235
|
+
* for an SVG too, from its `width`/`height` or `viewBox`.
|
|
2236
|
+
* - A `path` image is measured at export time (its bytes are not available synchronously);
|
|
2237
|
+
* an omitted dimension falls back to 1 inch if it stays unmeasurable.
|
|
2238
|
+
* - An SVG with *neither* dimension given also falls back to 1 inch: its user units carry a
|
|
2239
|
+
* dependable aspect ratio but only a conventional magnitude, so a 24-unit icon is not
|
|
2240
|
+
* treated as a quarter-inch object.
|
|
2241
|
+
* - A vector source placed in a box whose ratio differs from its own is letterboxed, not
|
|
2242
|
+
* stretched; see {@link sizing} to override.
|
|
2155
2243
|
*/
|
|
2156
2244
|
/**
|
|
2157
2245
|
* Alt Text value ("How would you describe this object and its contents to someone who is blind?")
|
|
@@ -2260,31 +2348,38 @@ interface ImageBaseProps extends PositionProps, ObjectNameProps {
|
|
|
2260
2348
|
};
|
|
2261
2349
|
/**
|
|
2262
2350
|
* Image sizing options
|
|
2351
|
+
* - omit entirely for the default: a raster fills the `w`×`h` box, a vector (SVG) source is
|
|
2352
|
+
* letterboxed to its own aspect ratio inside that box
|
|
2263
2353
|
*/
|
|
2264
2354
|
sizing?: {
|
|
2265
2355
|
/**
|
|
2266
2356
|
* Sizing type
|
|
2267
2357
|
* - `cover` / `contain` fit the image into the `w`×`h` box using the image's *natural*
|
|
2268
|
-
*
|
|
2269
|
-
* natural size cannot be determined (
|
|
2270
|
-
*
|
|
2358
|
+
* aspect ratio — read from the embedded PNG/JPEG/GIF/BMP/WebP header, or from an SVG's
|
|
2359
|
+
* `width`/`height` or `viewBox`. If the natural size cannot be determined (an
|
|
2360
|
+
* unrecognized format, or an SVG carrying neither) the displayed `w`/`h` ratio is used
|
|
2361
|
+
* as a fallback and a warning is logged.
|
|
2271
2362
|
* - `crop` cuts a window out of the displayed image using the `x`/`y`/`w`/`h` offsets.
|
|
2363
|
+
* - `stretch` fills the box regardless of aspect ratio. This is what a raster does
|
|
2364
|
+
* anyway; name it explicitly to opt a vector source out of its aspect-correct default.
|
|
2272
2365
|
*/
|
|
2273
|
-
type: 'contain' | 'cover' | 'crop';
|
|
2366
|
+
type: 'contain' | 'cover' | 'crop' | 'stretch';
|
|
2274
2367
|
/**
|
|
2275
2368
|
* Image width
|
|
2276
2369
|
* - inches or percentage
|
|
2370
|
+
* - defaults to the picture's own `w`, which is what `cover`/`contain` almost always want
|
|
2277
2371
|
* @example 10.25 // position in inches
|
|
2278
2372
|
* @example '75%' // position as percentage of slide size
|
|
2279
2373
|
*/
|
|
2280
|
-
w
|
|
2374
|
+
w?: Coord;
|
|
2281
2375
|
/**
|
|
2282
2376
|
* Image height
|
|
2283
2377
|
* - inches or percentage
|
|
2378
|
+
* - defaults to the picture's own `h`
|
|
2284
2379
|
* @example 10.25 // position in inches
|
|
2285
2380
|
* @example '75%' // position as percentage of slide size
|
|
2286
2381
|
*/
|
|
2287
|
-
h
|
|
2382
|
+
h?: Coord;
|
|
2288
2383
|
/**
|
|
2289
2384
|
* Offset from left to crop image
|
|
2290
2385
|
* - `crop` only
|
|
@@ -2592,6 +2687,63 @@ interface TableToSlidesProps extends TableProps {
|
|
|
2592
2687
|
*/
|
|
2593
2688
|
slideMargin?: Margin;
|
|
2594
2689
|
}
|
|
2690
|
+
/**
|
|
2691
|
+
* A table cell's corner-to-corner rules (`a:tcPr/a:lnTlToBr` / `a:lnBlToTr`) — the
|
|
2692
|
+
* "Diagonal Down Border" / "Diagonal Up Border" of PowerPoint's border gallery.
|
|
2693
|
+
*
|
|
2694
|
+
* Deliberately its own object rather than two more entries on {@link TableCellProps.border}'s
|
|
2695
|
+
* tuple: widening that tuple to six would break every existing caller for a construct almost
|
|
2696
|
+
* no deck uses, and the two diagonals are not edges — they do not participate in the
|
|
2697
|
+
* perimeter, and they are not inherited by a merged region's covered cells.
|
|
2698
|
+
*
|
|
2699
|
+
* @example diagonal: { tlToBr: { type:'solid', color:'C00000', width:1 } } // strike a cell out
|
|
2700
|
+
* @example diagonal: { tlToBr: { type:'solid' }, blToTr: { type:'solid' } } // an X across the cell
|
|
2701
|
+
*/
|
|
2702
|
+
interface TableCellDiagonals {
|
|
2703
|
+
/** Top-left to bottom-right (`╲`, `a:lnTlToBr`). */
|
|
2704
|
+
tlToBr?: BorderProps;
|
|
2705
|
+
/** Bottom-left to top-right (`╱`, `a:lnBlToTr`). */
|
|
2706
|
+
blToTr?: BorderProps;
|
|
2707
|
+
}
|
|
2708
|
+
/**
|
|
2709
|
+
* A cell's 3-D bevel (`a:tcPr/a:cell3D`).
|
|
2710
|
+
*
|
|
2711
|
+
* A minimal surface over `CT_Cell3D`, which is a required `a:bevel` plus an optional
|
|
2712
|
+
* `a:lightRig`. PowerPoint's table UI exposes no control for it — it reaches a deck through a
|
|
2713
|
+
* theme's table style or through another producer — so this exists to author and reproduce
|
|
2714
|
+
* one, not as a general 3-D model.
|
|
2715
|
+
*/
|
|
2716
|
+
interface TableCell3DProps {
|
|
2717
|
+
/**
|
|
2718
|
+
* The bevel's preset shape (`a:bevel/@prst`).
|
|
2719
|
+
* @default 'circle'
|
|
2720
|
+
*/
|
|
2721
|
+
preset?: BevelPresetType;
|
|
2722
|
+
/**
|
|
2723
|
+
* Bevel width in points (`a:bevel/@w`; the attribute is EMU).
|
|
2724
|
+
* @default 6 // 76200 EMU
|
|
2725
|
+
*/
|
|
2726
|
+
width?: number;
|
|
2727
|
+
/**
|
|
2728
|
+
* Bevel height in points (`a:bevel/@h`; the attribute is EMU).
|
|
2729
|
+
* @default 6 // 76200 EMU
|
|
2730
|
+
*/
|
|
2731
|
+
height?: number;
|
|
2732
|
+
/**
|
|
2733
|
+
* Surface material (`a:cell3D/@prstMaterial`), which decides how the bevel takes light.
|
|
2734
|
+
* @default 'plastic'
|
|
2735
|
+
*/
|
|
2736
|
+
material?: PresetMaterialType;
|
|
2737
|
+
/**
|
|
2738
|
+
* Scene lighting (`a:cell3D/a:lightRig`). Both fields are required by the schema, so
|
|
2739
|
+
* either give both or omit the whole object and let the renderer light the bevel.
|
|
2740
|
+
* @example lightRig: { rig: 'threePt', dir: 't' }
|
|
2741
|
+
*/
|
|
2742
|
+
lightRig?: {
|
|
2743
|
+
rig: LightRigType;
|
|
2744
|
+
dir: LightRigDirection;
|
|
2745
|
+
};
|
|
2746
|
+
}
|
|
2595
2747
|
interface TableCellProps extends TextBaseProps {
|
|
2596
2748
|
/**
|
|
2597
2749
|
* Auto-paging character weight
|
|
@@ -2610,9 +2762,44 @@ interface TableCellProps extends TextBaseProps {
|
|
|
2610
2762
|
*/
|
|
2611
2763
|
autoPageLineWeight?: number;
|
|
2612
2764
|
/**
|
|
2613
|
-
*
|
|
2765
|
+
* The cell's four edge borders (`a:tcPr/a:lnT|lnR|lnB|lnL`).
|
|
2766
|
+
* - a single `BorderProps` is broadcast to all four sides
|
|
2767
|
+
* - an array is read in **TRBL** order (`[top, right, bottom, left]`)
|
|
2768
|
+
*
|
|
2769
|
+
* Overrides the table-level {@link TableProps.border} default entirely — the two do not
|
|
2770
|
+
* merge per side. For the two corner-to-corner rules see {@link diagonal}; for the
|
|
2771
|
+
* table's outside edge see {@link TableProps.outerBorder}.
|
|
2614
2772
|
*/
|
|
2615
2773
|
border?: BorderProps | [BorderProps, BorderProps, BorderProps, BorderProps];
|
|
2774
|
+
/**
|
|
2775
|
+
* The cell's corner-to-corner rules — PowerPoint's "Diagonal Down/Up Border".
|
|
2776
|
+
*
|
|
2777
|
+
* Kept off {@link border}'s tuple on purpose: see {@link TableCellDiagonals}. A diagonal
|
|
2778
|
+
* on a merged cell is one stroke across the whole region, so only the span origin carries
|
|
2779
|
+
* it — the covered cells inherit the origin's *edges* but never its diagonals.
|
|
2780
|
+
* @example diagonal: { tlToBr: { type:'solid', color:'C00000' } } // strike the cell out
|
|
2781
|
+
*/
|
|
2782
|
+
diagonal?: TableCellDiagonals;
|
|
2783
|
+
/**
|
|
2784
|
+
* Centre the cell's whole text **block** horizontally within the cell
|
|
2785
|
+
* (`a:tcPr/@anchorCtr`), independent of each paragraph's own `align`.
|
|
2786
|
+
*
|
|
2787
|
+
* The two do different things and compose: `align` decides where each line sits inside
|
|
2788
|
+
* the text block, `anchorCtr` decides where that block sits inside the cell. With
|
|
2789
|
+
* left-aligned text in a wide cell, `anchorCtr: true` centres the ragged-right column of
|
|
2790
|
+
* lines as a unit while keeping their left edges flush with each other.
|
|
2791
|
+
*
|
|
2792
|
+
* `false` is the schema default, so it emits nothing — the same reasoning as
|
|
2793
|
+
* `horzOverflow: 'clip'`.
|
|
2794
|
+
* @default false
|
|
2795
|
+
*/
|
|
2796
|
+
anchorCtr?: boolean;
|
|
2797
|
+
/**
|
|
2798
|
+
* A 3-D bevel on the cell (`a:tcPr/a:cell3D`). Niche: PowerPoint's table UI has no
|
|
2799
|
+
* control for it, so it reaches a deck from a theme or another producer, and this exists
|
|
2800
|
+
* to author and reproduce one. See {@link TableCell3DProps}.
|
|
2801
|
+
*/
|
|
2802
|
+
cell3D?: TableCell3DProps;
|
|
2616
2803
|
/**
|
|
2617
2804
|
* Cell colspan
|
|
2618
2805
|
*/
|
|
@@ -2629,6 +2816,24 @@ interface TableCellProps extends TextBaseProps {
|
|
|
2629
2816
|
* @example { image:{ data:'image/png;base64,…' } } // picture fill, `type` inferred
|
|
2630
2817
|
*/
|
|
2631
2818
|
fill?: ShapeFillProps;
|
|
2819
|
+
/**
|
|
2820
|
+
* What happens to a **single glyph** wider than the cell's text width (`a:tcPr/@horzOverflow`).
|
|
2821
|
+
* - `'clip'` (PowerPoint's default) cuts the glyph off at the cell edge
|
|
2822
|
+
* - `'overflow'` lets it draw past the edge, over whatever is beside it
|
|
2823
|
+
*
|
|
2824
|
+
* This is **not** a text-wrap switch, despite the name. Lines always wrap to the column
|
|
2825
|
+
* width; only an individual character too wide to fit on a line by itself is affected, so
|
|
2826
|
+
* it matters for oversized display type, wide CJK/emoji glyphs, and icon fonts in a narrow
|
|
2827
|
+
* column. PowerPoint has no per-cell no-wrap at all — `wrap="none"` on a cell's `a:bodyPr`
|
|
2828
|
+
* is discarded on the next save (probe:
|
|
2829
|
+
* `test/read/fixtures/authoring/probe-table-cell-wrap.ps1`).
|
|
2830
|
+
* `'clip'` is written as asked but is the schema default, so PowerPoint drops the
|
|
2831
|
+
* attribute again the first time it saves the deck — the visible result is the same
|
|
2832
|
+
* either way, and leaving this unset emits nothing at all.
|
|
2833
|
+
* @default (unset — PowerPoint clips)
|
|
2834
|
+
* @example 'overflow' // a 60pt glyph in a 0.5in column draws whole instead of being cut
|
|
2835
|
+
*/
|
|
2836
|
+
horzOverflow?: 'clip' | 'overflow';
|
|
2632
2837
|
hyperlink?: HyperlinkProps;
|
|
2633
2838
|
/**
|
|
2634
2839
|
* Cell margin (inches)
|
|
@@ -2658,74 +2863,6 @@ interface TableCellProps extends TextBaseProps {
|
|
|
2658
2863
|
*/
|
|
2659
2864
|
fit?: 'none' | 'shrink' | 'resize' | TextFitShrinkProps;
|
|
2660
2865
|
}
|
|
2661
|
-
/**
|
|
2662
|
-
* Styling for one region of a custom table style (maps to a `CT_TablePartStyle`).
|
|
2663
|
-
* A region (e.g. the header row or banded rows) is shown only when the matching
|
|
2664
|
-
* `TableProps` flag is set — `firstRow` needs `hasHeader`, `band1H`/`band2H` need
|
|
2665
|
-
* `hasBandedRows`, and so on.
|
|
2666
|
-
* @see TableStyleProps
|
|
2667
|
-
*/
|
|
2668
|
-
interface TableStyleRegionProps {
|
|
2669
|
-
/**
|
|
2670
|
-
* Solid cell fill color (hex).
|
|
2671
|
-
* - `HexColor` only; theme references are not supported in custom styles
|
|
2672
|
-
* @example '1A2B3C'
|
|
2673
|
-
*/
|
|
2674
|
-
fill?: HexColor;
|
|
2675
|
-
/**
|
|
2676
|
-
* Text color (hex).
|
|
2677
|
-
* @example 'FFFFFF'
|
|
2678
|
-
*/
|
|
2679
|
-
color?: HexColor;
|
|
2680
|
-
/** Bold text. */
|
|
2681
|
-
bold?: boolean;
|
|
2682
|
-
/** Italic text. */
|
|
2683
|
-
italic?: boolean;
|
|
2684
|
-
/**
|
|
2685
|
-
* Cell border(s).
|
|
2686
|
-
* - single value is applied to all four sides plus the interior grid lines
|
|
2687
|
-
* - array of values in TRBL order styles only the four outer sides
|
|
2688
|
-
*/
|
|
2689
|
-
border?: BorderProps | [BorderProps, BorderProps, BorderProps, BorderProps];
|
|
2690
|
-
}
|
|
2691
|
-
/**
|
|
2692
|
-
* A reusable custom table style written to `ppt/tableStyles.xml`.
|
|
2693
|
-
* Pass to `pptx.defineTableStyle()`, which registers it and returns a GUID to use
|
|
2694
|
-
* as `TableProps.tableStyle`. Unlike the fixed built-in `TableStyle` set, a custom
|
|
2695
|
-
* style can use arbitrary brand colors, is editable in PowerPoint's Table Styles
|
|
2696
|
-
* gallery, and bands correctly across any row/column count (including auto-paged tables).
|
|
2697
|
-
* @example
|
|
2698
|
-
* const brand = pptx.defineTableStyle({
|
|
2699
|
-
* name: 'Brand Banded',
|
|
2700
|
-
* wholeTbl: { border: { type:'solid', color:'D9D9D9', width:0.5 } },
|
|
2701
|
-
* firstRow: { fill:'1A2B3C', color:'FFFFFF', bold:true },
|
|
2702
|
-
* band1H: { fill:'EAF1F8' },
|
|
2703
|
-
* band2H: { fill:'FFFFFF' },
|
|
2704
|
-
* })
|
|
2705
|
-
* slide.addTable(rows, { tableStyle: brand, hasHeader:true, hasBandedRows:true })
|
|
2706
|
-
*/
|
|
2707
|
-
interface TableStyleProps {
|
|
2708
|
-
/** Display name shown in PowerPoint's Table Styles gallery. */
|
|
2709
|
-
name: string;
|
|
2710
|
-
/** Base styling applied to every cell. */
|
|
2711
|
-
wholeTbl?: TableStyleRegionProps;
|
|
2712
|
-
/** Header (first) row — activated by `TableProps.hasHeader`. */
|
|
2713
|
-
firstRow?: TableStyleRegionProps;
|
|
2714
|
-
/** Footer (last) row — activated by `TableProps.hasFooter`. */
|
|
2715
|
-
lastRow?: TableStyleRegionProps;
|
|
2716
|
-
/** First column — activated by `TableProps.hasFirstColumn`. */
|
|
2717
|
-
firstCol?: TableStyleRegionProps;
|
|
2718
|
-
/** Last column — activated by `TableProps.hasLastColumn`. */
|
|
2719
|
-
lastCol?: TableStyleRegionProps;
|
|
2720
|
-
/** Odd horizontal band — activated by `TableProps.hasBandedRows`. */
|
|
2721
|
-
band1H?: TableStyleRegionProps;
|
|
2722
|
-
/** Even horizontal band — activated by `TableProps.hasBandedRows`. */
|
|
2723
|
-
band2H?: TableStyleRegionProps;
|
|
2724
|
-
/** Odd vertical band — activated by `TableProps.hasBandedColumns`. */
|
|
2725
|
-
band1V?: TableStyleRegionProps;
|
|
2726
|
-
/** Even vertical band — activated by `TableProps.hasBandedColumns`. */
|
|
2727
|
-
band2V?: TableStyleRegionProps;
|
|
2728
|
-
}
|
|
2729
2866
|
interface TableProps extends PositionProps, TextBaseProps, ObjectNameProps {
|
|
2730
2867
|
_arrObjTabHeadRows?: TableRow[];
|
|
2731
2868
|
/**
|
|
@@ -2786,11 +2923,41 @@ interface TableProps extends PositionProps, TextBaseProps, ObjectNameProps {
|
|
|
2786
2923
|
*/
|
|
2787
2924
|
autoPagePlaceholder?: boolean;
|
|
2788
2925
|
/**
|
|
2789
|
-
*
|
|
2790
|
-
*
|
|
2791
|
-
*
|
|
2926
|
+
* Default border for **every cell** in the table — not the table's outer perimeter.
|
|
2927
|
+
*
|
|
2928
|
+
* A single `BorderProps` is broadcast to all four sides of each cell; an array is read
|
|
2929
|
+
* in TRBL order and applied to each cell's own four sides. So
|
|
2930
|
+
* `border: [{type:'solid'}, {type:'none'}, {type:'solid'}, {type:'none'}]` gives *every*
|
|
2931
|
+
* cell a top and bottom rule — a full set of horizontal grid lines, not a rule at the
|
|
2932
|
+
* top and bottom of the table. A cell's own `options.border` overrides this entirely.
|
|
2933
|
+
*
|
|
2934
|
+
* For the perimeter, use {@link outerBorder}, which applies only to the cells on the
|
|
2935
|
+
* table's outside edge. The two compose: `border` draws the interior grid and
|
|
2936
|
+
* `outerBorder` overrides the edges it reaches.
|
|
2937
|
+
* @example border: { type:'solid', color:'D9D9D9', width:0.5 } // full grid
|
|
2938
|
+
* @example border: [{type:'solid'}, {type:'none'}, {type:'solid'}, {type:'none'}] // horizontal rules only
|
|
2792
2939
|
*/
|
|
2793
2940
|
border?: BorderProps | [BorderProps, BorderProps, BorderProps, BorderProps];
|
|
2941
|
+
/**
|
|
2942
|
+
* Border for the table's outer perimeter only — the top edge of the first row, the
|
|
2943
|
+
* bottom edge of the last row, the left edge of the first column and the right edge of
|
|
2944
|
+
* the last column.
|
|
2945
|
+
*
|
|
2946
|
+
* A single `BorderProps` is used for all four perimeter sides; an array is read in TRBL
|
|
2947
|
+
* order, so `outerBorder: [box, box, box, box]` boxes the table and
|
|
2948
|
+
* `outerBorder: [rule, undefined, rule, undefined]` rules only above and below it.
|
|
2949
|
+
* An `undefined`/omitted entry leaves that side to whatever {@link border} (or the cell's
|
|
2950
|
+
* own `options.border`) already put there.
|
|
2951
|
+
*
|
|
2952
|
+
* Applied **after** every other border source, so it wins on the sides it touches and
|
|
2953
|
+
* leaves the interior alone — the "outline the table, no interior grid" case is
|
|
2954
|
+
* `outerBorder` with no `border` at all. Merged cells are handled: a span's covered cells
|
|
2955
|
+
* inherit the origin's borders, so a colspan straddling the last column still gets the
|
|
2956
|
+
* right-hand rule.
|
|
2957
|
+
* @example outerBorder: { type:'solid', color:'1A2B3C', width:1 } // box the table
|
|
2958
|
+
* @example outerBorder: [{type:'solid'}, undefined, {type:'solid'}, undefined] // rules above and below
|
|
2959
|
+
*/
|
|
2960
|
+
outerBorder?: BorderProps | [BorderProps?, BorderProps?, BorderProps?, BorderProps?];
|
|
2794
2961
|
/**
|
|
2795
2962
|
* Width of table columns (inches)
|
|
2796
2963
|
* - single value is applied to every column equally based upon `w`
|
|
@@ -2875,30 +3042,34 @@ interface TableProps extends PositionProps, TextBaseProps, ObjectNameProps {
|
|
|
2875
3042
|
*/
|
|
2876
3043
|
rtl?: boolean;
|
|
2877
3044
|
/**
|
|
2878
|
-
*
|
|
2879
|
-
* returned by `pptx.defineTableStyle()` for a custom style.
|
|
3045
|
+
* Built-in table style to apply, as a `TableStyle` member.
|
|
2880
3046
|
* Emits `<a:tableStyleId>` inside `<a:tblPr>` with the corresponding GUID.
|
|
2881
3047
|
* Style flags (`hasHeader`, `hasFooter`, `hasBandedRows`, etc.) select which
|
|
2882
3048
|
* regions of the chosen style are activated; they have no visible effect without
|
|
2883
3049
|
* a `tableStyle` set.
|
|
2884
3050
|
*
|
|
2885
|
-
*
|
|
2886
|
-
*
|
|
3051
|
+
* **Only a built-in GUID renders.** PowerPoint resolves `<a:tableStyleId>` against
|
|
3052
|
+
* its own table-style gallery and never reads a style definition out of the package,
|
|
3053
|
+
* so a GUID it does not recognise leaves the table with PowerPoint's no-style look —
|
|
3054
|
+
* a black hairline grid. For brand colours use direct formatting instead:
|
|
3055
|
+
* `headerRow`, `columns[i]`, the table-level {@link border} / {@link fill}, or per-cell
|
|
3056
|
+
* options. See `docs/tables.md` → "Table styles".
|
|
3057
|
+
*
|
|
3058
|
+
* @example tableStyle: pptx.TableStyle.MEDIUM_STYLE_2_ACCENT_1
|
|
2887
3059
|
*/
|
|
2888
|
-
tableStyle?: TableStyle
|
|
3060
|
+
tableStyle?: TableStyle;
|
|
2889
3061
|
/**
|
|
2890
3062
|
* Inline styling for the header (first) row, applied as direct per-cell formatting.
|
|
2891
3063
|
*
|
|
2892
|
-
*
|
|
2893
|
-
*
|
|
2894
|
-
* merged onto every cell of row 0 (`fill`, `color`, `bold`, `align`, `border`, etc.).
|
|
3064
|
+
* This is how a header is styled distinctly from the body: each property is merged
|
|
3065
|
+
* onto every cell of row 0 (`fill`, `color`, `bold`, `align`, `border`, etc.).
|
|
2895
3066
|
*
|
|
2896
3067
|
* Precedence (highest wins), matching how PowerPoint resolves styling — direct cell
|
|
2897
3068
|
* formatting overrides a table-style region:
|
|
2898
3069
|
* 1. explicit per-cell `options` on a row-0 cell
|
|
2899
3070
|
* 2. this `headerRow`
|
|
2900
|
-
* 3. the `firstRow` region of
|
|
2901
|
-
* 4.
|
|
3071
|
+
* 3. the `firstRow` region of a built-in `tableStyle`
|
|
3072
|
+
* 4. the library's per-cell defaults
|
|
2902
3073
|
*
|
|
2903
3074
|
* Setting `headerRow` also implies `hasHeader: true` (emits `firstRow="1"` for the
|
|
2904
3075
|
* accessibility "table header" marker) unless `hasHeader` is explicitly set to `false`.
|
|
@@ -2920,7 +3091,7 @@ interface TableProps extends PositionProps, TextBaseProps, ObjectNameProps {
|
|
|
2920
3091
|
* 1. explicit per-cell `options`
|
|
2921
3092
|
* 2. `headerRow` (row 0 only)
|
|
2922
3093
|
* 3. this `columns[colIdx]`
|
|
2923
|
-
* 4.
|
|
3094
|
+
* 4. a built-in `tableStyle` / the library's per-cell defaults
|
|
2924
3095
|
*
|
|
2925
3096
|
* The merge is property-level, so a header cell keeps `headerRow`'s typography **and**
|
|
2926
3097
|
* takes its column's `fill` when they set different properties. For a graduated header
|
|
@@ -2942,16 +3113,39 @@ interface TableProps extends PositionProps, TextBaseProps, ObjectNameProps {
|
|
|
2942
3113
|
*/
|
|
2943
3114
|
columns?: TableCellProps[];
|
|
2944
3115
|
/**
|
|
2945
|
-
* Default cell background
|
|
2946
|
-
*
|
|
2947
|
-
*
|
|
2948
|
-
*
|
|
3116
|
+
* Default cell background — **stamped onto every cell**, not painted behind the table.
|
|
3117
|
+
*
|
|
3118
|
+
* Each cell that does not set its own `options.fill` (or take one from `headerRow` /
|
|
3119
|
+
* `columns[i]`) gets this as its own `a:tcPr` fill. A picture fill is embedded once and
|
|
3120
|
+
* shared by every cell that inherits it.
|
|
3121
|
+
*
|
|
3122
|
+
* Visually this is usually what you want, but it is not what a source deck contains, and
|
|
3123
|
+
* it has one real consequence: because every cell ends up explicitly filled, a cell that
|
|
3124
|
+
* later gets its own fill has nothing to fall back to. For a genuine table background —
|
|
3125
|
+
* one `a:tblPr` fill that cells sit on top of — use {@link tableFill}.
|
|
2949
3126
|
* @example { color:'FF0000' } // hex color (red)
|
|
2950
3127
|
* @example { color:'0088CC', transparency:50 } // hex color, 50% transparent
|
|
2951
3128
|
* @example { color:SchemeColor.accent1 } // theme color Accent1
|
|
2952
3129
|
* @example { type:'image', image:{ path:'watermark.png' } } // picture fill
|
|
2953
3130
|
*/
|
|
2954
3131
|
fill?: ShapeFillProps;
|
|
3132
|
+
/**
|
|
3133
|
+
* The table's own background (`a:tblPr` fill) — one fill behind the whole table that
|
|
3134
|
+
* every cell sits on top of.
|
|
3135
|
+
*
|
|
3136
|
+
* The counterpart to {@link fill}, and the difference is where the paint lands rather
|
|
3137
|
+
* than how it looks: `fill` copies a colour onto every cell, while this writes a single
|
|
3138
|
+
* fill on the table itself. That matters when a cell is meant to be transparent — with
|
|
3139
|
+
* `tableFill`, an unfilled cell shows the table background through; with `fill` there is
|
|
3140
|
+
* no such thing as an unfilled cell. It is also what a deck read back from PowerPoint
|
|
3141
|
+
* actually carries, so a replica reproduces the source's structure rather than an
|
|
3142
|
+
* equivalent-looking flattening of it.
|
|
3143
|
+
*
|
|
3144
|
+
* Takes the same `ShapeFillProps` a cell does — solid, gradient, pattern or picture.
|
|
3145
|
+
* @example { color:'F2F2F2' } // a light background behind the whole table
|
|
3146
|
+
* @example { type:'image', image:{ path:'watermark.png' } } // one watermark, not one per cell
|
|
3147
|
+
*/
|
|
3148
|
+
tableFill?: ShapeFillProps;
|
|
2955
3149
|
/**
|
|
2956
3150
|
* Cell margin (inches)
|
|
2957
3151
|
* - affects all table cells, is superceded by cell options
|
|
@@ -3228,6 +3422,108 @@ interface SlideMasterProps {
|
|
|
3228
3422
|
textStyles?: MasterTextStyleProps;
|
|
3229
3423
|
}
|
|
3230
3424
|
//#endregion
|
|
3425
|
+
//#region src/types/model3d.d.ts
|
|
3426
|
+
/** A point or direction in the model's 3D scene, in metres. */
|
|
3427
|
+
interface Model3dPoint {
|
|
3428
|
+
x: number;
|
|
3429
|
+
y: number;
|
|
3430
|
+
z: number;
|
|
3431
|
+
}
|
|
3432
|
+
/**
|
|
3433
|
+
* Camera override for `addModel3d()`, mapping onto `am3d:camera`.
|
|
3434
|
+
*
|
|
3435
|
+
* The defaults are what PowerPoint itself wrote for a 2×2×2 cube, and they are correct for any
|
|
3436
|
+
* model whose bounding box is roughly cubic **once `meterPerModelUnit` is right** — the camera is
|
|
3437
|
+
* expressed in metres, so the scale is what actually decides framing.
|
|
3438
|
+
*
|
|
3439
|
+
* PowerPoint's own rule, measured against three models: it normalizes the model's largest
|
|
3440
|
+
* bounding-box extent to 1 metre and then places the camera at
|
|
3441
|
+
*
|
|
3442
|
+
* ```
|
|
3443
|
+
* pos.z = |halfExtents / maxExtent| / sin(fov / 2)
|
|
3444
|
+
* ```
|
|
3445
|
+
*
|
|
3446
|
+
* looking at the origin. A caller who knows their model's bounding box can reproduce that
|
|
3447
|
+
* exactly; a caller who does not should at least set `meterPerModelUnit` to `1 / maxExtent`.
|
|
3448
|
+
*/
|
|
3449
|
+
interface Model3dCameraProps {
|
|
3450
|
+
/**
|
|
3451
|
+
* Camera position in metres (`am3d:camera/am3d:pos`).
|
|
3452
|
+
* @default { x: 0, y: 0, z: 2.2630334 }
|
|
3453
|
+
*/
|
|
3454
|
+
pos?: Model3dPoint;
|
|
3455
|
+
/**
|
|
3456
|
+
* Point the camera aims at, in metres (`am3d:camera/am3d:lookAt`).
|
|
3457
|
+
* @default { x: 0, y: 0, z: 0 }
|
|
3458
|
+
*/
|
|
3459
|
+
lookAt?: Model3dPoint;
|
|
3460
|
+
/**
|
|
3461
|
+
* Camera "up" direction (`am3d:camera/am3d:up`). Need not be normalized.
|
|
3462
|
+
* @default { x: 0, y: 1, z: 0 }
|
|
3463
|
+
*/
|
|
3464
|
+
up?: Model3dPoint;
|
|
3465
|
+
/**
|
|
3466
|
+
* Vertical field of view in **degrees** (`am3d:perspective@fov`).
|
|
3467
|
+
* - range: greater than 0 and less than 180
|
|
3468
|
+
* @default 45
|
|
3469
|
+
*/
|
|
3470
|
+
fov?: number;
|
|
3471
|
+
}
|
|
3472
|
+
/**
|
|
3473
|
+
* Add an embedded 3D model (PowerPoint's Insert ▸ 3D Models) to a slide.
|
|
3474
|
+
*
|
|
3475
|
+
* The `.glb` bytes travel inside the `.pptx` (in `ppt/media/`), so PowerPoint 2019+ renders and
|
|
3476
|
+
* lets the viewer orbit the model. Requires either `data` or `path`. Linked (non-embedded)
|
|
3477
|
+
* models are not supported.
|
|
3478
|
+
*/
|
|
3479
|
+
interface Model3dBaseProps extends PositionProps, ObjectNameProps {
|
|
3480
|
+
/**
|
|
3481
|
+
* Picture of the model shown wherever the live 3D view is unavailable — a raster image `path`
|
|
3482
|
+
* (Node/local) or base64 `data:` URI.
|
|
3483
|
+
* - the library cannot render a 3D scene, so when this is omitted a neutral gray placeholder is
|
|
3484
|
+
* embedded; PowerPoint 2019+ draws the live model over it, but every other consumer — and
|
|
3485
|
+
* PowerPoint's own `mc:Fallback` path, thumbnails, and PDF export — shows exactly what is here
|
|
3486
|
+
* - supply a real render whenever the deck is meant to read correctly outside PowerPoint
|
|
3487
|
+
* @example { path: 'assets/engine-render.png' }
|
|
3488
|
+
*/
|
|
3489
|
+
preview?: {
|
|
3490
|
+
path?: string;
|
|
3491
|
+
data?: string;
|
|
3492
|
+
};
|
|
3493
|
+
/**
|
|
3494
|
+
* Camera override. Omitted, ts-pptx emits the camera PowerPoint wrote for a 2×2×2 cube.
|
|
3495
|
+
* @see {@link Model3dCameraProps} for the framing formula and when this matters.
|
|
3496
|
+
*/
|
|
3497
|
+
camera?: Model3dCameraProps;
|
|
3498
|
+
/**
|
|
3499
|
+
* Metres per model unit (`am3d:trans/am3d:meterPerModelUnit`) — the scale that decides how
|
|
3500
|
+
* large the model is in the scene the {@link camera} looks at.
|
|
3501
|
+
*
|
|
3502
|
+
* This is the single override most models need. PowerPoint sets it to `1 / maxExtent`, where
|
|
3503
|
+
* `maxExtent` is the model's largest bounding-box dimension in model units, which normalizes
|
|
3504
|
+
* every model to 1 metre across. ts-pptx does not parse the `.glb`, so it cannot measure that
|
|
3505
|
+
* — it defaults to `0.5`, correct for a model 2 units across. A model 100 units across left at
|
|
3506
|
+
* the default is a 50-metre object with the camera 2.26 metres from its centre, i.e. the
|
|
3507
|
+
* viewer is inside it.
|
|
3508
|
+
* - range: greater than 0
|
|
3509
|
+
* @default 0.5
|
|
3510
|
+
* @example 1 / 100 // a model whose largest bounding-box dimension is 100 units
|
|
3511
|
+
*/
|
|
3512
|
+
meterPerModelUnit?: number;
|
|
3513
|
+
/**
|
|
3514
|
+
* Alt text (`p:cNvPr@descr`) — what a screen reader announces for the model.
|
|
3515
|
+
*/
|
|
3516
|
+
altText?: string;
|
|
3517
|
+
}
|
|
3518
|
+
/**
|
|
3519
|
+
* Options for `slide.addModel3d()`. Requires either `data` (base64, with or without a
|
|
3520
|
+
* `data:...;base64,` header) or `path` (a local/remote `.glb` read at export time).
|
|
3521
|
+
*
|
|
3522
|
+
* Sizing note: `w`/`h` default to 4 × 3 inches rather than being measured. A 3D model has no
|
|
3523
|
+
* intrinsic aspect ratio, and the library never opens the payload.
|
|
3524
|
+
*/
|
|
3525
|
+
type Model3dProps = Model3dBaseProps & DataOrPathRequiredProps;
|
|
3526
|
+
//#endregion
|
|
3231
3527
|
//#region src/types/slide.d.ts
|
|
3232
3528
|
/**
|
|
3233
3529
|
* A child object that can be placed inside a group via `slide.addGroup()`.
|
|
@@ -3320,7 +3616,15 @@ interface ObjectOptions extends ImageBaseProps, PositionProps, ShapeProps, Table
|
|
|
3320
3616
|
hasFirstColumn?: boolean;
|
|
3321
3617
|
hasLastColumn?: boolean;
|
|
3322
3618
|
rtl?: boolean;
|
|
3323
|
-
tableStyle?: TableStyle
|
|
3619
|
+
tableStyle?: TableStyle;
|
|
3620
|
+
/**
|
|
3621
|
+
* Table perimeter border. `addTableDefinition` normalizes it to a 4-tuple (TRBL, sides
|
|
3622
|
+
* left unset as `undefined`) before it reaches the emitter, so the serializer never has
|
|
3623
|
+
* to re-handle the single-`BorderProps` form.
|
|
3624
|
+
*/
|
|
3625
|
+
outerBorder?: TableProps['outerBorder'];
|
|
3626
|
+
/** Table background (`a:tblPr` fill), as distinct from `fill`, which is stamped onto each cell. */
|
|
3627
|
+
tableFill?: TableProps['tableFill'];
|
|
3324
3628
|
}
|
|
3325
3629
|
interface SlideLayout {
|
|
3326
3630
|
background?: BackgroundProps;
|
|
@@ -3333,6 +3637,8 @@ interface Slide {
|
|
|
3333
3637
|
addConnector: (options: ConnectorProps) => Slide;
|
|
3334
3638
|
addImage: (options: ImageProps) => Slide;
|
|
3335
3639
|
addMedia: (options: MediaProps) => Slide;
|
|
3640
|
+
/** Embed a 3D model (Insert ▸ 3D Models) — a `.glb` PowerPoint 2019+ renders live. */
|
|
3641
|
+
addModel3d: (options: Model3dProps) => Slide;
|
|
3336
3642
|
/** Embed an OLE object (Insert ▸ Object) whose bytes travel inside the `.pptx`. */
|
|
3337
3643
|
addOleObject: (options: OleObjectProps) => Slide;
|
|
3338
3644
|
addComment: (options: CommentProps) => Slide;
|
|
@@ -3392,5 +3698,5 @@ interface AddSlideProps {
|
|
|
3392
3698
|
sectionTitle?: string;
|
|
3393
3699
|
}
|
|
3394
3700
|
//#endregion
|
|
3395
|
-
export {
|
|
3396
|
-
//# sourceMappingURL=slide-
|
|
3701
|
+
export { HAlign as $, ChartSeriesOpts as $t, TableToSlidesDocument as A, ChartLineDash as At, ShapeAdjustHandleXY as B, ChartPropsChartHistogram as Bt, TableCell as C, ChartAreaProps as Ct, TableProps as D, ChartExBinning as Dt, TableCellProps as E, ChartErrorBarOptions as Et, MediaProps as F, ChartPropsAxisVal as Ft, BackgroundProps as G, ChartPropsChartStock as Gt, ShapeConnectionSite as H, ChartPropsChartPie as Ht, MediaType as I, ChartPropsBase as It, DataOrPathProps as J, ChartPropsDataLabel as Jt, Color as K, ChartPropsChartSurface as Kt, OleObjectProps as L, ChartPropsChartBar as Lt, TableToSlidesProps as M, ChartOpts as Mt, ImageBaseProps as N, ChartPropsAxisCat as Nt, TableRow as O, ChartExGeography as Ot, ImageProps as P, ChartPropsAxisSer as Pt, GradientStopProps as Q, ChartPropsTitle as Qt, ShapeAdjustHandle as R, ChartPropsChartBoxWhisker as Rt, TransitionType as S, textRuns as Sn, PresetMaterialType as St, TableCellDiagonals as T, ChartDataPointStyle as Tt, ShapeGuide as U, ChartPropsChartRadar as Ut, ShapeAdjustValue as V, ChartPropsChartLine as Vt, ShapeProps as W, ChartPropsChartRegionMap as Wt, GeometryPoint as X, ChartPropsFillLine as Xt, DataOrPathRequiredProps as Y, ChartPropsDataTable as Yt, GradientFillProps as Z, ChartPropsLegend as Zt, AnimationProps as _, TextGlowProps as _n, ShapeFillProps as _t, Slide as a, PlaceholderProps as an, PatternPreset as at, TransitionProps as b, TextPropsOptions as bn, LightRigDirection as bt, Model3dPoint as c, NotesProps as cn, TextVertType as ct, MasterTextStyleLevel as d, ResolvedCommentAuthor as dn, BorderProps as dt, LineCap as en, HexColor as et, MasterTextStyleProps as f, SlideComment as fn, ConnectorProps as ft, SlideNumberProps as g, TextFitShrinkProps as gn, ShadowProps as gt, SlideMasterProps as h, TextBaseProps as hn, HyperlinkProps as ht, ObjectOptions as i, ObjectNameProps as in, PatternFillProps as it, TableToSlidesElement as j, ChartMulti as jt, TableRowSlide as k, ChartExStatistics as kt, Model3dProps as l, NotesTextOptions as ln, ThemeColor as lt, SlideMasterObject as m, TableLayoutResult as mn, HyperlinkActionJump as mt, GroupChildProps as n, OptsChartGridLine as nn, LinearGradientFillProps as nt, SlideLayout as o, CommentProps as on, PositionProps as ot, SlideMasterChartProps as p, TableCellLayout as pn, ConnectorType as pt, Coord as q, ChartPropsChartWaterfall as qt, GroupProps as r, ObjectLockProps as rn, Margin as rt, Model3dCameraProps as s, MeasureTextOptions as sn, RadialGradientFillProps as st, AddSlideProps as t, OptsChartData as tn, ImageFillProps as tt, MasterBulletProps as u, OverflowBoxOptions as un, VAlign as ut, AnimationTrigger as v, TextMeasurement as vn, ShapeLineProps as vt, TableCell3DProps as w, ChartAxisTickMark as wt, TransitionSoundProps as x, textRun as xn, LightRigType as xt, PresetEffect as y, TextProps as yn, BevelPresetType as yt, ShapeAdjustHandlePolar as z, ChartPropsChartDoughnut as zt };
|
|
3702
|
+
//# sourceMappingURL=slide-YuSCGa45.d.ts.map
|