UNPKG

@gravity-ui/graph

Version:

Modern graph editor component

18 lines (17 loc) 569 B
import React from "react"; import type { Graph } from "../graph"; export interface GraphContextType { graph: Graph; } export declare const GraphContext: React.Context<GraphContextType>; /** * Hook for getting Graph instance from context * * @throws {Error} If used outside of GraphCanvas */ export declare function useGraphContext(): GraphContextType; export interface GraphContextProviderProps { graph: Graph; children: React.ReactNode; } export declare function GraphContextProvider({ graph, children }: GraphContextProviderProps): React.JSX.Element;