import { DisplayableIdentity } from './types/index.js';
import { Base64String, CertificateFieldNameUnder50Bytes, DiscoverByAttributesArgs, DiscoverByIdentityKeyArgs, IdentityCertificate, OriginatorDomainNameStringUnder250Bytes, PubKeyHex, WalletCertificate, WalletInterface } from '../wallet/index.js';
import { BroadcastFailure, BroadcastResponse } from '../transaction/index.js';
import { Contact } from './ContactsManager.js';
/** Options for {@link IdentityClient.resolveByIdentityKey}. */
export interface ResolveByIdentityKeyOptions {
    /** Default `true`. If `false`, contacts are skipped and the overlay is queried directly. */
    overrideWithContacts?: boolean;
    /**
     * Default `false`. When `true`, fire contacts and overlay in parallel (legacy behavior) instead
     * of short-circuiting on a contacts hit. Use when callers specifically need a fresh overlay
     * answer alongside the contact record.
     */
    parallel?: boolean;
}
/** Options for {@link IdentityClient.resolveByAttributes}. */
export interface ResolveByAttributesOptions {
    /** Default `true`. If `false`, contacts are skipped and the overlay is queried directly. */
    overrideWithContacts?: boolean;
    /**
     * Default `false`. When `true`, fire contacts and overlay in parallel (legacy behavior). The
     * contacts-first path tries to match the supplied attributes against the locally-stored
     * contacts; if any contact matches every attribute, the overlay is skipped.
     */
    parallel?: boolean;
}
/**
 * IdentityClient lets you discover who others are, and let the world know who you are.
 */
export declare class IdentityClient {
    private readonly options;
    private readonly originator?;
    private readonly wallet;
    private readonly contactsManager;
    constructor(wallet?: WalletInterface, options?: import("./types/index.js").IdentityClientOptions, originator?: OriginatorDomainNameStringUnder250Bytes);
    /**
     * Publicly reveals selected fields from a given certificate by creating a publicly verifiable certificate.
     * The publicly revealed certificate is included in a blockchain transaction and broadcast to a federated overlay node.
     *
     * @param {Certificate} certificate - The master certificate to selectively reveal.
     * @param {CertificateFieldNameUnder50Bytes[]} fieldsToReveal - An array of certificate field names to reveal. Only these fields will be included in the public certificate.
     *
     * @returns {Promise<object>} A promise that resolves with the broadcast result from the overlay network.
     * @throws {Error} Throws an error if the certificate is invalid, the fields cannot be revealed, or if the broadcast fails.
     */
    publiclyRevealAttributes(certificate: WalletCertificate, fieldsToReveal: CertificateFieldNameUnder50Bytes[]): Promise<BroadcastResponse | BroadcastFailure>;
    /**
     * Resolves displayable identity certificates, issued to a given identity key by a trusted certifier.
     *
     * By default, contacts are consulted first and the overlay is only queried on a contacts miss.
     * Pass `{ parallel: true }` to fire both in parallel (the legacy behavior, useful when callers
     * specifically want a fresh overlay answer even when a contact exists).
     *
     * @param args - Arguments for requesting the discovery based on the identity key.
     * @param overrideWithContacts - Whether to consult personal contacts. Default true. When `false`,
     *   contacts are skipped entirely and the overlay is queried directly. Boolean kept for legacy
     *   call sites; new code should prefer the options-object form.
     * @returns The promise resolves to displayable identities.
     */
    resolveByIdentityKey(args: DiscoverByIdentityKeyArgs, overrideWithContacts?: boolean | ResolveByIdentityKeyOptions): Promise<DisplayableIdentity[]>;
    /**
     * Resolves displayable identity certificates by specific identity attributes, issued by a trusted entity.
     *
     * By default, contacts are consulted first: if any contact matches, the overlay call is skipped
     * entirely. Set `parallel: true` to keep the legacy parallel behavior.
     *
     * @param args - Attributes and optional parameters used to discover certificates.
     * @param overrideWithContacts - Whether to consult personal contacts. Default true. Boolean kept
     *   for legacy call sites; new code should prefer the options-object form.
     * @returns The promise resolves to displayable identities.
     */
    resolveByAttributes(args: DiscoverByAttributesArgs, overrideWithContacts?: boolean | ResolveByAttributesOptions): Promise<DisplayableIdentity[]>;
    /**
     * Best-effort match of contacts against a `DiscoverByAttributesArgs.attributes` shape.
     * Used by the contacts-first path of {@link resolveByAttributes} to decide whether the overlay
     * can be skipped. Compares string-valued attributes against same-named fields on the contact's
     * decrypted record. Returns the subset of contacts that match every supplied attribute.
     */
    private matchContactsByAttributes;
    /**
     * Remove public certificate revelation from overlay services by spending the identity token
     * @param serialNumber - Unique serial number of the certificate to revoke revelation
     */
    revokeCertificateRevelation(serialNumber: Base64String): Promise<void>;
    /**
     * Load all records from the contacts basket
     * @param identityKey Optional specific identity key to fetch
     * @param forceRefresh Whether to force a check for new contact data
     * @param limit Optional limit on number of contacts to fetch
     * @returns A promise that resolves with an array of contacts
     */
    getContacts(identityKey?: PubKeyHex, forceRefresh?: boolean, limit?: number): Promise<Contact[]>;
    /**
     * Save or update a Metanet contact
     * @param contact The displayable identity information for the contact
     * @param metadata Optional metadata to store with the contact (ex. notes, aliases, etc)
     */
    saveContact(contact: DisplayableIdentity, metadata?: Record<string, any>): Promise<void>;
    /**
     * Remove a contact from the contacts basket
     * @param identityKey The identity key of the contact to remove
     */
    removeContact(identityKey: PubKeyHex): Promise<void>;
    /**
     * Parse out identity and certifier attributes to display from an IdentityCertificate
     * @param identityToParse - The Identity Certificate to parse
     * @returns - IdentityToDisplay
     */
    static parseIdentity(identityToParse: IdentityCertificate): DisplayableIdentity;
    /**
     * Helper to check if a value is a non-empty string
     */
    private static hasValue;
    /**
     * Try to parse identity information from unknown certificate types
     * by checking common field names
     */
    private static tryToParseGenericIdentity;
}
//# sourceMappingURL=IdentityClient.d.ts.map