A Tern plugin for guessing types.
npm install tern-guess-typesdocument and select addEventListener :
addEventListener type argument :
javascript
document. //addEventListener(type, listener, capture)
var s = "", y = "", z = 10;
var f = function(e) {
}
var g = function() {
}
var b = true;
`
JSON request :
`json
{
"type": "guess-types",
"file": "#0",
"end": {
"ch": 10,
"line": 0
},
"property": "addEventListener",
"lineCharPositions": true
}
`
JSON response :
`json
{
"args": [
"string",
"fn(e: Event)",
"bool"
],
"string": [
"name",
"s",
"y"
],
"fn(e: Event)": [],
"bool": [
"true",
"false",
"closed",
"b"
]
}
``