From ec7cccef2d5f73b59a87c2b3c90d0dad1edd4428 Mon Sep 17 00:00:00 2001 From: woutervh- Date: Mon, 2 Mar 2020 18:53:48 +0100 Subject: [PATCH] [d3-brush] Added keymodifiers definition (#42649) --- types/d3-brush/d3-brush-tests.ts | 6 ++++++ types/d3-brush/index.d.ts | 18 ++++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/types/d3-brush/d3-brush-tests.ts b/types/d3-brush/d3-brush-tests.ts index c5a287b562..3df845d881 100644 --- a/types/d3-brush/d3-brush-tests.ts +++ b/types/d3-brush/d3-brush-tests.ts @@ -57,6 +57,12 @@ brush = brush.filter(function(d, i, group) { let filterFn: (this: SVGGElement, d: BrushDatum, index: number, group: SVGGElement[]) => boolean; filterFn = brush.filter(); +// keyModifiers() ---------------------------------------------------------------- + +// chainable +brush = brush.keyModifiers(true); +const keyModifiers: boolean = brush.keyModifiers(); + // handleSize() ---------------------------------------------------------------- // chainable diff --git a/types/d3-brush/index.d.ts b/types/d3-brush/index.d.ts index 89731cb3d2..c656bf8935 100644 --- a/types/d3-brush/index.d.ts +++ b/types/d3-brush/index.d.ts @@ -1,10 +1,10 @@ -// Type definitions for D3JS d3-brush module 1.0 +// Type definitions for D3JS d3-brush module 1.1 // Project: https://github.com/d3/d3-brush/, https://d3js.org/d3-brush // Definitions by: Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -// Last module patch version validated against: 1.0.3 +// Last module patch version validated against: 1.1.5 import { ArrayLike, Selection, TransitionLike, ValueFn } from 'd3-selection'; @@ -138,6 +138,20 @@ export interface BrushBehavior { */ filter(filterFn: ValueFn): this; + /** + * Returns the current key modifiers flag. + */ + keyModifiers(): boolean; + /** + * Sets the key modifiers flag and returns the brush. + * + * The key modifiers flag determines whether the brush listens to key events during brushing. + * The default value is true. + * + * @param keyModifiers New value for key modifiers flag. + */ + keyModifiers(modifiers: boolean): this; + /** * Returns the current handle size, which defaults to six. */