From 9da84cc5d76199882ba6a23b2543ce79fd77d191 Mon Sep 17 00:00:00 2001 From: Max Mumford Date: Tue, 29 Oct 2019 18:26:29 +0000 Subject: [PATCH] Add end method to d3 transition (#39355) --- types/d3-transition/d3-transition-tests.ts | 3 +++ types/d3-transition/index.d.ts | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/types/d3-transition/d3-transition-tests.ts b/types/d3-transition/d3-transition-tests.ts index 19f05ec9c3..b3d8633a5f 100644 --- a/types/d3-transition/d3-transition-tests.ts +++ b/types/d3-transition/d3-transition-tests.ts @@ -421,6 +421,9 @@ if (listener) { // remove listener enterTransition = enterTransition.on('end', null); // check chaining return type by re-assigning +// check end method exists +enterTransition.end(); + // -------------------------------------------------------------------------- // Test Control Flow // -------------------------------------------------------------------------- diff --git a/types/d3-transition/index.d.ts b/types/d3-transition/index.d.ts index caff3a4112..64feb4f0a8 100644 --- a/types/d3-transition/index.d.ts +++ b/types/d3-transition/index.d.ts @@ -456,6 +456,11 @@ export interface Transition): this; + /** + * Returns a promise that resolves when every selected element finishes transitioning. If any element’s transition is cancelled or interrupted, the promise rejects. + */ + end(): Promise; + // Control Flow ---------------------- /**