Skip to content

Commit 04f4a10

Browse files
committed
add types for utils from Neo
1 parent 26aaafc commit 04f4a10

File tree

1 file changed

+23
-6
lines changed

1 file changed

+23
-6
lines changed

types/index.d.ts

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ declare module 'react-base-table' {
170170
/**
171171
* A collection of Column
172172
*/
173-
children?: React.ReactElement<T> | React.ReactElement<T>[] | null;
173+
children?: React.ReactNode;
174174
/**
175175
* Columns for the table
176176
*/
@@ -543,9 +543,26 @@ declare module 'react-base-table' {
543543

544544
export const AutoResizer: React.FC<AutoResizerProps>;
545545

546-
export type getScrollbarSize = (recalculate?: boolean) => number;
547-
export type isObjectEqual = (objA: object, objB: object) => boolean;
548-
export type hasChildren = (data: { children: any[] | undefined }) => boolean;
549-
export type getValue = (obj: object, path: string, defaultValue: any) => any;
550-
export type normalizeColumns = (elements: React.ReactElement[]) => React.ReactElement[];
546+
export function renderElement(renderer: React.ReactElement | function, props?: object): React.ReactNode;
547+
548+
export function normalizeColumns(elements: React.ReactNode[]): ColumnShape<any>[];
549+
550+
export function isObjectEqual(objA: any, objB: any, ignoreFunction?: boolean): boolean;
551+
552+
export function callOrReturn<T, P = any[]>(funcOrValue: CallOrReturn<T, P>, ...args: P): T;
553+
554+
export function hasChildren(data: object): boolean;
555+
556+
export function unflatten<T = any>(array: T[], rootId?: any, dataKey?: string, parentKey?: string): T[];
557+
558+
export function flattenOnKeys<T = any>(
559+
tree: T[],
560+
keys?: RowKey[],
561+
depthMap?: { [key: RowKey]: number },
562+
dataKey?: string
563+
): T[];
564+
565+
export function getValue(object: any, path?: string, defaultValue?: any): any;
566+
567+
export function getScrollbarSize(recalculate?: boolean): number;
551568
}

0 commit comments

Comments
 (0)