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. */