import { JWTPayload } from '@tonomy/did-jwt/lib/JWT';
import { DIDurl, URL, JWT, JWTVCPayload } from './types';
import { Issuer, VerifiedCredential } from '@tonomy/did-jwt-vc';
import { Serializable } from '../serializable';
/**
 * A W3C Verifiable Credential
 */
export declare class VerifiableCredential<T extends object = object> {
    private decodedJwt;
    private jwt;
    /**
     * @param {JWT} jwt - a JWT string
     *
     * @returns {VerifiableCredential} a VerifiableCredential object
     */
    constructor(jwt: JWT);
    /**
     * Returns the payload of the JWT
     *
     * @returns {JWTPayload} the payload of the JWT
     */
    getPayload(): JWTPayload;
    /**
     * Returns the vc object of the JWT
     *
     * @returns {JWTVCPayload} the vc object
     */
    getVc(): JWTVCPayload;
    /**
     * Returns the credentialSubject object of the Verifiable Credential
     *
     * @returns {any} the credentialSubject object
     */
    getCredentialSubject(): T;
    /**
     * Returns the issuer of the Verifiable Credential
     *
     * @returns {DIDurl | undefined} the issuer
     */
    getIssuer(): DIDurl;
    /**
     * Returns the subject of the Verifiable Credential
     *
     * @returns {DIDurl | undefined} the subject of the Verifiable Credential
     */
    getSubject(): DIDurl | undefined;
    /**
     * Returns the ID of the Verifiable Credential
     *
     * @returns {URL | undefined} the id
     */
    getId(): URL | undefined;
    /**
     * Returns the audience of the Verifiable Credential
     *
     * @returns {DIDurl | DIDurl[] | undefined} the audience
     */
    getAudience(): DIDurl | DIDurl[] | undefined;
    /**
     * Returns the expiration of the Verifiable Credential
     *
     * @returns {Date | undefined} the expiration
     */
    getExpiration(): Date | undefined;
    /**
     * Returns the issued time of the Verifiable Credential
     *
     * @returns {Date | undefined} the issued time
     */
    getIssuedAt(): Date | undefined;
    /**
     * Returns the time the verifiable credential is valid after
     *
     * @returns {Date | undefined} the time the verifiable credential is valid after
     */
    getNotBefore(): Date | undefined;
    /**
     * Verifies the Verifiable Credential is signed by the issuer
     *
     * @returns {Promise<VerifiedCredential>} the verified credential
     * @throws {Error} if the Verifiable Credential is not signed correctly by the issuer
     */
    verify(): Promise<VerifiedCredential>;
    /**
     * Creates a new Verifiable Credential object signed by the issuer
     *
     * @param {DIDurl} id - the id of the Verifiable Credential
     * @param {string[]} type - the type of the Verifiable Credential
     * @param {object} credentialSubject - the credential subject of the Verifiable Credential
     * @param {Issuer} issuer - the issuer of the Verifiable Credential
     * @property {URL} [options.subject] - the subject of the Verifiable Credential
     *
     * @returns {Promise<VerifiableCredential>} the Verifiable Credential
     */
    static sign<T extends object = object>(id: DIDurl, type: string | string[], credentialSubject: T, issuer: Issuer, options?: {
        subject?: URL;
    }): Promise<VerifiableCredential<T>>;
    /**
     * Returns the JWT string
     *
     * @returns {string} the JWT string
     */
    toString(): string;
    /**
     * Returns the JSON string representation of the object - which is the jwt string
     *
     * @description This is used in JSON.stringify(). It is not recommended to use this method directly.
     * Only the jwt is returned, not the full object. This is all that is needed to reconstruct the
     * full object in the constructor, and thus minimizes the size of the JSON string.
     *
     * @override Serializable.toJSON
     * @returns {string} the jwt
     */
    toJSON(): string;
}
export type VerifiableCredentialOptions = {
    subject?: URL;
    additionalTypes?: string[];
};
export type VCWithTypeType<T extends object = object> = VerifiableCredential<{
    payload: T;
    type: string;
}> | VerifiableCredentialWithType<T> | JWT;
/**
 * A wrapper that adds a type object to VCs to allow for identification, and presents a simper interface
 *
 * This is the base class. It is expected that extension classes will be created for the different VC types.
 *
 * @inheritdoc sign() is a protected alternative constructor. In child classes, a new alternative constructor
 * should be created which returns the child class type.
 * @inheritdoc protected "type" property should be overridden in child classes with the name of the class
 * @inheritdoc if the payload type requires ad-hoc decoding, override the constructor and decode the payload
 *
 * @example see an example of the above in the LoginRequestMessage class in `../..services/communication/messages.ts`
 */
export declare class VerifiableCredentialWithType<T extends object = object> implements Serializable {
    private vc;
    protected decodedPayload: T;
    protected static type: string;
    /**
     *
     * @param vc the VC to wrap
     *
     * @inheritdoc override me if the payload type requires ad-hoc decoding
     */
    constructor(vc: VCWithTypeType<T>);
    /**
     * Creates a signed VC object
     *
     * @access protected
     *
     * @param {object} payload the payload
     * @param {Issuer} issuer the issuer id
     * @param {VerifiableCredentialOptions} options the options
     *
     * @returns a VC object
     */
    protected static sign<T extends object = object>(payload: T, issuer: Issuer, options?: VerifiableCredentialOptions): Promise<VerifiableCredentialWithType<T>>;
    /**
     * Returns the type of the VC
     * @returns {string} the class type of the VC
     */
    static getType(): string;
    /**
     * Returns the internal Verifiable Credential
     * @returns {VerifiableCredential} the VC
     */
    getVc(): VerifiableCredential<{
        payload: T;
        type: string;
    }>;
    /**
     * Returns the issuer of the payload
     * @returns {DIDurl} the payload issuer
     */
    getIssuer(): DIDurl;
    /**
     * Returns the payload
     * @returns {object} the payload
     */
    getPayload(): T;
    /**
     * Returns the payload type used to determine what kind of payload it is
     * @returns {string | undefined} the payload type
     */
    getType(): string | undefined;
    /**
     * Verifies that the VC is signed by the issuer
     *
     * @returns {Promise<boolean>} true if the VC is signed by the issuer
     * @throws {Error} if the VC is not signed by the issuer
     */
    verify(): Promise<boolean>;
    /**
     * Returns the JWT string
     *
     * @returns {string} the JWT string
     */
    toString(): string;
    /**
     * Returns the JSON string representation of the object - which is the jwt string
     *
     * @description This is used in JSON.stringify(). It is not recommended to use this method directly.
     * Only the jwt is returned, not the full object. This is all that is needed to reconstruct the
     * full object in the constructor, and thus minimizes the size of the JSON string.
     *
     * @override Serializable.toJSON
     * @returns {string} the jwt
     */
    toJSON(): string;
}
//# sourceMappingURL=vc.d.ts.map