Skip to content

[Bug/Question] Cross tables typing #185

@Xaz16

Description

@Xaz16

Problem:

This code snippet produce such error from Typescript:

const resultTable = new Table({
  head: ['', 'Assets ', 'Entries']
});

resultTable.push(
   { 'Previous values': [`100`, `200`] },
   { 'Normalized values': [`10`, `100`] }
);
Type 'string[]' is not assignable to type '(string & Cell[]) | (number & Cell[]) | (false & Cell[]) | (true & Cell[]) | (CellOptions & Cell[])'.
  Type 'string[]' is not assignable to type 'CellOptions & Cell[]'.
    Property 'content' is missing in type 'string[]' but required in type 'CellOptions'.ts(2322)

According to the documentation about cross table this code should be absolutely valid https://github.com/cli-table/cli-table3#cross-tables.

Could you check the typing for that case or maybe I'm wrong?

Environment

Typescript: 3.8.3
cli-table3: 0.6.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    support requestQuestions or issues with implementation

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions