import { PresentationDefinition, PresentationSubmission } from '@sphereon/pe-models'; import { EvaluationResults, SelectResults } from './evaluation'; import { PresentationSignCallBackParams, PresentationSignOptions } from './signing'; import { Presentation, VerifiableCredential, VerifiablePresentation } from './types'; import { Validated } from './validation'; /** * This is the main interfacing class to be used from out side the library to use the functionality provided by the library. */ export declare class PEJS { private _evaluationClientWrapper; constructor(); /*** * The evaluate compares what is expected from a presentation with the presentationDefinition. * * @param presentationDefinition the definition of what is expected in the presentation. * @param presentation the presentation which has to be evaluated in comparison of the definition. * @param limitDisclosureSignatureSuites the credential signature suites that support limit disclosure * * @return the evaluation results specify what was expected and was fulfilled and also specifies which requirements described in the input descriptors * were not fulfilled by the presentation. */ evaluatePresentation(presentationDefinition: PresentationDefinition, presentation: Presentation, limitDisclosureSignatureSuites?: string[]): EvaluationResults; /*** * The evaluate compares what is expected from a verifiableCredentials with the presentationDefinition. * * @param presentationDefinition the definition of what is expected in the presentation. * @param verifiableCredentials the verifiable credentials which are candidates to fulfill requirements defined in the presentationDefinition param. * @param holderDIDs the list of the DIDs that the wallet holders controlls. * @param limitDisclosureSignatureSuites the credential signature suites that support limit disclosure * * @return the evaluation results specify what was expected and was fulfilled and also specifies which requirements described in the input descriptors * were not fulfilled by the verifiable credentials. */ evaluateCredentials(presentationDefinition: PresentationDefinition, verifiableCredentials: VerifiableCredential[], holderDIDs: string[], limitDisclosureSignatureSuites: string[]): EvaluationResults; /** * The getSelectableCredentials method is a helper function that helps filter out the verifiable credentials which can not be selected and returns * the selectable credentials. * * @param presentationDefinition the definition of what is expected in the presentation. * @param verifiableCredentials verifiable credentials are the credentials from wallet provided to the library to find selectable credentials. * @param holderDIDs the decentralized identity of the wallet holder. This is used to identify the credentials issued to the holder of wallet. * @param limitDisclosureSignatureSuites the credential signature suites that support limit disclosure * * @return the selectable credentials. */ selectFrom(presentationDefinition: PresentationDefinition, verifiableCredentials: VerifiableCredential[], holderDIDs: string[], limitDisclosureSignatureSuites: string[]): SelectResults; /** * This method helps create a submittablePresentation. A submittablePresentation after signing becomes a Presentation. And can be sent to * the verifier after signing it. * * @param presentationDefinition the definition of what is expected in the presentation. * @param selectedCredential the credentials which were declared selectable by getSelectableCredentials and then chosen by the intelligent-user * (e.g. human). * @param holderDID optional; the decentralized identity of the wallet holder. This is used to identify the holder of the presentation. * * @return the presentation. */ presentationFrom(presentationDefinition: PresentationDefinition, selectedCredential: VerifiableCredential[], holderDID?: string): Presentation; private static getPresentation; /** * This method validates whether an object is usable as a presentation definition or not. * * @param presentationDefinition the object to be validated. * * @return the validation results to reveal what is acceptable/unacceptable about the passed object to be considered a valid presentation definition */ validateDefinition(presentationDefinition: PresentationDefinition): Validated; /** * This method validates whether an object is usable as a presentation submission or not. * * @param presentationSubmission the object to be validated. * * @return the validation results to reveal what is acceptable/unacceptable about the passed object to be considered a valid presentation submission */ validateSubmission(presentationSubmission: PresentationSubmission): Validated; /** * This method can be used to combine a definition, selected Verifiable Credentials, together with * signing options and a callback to sign a presentation, making it a Verifiable Presentation before sending. * * Please note that PE-JS has no signature support on purpose. We didn't want this library to depend on all kinds of signature suites. * The callback function next to the Signing Params also gets a Presentation which is evaluated against the definition. * It is up to you to decide whether you simply update the supplied partial proof and add it to the presentation in the callback, * or whether you will use the selected Credentials, Presentation definition, evaluation results and/or presentation submission together with the signature options * * @param presentationDefinition the Presentation Definition * @param selectedCredentials the PE-JS and/or User selected/filtered credentials that will become part of the Verifiable Presentation * @param signingCallBack the function which will be provided as a parameter. And this will be the method that will be able to perform actual * signing. One example of signing is available in the project named. pe-selective-disclosure. * @param options: Signing Params these are the signing params required to sign. * * @return the signed and thus Verifiable Presentation. */ verifiablePresentationFrom(presentationDefinition: PresentationDefinition, selectedCredentials: VerifiableCredential[], signingCallBack: (callBackParams: PresentationSignCallBackParams) => VerifiablePresentation, options: PresentationSignOptions): VerifiablePresentation; }