I am encountering an issue while trying to declare an external module that does not have existing typings.
This library has a function that returns a string and takes no arguments.
My attempt to define it in a .d.ts
file is as follows:
declare module "cuid" {
export function cuid(): string;
}
When importing in my code with import * as cuid from 'cuid';
An error occurs when I try to use it with cuid()
:
error TS2349: Cannot invoke an expression whose type lacks a call signature.