gitbrent / PptxGenJS

Create PowerPoint presentations with a powerful, concise JavaScript API.
https://gitbrent.github.io/PptxGenJS/
MIT License
3.05k stars 648 forks source link

Add 'custGeom' to ShapeTypes #1328

Open sventies opened 7 months ago

sventies commented 7 months ago

I'd love to see 'custGeom' added to the ShapeType in type definitions, so I can add custom geometries without having to ts issues.

Issue Category

Product Versions

Desired Behavior

I want to do something like this slide.addShape(pptx.ShapeType.custGeom, { line: { color: "00FF66", width: 1 }, points: [ { x: 2, y: 2 }, { x: 2, y: 3, curve: { type: "quadratic", x1: 2.5, y1: 2.5 } }, ], });

Which works perfectly! Only custGeom is not defined in the type definitions, so typescript will complain about it.

Observed Behavior

Obeserved Behavior is properly functioning Custom Geometry, while typescript complains that it doesn't know custGeom / CUSTOM_GEOMETRY.

Steps to Reproduce

I added the type locally in a new branch, but I don't have the rights to push it. Happy to push it and make a pr if you can add permissions for me to do so, otherwise here is the diff (but maybe I'm missing something? This fixes the issue for me locally at least).

Screenshot 2024-05-03 at 15 35 07
niels-bosman commented 6 months ago

Opened a PR for this: https://github.com/gitbrent/PptxGenJS/pull/1333