Skip to content

Extension to Types/index.d.ts to allow more complete use of jsPDF from Typescript #3238

Closed
@AlexanderBaruta

Description

@AlexanderBaruta

In working with jsPDF as part of the Angular Framework I have come across a couple of common jsPDF features that do not currently work in Typescript due to the Types/index.d.ts not containing the full definition of the object.

This includes the jsPDF constructor and jsPDFOptions not taking the optional parameter of hotfixes?: string[],
and the definition of ImageProperties not containing the filetype property.

I can provide a PR to fix these issues if desired.
The main use-case for the hotfixes is to allow the use of pixel-scaling and other such hotfixes
The main use-case for the image properties extension is to allow ease of use when adding images with potentially unknown filetype to the PDF document since the filetype can then be inferred from the image properties.

Attached are my notes on the issue and the modifications that I have made to my local copy of the file in order to use these interfaces
Notes.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions