import { GraphDocument } from './../classes/';
import { GraphElement, TextEntity, GraphDatasource, FilterGraphElement, DataSet, FeatureType, IGraphNodeDefinition, NodeRule } from '@csnext/cs-data';
import { SearchEntity } from '../classes/document/search-entity';
import { IDocumentPlugin, IDocumentPluginResult } from '../plugins/document-plugin';
import { EntityParser } from '../plugins/entity-parser';
import { EntityList } from '../components/document/node-entities';
import { IFormOptions, IWidget } from '@csnext/cs-core';
import { GeojsonPlusLayer, IMapLayer, MapLayers } from '@csnext/cs-map';
import { Editor } from '@tiptap/vue-2';
import { IImportPlugin, IDocumentViewerPlugin, GraphShapeDefinitions, IGraphStorage } from '..';
import { Component } from 'vue';
import { ISearchPlugin } from '../plugins/search-plugin';
import { ITool } from '../classes/tool';
import { IActionPlugin } from '../plugins/action-plugin';
import { IGridPlugin } from '../plugins/grid-plugin';
export declare class DocDatasource extends GraphDatasource {
    base_url?: string | undefined;
    timesourceId?: string | undefined;
    id: string;
    static sourceId: string;
    static DOCUMENT: string;
    static DOCUMENT_UPDATED: string;
    static DOCUMENT_ENTITIES: string;
    static ENTITIES_UPDATED: string;
    static FEATURE_TYPES: string;
    static FEATURE_TYPE_SELECTED: string;
    static STORAGE: string;
    static STORAGE_CHANGED: string;
    storage?: IGraphStorage;
    activeDocument?: GraphDocument;
    searchEntities?: SearchEntity[];
    documentPlugins: IDocumentPlugin[];
    searchPlugins: ISearchPlugin[];
    gridPlugins: IGridPlugin[];
    importPlugins: IImportPlugin[];
    viewerPlugins: IDocumentViewerPlugin[];
    actionPlugins: IActionPlugin[];
    editor?: Editor | null;
    elementHistory?: string[];
    activeUser?: GraphElement;
    bookmarks: string[];
    filters: FilterGraphElement[];
    graphShapeDefinitions: GraphShapeDefinitions;
    newsCardSelector?: (el: GraphElement) => Component;
    entityParser: EntityParser;
    layers: {
        [type: string]: GeojsonPlusLayer;
    };
    tools: ITool[];
    slideConfigs: IWidget[];
    constructor(base_url?: string | undefined, timesourceId?: string | undefined);
    openServerStorage(): Promise<void>;
    private get storageTypeKey();
    private get historyKey();
    private get activeUserKey();
    openDeviceStorage(databaseHandle: any): Promise<void>;
    initStorage(): Promise<void>;
    reset(): Promise<boolean>;
    addSearchPlugin(plugin: ISearchPlugin): void;
    addSlideConfig(config: IWidget): void;
    removeSlideConfig(id: string): void;
    removeAllSlideConfigs(): void;
    addTool(tool: ITool): void;
    removeTool(id: string): void;
    removeWidgetTools(widgetId: string): void;
    toggleBookmark(bookmark: GraphElement): boolean;
    importNodes(nodes: GraphElement[]): Promise<GraphElement[] | undefined>;
    importNodesMap(nodes: {
        [id: string]: GraphElement;
    }): Promise<GraphElement[] | undefined>;
    importNode(node: GraphElement, notify?: boolean): Promise<GraphElement>;
    addBookmark(bookmark: GraphElement): boolean;
    removeBookmark(bookmark: GraphElement): boolean;
    initLayer(ml: MapLayers, key: string, obs: FeatureType): Promise<IMapLayer>;
    initLayers(defaultLayer?: string): Promise<void>;
    addElementToLayer(layer: DataSet, element: GraphElement): void;
    updateLayer(type: FeatureType, traversal?: boolean): void;
    updateLayers(): void;
    updateLayerElements(elements: GraphElement[]): Promise<void>;
    openFeatureTypeEditor(featureType: FeatureType): void;
    openOriginal(original: GraphElement): void;
    getGraphPreset(id: string): FilterGraphElement | undefined;
    emptyGraph(trigger?: boolean, preset?: string): void;
    addGraphPreset(preset?: FilterGraphElement, activate?: boolean): FilterGraphElement;
    updateRules(preset: FilterGraphElement, rule: NodeRule, state: any): void;
    applyGraphPresetRules(preset: FilterGraphElement, rules: NodeRule[], element?: GraphElement, list?: GraphElement[], state?: any): void;
    updateFilterStats(preset: FilterGraphElement): false | undefined;
    addVisibleElement(preset: FilterGraphElement, e: GraphElement): boolean;
    applyGraphPreset(preset: FilterGraphElement): void;
    linkObservationToDocument(observation: FeatureType, doc: GraphDocument): Promise<FeatureType>;
    parseDocument(doc: GraphDocument): Promise<GraphDocument>;
    initDocumentPlugins(): void;
    openViewer(element: GraphElement, document?: GraphElement): void;
    linkDocumentObservations(doc: GraphDocument): void;
    linkDocumentEntities(doc: GraphDocument): void;
    initDocument(doc: GraphDocument): GraphDocument;
    parseDocuments(): void;
    deleteDocument(doc: GraphDocument): void;
    linkEntityToDocument(entity: TextEntity, doc: GraphDocument): Promise<TextEntity>;
    linkEntityListToDocument(entity: EntityList, doc: GraphDocument): Promise<EntityList>;
    triggerDocumentEntities(): void;
    updateHighlights(): void;
    removeEntityNodeFromDocument(node: any, doc: GraphDocument): void;
    removeEntityListFromDocument(list: EntityList, doc: GraphDocument, removeInstances?: boolean): Promise<EntityList>;
    removeEntityFromDocument(entity: TextEntity, doc: GraphDocument): Promise<TextEntity>;
    setActiveUser(user: GraphElement): void;
    initUser(): Promise<void>;
    loadTypes(): Promise<boolean>;
    elementEditorForm(node: GraphElement, editOnly?: boolean, verbose?: boolean): IFormOptions;
    openEntityEditor(entity: SearchEntity): void;
    loadGraphElement<T>(id: string): Promise<undefined>;
    loadGraph(clearCache?: boolean): Promise<void>;
    checkQueryParams(): void;
    refresh(loadGraph?: boolean): Promise<boolean>;
    saveFeatureType(type: FeatureType): Promise<FeatureType>;
    createEntity(type: FeatureType, askForName?: boolean, newItem?: GraphElement): Promise<GraphElement>;
    saveDocument(d: GraphDocument): Promise<GraphDocument>;
    updateDocumentOriginals(doc: GraphDocument): void;
    removeNodeByType(classId: string): Promise<boolean>;
    removeNode(element: GraphElement, relations?: boolean, notify?: boolean): Promise<boolean>;
    toggleAproveElement(element: GraphElement, agent?: GraphElement): Promise<GraphElement>;
    updateProvanance(element: GraphElement, user?: GraphElement): void;
    saveMultiple(elements: GraphElement[], user?: GraphElement, notify?: boolean): Promise<GraphElement[] | undefined>;
    duplicateNode(element: GraphElement, newName?: string): Promise<GraphElement>;
    saveNode(element: GraphElement, user?: GraphElement, notify?: boolean): Promise<GraphElement>;
    parseEntities(doc: GraphDocument): Promise<IDocumentPluginResult | undefined>;
    activateDocument(doc?: GraphDocument): Promise<GraphDocument>;
    removeEdge(edge: GraphElement): Promise<boolean>;
    saveEdge(edge: GraphElement, updateEdges?: boolean): Promise<GraphElement>;
    addNewEdge(edge: GraphElement, skipExisting?: boolean): Promise<GraphElement>;
    addNewNode(element: GraphElement): Promise<GraphElement>;
    selectElementId(id: string, open?: boolean, expanded?: boolean, tab?: string | undefined): void;
    selectElement(element: GraphElement | undefined, open?: boolean, expanded?: boolean, tab?: string | undefined): void;
    startEditElement(element: GraphElement): void;
    stopEditElement(element: GraphElement): void;
    createKGView(elements?: GraphElement[], preset?: string, empty?: boolean): void;
    addElementToPreset(el: GraphElement, preset: string, trigger?: boolean, pos?: IGraphNodeDefinition): void;
    removeElementFromPreset(el: GraphElement, preset: string): void;
    addRelationsToPreset(element: GraphElement, preset: string, classId?: string): void;
    openElement(node: GraphElement | string, expanded?: boolean, tab?: string | undefined): void;
    updateSearchEntities(): void;
    setQueryParams(): void;
    loadElementHistory(): void;
    saveElementHistory(): void;
    addElementToHistory(id: string): void;
    execute(): Promise<DocDatasource>;
}
