-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.d.ts
More file actions
54 lines (48 loc) · 1.53 KB
/
Copy pathindex.d.ts
File metadata and controls
54 lines (48 loc) · 1.53 KB
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
import React, { HTMLAttributes } from "react";
type PlainObject = {
[key: string]: any
}
export interface ColumnProps<T extends PlainObject = PlainObject> {
title?: React.ReactNode
key?: React.Key
dataIndex?: keyof T | string
render?: (text: any, record: T, index: number) => React.ReactNode
align?: 'left' | 'right' | 'center'
className?: string
fixed?: boolean | ('left' | 'right')
}
export type TableRowProp = Partial<HTMLAttributes<HTMLTableRowElement>>
export interface TableProp<T extends PlainObject = PlainObject> {
columns?: ColumnProps<T>[]
dataSource?: T[]
rowKey?: string
className?: string
style?: React.CSSProperties
offsetTop?: number
multiLine?: boolean
scrollBarOffset?: number
onRow?: (record: T) => TableRowProp
}
export interface HorizontalScrollBarProp {
className?: string;
scrollTarget?: string | HTMLElement;
offsetBottom?: number;
}
interface BaseTableProp<T extends PlainObject = PlainObject> {
columns?: ColumnProps<T>[]
dataSource?: T[]
rowKey?: string
maxTop?: number
getRef?: React.RefObject<HTMLTableElement>
className?: string
multiLine?: boolean
style?: React.CSSProperties
offsetTop?: number
onRow?: (record: T) => TableRowProp
}
declare module "@zzwing/react-table" {
// type definitions goes here
class BaseTable<T extends PlainObject = any> extends React.PureComponent<BaseTableProp<T>> {}
class Table<T extends PlainObject = any> extends React.PureComponent<TableProp<T>> {}
class HorizontalScrollBar extends React.Component<HorizontalScrollBarProp> {}
}