import { KnownJwaSignatureAlgorithm } from "../kms/jwk/jwa.js";
import { W3cCredential } from "./models/credential/W3cCredential.js";
import { ClaimFormat } from "./models/ClaimFormat.js";
import { W3cJsonLdVerifiableCredential } from "./data-integrity/models/W3cJsonLdVerifiableCredential.js";
import { W3cJwtVerifiableCredential } from "./jwt-vc/W3cJwtVerifiableCredential.js";
import { W3cVerifiableCredential } from "./models/credential/W3cVerifiableCredential.js";
import { W3cPresentation } from "./models/presentation/W3cPresentation.js";
import { W3cJwtVerifiablePresentation } from "./jwt-vc/W3cJwtVerifiablePresentation.js";
import { W3cJsonLdVerifiablePresentation } from "./data-integrity/models/W3cJsonLdVerifiablePresentation.js";
import { ProofPurpose } from "./data-integrity/proof-purposes/ProofPurpose.js";
import { SingleOrArray } from "../../types.js";

//#region src/modules/vc/W3cCredentialServiceOptions.d.ts
type W3cSignCredentialOptions<Format extends ClaimFormat.JwtVc | ClaimFormat.LdpVc | undefined = undefined> = Format extends ClaimFormat.JwtVc ? W3cJwtSignCredentialOptions : Format extends ClaimFormat.LdpVc ? W3cJsonLdSignCredentialOptions : W3cJwtSignCredentialOptions | W3cJsonLdSignCredentialOptions;
type W3cVerifyCredentialOptions<Format extends ClaimFormat.JwtVc | ClaimFormat.LdpVc | undefined = undefined> = Format extends ClaimFormat.JwtVc ? W3cJwtVerifyCredentialOptions : Format extends ClaimFormat.LdpVc ? W3cJsonLdVerifyCredentialOptions : W3cJwtVerifyCredentialOptions | W3cJsonLdVerifyCredentialOptions;
type W3cSignPresentationOptions<Format extends ClaimFormat.JwtVp | ClaimFormat.LdpVp | undefined = undefined> = Format extends ClaimFormat.JwtVp ? W3cJwtSignPresentationOptions : Format extends ClaimFormat.LdpVp ? W3cJsonLdSignPresentationOptions : W3cJwtSignPresentationOptions | W3cJsonLdSignPresentationOptions;
type W3cVerifyPresentationOptions = W3cJwtVerifyPresentationOptions | W3cJsonLdVerifyPresentationOptions;
interface W3cSignCredentialOptionsBase {
  /**
   * The format of the credential to be signed.
   *
   * @see https://identity.foundation/claim-format-registry
   */
  format: ClaimFormat;
  /**
   * The credential to be signed.
   */
  credential: W3cCredential;
  /**
   * URI of the verificationMethod to be used for signing the credential.
   *
   * Must be a valid did url pointing to a key.
   */
  verificationMethod: string;
}
interface W3cJwtSignCredentialOptions extends W3cSignCredentialOptionsBase {
  format: ClaimFormat.JwtVc;
  /**
   * The alg to be used for signing the credential.
   *
   * Must be a valid JWA signature algorithm.
   */
  alg: KnownJwaSignatureAlgorithm;
}
interface W3cJsonLdSignCredentialOptions extends W3cSignCredentialOptionsBase {
  /**
   * The format of the credential to be signed. Must be either `jwt_vc` or `ldp_vc`.
   * @see https://identity.foundation/claim-format-registry
   */
  format: ClaimFormat.LdpVc;
  /**
   * The proofType to be used for signing the credential.
   *
   * Must be a valid Linked Data Signature suite.
   */
  proofType: string;
  proofPurpose?: ProofPurpose;
  created?: string;
}
interface W3cVerifyCredentialOptionsBase {
  credential: unknown;
  /**
   * Whether to verify the credentialStatus, if present.
   */
  verifyCredentialStatus?: boolean;
}
interface W3cJwtVerifyCredentialOptions extends W3cVerifyCredentialOptionsBase {
  credential: W3cJwtVerifiableCredential | string;
}
interface W3cJsonLdVerifyCredentialOptions extends W3cVerifyCredentialOptionsBase {
  credential: W3cJsonLdVerifiableCredential;
  proofPurpose?: ProofPurpose;
}
interface W3cCreatePresentationOptions {
  credentials: SingleOrArray<W3cVerifiableCredential>;
  id?: string;
  holder?: string;
}
interface W3cSignPresentationOptionsBase {
  /**
   * The format of the presentation to be signed.
   *
   * @see https://identity.foundation/claim-format-registry
   */
  format: ClaimFormat;
  /**
   * The presentation to be signed.
   */
  presentation: W3cPresentation;
  /**
   * URI of the verificationMethod to be used for signing the presentation.
   *
   * Must be a valid did url pointing to a key.
   */
  verificationMethod: string;
  /**
   * The challenge / nonce to be used in the proof to prevent replay attacks.
   */
  challenge?: string;
  /**
   * The domain / aud to be used in the proof to assert the intended recipient.
   */
  domain?: string;
}
interface W3cJsonLdSignPresentationOptions extends W3cSignPresentationOptionsBase {
  format: ClaimFormat.LdpVp;
  /**
   * The proofType to be used for signing the presentation.
   *
   * Must be a valid Linked Data Signature suite.
   */
  proofType: string;
  proofPurpose: ProofPurpose;
}
interface W3cJwtSignPresentationOptions extends W3cSignPresentationOptionsBase {
  format: ClaimFormat.JwtVp;
  /**
   * The alg to be used for signing the presentation.
   *
   * Must be a valid JWA signature algorithm.
   */
  alg: KnownJwaSignatureAlgorithm;
}
interface W3cVerifyPresentationOptionsBase {
  /**
   * The presentation to be verified.
   */
  presentation: unknown;
  /**
   * The challenge / nonce that must present in the presentation prevent replay attacks.
   */
  challenge: string;
  /**
   * The domain / aud to be used in the proof to assert the intended recipient.
   */
  domain?: string;
  /**
   * Whether to verify the credentialStatus, if present.
   */
  verifyCredentialStatus?: boolean;
}
interface W3cJwtVerifyPresentationOptions extends W3cVerifyPresentationOptionsBase {
  presentation: W3cJwtVerifiablePresentation | string;
}
interface W3cJsonLdVerifyPresentationOptions extends W3cVerifyPresentationOptionsBase {
  presentation: W3cJsonLdVerifiablePresentation;
  purpose?: ProofPurpose;
}
interface W3cStoreCredentialOptions {
  credential: W3cVerifiableCredential;
}
//#endregion
export { W3cCreatePresentationOptions, W3cJsonLdSignCredentialOptions, W3cJsonLdSignPresentationOptions, W3cJsonLdVerifyCredentialOptions, W3cJsonLdVerifyPresentationOptions, W3cJwtSignCredentialOptions, W3cJwtSignPresentationOptions, W3cJwtVerifyCredentialOptions, W3cJwtVerifyPresentationOptions, W3cSignCredentialOptions, W3cSignPresentationOptions, W3cStoreCredentialOptions, W3cVerifyCredentialOptions, W3cVerifyPresentationOptions };
//# sourceMappingURL=W3cCredentialServiceOptions.d.ts.map