/// <reference types="node" />
import Graph = require('ipld-graph-builder');
import { CryptoInfo, Ipfs, KeyProviderInterface, Logger, LoggerOptions, NameResolver } from '@evan.network/dbcp';
import { CryptoProvider } from '../encryption/crypto-provider';
export interface IpldOptions extends LoggerOptions {
    ipfs: Ipfs;
    keyProvider: KeyProviderInterface;
    cryptoProvider: CryptoProvider;
    originator: string;
    defaultCryptoAlgo: string;
    nameResolver: NameResolver;
}
/**
 * IPLD helper class, a single instance has to be created for each cryptor configuration.
 *
 * @class      Ipld IPFS helper class
 */
export declare class Ipld extends Logger {
    graph: Graph;
    ipfs: Ipfs;
    keyProvider: KeyProviderInterface;
    cryptoProvider: CryptoProvider;
    originator: string;
    defaultCryptoAlgo: string;
    nameResolver: NameResolver;
    private readonly dagOptions;
    private readonly encodingUnencrypted;
    private readonly encodingEncrypted;
    /**
     * remove all cryptoInfos from tree
     *
     * @param      {any}     toPurge  tree to purge
     */
    static purgeCryptoInfo(toPurge: any): void;
    constructor(options: IpldOptions);
    /**
     * Get a path from a tree; resolve only if required (depends on requested path)
     *
     * @param      {string | Buffer | any}  graphReference  hash/buffer to look up or a graph object
     * @param      {string}                 path            path in the tree
     * @return     {Promise<any>}           linked graph.
     */
    getLinkedGraph(graphReference: string | Buffer | any, path?: string): Promise<any>;
    /**
     * Get a path from a tree; resolve links in paths up to depth (default is 10)
     *
     * @param      {string | Buffer | any}  graphReference  hash/buffer to look up or a graph object
     * @param      {string}                 path            path in the tree
     * @param      {number}                 depth           resolve up do this many levels of depth
     *                                                      (default: 10)
     * @return     {Promise<any>}           resolved graph
     */
    getResolvedGraph(graphReference: string | Buffer | any, path?: string, depth?: number): Promise<any>;
    /**
     * store tree, if tree contains merklefied links, stores tree with multiple linked subtrees
     *
     * @param      {any}              toSet   tree to store
     * @return     {Promise<string>}  hash reference to a tree with with merklefied links
     */
    store(toSet: any): Promise<string>;
    /**
     * set a value to a tree node; inserts new element as a linked subtree by default
     *
     * @param      {any}           tree         tree to extend
     * @param      {string}        path         path of inserted element
     * @param      {any}           subtree      element that will be added
     * @param      {boolean}       plainObject  do not link value as new subtree
     * @param      {CryptoInfo}    cryptoInfo   crypto info for encrypting subtree
     * @return     {Promise<any>}  tree with merklefied links
     */
    set(tree: any, path: string, subtree: any, plainObject?: boolean, cryptoInfo?: CryptoInfo): Promise<any>;
    /**
     * delete a value from a tree node
     *
     * @param      {any}           tree    tree to extend
     * @param      {string}        path    path of inserted element
     * @return     {Promise<any>}  tree with merklefied links
     */
    remove(tree: any, path: string): Promise<any>;
}
