Skip to content

Wrong TypeScript type in jsPDF.table #3086

Closed
@jabaa

Description

@jabaa

The declaration for jsPDF.table in types/index.d.ts is

table(
  x: number,
  y: number,
  data: any,
  headers: string[],
  config: any
): jsPDF;

but in the spec tests in test/specs/cell.spec.js the headers are passed as

headers: {
  name: string;
  prompt: string;
  width: number;
  align: "center" | "left" | "right";
  padding: number
}[]

Changing the headers to a list of strings

var header = [
  "coin",
  "game_group",
  "game_name",
  "game_version",
  "machine",
  "vlt"
]

causes the tests to fail. It seems like it's not possible to create a table in TypeScript without ignoring the declaration.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions