Last active
May 9, 2023 07:37
-
-
Save ramybenaroya/22bc7b6cad5fecf780d10c0d31352053 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare module 'virtualizedtableforantd4' { | |
export interface VtOpts { | |
id?: number | string; | |
/** | |
* @default 5 | |
*/ | |
overscanRowCount?: number; | |
/** | |
* this only needs the scroll.y | |
*/ | |
scroll: { | |
y: number | string; | |
}; | |
/** | |
* wheel event(only works on native events). | |
*/ | |
onScroll?: ({ left, top, isEnd }: { top: number; left: number; isEnd: boolean }) => void; | |
initTop?: number; | |
/** | |
* Offset of the table when isEnd becomes true. | |
* @default 0 | |
*/ | |
offset?: number; | |
/** | |
* @default false | |
*/ | |
debug?: boolean; | |
// pass -1 means scroll to the bottom of the table | |
ref?: React.MutableRefObject<{ | |
scrollTo: (y: number) => void; | |
scrollToIndex: (idx: number) => void; | |
}>; | |
} | |
type CustomizeComponent = React.FC<any>; | |
export interface TableComponents { | |
table?: CustomizeComponent; | |
header?: { | |
wrapper?: CustomizeComponent; | |
row?: CustomizeComponent; | |
cell?: CustomizeComponent; | |
}; | |
body?: { | |
wrapper?: CustomizeComponent; | |
row?: CustomizeComponent; | |
cell?: CustomizeComponent; | |
}; | |
} | |
export function useVT( | |
fnOpts: () => VtOpts, | |
deps: React.DependencyList, | |
): [TableComponents, (components: TableComponents) => void]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment