import { ContractLoader, Executor, Logger, LoggerOptions, NameResolver } from '@evan.network/dbcp';
import { DataContract } from '../contracts/data-contract/data-contract';
import { Ipld } from '../dfs/ipld';
/**
 * parameters for Profile constructor
 */
export interface ProfileOptions extends LoggerOptions {
    accountId: string;
    contractLoader: ContractLoader;
    dataContract: DataContract;
    defaultCryptoAlgo: string;
    executor: Executor;
    ipld: Ipld;
    nameResolver: NameResolver;
}
/**
 * bookmark to a dapp
 */
export interface DappBookmark {
    description: string;
    img: string;
    primaryColor: string;
    secondaryColor?: string;
    title: string;
}
/**
 * profile helper class, builds profile graphs
 *
 * @class      Profile (name)
 */
export declare class Profile extends Logger {
    activeAccount: string;
    contractLoader: ContractLoader;
    dataContract: DataContract;
    defaultCryptoAlgo: string;
    executor: Executor;
    ipld: Ipld;
    nameResolver: NameResolver;
    profileContract: any;
    trees: any;
    treeLabels: {
        addressBook: string;
        bookmarkedDapps: string;
        contracts: string;
        publicKey: string;
    };
    constructor(options: ProfileOptions);
    /**
     * add a contract (task contract etc. ) to a business center scope of the current profile
     *
     * @param      {string}         bc       business center ens address or contract address
     * @param      {string}         address  contact address
     * @param      {any}            data     bookmark metadata
     * @return     {Promise<void>}  resolved when done
     */
    addBcContract(bc: string, address: string, data: any): Promise<void>;
    /**
     * add a key for a contact to bookmarks
     *
     * @param      {string}         address  account key of the contact
     * @param      {string}         context  store key for this context, can be a contract, bc, etc.
     * @param      {string}         key      communication key to store
     * @return     {Promise<void>}  resolved when done
     */
    addContactKey(address: string, context: string, key: string): Promise<void>;
    /**
     * add a contract to the current profile
     *
     * @param      {string}  address  contact address
     * @return     {any}     bookmark info
     */
    addContract(address: string, data: any): Promise<any>;
    /**
     * add a bookmark for a dapp
     *
     * @param      {string}         address      ENS name or contract address (if no ENS name is set)
     * @param      {DappBookmark}   description  description for bookmark
     * @return     {Promise<void>}  resolved when done
     */
    addDappBookmark(address: string, description: DappBookmark): Promise<void>;
    /**
     * add a profile value to an account
     *
     * @param      {string}         address  account key of the contact
     * @param      {string}         key      store key for the account like alias, etc.
     * @param      {string}         value    value of the profile key
     * @return     {Promise<void>}  resolved when done
     */
    addProfileKey(address: string, key: string, value: string): Promise<void>;
    /**
     * add a key for a contact to bookmarks
     *
     * @param      {string}         key     public Diffie Hellman key part to store
     * @return     {Promise<void>}  resolved when done
     */
    addPublicKey(key: string): Promise<void>;
    /**
     * create new profile, store it to profile index initialize addressBook and publicKey
     *
     * @param      {string}         keys    communication key to store
     * @return     {Promise<void>}  resolved when done
     */
    createProfile(keys: any): Promise<void>;
    /**
     * check if a profile has been stored for current account
     *
     * @return     {Promise<boolean>}  true if a contract was registered, false if not
     */
    exists(): Promise<boolean>;
    /**
     * get the whole addressBook
     *
     * @return     {any}     bookmark info
     */
    getAddressBook(): Promise<any>;
    /**
     * get a specific addressBook entry for a given address
     *
     * @param      {string}        address  contact address
     * @return     {Promise<any>}  bookmark info
     */
    getAddressBookAddress(address: string): Promise<any>;
    /**
     * get a specific contract entry for a given address
     *
     * @param      {string}        bc       business center ens address or contract address
     * @param      {string}        address  contact address
     * @return     {Promise<any>}  bookmark info
     */
    getBcContract(bc: string, address: string): Promise<any>;
    /**
     * get all contracts grouped under a business center
     *
     * @param      {string}        bc      business center
     * @return     {Promise<any>}  bc contracts.
     */
    getBcContracts(bc: string): Promise<any>;
    /**
     * get all bookmarks for profile
     *
     * @return     {any}  all bookmarks for profile
     */
    getBookmarkDefinitions(): Promise<any>;
    /**
     * get a communication key for a contact from bookmarks
     *
     * @param      {string}           address  account key of the contact
     * @param      {string}           context  store key for this context, can be a contract, bc, etc.
     * @return     {Promise<string>}  matching key
     */
    getContactKey(address: string, context: string): Promise<string>;
    /**
     * get a specific contract entry for a given address
     *
     * @param      {string}        address  contact address
     * @return     {Promise<any>}  bookmark info
     */
    getContract(address: string): Promise<any>;
    /**
     * get all contracts for the current profile
     *
     * @return     {Promise<any>}  contracts info
     */
    getContracts(): Promise<any>;
    /**
     * get a bookmark for a given address if any
     *
     * @param      {string}        address  ENS name or contract address (if no ENS name is set)
     * @return     {Promise<any>}  bookmark info
     */
    getDappBookmark(address: string): Promise<any>;
    /**
     * check, known state for given account
     *
     * @param      {string}            accountId  account id of a contact
     * @return     {Promise<boolean>}  true if known account
     */
    getContactKnownState(accountId: string): Promise<boolean>;
    /**
     * get a key from an address in the address book
     *
     * @param      {string}        address  address to look up
     * @param      {string}        key      type of key to get
     * @return     {Promise<any>}  key
     */
    getProfileKey(address: string, key: string): Promise<any>;
    /**
     * get public key of profiles
     *
     * @return     {any}  public key
     */
    getPublicKey(): Promise<any>;
    /**
     * load profile for given account from global profile contract, if a tree is given, load that tree
     * from ipld as well
     *
     * @param      {string}         tree    tree to load ('bookmarkedDapps', 'contracts', ...)
     * @return     {Promise<void>}  resolved when done
     */
    loadForAccount(tree?: string): Promise<void>;
    /**
     * load profile from ipfs via ipld dag via ipfs file hash
     *
     * @param      {string}            tree          tree to load ('bookmarkedDapps', 'contracts',
     *                                               ...)
     * @param      {string}            ipldIpfsHash  ipfs file hash that points to a file with ipld a
     *                                               hash
     * @return     {Promise<Profile>}  this profile
     */
    loadFromIpld(tree: string, ipldIpfsHash: string): Promise<Profile>;
    /**
     * remove a contact from bookmarkedDapps
     *
     * @param      {string}         address  account key of the contact
     * @return     {Promise<void>}  resolved when done
     */
    removeContact(address: string): Promise<void>;
    /**
     * remove a dapp bookmark from the bookmarkedDapps
     *
     * @param      {string}         address  address of the bookmark to remove
     * @return     {Promise<void>}  resolved when done
     */
    removeDappBookmark(address: string): Promise<void>;
    /**
     * set bookmarks with given value
     *
     * @param      {any}            bookmarks  bookmarks to set
     * @return     {Promise<void>}  resolved when done
     */
    setDappBookmarks(bookmarks: any): Promise<void>;
    /**
     * store given state for this account
     *
     * @param      {string}         accountId     account id of a contact
     * @param      {boolean}        contactKnown  true if known, false if not
     * @return     {Promise<void>}  resolved when done
     */
    setContactKnownState(accountId: string, contactKnown: boolean): Promise<void>;
    /**
     * stores profile tree or given hash to global profile contract
     *
     * @param      {string}   tree      tree to store ('bookmarkedDapps', 'contracts', ...)
     * @param      {string}   ipldHash  store this hash instead of the current tree for account
     * @return     {Promise}  resolved when done
     */
    storeForAccount(tree: string, ipldHash?: string): Promise<void>;
    /**
     * store profile in ipfs as an ipfs file that points to a ipld dag
     *
     * @param      {string}           tree    tree to store ('bookmarkedDapps', 'contracts', ...)
     * @return     {Promise<string>}  hash of the ipfs file
     */
    storeToIpld(tree: string): Promise<string>;
    /**
     * make sure that specified tree is available locally for inserting values
     *
     * @param      {string}  tree    name of the tree
     */
    private ensureTree(tree);
}
