forked from tomkp/react-split-pane
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
71 lines (55 loc) · 1.52 KB
/
index.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import * as React from 'react';
export type Size = string | number;
export type Split = 'vertical' | 'horizontal';
export type SplitPaneProps = {
allowResize?: boolean;
className?: string;
primary?: 'first' | 'second';
minSize?: Size;
maxSize?: Size;
defaultSize?: Size;
size?: Size;
split?: 'vertical' | 'horizontal';
onDragStarted?: () => void;
onDragFinished?: (newSize: number) => void;
onChange?: (newSize: number) => void;
onResizerClick?: (event: MouseEvent) => void;
onResizerDoubleClick?: (event: MouseEvent) => void;
style?: React.CSSProperties;
resizerStyle?: React.CSSProperties;
paneStyle?: React.CSSProperties;
pane1Style?: React.CSSProperties;
pane2Style?: React.CSSProperties;
resizerClassName?: string;
step?: number;
};
export type SplitPaneState = {
active: boolean;
resized: boolean;
};
declare class SplitPane extends React.Component<
SplitPaneProps,
SplitPaneState
> {
constructor();
onMouseDown(event: MouseEvent): void;
onTouchStart(event: TouchEvent): void;
onMouseMove(event: MouseEvent): void;
onTouchMove(event: TouchEvent): void;
onMouseUp(): void;
static getSizeUpdate(
props: SplitPaneProps,
state: SplitPaneState
): Partial<SplitPaneState>;
static defaultProps: SplitPaneProps;
}
export default SplitPane;
export type PaneProps = {
className?: string;
size?: Size;
split?: Split;
style?: React.CSSProperties;
eleRef?: (el: HTMLDivElement) => void;
};
declare class Pane extends React.PureComponent<PaneProps> {}
export { Pane };