Repository navigation
Expand file tree
/
Copy pathvendor.d.ts
More file actions
59 lines (46 loc) · 1.55 KB
/
Copy pathvendor.d.ts
File metadata and controls
59 lines (46 loc) · 1.55 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
55
56
57
58
59
/// <reference types="react" />
declare module 'react-treebeard' {
import { CSSProperties, PureComponent, ReactComponentElement } from "react";
export let Treebeard: ReactComponentElement;
interface TreebeardProps<Node extends TreeNode> {
decorators: Decorators;
data: Node[];
onToggle: (node: Node, toggled: boolean) => void;
animations: any;
}
interface TreeNode {
id: string,
name: JSX.Element | string,
children?: Array<this>,
toggled?: boolean,
active?: boolean,
loading?: boolean,
}
type Style = any;
type ContainerProps = {
style: Style,
decorators: Decorators,
terminal: boolean,
onClick: (...args: any[]) => any,
animations: Object | boolean,
node: any
};
export interface Container extends PureComponent<ContainerProps> {
renderToggle(): JSX.Element;
// So we can extend it
// new<P>(props: P): Container<P>;
new(): Container;
}
export let decorators: Decorators;
interface Decorators {
// I don't know what type to give this so that I can 'extend' from it in App.tsx
// declaring it via `declare class Container extends React.Component` also doesn't seem to work
Container: Container;
Header: Header;
// Hack we added so we can control when treebeard refreshes
cacheBust: number,
}
interface Header extends PureComponent<{node: Object, style: CSSProperties}> {
new(): Header;
}
}