@nodeject/ui-components
Version:
UI library for non-trivial components
48 lines (47 loc) • 1.65 kB
TypeScript
import { CytoNode, SchedioTreeFromServer } from '../types';
export declare type NodeActions = {
addChildNode?: (newNode: CytoNode) => void;
deleteNode?: (nodeId: string) => void;
insertParent?: (args: {
currentNodeWithNewParent: CytoNode;
newNode: CytoNode;
}) => void;
insertSiblingAfter?: (args: {
afterNode: CytoNode;
newNode: CytoNode;
}) => void;
insertSiblingBefore?: (args: {
beforeNode: CytoNode;
newNode: CytoNode;
}) => void;
moveNode?: (args: {
nodeId: string;
index: number;
parentId: string;
}) => void;
};
export declare type NodeActionsClient = {
addChildNodeClient?: (parent: string) => void;
deleteNodeClient?: (nodeId: string) => void;
insertParentClient?: (nodeId: string) => void;
insertSiblingAfterClient?: (nodeId: string) => void;
insertSiblingBeforeClient?: (nodeId: string) => void;
moveNodeClient?: (args: {
nodeId: string;
index: number;
parentId: string;
}) => void;
};
export interface UseSchedioTreeInitialState {
nodeActions: NodeActions;
createNewClientNode?: (parent: string) => CytoNode;
schedioTreeFromServer?: SchedioTreeFromServer;
}
export declare function useSchedioTree(initialState: UseSchedioTreeInitialState): {
cytoGraph: import("../types").CytoGraph;
nodeActions: NodeActionsClient;
};
export declare const SchedioTreeContainer: import("unstated-next").Container<{
cytoGraph: import("../types").CytoGraph;
nodeActions: NodeActionsClient;
}, UseSchedioTreeInitialState>;