import { IAgentContext, IPluginMethodMap } from '@veramo/core' export interface IQRCodeGenerator extends IPluginMethodMap { qrDIDCommOobInvitationElement( args: CreateElementArgs, context: IRequiredContext ): Promise qrDIDCommOobInvitationValue( args: CreateValueArgs, context: IRequiredContext ): Promise qrSIOPv2Element(args: CreateElementArgs, context: IRequiredContext): Promise qrSIOPv2Value(args: CreateValueArgs, context: IRequiredContext): Promise qrURIElement(args: CreateElementArgs, context: IRequiredContext): Promise qrOpenID4VCIElement(args: CreateElementArgs, context: IRequiredContext): Promise qrOpenID4VCIValue(args: CreateValueArgs, context: IRequiredContext): Promise } export interface CreateValueArgs { onGenerate?: (result: ValueResult) => void data: QRData } export interface CreateElementArgs extends CreateValueArgs { renderingProps: QRRenderingProps } export interface ValueResult { id: string value: string data: QRData renderingProps?: QRRenderingProps context?: IRequiredContext } export enum QRType { URI = 'uri', SIOPV2 = 'openid-vc', DIDCOMM_V2_OOB_INVITATION = 'https://didcomm.org/out-of-band/2.0/invitation', OpenID4VCI = 'openid-credential-offer', } export type SIOPv2Scheme = 'openid' | 'openid-vc' | string export interface SIOPv2DataWithScheme { scheme?: SIOPv2Scheme requestUri: string } export type OpenID4VCIScheme = 'openid-credential-offer' | 'https' | string export interface OpenID4VCIDataWithScheme { scheme?: OpenID4VCIScheme baseUri?: string credentialOfferUri?: string credentialOffer?: string } export interface DIDCommV2OOBInvitationData { baseURI: string oobInvitation: DIDCommV2OOBInvitation } /** * { * "type": "https://didcomm.org/out-of-band/2.0/invitation", * "id": "599f3638-b563-4937-9487-dfe55099d900", * "from": "did:example:verifier", * "body": { * "goal_code": "streamlined-vp", * "accept": ['didcomm/v2'] * } * } */ export interface DIDCommV2OOBInvitation { type: 'https://didcomm.org/out-of-band/2.0/invitation' id: string from: DID body: Body } export type URIData = string export type DID = string export interface Body { goal_code: GoalCode accept: [AcceptMode] } export type GoalCode = 'streamlined-vp' | 'streamlined-vc' export type AcceptMode = 'didcomm/v2' | string /*OIDC4VP = 'oidc4vp', SIOPV2_WITH_OIDC4VP = 'siopv2+oidc4vp', SIOP_V2 = 'siopv2',*/ export enum StatusCode { OK = 'OK', CREATED = 'CREATED', } export interface QRData { id: string type: T object: D } export interface QRRenderingProps { bgColor?: string fgColor?: string level?: 'L' | 'M' | 'Q' | 'H' size?: number title?: string } export enum events { QR_CODE_CODE_CREATED = 'QrCodeCreated', } export type IRequiredContext = IAgentContext>