When you create a typescript project on Stackblitz it turns out that there is an issue with BigInt
const val = BigInt(10);
It doesn't know BigInt
. Although the code runs fine I still want the error to go away :)
So, in the above case I can add the follow
declare function BigInt(inp: number | string);
This works, the error is gone. But when I add more code, like this
declare function BigInt(inp: number | string);
function convert(inp: string): BigInt {
return BigInt(inp);
}
const val = BigInt(10);
The declare
at the top is not enough
It complains that BigInt refers to a value and is being used as a Type.
I'm not sure any more what I can do to fix this. Any suggestions?