fix for wrong method signature in params of WindowScroller render-prop (#24953)

* typings update to catch up with current version of react-virtualized

* fixed lint errors

* fixed ts version

* fixed void return type of defaultProps functions

* changed interface to type for better consistency

* fixed signature of onChildScroll params in WindowScroller

* Auto stash before merge of "enable-strict-mode" and "master"

* removed unimportant line from test file

* replaced strict with explicit options

* updated TS version

* ts version set to 2.7

* back to ts 2.6

* changed autogenerated relative import to global import
This commit is contained in:
Kalle Ott
2018-04-14 21:29:21 +02:00
committed by Mohamed Hegazy
parent 3a647d4f0e
commit 4ac43f6061
8 changed files with 701 additions and 982 deletions

View File

@@ -29,15 +29,15 @@ export class CellMeasurerCache implements CellMeasurerCacheInterface {
constructor(params?: CellMeasurerCacheParams);
clear(rowIndex: number, columnIndex: number): void;
clearAll(): void;
columnWidth: (params: { index: number }) => number | undefined;
columnWidth: (params: { index: number }) => number;
readonly defaultHeight: number;
readonly defaultWidth: number;
hasFixedHeight(): boolean;
hasFixedWidth(): boolean;
getHeight(rowIndex: number, columnIndex: number): number | undefined;
getWidth(rowIndex: number, columnIndex: number): number | undefined;
getHeight(rowIndex: number, columnIndex: number): number;
getWidth(rowIndex: number, columnIndex: number): number;
has(rowIndex: number, columnIndex: number): boolean;
rowHeight: (params: { index: number }) => number | undefined;
rowHeight: (params: { index: number }) => number;
set(
rowIndex: number,
columnIndex: number,

View File

@@ -29,8 +29,9 @@ export type CollectionCellGroupRenderer = (
) => React.ReactNode[];
export type CollectionCellRendererParams = {
index: number;
key: string;
style?: React.CSSProperties;
isScrolling: boolean;
key: number;
style: React.CSSProperties;
};
export type CollectionCellRenderer = (
params: CollectionCellRendererParams

View File

@@ -54,12 +54,7 @@ export type ScrollParams = {
scrollTop: number;
scrollWidth: number;
};
export type SectionRenderedParams = {
columnStartIndex: number;
columnStopIndex: number;
rowStartIndex: number;
rowStopIndex: number;
};
export type SectionRenderedParams = RenderedSection;
export type SCROLL_DIRECTION_HORIZONTAL = "horizontal";
export type SCROLL_DIRECTION_VERTICAL = "vertical";
export type OverscanIndicesGetterParams = {

View File

@@ -208,9 +208,7 @@ export type TableProps = GridCoreProps & {
*/
autoHeight?: boolean;
/** One or more Columns describing the data displayed in this row */
children?:
| React.ReactElement<ColumnProps>[]
| React.ReactElement<ColumnProps>;
children?: React.ReactNode;
/** Optional CSS class name */
className?: string;
/** Disable rendering the header at all */
@@ -372,7 +370,7 @@ export const SortDirection: SortDirectionStatic;
export type SortDirectionType = "ASC" | "DESC";
export const SortIndicator: React.StatelessComponent<{
sortDirection: SortDirectionType;
sortDirection?: SortDirectionType;
}>;
/**

View File

@@ -22,7 +22,7 @@ export type WindowScrollerProps = {
*/
children: (
params: {
onChildScroll: ({ scrollTop: number }) => void;
onChildScroll: (params: { scrollTop: number }) => void;
registerChild: (params?: Element) => void;
height: number;
isScrolling: boolean;

View File

@@ -118,7 +118,8 @@ export {
TableHeaderRowRenderer,
TableProps,
TableRowProps,
TableRowRenderer
TableRowRenderer,
SortParams
} from "./dist/es/Table";
export {
WindowScroller,

File diff suppressed because it is too large Load Diff

View File

@@ -2,13 +2,13 @@
"compilerOptions": {
"module": "commonjs",
"lib": ["es6", "dom"],
"noImplicitAny": false,
"noImplicitThis": true,
"strictNullChecks": false,
"strictFunctionTypes": false,
"jsx": "react",
"baseUrl": "../",
"typeRoots": ["../"],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true,