UNPKG

capacitor-plugin-scanbot-sdk

Version:

Scanbot Document and Barcode Scanner SDK for Capacitor

1,373 lines (1,370 loc) 448 kB
'use strict'; var core = require('@capacitor/core'); class PartiallyConstructible { /** @internal */ _marker() { } } class Point { constructor(x, y) { this.x = x; this.y = y; } } const BoardingPassDocumentType = 'BoardingPass'; const BoardingPassLegDocumentType = 'Leg'; const DEMedicalPlanDocumentType = 'DEMedicalPlan'; const DEMedicalPlanPatientDocumentType = 'Patient'; const DEMedicalPlanDoctorDocumentType = 'Doctor'; const DEMedicalPlanSubheadingDocumentType = 'Subheading'; const DEMedicalPlanSubheadingMedicineDocumentType = 'Medicine'; const DEMedicalPlanSubheadingMedicineSubstanceDocumentType = 'Substance'; const DEMedicalPlanSubheadingPrescriptionDocumentType = 'Prescription'; const GS1DocumentType = 'GS1'; const GS1ElementDocumentType = 'Element'; const GS1ElementValidationErrorDocumentType = 'ValidationError'; const VCardDocumentType = 'VCard'; const VCardVersionDocumentType = 'Version'; const VCardSourceDocumentType = 'Source'; const VCardKindDocumentType = 'Kind'; const VCardXMLDocumentType = 'XML'; const VCardNameDocumentType = 'Name'; const VCardFirstNameDocumentType = 'FirstName'; const VCardNicknameDocumentType = 'Nickname'; const VCardBirthdayDocumentType = 'Birthday'; const VCardAnniversaryDocumentType = 'Anniversary'; const VCardGenderDocumentType = 'Gender'; const VCardDeliveryAddressDocumentType = 'DeliveryAddress'; const VCardPhotoDocumentType = 'Photo'; const VCardTelephoneNumberDocumentType = 'TelephoneNumber'; const VCardEmailDocumentType = 'Email'; const VCardIMPPDocumentType = 'IMPP'; const VCardLanguagesDocumentType = 'Languages'; const VCardTimeZoneDocumentType = 'TimeZone'; const VCardGeoLocationDocumentType = 'GeoLocation'; const VCardTitleDocumentType = 'Title'; const VCardRoleDocumentType = 'Role'; const VCardLogoDocumentType = 'Logo'; const VCardOrganisationDocumentType = 'Organisation'; const VCardMemberDocumentType = 'Member'; const VCardRelatedDocumentType = 'Related'; const VCardCategoriesDocumentType = 'Categories'; const VCardNoteDocumentType = 'Note'; const VCardProductIdDocumentType = 'ProductId'; const VCardRevisionDocumentType = 'Revision'; const VCardSoundDocumentType = 'Sound'; const VCardUIDDocumentType = 'UID'; const VCardClientPIDMapDocumentType = 'ClientPIDMap'; const VCardURLDocumentType = 'URL'; const VCardPublicKeyDocumentType = 'PublicKey'; const VCardBusyTimeURLDocumentType = 'BusyTimeURL'; const VCardCalendarURIForRequestsDocumentType = 'CalendarURIForRequests'; const VCardCalendarURIDocumentType = 'CalendarURI'; const VCardCustomDocumentType = 'Custom'; const AAMVADocumentType = 'AAMVA'; const AAMVATitleDataDocumentType = 'TitleData'; const AAMVARegistrationDataDocumentType = 'RegistrationData'; const AAMVAMotorCarrierDataDocumentType = 'MotorCarrierData'; const AAMVARegistrantAndVehicleDataDocumentType = 'RegistrantAndVehicleData'; const AAMVAVehicleOwnerDataDocumentType = 'VehicleOwnerData'; const AAMVAVehicleDataDocumentType = 'VehicleData'; const AAMVAVehicleSafetyInspectionDataDocumentType = 'VehicleSafetyInspectionData'; const AAMVADriverLicenseDocumentType = 'DriverLicense'; const AAMVAIDCardDocumentType = 'IDCard'; const AAMVAEnhancedDriverLicenseDocumentType = 'EnhancedDriverLicense'; const AAMVARawDocumentDocumentType = 'RawDocument'; /** Boarding Pass */ class BoardingPass { get document() { return this._document; } constructor(document) { if (document.type.name !== this.requiredDocumentType()) { throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${document.type.name}`); } this._document = document; } requiredDocumentType() { return BoardingPassDocumentType; } /** Electronic Ticket */ get electronicTicket() { return this.document.fields.find((f) => f.type.name === 'ElectronicTicket'); } /** Name */ get name() { return this.document.fields.find((f) => f.type.name === 'Name'); } /** Number Of Legs */ get numberOfLegs() { return this.document.fields.find((f) => f.type.name === 'NumberOfLegs'); } /** Security Data */ get securityData() { return this.document.fields.find((f) => f.type.name === 'SecurityData'); } /** An array of all children of type "Leg". */ get legs() { return this.document.children .filter((c) => c.type.name === 'Leg') .map((c) => new BoardingPass.Leg(c)); } } (function (BoardingPass) { /** Leg of the journey */ class Leg { get document() { return this._document; } constructor(document) { if (document.type.name !== this.requiredDocumentType()) { throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${document.type.name}`); } this._document = document; } requiredDocumentType() { return BoardingPassLegDocumentType; } /** Airline Designator Of Boarding Pass Issuer */ get airlineDesignatorOfBoardingPassIssuer() { return this.document.fields.find((f) => f.type.name === 'AirlineDesignatorOfBoardingPassIssuer'); } /** Airline Numeric Code */ get airlineNumericCode() { return this.document.fields.find((f) => f.type.name === 'AirlineNumericCode'); } /** Baggage Tag License Plate Numbers */ get baggageTagLicensePlateNumbers() { return this.document.fields.find((f) => f.type.name === 'BaggageTagLicensePlateNumbers'); } /** Check In Sequence Number */ get checkInSequenceNumber() { return this.document.fields.find((f) => f.type.name === 'CheckInSequenceNumber'); } /** Compartment Code */ get compartmentCode() { return this.document.fields.find((f) => f.type.name === 'CompartmentCode'); } /** Date Of Boarding Pass Issuance Julian */ get dateOfBoardingPassIssuanceJulian() { return this.document.fields.find((f) => f.type.name === 'DateOfBoardingPassIssuanceJulian'); } /** Date Of Flight Julian */ get dateOfFlightJulian() { return this.document.fields.find((f) => f.type.name === 'DateOfFlightJulian'); } /** Departure Airport Code */ get departureAirportCode() { return this.document.fields.find((f) => f.type.name === 'DepartureAirportCode'); } /** Destination Airport Code */ get destinationAirportCode() { return this.document.fields.find((f) => f.type.name === 'DestinationAirportCode'); } /** Document Form Serial Number */ get documentFormSerialNumber() { return this.document.fields.find((f) => f.type.name === 'DocumentFormSerialNumber'); } /** Document Type */ get documentType() { return this.document.fields.find((f) => f.type.name === 'DocumentType'); } /** Fast Track */ get fastTrack() { return this.document.fields.find((f) => f.type.name === 'FastTrack'); } /** First Non Consecutive Baggage Tag License Plate Number */ get firstNonConsecutiveBaggageTagLicensePlateNumber() { return this.document.fields.find((f) => f.type.name === 'FirstNonConsecutiveBaggageTagLicensePlateNumber'); } /** Flight Number */ get flightNumber() { return this.document.fields.find((f) => f.type.name === 'FlightNumber'); } /** For Individual Airline Use */ get forIndividualAirlineUse() { return this.document.fields.find((f) => f.type.name === 'ForIndividualAirlineUse'); } /** Free Baggage Allowance */ get freeBaggageAllowance() { return this.document.fields.find((f) => f.type.name === 'FreeBaggageAllowance'); } /** Frequent Flyer Airline Designator */ get frequentFlyerAirlineDesignator() { return this.document.fields.find((f) => f.type.name === 'FrequentFlyerAirlineDesignator'); } /** Frequent Flyer Number */ get frequentFlyerNumber() { return this.document.fields.find((f) => f.type.name === 'FrequentFlyerNumber'); } /** IDAD Indicator */ get idadIndicator() { return this.document.fields.find((f) => f.type.name === 'IDADIndicator'); } /** International Documentation Verification */ get internationalDocumentationVerification() { return this.document.fields.find((f) => f.type.name === 'InternationalDocumentationVerification'); } /** Marketing Carrier Designator */ get marketingCarrierDesignator() { return this.document.fields.find((f) => f.type.name === 'MarketingCarrierDesignator'); } /** Operating Carrier Designator */ get operatingCarrierDesignator() { return this.document.fields.find((f) => f.type.name === 'OperatingCarrierDesignator'); } /** Operating Carrier PNR Code */ get operatingCarrierPNRCode() { return this.document.fields.find((f) => f.type.name === 'OperatingCarrierPNRCode'); } /** Passenger Description */ get passengerDescription() { return this.document.fields.find((f) => f.type.name === 'PassengerDescription'); } /** Passenger Status */ get passengerStatus() { return this.document.fields.find((f) => f.type.name === 'PassengerStatus'); } /** Seat Number */ get seatNumber() { return this.document.fields.find((f) => f.type.name === 'SeatNumber'); } /** Second Non Consecutive Baggage Tag License Plate Number */ get secondNonConsecutiveBaggageTagLicensePlateNumber() { return this.document.fields.find((f) => f.type.name === 'SecondNonConsecutiveBaggageTagLicensePlateNumber'); } /** Selectee Indicator */ get selecteeIndicator() { return this.document.fields.find((f) => f.type.name === 'SelecteeIndicator'); } /** Source Of Boarding Pass Issuance */ get sourceOfBoardingPassIssuance() { return this.document.fields.find((f) => f.type.name === 'SourceOfBoardingPassIssuance'); } /** Source Of Check In */ get sourceOfCheckIn() { return this.document.fields.find((f) => f.type.name === 'SourceOfCheckIn'); } /** VersionNumber */ get versionNumber() { return this.document.fields.find((f) => f.type.name === 'VersionNumber'); } } BoardingPass.Leg = Leg; })(BoardingPass || (BoardingPass = {})); /** Medical Plan */ class DEMedicalPlan { get document() { return this._document; } constructor(document) { if (document.type.name !== this.requiredDocumentType()) { throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${document.type.name}`); } this._document = document; } requiredDocumentType() { return DEMedicalPlanDocumentType; } /** Current Page */ get currentPage() { return this.document.fields.find((f) => f.type.name === 'CurrentPage'); } /** Document Version Number */ get documentVersionNumber() { return this.document.fields.find((f) => f.type.name === 'DocumentVersionNumber'); } /** GUID */ get guid() { return this.document.fields.find((f) => f.type.name === 'GUID'); } /** Language Country Code */ get languageCountryCode() { return this.document.fields.find((f) => f.type.name === 'LanguageCountryCode'); } /** Patch Version Number */ get patchVersionNumber() { return this.document.fields.find((f) => f.type.name === 'PatchVersionNumber'); } /** Total Number Of Pages */ get totalNumberOfPages() { return this.document.fields.find((f) => f.type.name === 'TotalNumberOfPages'); } /** The child document of type "Patient". */ get patient() { const child = this.document.children.find((c) => c.type.name === 'Patient'); return new DEMedicalPlan.Patient(child); } /** The child document of type "Doctor". */ get doctor() { const child = this.document.children.find((c) => c.type.name === 'Doctor'); return new DEMedicalPlan.Doctor(child); } /** An array of all children of type "Subheading". */ get subheadings() { return this.document.children .filter((c) => c.type.name === 'Subheading') .map((c) => new DEMedicalPlan.Subheading(c)); } } (function (DEMedicalPlan) { /** Patient */ class Patient { get document() { return this._document; } constructor(document) { if (document.type.name !== this.requiredDocumentType()) { throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${document.type.name}`); } this._document = document; } requiredDocumentType() { return DEMedicalPlanPatientDocumentType; } /** Allergies And Intolerances */ get allergiesAndIntolerances() { return this.document.fields.find((f) => f.type.name === 'AllergiesAndIntolerances'); } /** Birth Date */ get birthDate() { return this.document.fields.find((f) => f.type.name === 'BirthDate'); } /** Breast Feeding */ get breastFeeding() { return this.document.fields.find((f) => f.type.name === 'BreastFeeding'); } /** Creatinine Value */ get creatinineValue() { return this.document.fields.find((f) => f.type.name === 'CreatinineValue'); } /** First Name */ get firstName() { return this.document.fields.find((f) => f.type.name === 'FirstName'); } /** Gender */ get gender() { return this.document.fields.find((f) => f.type.name === 'Gender'); } /** Height */ get height() { return this.document.fields.find((f) => f.type.name === 'Height'); } /** Last Name */ get lastName() { return this.document.fields.find((f) => f.type.name === 'LastName'); } /** Patient Free Text */ get patientFreeText() { return this.document.fields.find((f) => f.type.name === 'PatientFreeText'); } /** Patient ID */ get patientID() { return this.document.fields.find((f) => f.type.name === 'PatientID'); } /** Pre Name */ get preName() { return this.document.fields.find((f) => f.type.name === 'PreName'); } /** Pregnant */ get pregnant() { return this.document.fields.find((f) => f.type.name === 'Pregnant'); } /** Name Suffix */ get suffix() { return this.document.fields.find((f) => f.type.name === 'Suffix'); } /** Title */ get title() { return this.document.fields.find((f) => f.type.name === 'Title'); } /** Weight */ get weight() { return this.document.fields.find((f) => f.type.name === 'Weight'); } } DEMedicalPlan.Patient = Patient; /** Doctor */ class Doctor { get document() { return this._document; } constructor(document) { if (document.type.name !== this.requiredDocumentType()) { throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${document.type.name}`); } this._document = document; } requiredDocumentType() { return DEMedicalPlanDoctorDocumentType; } /** Doctor Number */ get doctorNumber() { return this.document.fields.find((f) => f.type.name === 'DoctorNumber'); } /** Email */ get email() { return this.document.fields.find((f) => f.type.name === 'Email'); } /** Hospital ID */ get hospitalID() { return this.document.fields.find((f) => f.type.name === 'HospitalID'); } /** Issuer Name */ get issuerName() { return this.document.fields.find((f) => f.type.name === 'IssuerName'); } /** Issuing Date And Time */ get issuingDateAndTime() { return this.document.fields.find((f) => f.type.name === 'IssuingDateAndTime'); } /** Pharmacy ID */ get pharmacyID() { return this.document.fields.find((f) => f.type.name === 'PharmacyID'); } /** Place */ get place() { return this.document.fields.find((f) => f.type.name === 'Place'); } /** Postal Code */ get postalCode() { return this.document.fields.find((f) => f.type.name === 'PostalCode'); } /** Street */ get street() { return this.document.fields.find((f) => f.type.name === 'Street'); } /** Telephone Number */ get telephoneNumber() { return this.document.fields.find((f) => f.type.name === 'TelephoneNumber'); } } DEMedicalPlan.Doctor = Doctor; /** Subheading */ class Subheading { get document() { return this._document; } constructor(document) { if (document.type.name !== this.requiredDocumentType()) { throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${document.type.name}`); } this._document = document; } requiredDocumentType() { return DEMedicalPlanSubheadingDocumentType; } /** General Note */ get generalNotes() { return this.document.fields.filter((f) => f.type.name === 'GeneralNote'); } /** Key Words */ get keyWords() { return this.document.fields.find((f) => f.type.name === 'KeyWords'); } /** Subheading Free Text */ get subheadingFreeText() { return this.document.fields.find((f) => f.type.name === 'SubheadingFreeText'); } /** An array of all children of type "Medicine". */ get medicines() { return this.document.children .filter((c) => c.type.name === 'Medicine') .map((c) => new DEMedicalPlan.Subheading.Medicine(c)); } /** An array of all children of type "Prescription". */ get prescriptions() { return this.document.children .filter((c) => c.type.name === 'Prescription') .map((c) => new DEMedicalPlan.Subheading.Prescription(c)); } } DEMedicalPlan.Subheading = Subheading; (function (Subheading) { /** Medicine */ class Medicine { get document() { return this._document; } constructor(document) { if (document.type.name !== this.requiredDocumentType()) { throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${document.type.name}`); } this._document = document; } requiredDocumentType() { return DEMedicalPlanSubheadingMedicineDocumentType; } /** Dosage Form */ get dosageForm() { return this.document.fields.find((f) => f.type.name === 'DosageForm'); } /** Dosage Form Free Text */ get dosageFormFreeText() { return this.document.fields.find((f) => f.type.name === 'DosageFormFreeText'); } /** Dosage Free Text */ get dosageFreeText() { return this.document.fields.find((f) => f.type.name === 'DosageFreeText'); } /** Dosing Unit */ get dosingUnit() { return this.document.fields.find((f) => f.type.name === 'DosingUnit'); } /** Dosing Unit Free Text */ get dosingUnitFreeText() { return this.document.fields.find((f) => f.type.name === 'DosingUnitFreeText'); } /** Drug Name */ get drugName() { return this.document.fields.find((f) => f.type.name === 'DrugName'); } /** Evening Intake Dose */ get evening() { return this.document.fields.find((f) => f.type.name === 'Evening'); } /** General Notes */ get generalNotes() { return this.document.fields.find((f) => f.type.name === 'GeneralNotes'); } /** Midday Intake Dose */ get midday() { return this.document.fields.find((f) => f.type.name === 'Midday'); } /** Morning Intake Dose */ get morning() { return this.document.fields.find((f) => f.type.name === 'Morning'); } /** Night Intake Dose */ get night() { return this.document.fields.find((f) => f.type.name === 'Night'); } /** Pharmaceutical Number */ get pharmaceuticalNumber() { return this.document.fields.find((f) => f.type.name === 'PharmaceuticalNumber'); } /** Reason For Treatment */ get reasonForTreatment() { return this.document.fields.find((f) => f.type.name === 'ReasonForTreatment'); } /** Relevant Info */ get relevantInfo() { return this.document.fields.find((f) => f.type.name === 'RelevantInfo'); } /** An array of all children of type "Substance". */ get substances() { return this.document.children .filter((c) => c.type.name === 'Substance') .map((c) => new DEMedicalPlan.Subheading.Medicine.Substance(c)); } } Subheading.Medicine = Medicine; (function (Medicine) { /** Substance */ class Substance { get document() { return this._document; } constructor(document) { if (document.type.name !== this.requiredDocumentType()) { throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${document.type.name}`); } this._document = document; } requiredDocumentType() { return DEMedicalPlanSubheadingMedicineSubstanceDocumentType; } /** Active Substance */ get activeSubstance() { return this.document.fields.find((f) => f.type.name === 'ActiveSubstance'); } /** Potency */ get potency() { return this.document.fields.find((f) => f.type.name === 'Potency'); } } Medicine.Substance = Substance; })(Medicine = Subheading.Medicine || (Subheading.Medicine = {})); /** Prescription */ class Prescription { get document() { return this._document; } constructor(document) { if (document.type.name !== this.requiredDocumentType()) { throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${document.type.name}`); } this._document = document; } requiredDocumentType() { return DEMedicalPlanSubheadingPrescriptionDocumentType; } /** General Information */ get generalInformation() { return this.document.fields.find((f) => f.type.name === 'GeneralInformation'); } /** Prescription Free Text */ get prescriptionFreeText() { return this.document.fields.find((f) => f.type.name === 'PrescriptionFreeText'); } } Subheading.Prescription = Prescription; })(Subheading = DEMedicalPlan.Subheading || (DEMedicalPlan.Subheading = {})); })(DEMedicalPlan || (DEMedicalPlan = {})); /** GS1 */ class GS1 { get document() { return this._document; } constructor(document) { if (document.type.name !== this.requiredDocumentType()) { throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${document.type.name}`); } this._document = document; } requiredDocumentType() { return GS1DocumentType; } /** An array of all children of type "Element". */ get elements() { return this.document.children .filter((c) => c.type.name === 'Element') .map((c) => new GS1.Element(c)); } } (function (GS1) { /** GS1 Element */ class Element { get document() { return this._document; } constructor(document) { if (document.type.name !== this.requiredDocumentType()) { throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${document.type.name}`); } this._document = document; } requiredDocumentType() { return GS1ElementDocumentType; } /** Application Identifier */ get applicationIdentifier() { return this.document.fields.find((f) => f.type.name === 'ApplicationIdentifier'); } /** Data Title */ get dataTitle() { return this.document.fields.find((f) => f.type.name === 'DataTitle'); } /** Description */ get elementDescription() { return this.document.fields.find((f) => f.type.name === 'ElementDescription'); } /** Raw Value */ get rawValue() { return this.document.fields.find((f) => f.type.name === 'RawValue'); } /** An array of all children of type "ValidationError". */ get validationErrors() { return this.document.children .filter((c) => c.type.name === 'ValidationError') .map((c) => new GS1.Element.ValidationError(c)); } } GS1.Element = Element; (function (Element) { /** Validation Errors */ class ValidationError { get document() { return this._document; } constructor(document) { if (document.type.name !== this.requiredDocumentType()) { throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${document.type.name}`); } this._document = document; } requiredDocumentType() { return GS1ElementValidationErrorDocumentType; } /** Error Code */ get code() { return this.document.fields.find((f) => f.type.name === 'Code'); } /** Reason */ get reason() { return this.document.fields.find((f) => f.type.name === 'Reason'); } } Element.ValidationError = ValidationError; })(Element = GS1.Element || (GS1.Element = {})); })(GS1 || (GS1 = {})); /** VCard */ class VCard { get document() { return this._document; } constructor(document) { if (document.type.name !== this.requiredDocumentType()) { throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${document.type.name}`); } this._document = document; } requiredDocumentType() { return VCardDocumentType; } /** The child document of type "Version". */ get version() { const child = this.document.children.find((c) => c.type.name === 'Version'); return new VCard.Version(child); } /** The child document of type "Source". */ get source() { const child = this.document.children.find((c) => c.type.name === 'Source'); return child ? new VCard.Source(child) : undefined; } /** The child document of type "Kind". */ get kind() { const child = this.document.children.find((c) => c.type.name === 'Kind'); return child ? new VCard.Kind(child) : undefined; } /** The child document of type "XML". */ get xml() { const child = this.document.children.find((c) => c.type.name === 'XML'); return child ? new VCard.XML(child) : undefined; } /** The child document of type "Name". */ get name() { const child = this.document.children.find((c) => c.type.name === 'Name'); return child ? new VCard.Name(child) : undefined; } /** The child document of type "FirstName". */ get firstName() { const child = this.document.children.find((c) => c.type.name === 'FirstName'); return child ? new VCard.FirstName(child) : undefined; } /** The child document of type "Nickname". */ get nickname() { const child = this.document.children.find((c) => c.type.name === 'Nickname'); return child ? new VCard.Nickname(child) : undefined; } /** The child document of type "Birthday". */ get birthday() { const child = this.document.children.find((c) => c.type.name === 'Birthday'); return child ? new VCard.Birthday(child) : undefined; } /** The child document of type "Anniversary". */ get anniversary() { const child = this.document.children.find((c) => c.type.name === 'Anniversary'); return child ? new VCard.Anniversary(child) : undefined; } /** The child document of type "Gender". */ get gender() { const child = this.document.children.find((c) => c.type.name === 'Gender'); return child ? new VCard.Gender(child) : undefined; } /** The child document of type "DeliveryAddress". */ get deliveryAddress() { const child = this.document.children.find((c) => c.type.name === 'DeliveryAddress'); return child ? new VCard.DeliveryAddress(child) : undefined; } /** The child document of type "Photo". */ get photo() { const child = this.document.children.find((c) => c.type.name === 'Photo'); return child ? new VCard.Photo(child) : undefined; } /** The child document of type "TelephoneNumber". */ get telephoneNumber() { const child = this.document.children.find((c) => c.type.name === 'TelephoneNumber'); return child ? new VCard.TelephoneNumber(child) : undefined; } /** The child document of type "Email". */ get email() { const child = this.document.children.find((c) => c.type.name === 'Email'); return child ? new VCard.Email(child) : undefined; } /** The child document of type "IMPP". */ get impp() { const child = this.document.children.find((c) => c.type.name === 'IMPP'); return child ? new VCard.IMPP(child) : undefined; } /** The child document of type "Languages". */ get languages() { const child = this.document.children.find((c) => c.type.name === 'Languages'); return child ? new VCard.Languages(child) : undefined; } /** The child document of type "TimeZone". */ get timeZone() { const child = this.document.children.find((c) => c.type.name === 'TimeZone'); return child ? new VCard.TimeZone(child) : undefined; } /** The child document of type "GeoLocation". */ get geoLocation() { const child = this.document.children.find((c) => c.type.name === 'GeoLocation'); return child ? new VCard.GeoLocation(child) : undefined; } /** The child document of type "Title". */ get title() { const child = this.document.children.find((c) => c.type.name === 'Title'); return child ? new VCard.Title(child) : undefined; } /** The child document of type "Role". */ get role() { const child = this.document.children.find((c) => c.type.name === 'Role'); return child ? new VCard.Role(child) : undefined; } /** The child document of type "Logo". */ get logo() { const child = this.document.children.find((c) => c.type.name === 'Logo'); return child ? new VCard.Logo(child) : undefined; } /** The child document of type "Organisation". */ get organisation() { const child = this.document.children.find((c) => c.type.name === 'Organisation'); return child ? new VCard.Organisation(child) : undefined; } /** The child document of type "Member". */ get member() { const child = this.document.children.find((c) => c.type.name === 'Member'); return child ? new VCard.Member(child) : undefined; } /** The child document of type "Related". */ get related() { const child = this.document.children.find((c) => c.type.name === 'Related'); return child ? new VCard.Related(child) : undefined; } /** The child document of type "Categories". */ get categories() { const child = this.document.children.find((c) => c.type.name === 'Categories'); return child ? new VCard.Categories(child) : undefined; } /** The child document of type "Note". */ get note() { const child = this.document.children.find((c) => c.type.name === 'Note'); return child ? new VCard.Note(child) : undefined; } /** The child document of type "ProductId". */ get productId() { const child = this.document.children.find((c) => c.type.name === 'ProductId'); return child ? new VCard.ProductId(child) : undefined; } /** The child document of type "Revision". */ get revision() { const child = this.document.children.find((c) => c.type.name === 'Revision'); return child ? new VCard.Revision(child) : undefined; } /** The child document of type "Sound". */ get sound() { const child = this.document.children.find((c) => c.type.name === 'Sound'); return child ? new VCard.Sound(child) : undefined; } /** The child document of type "UID". */ get uid() { const child = this.document.children.find((c) => c.type.name === 'UID'); return child ? new VCard.UID(child) : undefined; } /** The child document of type "ClientPIDMap". */ get clientPIDMap() { const child = this.document.children.find((c) => c.type.name === 'ClientPIDMap'); return child ? new VCard.ClientPIDMap(child) : undefined; } /** The child document of type "URL". */ get url() { const child = this.document.children.find((c) => c.type.name === 'URL'); return child ? new VCard.URL(child) : undefined; } /** The child document of type "PublicKey". */ get publicKey() { const child = this.document.children.find((c) => c.type.name === 'PublicKey'); return child ? new VCard.PublicKey(child) : undefined; } /** The child document of type "BusyTimeURL". */ get busyTimeURL() { const child = this.document.children.find((c) => c.type.name === 'BusyTimeURL'); return child ? new VCard.BusyTimeURL(child) : undefined; } /** The child document of type "CalendarURIForRequests". */ get calendarURIForRequests() { const child = this.document.children.find((c) => c.type.name === 'CalendarURIForRequests'); return child ? new VCard.CalendarURIForRequests(child) : undefined; } /** The child document of type "CalendarURI". */ get calendarURI() { const child = this.document.children.find((c) => c.type.name === 'CalendarURI'); return child ? new VCard.CalendarURI(child) : undefined; } /** An array of all children of type "Custom". */ get customs() { return this.document.children .filter((c) => c.type.name === 'Custom') .map((c) => new VCard.Custom(c)); } } (function (VCard) { /** VCard Entry */ class Entry { get document() { return this._document; } constructor(document) { if (document.type.name !== this.requiredDocumentType()) { throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${document.type.name}`); } this._document = document; } /** Raw Value */ get rawValue() { return this.document.fields.find((f) => f.type.name === 'RawValue'); } /** Type Modifier */ get typeModifiers() { return this.document.fields.filter((f) => f.type.name === 'TypeModifier'); } /** Value */ get values() { return this.document.fields.filter((f) => f.type.name === 'Value'); } } VCard.Entry = Entry; /** Version */ class Version extends Entry { constructor(document) { super(document); } requiredDocumentType() { return VCardVersionDocumentType; } } VCard.Version = Version; /** Source */ class Source extends Entry { constructor(document) { super(document); } requiredDocumentType() { return VCardSourceDocumentType; } } VCard.Source = Source; /** Kind */ class Kind extends Entry { constructor(document) { super(document); } requiredDocumentType() { return VCardKindDocumentType; } } VCard.Kind = Kind; /** XML */ class XML extends Entry { constructor(document) { super(document); } requiredDocumentType() { return VCardXMLDocumentType; } } VCard.XML = XML; /** Name */ class Name extends Entry { constructor(document) { super(document); } requiredDocumentType() { return VCardNameDocumentType; } } VCard.Name = Name; /** First Name */ class FirstName extends Entry { constructor(document) { super(document); } requiredDocumentType() { return VCardFirstNameDocumentType; } } VCard.FirstName = FirstName; /** Nickname */ class Nickname extends Entry { constructor(document) { super(document); } requiredDocumentType() { return VCardNicknameDocumentType; } } VCard.Nickname = Nickname; /** Birthday */ class Birthday extends Entry { constructor(document) { super(document); } requiredDocumentType() { return VCardBirthdayDocumentType; } } VCard.Birthday = Birthday; /** Anniversary */ class Anniversary extends Entry { constructor(document) { super(document); } requiredDocumentType() { return VCardAnniversaryDocumentType; } } VCard.Anniversary = Anniversary; /** Gender */ class Gender extends Entry { constructor(document) { super(document); } requiredDocumentType() { return VCardGenderDocumentType; } } VCard.Gender = Gender; /** Delivery Address */ class DeliveryAddress extends Entry { constructor(document) { super(document); } requiredDocumentType() { return VCardDeliveryAddressDocumentType; } } VCard.DeliveryAddress = DeliveryAddress; /** Photo */ class Photo extends Entry { constructor(document) { super(document); } requiredDocumentType() { return VCardPhotoDocumentType; } } VCard.Photo = Photo; /** Telephone Number */ class TelephoneNumber extends Entry { constructor(document) { super(document); } requiredDocumentType() { return VCardTelephoneNumberDocumentType; } } VCard.TelephoneNumber = TelephoneNumber; /** Email */ class Email extends Entry { constructor(document) { super(document); } requiredDocumentType() { return VCardEmailDocumentType; } } VCard.Email = Email; /** IMPP */ class IMPP extends Entry { constructor(document) { super(document); } requiredDocumentType() { return VCardIMPPDocumentType; } } VCard.IMPP = IMPP; /** Languages */ class Languages extends Entry { constructor(document) { super(document); } requiredDocumentType() { return VCardLanguagesDocumentType; } } VCard.Languages = Languages; /** Time Zone */ class TimeZone extends Entry { constructor(document) { super(document); } requiredDocumentType() { return VCardTimeZoneDocumentType; } } VCard.TimeZone = TimeZone; /** Geo Location */ class GeoLocation extends Entry { constructor(document) { super(document); } requiredDocumentType() { return VCardGeoLocationDocumentType; } } VCard.GeoLocation = GeoLocation; /** Title */ class Title extends Entry { constructor(document) { super(document); } requiredDocumentType() { return VCardTitleDocumentType; } } VCard.Title = Title; /** Role */ class Role extends Entry { constructor(document) { super(document); } requiredDocumentType() { return VCardRoleDocumentType; } } VCard.Role = Role; /** Logo */ class Logo extends Entry { constructor(document) { super(document); } requiredDocumentType() { return VCardLogoDocumentType; } } VCard.Logo = Logo; /** Organisation */ class Organisation extends Entry { constructor(document) { super(document); } requiredDocumentType() { return VCardOrganisationDocumentType; } } VCard.Organisation = Organisation; /** Member */ class Member extends Entry { constructor(document) { super(document); } requiredDocumentType() { return VCardMemberDocumentType; } } VCard.Member = Member; /** Related */ class Related extends Entry { constructor(document) { super(document); } requiredDocumentType() { return VCardRelatedDocumentType; } } VCard.Related = Related; /** Categories */ class Categories extends Entry { constructor(document) { super(document); } requiredDocumentType() { return VCardCategoriesDocumentType; } } VCard.Categories = Categories; /** Note */ class Note extends Entry { constructor(document) { super(document); } requiredDocumentType() { return VCardNoteDocumentType; } } VCard.Note = Note; /** ProductId */ class ProductId extends Entry { constructor(document) { super(document); } requiredDocumentType() { return VCardProductIdDocumentType; } } VCard.ProductId = ProductId; /** Revision */ class Revision extends Entry { constructor(document) { super(document); } requiredDocumentType() { return VCardRevisionDocumentType; } } VCard.Revision = Revision; /** Sound */ class Sound extends Entry { constructor(document) { super(document); } requiredDocumentType() { return VCardSoundDocumentType; } } VCard.Sound = Sound; /** UID */ class UID extends Entry { constructor(document) { super(document); } requiredDocumentType() { return VCardUIDDocumentType; } } VCard.UID = UID; /** Client PID Map */ class ClientPIDMap extends Entry { constructor(document) { super(document); } requiredDocumentType() { return VCardClientPIDMapDocumentType; } } VCard.ClientPIDMap = ClientPIDMap; /** URL */ class URL extends Entry { constructor(document) { super(document); } requiredDocumentType() { return VCardURLDocumentType; } } VCard.URL = URL; /** Public Key */ class PublicKey extends Entry { constructor(document) { super(document); } requiredDocumentType() { return VCardPublicKeyDocumentType; } } VCard.PublicKey = PublicKey; /** Busy Time URL */ class BusyTimeURL extends Entry { constructor(document) { super(document); } requiredDocumentType() { return VCardBusyTimeURLDocumentType; } } VCard.BusyTimeURL = BusyTimeURL; /** Calendar URI For Requests */ class CalendarURIForRequests extends Entry { constructor(document) { super(document); } requiredDocumentType() { return VCardCalendarURIForRequestsDocumentType; } } VCard.CalendarURIForRequests = CalendarURIForRequests; /** Calendar URI */ class CalendarURI extends Entry { constructor(document) { super(document); } requiredDocumentType() { return VCardCalendarURIDocumentType; } } VCard.CalendarURI = CalendarURI; /** Custom */ class Custom extends Entry { constructor(document) { super(document); } requiredDocumentType() { return VCardCustomDocumentType; } } VCard.Custom = Custom; })(VCard || (VCard = {})); /** AAMVA */ class AAMVA { get document() { return this._document; } constructor(document) { if (document.type.name !== this.requiredDocumentType()) { throw new Error(`Expected document type ${this.requiredDocumentType()}, got ${document.type.name}`); } this._document = document; } requiredDocumentType() { return AAMVADocumentType; } /** Issuer Identification Number */ get issuerIdentificationNumber() { return this.document.fields.find((f) => f.type.name === 'IssuerIdentificationNumber'); } /** Jurisdiction Version Number */ get jurisdictionVersionNumber() { return this.document.fields.find((f) => f.type.name === 'JurisdictionVersionNumber'); } /** Version */ get version() { return this.document.fields.find((f) => f.type.name === 'Version'); } /** The child document of type "TitleData". */ get titleData() { const child = this.document.children.find((c) => c.type.name === 'TitleData'); return child ? new AAMVA.TitleData(child) : undefined; } /** The child document of type "RegistrationData". */ get registrationData() { const child = this.document.children.find((c) => c.type.name === 'RegistrationData'); return child ? new AAMVA.RegistrationData(child) : undefined; } /** The child document of type "MotorCarrierData". */ get motorCarrierData() { const child = this.document.children.find((c) => c.type.name === 'MotorCarrierData'); return child ? new AAMVA.MotorCarrierData(child) : undefined; } /** The child document of type "RegistrantAndVehicleData". */ get registrantAndVehicleData() { const child = this.document.children.find((c) => c.type.name === 'RegistrantAndVehicleData'); return child ? new AAMVA.RegistrantAndVehicleData(child) : undefined; } /** The child document of type "VehicleOwnerData". */ get vehicleOwnerData() { const child = this.document.children.find((c) => c.type.name === 'VehicleOwnerData'); return child ? new AAMVA.VehicleOwnerData(child) : undefined; } /** The child document of type "VehicleData". */ get vehicleData() { const child = this.document.children.find((c) => c.type.name === 'VehicleData'); return child ? new AAMVA.VehicleData(child) : undefined; } /** The child document of type "VehicleSafetyInspectionData". */ get vehicleSafetyInspectionData() { const child = this.document.children.find((c) => c.type.name === 'VehicleSafetyInspectionData'); return child ? new AAMVA.VehicleSafetyInspectionData(child) : undefined; } /** The child document of type "DriverLicense". */ get driverLicense() { const child = this.document.children.find((c) => c.type.name === 'DriverLicense'); return child ? new AAMVA.DriverLicense(child) : undefined; } /** The child document of type "IDCard". */ get idCard() { const child = this.document.children.find((c) => c.type.name === 'IDCard'); return child ? new AAMVA.IDCard(child) : undefined; } /** The child document of type "EnhancedDriverLicense". */ ge