CodeQL library for JavaScript

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()