Skip to content

Type definitions do not match in version 1.4.1 #1943

@PCASME

Description

@PCASME

Using jsPDF version 1.41 (I think the problem also applies to version 1.4.0.)
Using @types/jspdf version v1.1.31 (AFAIK, no other version available).

Problem:

The types in v1.4.1 do not match with type definitions in @types/jspdf@1.1.31.

Sample:

const doc = new jsPDF();
console.log(doc.internal.pageSize.width);

Previous 1.4.1/1.4.0 the above code works as expected.
Property doc.internal.pageSize.width match with type definitions and exists as a property.
All is OK.

In version 1.4.1/1.4.0 the property doc.internal.pageSize.width does not exists and I must use the doc.internal.pageSize.getWidth() method instead. Doing this works but I get an error in the editor (VSCode) due to mismatching type definitions.

How can I solve this?
There is an updated version of type definitions?

Thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions