CodeQL library for JavaScript/TypeScript
codeql/javascript-all 0.8.15-dev (changelog, source)
Search

Member predicate BindingPattern::getTypeAnnotation

Returns the type annotation for this variable or pattern, if any.

Only the outermost part of a binding pattern can have a type annotation. For instance, in the declaration,

 var {x}: Point
 

the variable x has no type annotation, whereas the pattern {x} has the type annotation Point.

TypeAnnotation getTypeAnnotation()