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

Fix the union "Table" type definition #54

Closed
macieklad opened this issue Oct 4, 2018 · 1 comment
Closed

Fix the union "Table" type definition #54

macieklad opened this issue Oct 4, 2018 · 1 comment

Comments

@macieklad
Copy link
Contributor

While I was working on the issue #28, after updating the code for the new version of cli-table, typescript threw at me the following error for the push method of the Table type.

Cannot invoke an expression whose type lacks a call signature. Type '((...items: Cell[][]) => number) | ((...items: VerticalTableRow[]) => number) | ((...items: CrossTableRow[]) => number)' has no compatible call signatures.

The problem

The method was called with proper signature, but it still throws the error.

The solution

It seems that the "Table" union type definition was created incorrectly, as Typescript prefers to wrap the generics with a single type instead of creating new ones for them.

I created a pull request for the suggested solution #53

@schalkneethling
Copy link

Thanks @macieklad this has been merged.

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

No branches or pull requests

2 participants