import { xy } from '@synnaxlabs/x';
import { NodeChange } from '@xyflow/react';
import { ComponentPropsWithoutRef, ReactElement } from 'react';
import { z } from 'zod';
import { Aether } from '../../aether';
import { Button } from '../../button';
import { RenderProp } from '../../component/renderProp';
import { Flex } from '../../flex';
import { Viewport as CoreViewport } from '../../viewport';
import { diagram } from './aether';
import { Edge, Node, Viewport } from './aether/types';
export interface SymbolProps {
    symbolKey: string;
    position: xy.XY;
    selected: boolean;
    draggable: boolean;
}
export interface UseProps {
    allowEdit?: boolean;
    initialEdges: Edge[];
    initialNodes: Node[];
    initialViewport?: Viewport;
}
export declare const use: ({ initialNodes, initialEdges, allowEdit, initialViewport, }: UseProps) => UseReturn;
export interface UseReturn {
    edges: Edge[];
    nodes: Node[];
    onNodesChange: (nodes: Node[], changes: NodeChange[]) => void;
    onEdgesChange: (edges: Edge[]) => void;
    editable: boolean;
    onEditableChange: (v: boolean) => void;
    onViewportChange: (vp: Viewport) => void;
    viewport: Viewport;
    fitViewOnResize: boolean;
    setFitViewOnResize: (v: boolean) => void;
    viewportMode: CoreViewport.Mode;
    onViewportModeChange: (v: CoreViewport.Mode) => void;
}
export interface DiagramProps extends UseReturn, Omit<ComponentPropsWithoutRef<"div">, "onError">, Pick<z.infer<typeof diagram.Diagram.stateZ>, "visible">, Aether.ComponentProps {
    triggers?: CoreViewport.UseTriggers;
    dragHandleSelector?: string;
}
interface ContextValue {
    editable: boolean;
    visible: boolean;
    onEditableChange: (v: boolean) => void;
    viewportMode: CoreViewport.Mode;
    onViewportModeChange: (v: CoreViewport.Mode) => void;
    registerNodeRenderer: (renderer: RenderProp<SymbolProps>) => void;
    fitViewOnResize: boolean;
    setFitViewOnResize: (v: boolean) => void;
}
export declare const useContext: () => ContextValue;
export interface NodeRendererProps {
    children: RenderProp<SymbolProps>;
}
export declare const NodeRenderer: import('react').MemoExoticComponent<({ children }: NodeRendererProps) => ReactElement | null>;
export declare const Background: () => ReactElement | null;
export interface ControlsProps extends Flex.BoxProps {
}
export declare const Controls: (props: ControlsProps) => ReactElement;
export interface ToggleEditControlProps extends Omit<Button.ToggleProps, "value" | "onChange" | "children"> {
}
export declare const ToggleEditControl: ({ onClick, ...rest }: ToggleEditControlProps) => ReactElement;
export interface FitViewControlProps extends Omit<Button.ToggleProps, "children" | "onChange" | "value"> {
}
export declare const FitViewControl: ({ onClick, ...rest }: FitViewControlProps) => ReactElement;
export declare const VIEWPORT_MODES: readonly ["zoom", "pan", "select"];
export declare const SelectViewportModeControl: () => ReactElement;
export declare const Diagram: (props: DiagramProps) => ReactElement;
export {};
//# sourceMappingURL=Diagram.d.ts.map