UNPKG

@vecrea/oid4vc-prex

Version:

A TypeScript library for handling OpenID for Verifiable Credentials (OID4VC) Presentation Exchange operations

49 lines (48 loc) 1.91 kB
import { JsonParser } from '../JsonParser'; import { Result } from '@vecrea/oid4vc-core/utils'; import { JsonObject, PresentationSubmission, PresentationSubmissionJSON } from '../types'; /** * The key under which a presentation definition is expected to be found * as defined in Presentation Exchange specification */ export declare const presentationDefinitionKey = "presentation_definition"; /** * The key under which a presentation submission is expected to be found * as defined in Presentation Exchange specification */ export declare const presentationSubmissionKey = "presentation_submission"; /** * The location where the presentation submission is embedded * @enum * @see https://identity.foundation/presentation-exchange/spec/v2.0.0/#embed-locations */ export declare enum PresentationSubmissionEmbedLocation { JWT = 0, OIDC = 1, DIDComms = 2, VP = 3, CHAPI = 4 } /** * Namespace for presentation submission embed location * @namespace */ export declare namespace PresentationSubmissionEmbedLocation { /** * Extracts the presentation submission from a JSON object * @param {PresentationSubmissionEmbedLocation} location the location where the presentation submission is embedded * @param {JsonObject} json the JSON object * @return {PresentationSubmissionJSON | undefined} the presentation submission or undefined if not found */ function extractFrom(location: PresentationSubmissionEmbedLocation, json: JsonObject): PresentationSubmissionJSON | undefined; } /** * Default JSON parser implementation */ export declare const DefaultJsonParser: JsonParser; /** * Maps a JSON object to a presentation submission * @param {JsonObject} json the JSON object * @return {Promise<Result<PresentationSubmission>>} the presentation submission */ export declare const mapToPS: (json: JsonObject) => Promise<Result<PresentationSubmission>>;