I know the question is already closed but I’ve found it searching for same TypeScriptException, maybe some one else hit this question searching for this problem.
The problem lays in missing TypeScript typing:
var coordinates = outerElement.getBBox();
The property 'getBBox' does not exist on value of type 'HTMLElement'.
The easiest way is to explicitly type variable as `any`
var outerHtmlElement: any = outerElement; var coordinates = outerHtmlElement.getBBox();
Edit, late 2016
Since TypeScript 1.6, the prefered casting operator is
as, so those lines can be squashed into:
let coordinates = (outerElement as any).getBBox();
Of course if you’d like to do it right, which is an overkill sometimes, you can:
- Create own interface which simply extends
- Introduce own typing which extends