From 060060dc34ef700a6ea9e00ccee69b570ff3c242 Mon Sep 17 00:00:00 2001 From: Volker Braun Date: Mon, 25 Jul 2016 09:33:51 +0200 Subject: [PATCH] Return intersection type when indexing IDocumentService (#10267) Typescript 2.0 starts checking the compatibility of the index signature with the base JQuery interface; Hence we are forced to return Document & HTMLElement to be compatible with the base. --- angularjs/angular.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index 5aa6807605..bb028f3425 100644 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -986,7 +986,8 @@ declare namespace angular { // see http://docs.angularjs.org/api/ng.$document /////////////////////////////////////////////////////////////////////////// interface IDocumentService extends JQuery { - [index: number]: Document; + // Must return intersection type for index signature compatibility with JQuery + [index: number]: HTMLElement & Document; } ///////////////////////////////////////////////////////////////////////////