diff --git a/types/d3-transition/index.d.ts b/types/d3-transition/index.d.ts index eb60cec49f..2f935802bb 100644 --- a/types/d3-transition/index.d.ts +++ b/types/d3-transition/index.d.ts @@ -561,6 +561,12 @@ export interface Transition number): this; } +/** + * Represents the union of the Selection and Transition types for any usages that operate on both. + * Typically used for functions which take in either a selection or transition and set or update attributes. + */ +export type SelectionOrTransition = Selection | Transition; + /** * Returns a new transition with the specified name. If a name is not specified, null is used. * The new transition is only exclusive with other transitions of the same name. diff --git a/types/d3-zoom/d3-zoom-tests.ts b/types/d3-zoom/d3-zoom-tests.ts index 8051898b8b..819f344422 100644 --- a/types/d3-zoom/d3-zoom-tests.ts +++ b/types/d3-zoom/d3-zoom-tests.ts @@ -166,7 +166,7 @@ svgZoom = svgZoom.touchable(true); svgZoom = svgZoom.touchable(function(d, i, group) { const that: SVGRectElement = this; const datum: SVGDatum = d; - const g: SVGRectElement[] | NodeListOf = group; + const g: SVGRectElement[] | ArrayLike = group; return "ontouchstart" in this && datum.height > 0; });