d3-selection: Fix tests (#27768)

This commit is contained in:
Andy
2018-08-07 10:53:43 -07:00
committed by GitHub
parent 1151563af9
commit 0ca6d87b78
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -796,7 +796,7 @@ newDiv2 = body.append(function(d, i, g) {
const index: number = i;
const group: HTMLBodyElement[] | d3Selection.ArrayLike<HTMLBodyElement> = g;
console.log('Body element foo property: ', d.foo); // data of type BodyDatum
return this.ownerDocument.createElement('div'); // this-type HTMLBodyElement
return this.ownerDocument!.createElement('div'); // this-type HTMLBodyElement
});
// newDiv2 = body.append<HTMLDivElement>(function(d) {
@@ -828,7 +828,7 @@ const typeValueFunction = function(
i: number,
g: HTMLBodyElement[] | d3Selection.ArrayLike<HTMLBodyElement>
) {
return this.ownerDocument.createElement('p'); // this-type HTMLParagraphElement
return this.ownerDocument!.createElement('p'); // this-type HTMLParagraphElement
};
const beforeValueFunction = function(
+1 -1
View File
@@ -22,7 +22,7 @@ export type BaseType = Element | EnterElement | Document | Window | null;
*/
export interface ArrayLike<T> {
length: number;
item(index: number): T;
item(index: number): T | null;
[index: number]: T;
}