/// <reference types="node" />
import { FileToAdd, DfsInterface, DfsCacheInterface, Logger, LoggerOptions } from '@evan.network/dbcp';
import { Payments } from './../payments';
/**
 * ipfs instance options
 */
export interface IpfsOptions extends LoggerOptions {
    remoteNode: any;
    cache: any;
    dfsConfig: any;
    accountId: string;
    payments: Payments;
    privateKey: string;
    disablePin?: boolean;
    web3: any;
}
/**
 * @brief      IPFS add/get data handler
 */
export declare class Ipfs extends Logger implements DfsInterface {
    remoteNode: any;
    web3: any;
    dfsConfig: any;
    disablePin: boolean;
    accountId: string;
    payments: Payments;
    privateKey: string;
    cache: DfsCacheInterface;
    /**
     * convert IPFS hash to bytes 32 see
     * https://www.reddit.com/r/ethdev/comments/6lbmhy/a_practical_guide_to_cheap_ipfs_hash_storage_in
     *
     * @param      hash  IPFS hash
     *
     * @return     bytes32 string
     */
    static ipfsHashToBytes32(hash: string): string;
    /**
     * convert bytes32 string to IPFS hash see
     * https://www.reddit.com/r/ethdev/comments/6lbmhy/a_practical_guide_to_cheap_ipfs_hash_storage_in
     *
     * @param      str   bytes32 string
     *
     * @return     IPFS string
     */
    static bytes32ToIpfsHash(str: string): string;
    constructor(options: any);
    stop(): Promise<any>;
    /**
     * @brief      add content to ipfs
     *
     * @param      name  The name
     * @param      data  The data
     *
     * @return     ipfs hash of the data
     */
    add(name: string, data: Buffer): Promise<string>;
    /**
     * @brief      add multiple files to ipfs
     *
     * @param      files  array with files to add
     *
     * @return     ipfs hash array of the data
     */
    addMultiple(files: FileToAdd[]): Promise<string[]>;
    /**
     * @brief      pins file hashes on ipfs cluster
     *
     * @param      hash  filehash of the pinned item
     */
    pinFileHash(file: any): Promise<any>;
    /**
     * @brief      get data from ipfs by ipfs hash
     *
     * @param      hash  ipfs hash of the data
     * @param      returnBuffer  should the function return the plain buffer (default false)
     *
     * @return     data as text
     */
    get(hash: string, returnBuffer?: boolean): Promise<any>;
    /**
     * Sets the account identifier and accountstore, also generates a new ipfs instance.
     *
     * @param      {string}        accountId     The account identifier
     * @param      {any}           privateKey    The account private
     * @return     {Promise<any>}  resolved when done
     */
    setAccountAndPrivateKey(accountId: string, privateKey: any): Promise<void>;
}
