import { GraphElement } from '@csnext/cs-data';
import { DocDatasource } from '..';
export interface IGraphStorage {
    source?: DocDatasource;
    init(source: DocDatasource): any;
    loadTypes(): Promise<boolean>;
    saveTypes(): Promise<boolean>;
    loadGraph(): Promise<boolean>;
    saveEdge?(element: GraphElement): Promise<GraphElement | undefined>;
    saveElement?(element: GraphElement): Promise<GraphElement>;
    removeEdge?(id: string): Promise<boolean>;
    loadGraphElement?(id: string): Promise<GraphElement | undefined>;
    removeElement(id: string): Promise<boolean>;
}
export declare class GraphServer implements IGraphStorage {
    base_url: string;
    source: DocDatasource;
    constructor(base_url: string);
    init(source: DocDatasource): void;
    loadGraph(): Promise<boolean>;
    useSocket(): void;
    loadTypes(): Promise<boolean>;
    saveTypes(): Promise<boolean>;
    saveEdge(edge: GraphElement): Promise<GraphElement | undefined>;
    saveElement(element: GraphElement): Promise<GraphElement>;
    removeElement(id: string): Promise<boolean>;
    removeEdge(id: string): Promise<boolean>;
    loadGraphElement(id: string): Promise<GraphElement | undefined>;
}
