Skip to content
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

typescript definitions Slide and ISlide #673

Closed
gytisgreitai opened this issue Feb 13, 2020 · 1 comment
Closed

typescript definitions Slide and ISlide #673

gytisgreitai opened this issue Feb 13, 2020 · 1 comment
Assignees
Milestone

Comments

@gytisgreitai
Copy link

gytisgreitai commented Feb 13, 2020

Considering the code:

import pptxgen from "pptxgenjs";
const pptx = new pptxgen();
const slide = pptx.addSlide();

now slide is of type ISlide and e.g. addText is defined as Function :

export interface ISlide {
        <....>
       addText: Function
       <....>
}

Thought he specific Slide class has a correct definition

addText(text: string | IText[], options?: ITextOpts): Slide

what I am doing right now is :

const coverSlide = pptx.addSlide() as any as PptxGenJS.Slide;

so any way to get type safety when using slide object?

@gitbrent gitbrent self-assigned this Feb 19, 2020
@gitbrent gitbrent added this to the 3.2.0 milestone Feb 19, 2020
gitbrent added a commit that referenced this issue May 14, 2020
@gitbrent
Copy link
Owner

Thanks @gytisgreitai

This is now fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants