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.
This commit is contained in:
Volker Braun
2016-07-25 09:33:51 +02:00
committed by Masahiro Wakame
parent 7d6547a8a0
commit 060060dc34

View File

@@ -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;
}
///////////////////////////////////////////////////////////////////////////