does not exist on type 'typeof global' #27057
Labels
checkJs
Relates to checking JavaScript using TypeScript
In Discussion
Not yet reached consensus
Suggestion
An idea for TypeScript
TypeScript Version: 3.1.0-dev.20180912
Search Terms:
js ts global nodejs
Code
See Playground Link
Expected behavior:
No tsc error
Actual behavior:
[ts] Property 'getErrorAsString' does not exist on type 'typeof global'.
A second - possibly related issue - is that the declaration of
clazz1bGlobalVar: clazz1b
in./types/node-global.d.ts
is infered to(property) NodeJS.Global.clazz1bGlobalVar: any
A third - possibly related issue - is that if you alter the declaration of
clazz1bGlobalVar: clazz1b
in./types/node-global.d.ts
toclazz1bGlobalVar: number
, it is infered correctly in this file as(property) NodeJS.Global.clazz1bGlobalVar: number
. But in e.g.index.js
, you can assign just a value of any type to that, e.g.global.clazz1bGlobalVar= "clazz1bInstance"
. And on hover(property) global.clazz1bGlobalVar: string
is shown.Playground Link:
Open
index.js
and change as shown in videoRelated Issues:
None found
The text was updated successfully, but these errors were encountered: