import { AccountStore, ContractLoader, Description, Executor, Logger, LoggerOptions, NameResolver, DfsInterface } from '@evan.network/dbcp';
export declare enum ClaimsStatus {
    /**
     * issued by a non-issuer parent claim holder, self issued state is 0
     */
    Issued = 0,
    /**
     * issued by a non-issuer parent claim holder, self issued state is 0
     */
    Confirmed = 1,
    /**
     * claim rejected status
     */
    Rejected = 2,
}
export interface ClaimsOptions extends LoggerOptions {
    accountStore: AccountStore;
    config: any;
    contractLoader: ContractLoader;
    description: Description;
    dfs: DfsInterface;
    executor: Executor;
    nameResolver: NameResolver;
    storage?: string;
}
/**
 * Claims helper
 *
 * @class      Claims (name)
 */
export declare class Claims extends Logger {
    cachedIdentities: any;
    contracts: any;
    encodingEnvelope: string;
    options: ClaimsOptions;
    subjectTypes: any;
    constructor(options: ClaimsOptions);
    /**
     * confirms a claim; this can be done, if a claim has been issued for a subject and the subject
     * wants to confirm it
     *
     * @param      {string}         accountId  account, that performs the action
     * @param      {string}         subject    claim subject
     * @param      {string}         claimId    id of a claim to confirm
     * @return     {Promise<void>}  resolved when done
     */
    confirmClaim(accountId: string, subject: string, claimId: string): Promise<void>;
    /**
     * Creates a new identity for account or contract and registers them on the storage. Returned
     * identity is either a 40B contract address (for account identities) or a 32B idenity hash
     * contract identities
     *
     * @param      {string}           accountId   The account identifier
     * @param      {<type>}           contractId  The contract identifier
     * @return     {Promise<string>}  new identity
     */
    createIdentity(accountId: string, contractId?: string): Promise<string>;
    /**
     * delete a claim. This requires the accountId to have permissions for the parent claim (if claim
     * name seen as a path, the parent 'folder'). Subjects of a claim may only delete it, if they are
     * the issuer as well. If not, they can only react to it by confirming or rejecting the claim.
     *
     * @param      {string}         accountId  account, that performs the action
     * @param      {string}         subject    the subject of the claim
     * @param      {string}         claimId    id of a claim to delete
     * @return     {Promise<void>}  resolved when done
     */
    deleteClaim(accountId: string, subject: string, claimId: string): Promise<void>;
    /**
     * gets claim information for a claim name from a given account; results has the following
     * properties: creationBlock, creationDate, data, description, expirationDate, id, issuer, name,
     * signature, status, subject, topic, uri, valid
     *
     * @param      {string}        subject     subject of the claims
     * @param      {string}        claimName   name (/path) of a claim
     * @param      {boolean}       isIdentity  (optional) indicates if the subject is already an identity
     * @return     {Promise<any[]>}  claim info array
     */
    getClaims(subject: string, claimName: string, isIdentity?: boolean): Promise<any[]>;
    /**
     * gets the identity contract for a given account id or contract
     *
     * @param      {string}        subject  the subject for the identity contract
     * @return     {Promise<any>}  the identity contract instance
     */
    getIdentityForAccount(subject: string): Promise<any>;
    /**
     * checks if a account has already a identity contract
     *
     * @param      {string}            subject  the target subject
     * @return     {Promise<boolean>}  true if identity exists, otherwise false
     */
    identityAvailable(subject: string): Promise<any>;
    /**
     * reject a Claim. This claim will be marked as rejected but not deleted. This is important for
     * tracking reasons. You can also optionally add a reject reason as JSON object to track
     * additional informations about the rejection. Issuer and Subject can reject a special claim.
     *
     * @param      {string}         accountId     account, that performs the action
     * @param      {string}         subject       account, that rejects the claim
     * @param      {string}         claimId       id of a claim to reject
     * @param      {any}            rejectReason  (optional) rejectReason object
     * @return     {Promise<void>}  resolved when done
     */
    rejectClaim(accountId: string, subject: string, claimId: string, rejectReason?: any): Promise<void>;
    /**
     * Sets or creates a claim; this requires the issuer to have permissions for the parent claim (if
     * claim name seen as a path, the parent 'folder').
     *
     * @param      {string}           issuer             issuer of the claim
     * @param      {string}           subject            subject of the claim and the owner of the
     *                                                   claim node
     * @param      {string}           claimName          name of the claim (full path)
     * @param      {number}           expirationDate     expiration date, for the claim, defaults to
     *                                                   `0` (does not expire)
     * @param      {object}           claimValue         json object which will be stored in the claim
     * @param      {string}           descriptionDomain  domain of the claim, this is a subdomain
     *                                                   under 'claims.evan', so passing 'example'
     *                                                   will link claims description to
     *                                                   'example.claims.evan'
     * @return     {Promise<string>}  claimId
     */
    setClaim(issuer: string, subject: string, claimName: string, expirationDate?: number, claimValue?: any, descriptionDomain?: string): Promise<string>;
    /**
     * set description for a claim under a domain owned by given account
     *
     * @param      {string}         accountId    accountId, that performs the description update
     * @param      {string}         topic        name of the claim (full path) to set description
     * @param      {string}         domain       domain of the claim, this is a subdomain under
     *                                           'claims.evan', so passing `example` will link claims
     *                                           description to 'example.claims.evan'
     * @param      {any}            description  description of the claim; can be an Envelope but
     *                                           only public properties are used
     * @return     {Promise<void>}  resolved when done
     */
    setClaimDescription(accountId: string, topic: string, domain: string, description: any): Promise<void>;
    /**
     * validates a given claimId in case of integrity
     *
     * @param      {string}            subject     the subject of the claim
     * @param      {string}            claimId     claim identifier
     * @param      {boolean}           isIdentity  optional indicates if the subject is already an
     *                                             identity
     * @return     {Promise<boolean>}  resolves with true if the claim is valid, otherwise false
     */
    validateClaim(subject: string, claimId: string, isIdentity?: boolean): Promise<boolean>;
    /**
     * validates a whole claim tree if the path is valid (called recursively)
     *
     * @param      {string}          subject     subject of the claim and the owner of the claim node
     * @param      {string}          claimLabel  claim topic of a claim to build the tree for
     * @param      {array}           treeArr     (optional) result tree array, used for recursion
     * @return     {Promise<any[]>}  Array with all resolved claims for the tree
     */
    validateClaimTree(subject: string, claimLabel: string, treeArr?: any[]): Promise<any[]>;
    /**
     * execute contract call on identity, checks if account or contract identity is used and if given
     * subject is alraedy an identity
     *
     * @param      {string}        subject     account/contract with identity or an identity of it
     * @param      {boolean}       isIdentity  true if given subject is an identity
     * @param      {string}        fun         function to call
     * @param      {any[]}         args        arguments for function (exluding the identity (for
     *                                         ClaimsRegistry functions))
     * @return     {Promise<any>}  result of called function
     */
    private callOnIdentity(subject, isIdentity, fun, ...args);
    /**
     * Checks if a storage was initialized before, if not, load the default one.
     *
     * @return     {Promise<void>}  resolved when storage exists or storage was loaded
     */
    private ensureStorage();
    /**
     * execute contract transaction on identity, checks if account or contract identity is used and if
     * given subject is alraedy an identity
     *
     * @param      {string}        subject  account/contract with identity or an identity of it
     * @param      {string}        fun      function to call
     * @param      {any}           options  options for transaction
     * @param      {any[]}         args     arguments for function (exluding the identity (for
     *                                      ClaimsRegistry functions))
     * @return     {Promise<any>}  result of called function
     */
    private executeOnIdentity(subject, fun, options, ...args);
    /**
     * returns full domain for description
     *
     * @param      {string}  topic              claim topic
     * @param      {string}  descriptionDomain  domain of description
     * @return     {string}  full domain
     */
    private getFullDescriptionDomainWithHash(topic, descriptionDomain);
    /**
     * checks if given given subject belongs to an account to a contract
     *
     * @param      {string}           subject     claim subject
     * @param      {boolean}          isIdentity  true if given subject is an identity
     * @return     {Promise<string>}  resolves to 'account' or 'contract'
     */
    private getSubjectType(subject, isIdentity?);
}
