-
Notifications
You must be signed in to change notification settings - Fork 55
/
types.d.ts
54 lines (48 loc) · 1.39 KB
/
types.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
declare module 'react-speadsheet-grid' {
type ColumnId = string
type ColumnWidthValues = Record<ColumnId, number>
type Column = {
value: () => string
id: ColumnId
title?: string | (() => string)
width?: PropTypes.number
}
type Row = any
type Cell = { x: number; y: number }
export type Grid = React.Component<{
// required props
columns: Column[]
getRowKey: (row: Row) => string
// optional props
rows?: Row[]
placeholder?: string
focusOnSingleClick?: boolean
headerHeight?: number
rowHeight?: number
isScrollable?: boolean
isColumnsResizable?: boolean
disabledCellChecker?: (row: Row, columnId: ColumnId) => boolean
onCellClick?: (row: Row, columnId: ColumnId) => void
onActiveCellChanged?: (cell: Cell) => void
onScroll?: (scrollTop: number) => void
onScrollReachesBottom?: () => void
onColumnResize?: (columnWidthValues: ColumnWidthValues) => void
}>
export type Input = React.Component<{
value?: string | number
placeholder?: string
selectTextOnFocus?: boolean
onChange?: (value: string) => void
}>
type SelectItem = {
id: string | number
value: string
}
export type Select = React.Component<{
selectedId?: string | number
items?: SelectItem[]
placeholder?: string
isOpen?: boolean
onChange?: (selectedId: string | number, item: SelectItem) => void
}>
}