import { Description, DfsInterface, Envelope } from '@evan.network/dbcp';
import { BaseContract, BaseContractOptions } from '../base-contract/base-contract';
import { CryptoProvider } from '../../encryption/crypto-provider';
import { Sharing } from '../sharing';
/**
 * options for DataContract constructor
 */
export interface DataContractOptions extends BaseContractOptions {
    cryptoProvider: CryptoProvider;
    dfs: DfsInterface;
    sharing: Sharing;
    web3: any;
    defaultCryptoAlgo?: string;
    description: Description;
}
/**
 * helper class for AssetDataContracts
 *
 * @class      AssetDataContract (name)
 */
export declare class DataContract extends BaseContract {
    protected options: DataContractOptions;
    private readonly encodingUnencrypted;
    private readonly encodingEncrypted;
    private readonly encodingUnencryptedHash;
    private readonly cryptoAlgorithHashes;
    constructor(optionsInput: DataContractOptions);
    /**
     * create and initialize new contract
     *
     * @param      {string}        factoryName           factory to use for creating contract (without
     *                                                   the business center suffix)
     * @param      {string}        accountId             owner of the new contract and transaction
     *                                                   executor
     * @param      {string}        businessCenterDomain  ENS domain name of the business center
     * @param      {string|any}    contractDescription   bytes32 hash of DBCP description or a schema
     *                                                   object
     * @param      {bool}          allowConsumerInvite   true if consumers are allowed to invite other
     *                                                   consumers
     * @param      {string}        sharingsHash          sharings hash to use
     * @return     {Promise<any>}  contract instance
     */
    create(factoryName: string, accountId: string, businessCenterDomain?: string, contractDescription?: any, allowConsumerInvite?: boolean, sharingsHash?: any): Promise<any>;
    /**
     * create initial sharing for contract
     *
     * @param      {string}        accountId  owner of the new contract
     * @return     {Promise<any>}  sharing info with { contentKey, hashKey, sharings, sharingsHash, }
     */
    createSharing(accountId: string, skipUpload?: boolean): Promise<any>;
    /**
     * add list entries to lists
     *
     * @param      {object|string}  contract         contract or contractId
     * @param      {string}         listName         name of the list in the data contract
     * @param      {any}            values           values to add
     * @param      {string}         accountId        Ethereum account id
     * @param      {boolean}        dfsStorage       store values in dfs
     * @param      {boolean}        encryptedHashes  encrypt hashes from values
     * @param      {string}         encryption       encryption algorithm to use
     * @return     {Promise<void>}  resolved when done
     */
    addListEntries(contract: any | string, listName: string | string[], values: any[], accountId: string, dfsStorage?: boolean, encryptedHashes?: boolean, encryption?: string, encryptionContext?: string): Promise<void>;
    /**
     * clears cached sharing information of this contract, can be used when sharings have been updated
     * externally and new sharings should be fetched
     */
    clearSharingCache(): void;
    /**
     * decrypt input envelope return decrypted envelope
     *
     * @param      {string}        toDecrypt     data to decrypt
     * @param      {any}           contract      contract instance or contract id
     * @param      {string}        accountId     account id that decrypts the data
     * @param      {string}        propertyName  property in contract that is decrypted
     * @return     {Promise<any>}  decrypted envelope
     */
    decrypt(toDecrypt: string, contract: any, accountId: string, propertyName: string): Promise<Envelope>;
    /**
     * decrypt input hash, return decrypted hash
     *
     * @param      {string}           toDecrypt  hash to decrypt
     * @param      {any}              contract   contract instance or contract id
     * @param      {string}           accountId  account id that decrypts the data
     * @return     {Promise<string>}  decrypted hash
     */
    decryptHash(toDecrypt: string, contract: any, accountId: string): Promise<string>;
    /**
     * encrypt incoming envelope
     *
     * @param      {Envelope}         toEncrypt     envelope with data to encrypt
     * @param      {any}              contract      contract instance or contract id
     * @param      {string}           accountId     encrypting account
     * @param      {string}           propertyName  property in contract, the data is encrypted for
     * @param      {number}           block         block the data belongs to
     * @param      {string}           encryption    encryption name
     * @return     {Promise<string>}  encrypted envelope or hash as string
     */
    encrypt(toEncrypt: Envelope, contract: any, accountId: string, propertyName: string, block: number, encryption?: string): Promise<string>;
    /**
     * encrypt incoming hash
     *
     * @param      {string}           toEncrypt  hash to encrypt
     * @param      {any}              contract   contract to encrypt data for
     * @param      {string}           accountId  encrypting account
     * @return     {Promise<string>}  encrypted hash as string
     */
    encryptHash(toEncrypt: string, contract: any, accountId: string): Promise<string>;
    /**
     * return entry from contract
     *
     * @param      {object|string}   contract         contract or contractId
     * @param      {string}          entryName        entry name
     * @param      {string}          accountId        Ethereum account id
     * @param      {boolean}         dfsStorage       store values in dfs
     * @param      {boolean}         encryptedHashes  decrypt hashes from values
     * @return     {Promise<any[]>}  list entries
     */
    getEntry(contract: any | string, entryName: string, accountId: string, dfsStorage?: boolean, encryptedHashes?: boolean): Promise<any>;
    /**
     * return a value from a mapping
     *
     * @param      {object|string}  contract         contract or contractId
     * @param      {string}         mappingName      name of a data contracts mapping property
     * @param      {string}         entryName        entry name
     * @param      {string}         accountId        Ethereum account id
     * @param      {boolean}        dfsStorage       store values in dfs
     * @param      {boolean}        encryptedHashes  encrypt hashes from values
     * @return     {Promise<any>}   mappings value for given key
     */
    getMappingValue(contract: any | string, mappingName: string, entryName: string, accountId: string, dfsStorage?: boolean, encryptedHashes?: boolean): Promise<any>;
    /**
     * return list entries from contract
     *
     * @param      {object|string}   contract         contract or contractId
     * @param      {string}          listName         name of the list in the data contract
     * @param      {string}          accountId        Ethereum account id
     * @param      {boolean}         dfsStorage       store values in dfs
     * @param      {boolean}         encryptedHashes  encrypt hashes from values
     * @param      {number}          count            number of elements to retrieve (page size)
     * @param      {number}          offset           skip this many elements when retrieving
     * @param      {boolean}         reverse          reverse order of entries
     * @return     {Promise<any[]>}  list entries
     */
    getListEntries(contract: any | string, listName: string, accountId: string, dfsStorage?: boolean, encryptedHashes?: boolean, count?: number, offset?: number, reverse?: boolean): Promise<any[]>;
    /**
     * return a single list entry from contract
     *
     * @param      {object|string}  contract         contract or contractId
     * @param      {string}         listName         name of the list in the data contract
     * @param      {number}         index            list entry id to retrieve
     * @param      {string}         accountId        Ethereum account id
     * @param      {boolean}        dfsStorage       store values in dfs
     * @param      {boolean}        encryptedHashes  encrypt hashes from values
     * @return     {Promise<any>}   list entry
     */
    getListEntry(contract: any | string, listName: string, index: number, accountId: string, dfsStorage?: boolean, encryptedHashes?: boolean): Promise<any>;
    /**
     * return number of entries in the list
     *
     * @param      {object|string}    contract  contract or contractId
     * @param      {string}           listName  name of the list in the data contract
     * @return     {Promise<number>}  list entry count
     */
    getListEntryCount(contract: any | string, listName: string): Promise<number>;
    /**
     * move one list entry to one or more lists
     *
     * @param      {object|string}  contract      contract or contractId
     * @param      {string}         listNameFrom  origin list
     * @param      {number}         entryIndex    index of the entry to move in the origin list
     * @param      {string[]}       listNamesTo   lists to move data into
     * @param      {string}         accountId     Ethereum account id
     * @return     {Promise<void>}  resolved when done
     */
    moveListEntry(contract: any | string, listNameFrom: string, entryIndex: number, listNamesTo: string[], accountId: string): Promise<void>;
    /**
     * remove list entry from list; will reposition last list entry into emptied slot
     *
     * @param      {object|string}  contract    contract or contractId
     * @param      {string}         listName    name of the list in the data contract
     * @param      {number}         entryIndex  index of list entry
     * @param      {string}         accountId   Ethereum account id
     * @return     {Promise<void>}  resolved when done
     */
    removeListEntry(contract: any | string, listName: string, entryIndex: number, accountId: string): Promise<void>;
    /**
     * set entry for a key
     *
     * @param      {object|string}  contract         contract or contractId
     * @param      {string}         entryName        entry name
     * @param      {any}            value            value to add
     * @param      {string}         accountId        Ethereum account id
     * @param      {boolean}        dfsStorage       store values in dfs
     * @param      {boolean}        encryptedHashes  encrypt hashes from values
     * @param      {string}         encryption       encryption algorithm to use
     * @return     {Promise<void>}  resolved when done
     */
    setEntry(contract: any | string, entryName: string, value: any, accountId: string, dfsStorage?: boolean, encryptedHashes?: boolean, encryption?: string, encryptionContext?: string): Promise<void>;
    /**
     * set entry for a key in a mapping
     *
     * @param      {object|string}  contract         contract or contractId
     * @param      {string}         mappingName      name of a data contracts mapping property
     * @param      {string}         entryName        entry name (property in the mapping)
     * @param      {any}            value            value to add
     * @param      {string}         accountId        Ethereum account id
     * @param      {boolean}        dfsStorage       store values in dfs
     * @param      {boolean}        encryptedHashes  encrypt hashes from values
     * @param      {string}         encryption       encryption algorith (key provider property)
     * @return     {Promise<void>}  resolved when done
     */
    setMappingValue(contract: any | string, mappingName: string, entryName: string, value: any, accountId: string, dfsStorage?: boolean, encryptedHashes?: boolean, encryption?: string, encryptionContext?: string): Promise<void>;
    private validate;
}
