@vecrea/oid4vc-prex
Version:
A TypeScript library for handling OpenID for Verifiable Credentials (OID4VC) Presentation Exchange operations
69 lines (68 loc) • 2.08 kB
TypeScript
import { z } from 'zod';
import { InputDescriptorId } from './InputDescriptorId';
import { Name } from './Name';
import { Purpose } from './Purpose';
import { Format, FormatJSON } from './Format';
import { Constraints, ConstraintsJSON } from './Constraints';
import { Group } from './Group';
/**
* Zod schema for InputDescriptor
* @type {z.ZodObject}
* @property {string} id
* @property {string} name
* @property {string} purpose
* @property {FormatJSON} format
* @property {ConstraintsJSON} constraints
* @property {string[]} group
*/
export declare const inputDescriptorSchema: z.ZodType<InputDescriptorJSON>;
/**
* Type of InputDescriptor JSON
*/
export type InputDescriptorJSON = {
id: string;
name?: string;
purpose?: string;
format?: FormatJSON;
constraints: ConstraintsJSON;
group?: string[];
};
/**
* Represents an InputDescriptor
* @class
* @property {InputDescriptorId} id
* @property {Name} name
* @property {Purpose} purpose
* @property {Format} format
* @property {Constraints} constraints
* @property {Group[]} groups
*/
export declare class InputDescriptor {
id: InputDescriptorId;
name: Name | undefined;
purpose: Purpose | undefined;
format: Format | undefined;
constraints: Constraints;
groups: Group[] | undefined;
/**
* Constructor for InputDescriptor
* @property {InputDescriptorId} id
* @property {Name} name
* @property {Purpose} purpose
* @property {Format} format
* @property {Constraints} constraints
* @property {Group[]} groups
*/
constructor(id: InputDescriptorId, name: Name | undefined, purpose: Purpose | undefined, format: Format | undefined, constraints: Constraints, groups: Group[] | undefined);
/**
* Converts JSON to InputDescriptor
* @param {InputDescriptorJSON} json
* @returns {InputDescriptor}
*/
static fromJSON(json: InputDescriptorJSON): InputDescriptor;
/**
* Converts InputDescriptor to JSON
* @returns {InputDescriptorJSON}
*/
toJSON(): InputDescriptorJSON;
}