-
Notifications
You must be signed in to change notification settings - Fork 652
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Export more types to enhance TypeScript support #443
Conversation
Hi @ntietz The current changes are not passing validation: |
@gitbrent Good catch. I didn't notice that as I had a problem in my local workflow. This is resolved, and I've verified that no problems were detected locally - for my machine. Thanks for taking the time to check out this PR 😄 I've updated the diff to be smaller, based on a template from the TypeScript Handbook. I think this is cleaner, and results in the same end result: now Slide, CommonOptions, etc. can all be referenced as well to allow more typechecking in client code. |
Great work and thanks for the contribution @ntietz ! |
Thanks for creating and maintaining this and being responsive! |
Export more types to enhance TypeScript support
While using PptxGenJS with TypeScript, I wanted to do something like this:
With the existing type definitions, type inference works as expected but the Slide type (among others) are not exported and thus are not able to be referenced from client code, making it more difficult to write correct type definitions.
This PR exports all the types defined within the PptxGenJS namespace, while retaining the current behavior (export the PptxGenJS class as the default export).