[d3-brush] Added keymodifiers definition (#42649)

This commit is contained in:
woutervh-
2020-03-02 18:53:48 +01:00
committed by GitHub
parent b715241f21
commit ec7cccef2d
2 changed files with 22 additions and 2 deletions

View File

@@ -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

View File

@@ -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 <https://github.com/tomwanzek>, Alex Ford <https://github.com/gustavderdrache>, Boris Yankov <https://github.com/borisyankov>
// 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<Datum> {
*/
filter(filterFn: ValueFn<SVGGElement, Datum, boolean>): 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.
*/