mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-02 08:10:05 +00:00
[@types/d3-transition] Add a new type to d3-transition that represents either a selection or transition (#26673)
* Add a new type to d3-transition that represents either a selection or transition. * Fix linting errors with new type * Fixed a build error in d3-zoom that was preventing submissions
This commit is contained in:
committed by
Mohamed Hegazy
parent
be78ef130f
commit
6eb6c4ea55
6
types/d3-transition/index.d.ts
vendored
6
types/d3-transition/index.d.ts
vendored
@@ -561,6 +561,12 @@ export interface Transition<GElement extends BaseType, Datum, PElement extends B
|
||||
ease(easingFn: (normalizedTime: number) => 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<GElement extends BaseType, Datum, PElement extends BaseType, PDatum> = Selection<GElement, Datum, PElement, PDatum> | Transition<GElement, Datum, PElement, PDatum>;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
|
||||
@@ -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<SVGRectElement> = group;
|
||||
const g: SVGRectElement[] | ArrayLike<SVGRectElement> = group;
|
||||
return "ontouchstart" in this && datum.height > 0;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user