Skip to content

Instantly share code, notes, and snippets.

@upvalue
Created June 8, 2017 22:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save upvalue/10315370a166f2ac5ebdab6c9c57b996 to your computer and use it in GitHub Desktop.
Save upvalue/10315370a166f2ac5ebdab6c9c57b996 to your computer and use it in GitHub Desktop.
not-yet-functional react-treebeard bindings for typescript
// TypeScript bindings for react-sortable-tree
declare module "react-treebeard" {
import * as React from 'react';
export interface Node {
id?: string;
name: string;
active?: boolean;
toggled?: boolean;
loading?: boolean;
decorators?: boolean;
animations?: boolean;
children?: Array<Node>;
}
export interface ContainerProps {
style: any;
decorators: any;
terminal: boolean;
onClick: any;
animations: boolean | any;
node: Node;
}
export interface HeaderProps {
style?: any;
node: Node;
}
export interface Decorators {
Container(ContainerProps): JSX.Element | null;
Header(HeaderProps): JSX.Element | null;
}
export interface SortableTreeDataProp {
treeData: Node;
}
export interface TreebeardProps {
data: Array<Node>;
onToggle(node: Node, toggled: boolean): void;
decorators?: Decorators;
className?: string;
}
export const Treebeard: React.ClassicComponentClass<TreebeardProps>;
export const decorators: Decorators;
export default Treebeard;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment