import { ContractLoader, Executor, NameResolver, Logger, LoggerOptions } from '@evan.network/dbcp';
/**
 * type of modification in contraction
 */
export declare enum ModificationType {
    Set = "0xd2f67e6aeaad1ab7487a680eb9d3363a597afa7a3de33fa9bf3ae6edcb88435d",
    Remove = "0x8dd27a19ebb249760a6490a8d33442a54b5c3c8504068964b74388bfe83458be",
}
/**
 * property to set in contract
 */
export declare enum PropertyType {
    Entry = "0x84f3db82fb6cd291ed32c6f64f7f5eda656bda516d17c6bc146631a1f05a1833",
    ListEntry = "0x7da2a80303fd8a8b312bb0f3403e22702ece25aa85a5e213371a770a74a50106",
}
export interface RightsAndRolesOptions extends LoggerOptions {
    contractLoader: ContractLoader;
    executor: Executor;
    nameResolver: NameResolver;
    web3: any;
}
/**
 * Rights and Roles helper for managing contract permissions
 *
 * @class      RightsAndRoles (name)
 */
export declare class RightsAndRoles extends Logger {
    options: RightsAndRolesOptions;
    constructor(options: RightsAndRolesOptions);
    /**
     * check if given account can use operation (capability) on given contract; operation hashes can
     * be build with `getOperationCapabilityHash`
     *
     * @param      {string|any}  contract   contract to check for
     * @param      {string}      accountId  account id to check call for
     * @param      {string}      hash       hash from `getOperationCapabilityHash`
     */
    canCallOperation(contract: string | any, accountId: string, hash: string): Promise<boolean>;
    /**
     * returns all roles with all members
     *
     * @param      {any|string}    contract  contractId or contract instance
     * @return     {Promise<any>}  Object with mapping roleId -> [accountId, accountId,...]
     */
    getMembers(contract: any | string): Promise<any>;
    /**
     * get hash for operation capability, this creates the hashes, that are used in
     * `DSRolesPerContract` to check operation capabilities
     *
     * @param      {string}            name              property name
     * @param      {PropertyType}      propertyType      type of property
     * @param      {ModificationType}  modificationType  set or remove
     * @return     {string}            bytes32 hash as string
     */
    getOperationCapabilityHash(name: string, propertyType: PropertyType, modificationType: ModificationType): string;
    /**
     * allows or denies contract function for the accountId
     *
     * @param      {string|any}     contract           contractId or contract instance
     * @param      {string}         accountId          executing accountId
     * @param      {number}         role               roleid
     * @param      {string}         functionSignature  4 Bytes function signature
     * @param      {boolean}        allow              allow or deny function
     * @return     {Promise<void>}  resolved when done
     */
    setFunctionPermission(contract: string | any, accountId: string, role: number, functionSignature: string, allow: boolean): Promise<void>;
    /**
     * allows or denies setting properties on a contract
     *
     * @param      {string|any}        contract          contractId or contract instance
     * @param      {string}            accountId         executing accountId
     * @param      {number}            role              roleId
     * @param      {string}            propertyName      target property name
     * @param      {PropertyType}      propertyType      list or entry
     * @param      {ModificationType}  modificationType  set or remove
     * @param      {boolean}           allow             allow or deny
     * @return     {Promise<void>}     resolved when done
     */
    setOperationPermission(contract: string | any, accountId: string, role: number, propertyName: string, propertyType: PropertyType, modificationType: ModificationType, allow: boolean): Promise<void>;
    /**
     * adds the target account to a specific role
     *
     * @param      {string|any}     contract         contractId or contract instance
     * @param      {string}         accountId        executing accountId
     * @param      {string}         targetAccountId  target accountId
     * @param      {number}         role             roleId
     * @return     {Promise<void>}  resolved when done
     */
    addAccountToRole(contract: string | any, accountId: string, targetAccountId: string, role: number): Promise<void>;
    /**
     * returns true or false, depending on if the account has the specific role
     * @deprecated second argument "accountId" will be dropped, as it isnt' required anymore
     *
     * @param      {string|any}        contract         contractId or contract instance
     * @param      {string}            accountId        executing accountId
     * @param      {string}            targetAccountId  to be checked accountId
     * @param      {number}            role             roleId
     * @return     {Promise<boolean>}  true is given user as specified role
     */
    hasUserRole(contract: string | any, accountId: string, targetAccountId: string, role: number): Promise<any>;
    /**
     * removes target account from a specific role
     *
     * @param      {string|any}     contract         contractId or contract instance
     * @param      {string}         accountId        executing accountId
     * @param      {string}         targetAccountId  target accountId
     * @param      {number}         role             roleId
     * @return     {Promise<void>}  resolved when done
     */
    removeAccountFromRole(contract: string | any, accountId: string, targetAccountId: string, role: number): Promise<void>;
    /**
     * transfer ownership of a contract and its authority to another account
     *
     * @param      {string|any}     contract         contractId or contract instance
     * @param      {string}         accountId        executing accountId
     * @param      {string}         targetAccountId  target accountId
     * @return     {Promise<void>}  resolved when done
     */
    transferOwnership(contract: string | any, accountId: string, targetAccountId: string): Promise<void>;
}
