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

@types/countdown toString Unrecognised #17903

Closed
ChrisTalman opened this issue Jul 10, 2017 · 2 comments
Closed

@types/countdown toString Unrecognised #17903

ChrisTalman opened this issue Jul 10, 2017 · 2 comments

Comments

@ChrisTalman
Copy link

There seems to be an issue with @types/countdown. I receive the following error from TypeScript.

ERROR in ./src/modules/Initialise.ts
(85,64): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((radix?: number) => string) | ((label?: string) => string)' has no compatible call signatures.

The code which causes this error is as follows.

countdown(Date.now(), Date.now() + timeout).toString();

So far as I am aware, this is perfectly valid code, which works in the compiled JavaScript. However, TypeScript does not seem to understand it. Could there be a problem in the declaration file?

@gjuchault and @andy-ms seem to have been involved with this declaration file.

@ghost
Copy link

ghost commented Jul 10, 2017

Looks like microsoft/TypeScript#7294.
countdown returns TimeSpan | number, which have different signatures for toString(). The call here should be compatible with either, but TS can't figure that out.
However, the docs say The return value is a Timespan object and don't mention returning a number, so maybe the type definition is wrong?

@orta orta closed this as completed Jun 7, 2021
@orta
Copy link
Collaborator

orta commented Jun 7, 2021

Hi thread, we're moving DefinitelyTyped to use GitHub Discussions for conversations the @types modules in DefinitelyTyped.

To help with the transition, we're closing all issues which haven't had activity in the last 6 months, which includes this issue. If you think closing this issue is a mistake, please pop into the TypeScript Community Discord and mention the issue in the definitely-typed channel.

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