/// <reference types="node" />
import Long from "long";
import { Message, Properties } from "protobufjs/light";
import { IIdentity } from "./identity-wrapper";
import Rules from "./rules";
/**
 * Distributed Access Right Controls
 */
export default class Darc extends Message<Darc> {
    /**
     * Get the id of the darc
     * @returns the id as a buffer
     */
    readonly id: Buffer;
    static readonly ruleSign = "_sign";
    /**
     * Create a list of rules with basic permissions for owners and signers
     * @param owners those allow to evolve the darc
     * @param signers those allow to sign
     * @returns the list of rules
     */
    static initRules(owners: IIdentity[], signers: IIdentity[]): Rules;
    /**
     * Creates a basic darc using the owners and signers to populate the
     * rules.
     * @param owners    those you can evolve the darc
     * @param signers   those you can sign
     * @param desc      the description of the darc
     * @returns the new darc
     */
    static createBasic(owners: IIdentity[], signers: IIdentity[], desc?: Buffer, rules?: string[]): Darc;
    /**
     * @see README#Message classes
     */
    static register(): void;
    readonly version: Long;
    readonly description: Buffer;
    readonly baseID: Buffer;
    readonly prevID: Buffer;
    readonly rules: Rules;
    constructor(properties?: Properties<Darc>);
    /**
     * Get the id of the genesis darc
     * @returns the id as a buffer
     */
    getBaseID(): Buffer;
    /**
     * Append an identity to a rule using the given operator when
     * it already exists
     * @param rule      the name of the rule
     * @param identity  the identity to append to the rule
     * @param op        the operator to use if necessary
     */
    addIdentity(rule: string, identity: IIdentity, op: string): void;
    /**
     * Copy and evolve the darc to the next version so that it can be
     * changed and proposed to byzcoin.
     * @returns a new darc
     */
    evolve(): Darc;
    /**
     * Get a string representation of the darc
     * @returns the string representation
     */
    toString(): string;
    /**
     * Helper to encode the darc using protobuf
     * @returns encoded darc as a buffer
     */
    toBytes(): Buffer;
    /**
     * Returns a deep copy of the darc.
     */
    copy(): Darc;
    /**
     * Checks whether the given rule can be matched by a multi-signature created by all
     * signers. If the rule doesn't exist, it throws an error.
     * Currently restrictions:
     *  - only Rule.OR are supported. A Rule.AND or "(" will return an error.
     *  - only one identity can be checked. If more identities are given, the function
     *  returns an error.
     *
     * @param action the action to match
     * @param signers all supposed signers for this action.
     * @return the set of identities that match the rule.
     */
    ruleMatch(action: string, signers: IIdentity[], getDarc: (id: Buffer) => Promise<Darc>): Promise<IIdentity[]>;
}
