From 146be80fdd531148075310694c53b88e0a75785d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20DUNGLER?= Date: Mon, 16 Nov 2020 13:52:22 +0100 Subject: [PATCH 1/2] [core] Do not ship spec typings --- packages/grid/tsconfig.build.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/grid/tsconfig.build.json b/packages/grid/tsconfig.build.json index b6e476a6865da..48bc355daa81c 100644 --- a/packages/grid/tsconfig.build.json +++ b/packages/grid/tsconfig.build.json @@ -10,5 +10,5 @@ "rootDir": "./" }, "include": ["./data-grid/src", "./x-grid/src", "./_modules_/**/*"], - "exclude": ["__tests__", "**/*.test.ts", "node_modules"] + "exclude": ["__tests__", "**/*.test.*", "node_modules"] } From 14405ffda88c96474c5f88bba1dd231cecd9d43c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20DUNGLER?= Date: Mon, 16 Nov 2020 14:18:11 +0100 Subject: [PATCH 2/2] help types inference --- .../grid/hooks/features/selection/selectionSelector.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/grid/_modules_/grid/hooks/features/selection/selectionSelector.ts b/packages/grid/_modules_/grid/hooks/features/selection/selectionSelector.ts index 27d1a98e29797..b5cd20fd368cc 100644 --- a/packages/grid/_modules_/grid/hooks/features/selection/selectionSelector.ts +++ b/packages/grid/_modules_/grid/hooks/features/selection/selectionSelector.ts @@ -1,9 +1,13 @@ -import { createSelector } from 'reselect'; +import { createSelector, OutputSelector } from 'reselect'; import { GridState } from '../core/gridState'; import { SelectionState } from './selectionState'; export const selectionStateSelector = (state: GridState) => state.selection; -export const selectedRowsCountSelector = createSelector( +export const selectedRowsCountSelector: OutputSelector< + GridState, + number, + (res: SelectionState) => number +> = createSelector( selectionStateSelector, (selection) => Object.keys(selection).length, );