UNPKG

react-native-scanbot-sdk

Version:

Scanbot Document and Barcode Scanner SDK React Native Plugin for Android and iOS

1,564 lines (1,263 loc) 72.2 kB
/// Auto-generated. Modifications will be overwritten. /// Generated from core/document-schemas/DocumentsModel.yaml import { Field, GenericDocument } from './GenericDocument'; /// All possible root document types. export type DocumentsModelRootType = | typeof MRZDocumentType | typeof ParsedDeAddressDocumentType | typeof DeIdCardFrontDocumentType | typeof DeIdCardBackDocumentType | typeof DePassportDocumentType | typeof EuropeanDriverLicenseFrontDocumentType | typeof EuropeanDriverLicenseBackDocumentType | typeof DeResidencePermitFrontDocumentType | typeof DeResidencePermitBackDocumentType | typeof EuropeanHealthInsuranceCardDocumentType | typeof DeHealthInsuranceCardFrontDocumentType | typeof BrIdCardFrontDocumentType | typeof BrIdCardBackDocumentType | typeof BrIdCardFrontPhotoOnlyDocumentType | typeof CnEntryAndExitPermitBackDocumentType | typeof CnEntryAndExitPermitFrontDocumentType | typeof CnPermanentResidentCardFrontDocumentType | typeof HkIdentityCardFrontDocumentType | typeof TwEntryAndExitPermitDocumentType | typeof MoIdentityCardBackDocumentType | typeof MoIdentityCardFrontDocumentType; export const MRZDocumentType = 'MRZ'; export const ParsedDeAddressDocumentType = 'ParsedDeAddress'; export const DeIdCardFrontDocumentType = 'DeIdCardFront'; export const DeIdCardBackDocumentType = 'DeIdCardBack'; export const DePassportDocumentType = 'DePassport'; export const EuropeanDriverLicenseFrontDocumentType = 'EuropeanDriverLicenseFront'; export const EuropeanDriverLicenseBackDocumentType = 'EuropeanDriverLicenseBack'; export const EuropeanDriverLicenseBackCategoryDocumentType = 'Category'; export const EuropeanDriverLicenseBackCategoriesDocumentType = 'Categories'; export const EuropeanDriverLicenseBackCategoriesADocumentType = 'A'; export const EuropeanDriverLicenseBackCategoriesA1DocumentType = 'A1'; export const EuropeanDriverLicenseBackCategoriesA2DocumentType = 'A2'; export const EuropeanDriverLicenseBackCategoriesAMDocumentType = 'AM'; export const EuropeanDriverLicenseBackCategoriesBDocumentType = 'B'; export const EuropeanDriverLicenseBackCategoriesB1DocumentType = 'B1'; export const EuropeanDriverLicenseBackCategoriesBEDocumentType = 'BE'; export const EuropeanDriverLicenseBackCategoriesCDocumentType = 'C'; export const EuropeanDriverLicenseBackCategoriesC1DocumentType = 'C1'; export const EuropeanDriverLicenseBackCategoriesC1EDocumentType = 'C1E'; export const EuropeanDriverLicenseBackCategoriesCEDocumentType = 'CE'; export const EuropeanDriverLicenseBackCategoriesDDocumentType = 'D'; export const EuropeanDriverLicenseBackCategoriesD1DocumentType = 'D1'; export const EuropeanDriverLicenseBackCategoriesD1EDocumentType = 'D1E'; export const EuropeanDriverLicenseBackCategoriesDEDocumentType = 'DE'; export const EuropeanDriverLicenseBackCategoriesLDocumentType = 'L'; export const EuropeanDriverLicenseBackCategoriesTDocumentType = 'T'; export const DeResidencePermitFrontDocumentType = 'DeResidencePermitFront'; export const DeResidencePermitBackDocumentType = 'DeResidencePermitBack'; export const EuropeanHealthInsuranceCardDocumentType = 'EuropeanHealthInsuranceCard'; export const DeHealthInsuranceCardFrontDocumentType = 'DeHealthInsuranceCardFront'; export const BrIdCardFrontDocumentType = 'BrIdCardFront'; export const BrIdCardBackDocumentType = 'BrIdCardBack'; export const BrIdCardFrontPhotoOnlyDocumentType = 'BrIdCardFrontPhotoOnly'; export const CnEntryAndExitPermitBackDocumentType = 'CnEntryAndExitPermitBack'; export const CnEntryAndExitPermitFrontDocumentType = 'CnEntryAndExitPermitFront'; export const CnPermanentResidentCardFrontDocumentType = 'CnPermanentResidentCardFront'; export const HkIdentityCardFrontDocumentType = 'HkIdentityCardFront'; export const TwEntryAndExitPermitDocumentType = 'TwEntryAndExitPermit'; export const MoIdentityCardBackDocumentType = 'MoIdentityCardBack'; export const MoIdentityCardFrontDocumentType = 'MoIdentityCardFront'; /** MRZ part of the document */ export class MRZ { private _document: GenericDocument; get document(): GenericDocument { return this._document; } constructor(document: GenericDocument) { if (document.type.name !== this.requiredDocumentType()) { throw new Error( `Expected document type ${this.requiredDocumentType()}, got ${document.type.name}` ); } this._document = document; } requiredDocumentType(): string { return MRZDocumentType; } /** Birth date */ get birthDate(): Field { return this.document.fields.find((f: Field) => f.type.name === 'BirthDate') as Field; } /** Check digit birth date */ get checkDigitBirthDate(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'CheckDigitBirthDate'); } /** Check digit document number */ get checkDigitDocumentNumber(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'CheckDigitDocumentNumber'); } /** Check digit expiry date */ get checkDigitExpiryDate(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'CheckDigitExpiryDate'); } /** Check digit general */ get checkDigitGeneral(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'CheckDigitGeneral'); } /** Check digit personal number */ get checkDigitPersonalNumber(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'CheckDigitPersonalNumber'); } /** Date of issuance */ get dateOfIssuance(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'DateOfIssuance'); } /** Document number */ get documentNumber(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'DocumentNumber'); } /** Document type from the DocumentType enum */ get documentType(): Field { return this.document.fields.find((f: Field) => f.type.name === 'DocumentType') as Field; } /** Document type code */ get documentTypeCode(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'DocumentTypeCode'); } /** Expiry date */ get expiryDate(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'ExpiryDate'); } /** Gender */ get gender(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'Gender'); } /** Given names */ get givenNames(): Field { return this.document.fields.find((f: Field) => f.type.name === 'GivenNames') as Field; } /** Issuing authority */ get issuingAuthority(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'IssuingAuthority'); } /** Language code */ get languageCode(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'LanguageCode'); } /** Nationality */ get nationality(): Field { return this.document.fields.find((f: Field) => f.type.name === 'Nationality') as Field; } /** Office of issuance */ get officeOfIssuance(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'OfficeOfIssuance'); } /** TD1 Optional field (line 2) */ get optional1(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'Optional1'); } /** TD1 Optional field (line 3) */ get optional2(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'Optional2'); } /** PIN code */ get pinCode(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'PINCode'); } /** Personal number */ get personalNumber(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'PersonalNumber'); } /** Surname */ get surname(): Field { return this.document.fields.find((f: Field) => f.type.name === 'Surname') as Field; } /** Travel document type */ get travelDocType(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'TravelDocType'); } /** Travel document type variant */ get travelDocTypeVariant(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'TravelDocTypeVariant'); } /** Unknown */ get unknown(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'Unknown'); } /** Version number */ get versionNumber(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'VersionNumber'); } /** MRV-A/MRV-B (Travel Visa) Optional field */ get visaOptional(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'VisaOptional'); } } /** Parsed German Address part of the document */ export class ParsedDeAddress { private _document: GenericDocument; get document(): GenericDocument { return this._document; } constructor(document: GenericDocument) { if (document.type.name !== this.requiredDocumentType()) { throw new Error( `Expected document type ${this.requiredDocumentType()}, got ${document.type.name}` ); } this._document = document; } requiredDocumentType(): string { return ParsedDeAddressDocumentType; } /** District or city area corresponding to postal code */ get district(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'District'); } /** Additional information to district or city area (e.g. Ortsteil, Stadtteil) */ get districtAddition(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'DistrictAddition'); } /** House number */ get houseNumber(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'HouseNumber'); } /** postal code */ get postalCode(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'PostalCode'); } /** Street name */ get streetName(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'StreetName'); } } /** German ID card, front side */ export class DeIdCardFront { private _document: GenericDocument; get document(): GenericDocument { return this._document; } constructor(document: GenericDocument) { if (document.type.name !== this.requiredDocumentType()) { throw new Error( `Expected document type ${this.requiredDocumentType()}, got ${document.type.name}` ); } this._document = document; } requiredDocumentType(): string { return DeIdCardFrontDocumentType; } /** Birth date */ get birthDate(): Field { return this.document.fields.find((f: Field) => f.type.name === 'BirthDate') as Field; } /** Birthplace */ get birthplace(): Field { return this.document.fields.find((f: Field) => f.type.name === 'Birthplace') as Field; } /** Six digit card access number */ get cardAccessNumber(): Field { return this.document.fields.find((f: Field) => f.type.name === 'CardAccessNumber') as Field; } /** Expiry date */ get expiryDate(): Field { return this.document.fields.find((f: Field) => f.type.name === 'ExpiryDate') as Field; } /** Given names */ get givenNames(): Field { return this.document.fields.find((f: Field) => f.type.name === 'GivenNames') as Field; } /** Document ID number (in the top-right corner) */ get id(): Field { return this.document.fields.find((f: Field) => f.type.name === 'ID') as Field; } /** Maiden name */ get maidenName(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'MaidenName'); } /** Nationality */ get nationality(): Field { return this.document.fields.find((f: Field) => f.type.name === 'Nationality') as Field; } /** Photo image */ get photo(): Field { return this.document.fields.find((f: Field) => f.type.name === 'Photo') as Field; } /** Series of the document. The format is YYMM. */ get series(): Field { return this.document.fields.find((f: Field) => f.type.name === 'Series') as Field; } /** Signature image */ get signature(): Field { return this.document.fields.find((f: Field) => f.type.name === 'Signature') as Field; } /** Surname */ get surname(): Field { return this.document.fields.find((f: Field) => f.type.name === 'Surname') as Field; } } /** German ID card, back side */ export class DeIdCardBack { private _document: GenericDocument; get document(): GenericDocument { return this._document; } constructor(document: GenericDocument) { if (document.type.name !== this.requiredDocumentType()) { throw new Error( `Expected document type ${this.requiredDocumentType()}, got ${document.type.name}` ); } this._document = document; } requiredDocumentType(): string { return DeIdCardBackDocumentType; } /** Raw Address text value */ get address(): Field { return this.document.fields.find((f: Field) => f.type.name === 'Address') as Field; } /** Eye color */ get eyeColor(): Field { return this.document.fields.find((f: Field) => f.type.name === 'EyeColor') as Field; } /** Height */ get height(): Field { return this.document.fields.find((f: Field) => f.type.name === 'Height') as Field; } /** Issue date */ get issueDate(): Field { return this.document.fields.find((f: Field) => f.type.name === 'IssueDate') as Field; } /** Issuing authority */ get issuingAuthority(): Field { return this.document.fields.find((f: Field) => f.type.name === 'IssuingAuthority') as Field; } /** Pseudonym */ get pseudonym(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'Pseudonym'); } /** Raw MRZ text value */ get rawMRZ(): Field { return this.document.fields.find((f: Field) => f.type.name === 'RawMRZ') as Field; } /** Series of the document. The format is YYMM. */ get series(): Field { return this.document.fields.find((f: Field) => f.type.name === 'Series') as Field; } /** The child document of type "MRZ". */ get mrz(): MRZ { const child = this.document.children.find((c: GenericDocument) => c.type.name === 'MRZ'); return new MRZ(child as GenericDocument); } /** The child document of type "ParsedDeAddress". */ get parsedDeAddress(): ParsedDeAddress { const child = this.document.children.find( (c: GenericDocument) => c.type.name === 'ParsedDeAddress' ); return new ParsedDeAddress(child as GenericDocument); } } export namespace DeIdCardBack {} /** German travel passport (Reisepass) */ export class DePassport { private _document: GenericDocument; get document(): GenericDocument { return this._document; } constructor(document: GenericDocument) { if (document.type.name !== this.requiredDocumentType()) { throw new Error( `Expected document type ${this.requiredDocumentType()}, got ${document.type.name}` ); } this._document = document; } requiredDocumentType(): string { return DePassportDocumentType; } /** Birth date */ get birthDate(): Field { return this.document.fields.find((f: Field) => f.type.name === 'BirthDate') as Field; } /** Birthplace */ get birthplace(): Field { return this.document.fields.find((f: Field) => f.type.name === 'Birthplace') as Field; } /** Country code */ get countryCode(): Field { return this.document.fields.find((f: Field) => f.type.name === 'CountryCode') as Field; } /** Expiry date */ get expiryDate(): Field { return this.document.fields.find((f: Field) => f.type.name === 'ExpiryDate') as Field; } /** Gender */ get gender(): Field { return this.document.fields.find((f: Field) => f.type.name === 'Gender') as Field; } /** Given names */ get givenNames(): Field { return this.document.fields.find((f: Field) => f.type.name === 'GivenNames') as Field; } /** Document ID number (in the top-right corner) */ get id(): Field { return this.document.fields.find((f: Field) => f.type.name === 'ID') as Field; } /** Issue date */ get issueDate(): Field { return this.document.fields.find((f: Field) => f.type.name === 'IssueDate') as Field; } /** Issuing authority */ get issuingAuthority(): Field { return this.document.fields.find((f: Field) => f.type.name === 'IssuingAuthority') as Field; } /** Maiden name */ get maidenName(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'MaidenName'); } /** Nationality */ get nationality(): Field { return this.document.fields.find((f: Field) => f.type.name === 'Nationality') as Field; } /** Passport type */ get passportType(): Field { return this.document.fields.find((f: Field) => f.type.name === 'PassportType') as Field; } /** Photo image */ get photo(): Field { return this.document.fields.find((f: Field) => f.type.name === 'Photo') as Field; } /** Raw MRZ text value */ get rawMRZ(): Field { return this.document.fields.find((f: Field) => f.type.name === 'RawMRZ') as Field; } /** Signature image */ get signature(): Field { return this.document.fields.find((f: Field) => f.type.name === 'Signature') as Field; } /** Surname */ get surname(): Field { return this.document.fields.find((f: Field) => f.type.name === 'Surname') as Field; } /** The child document of type "MRZ". */ get mrz(): MRZ { const child = this.document.children.find((c: GenericDocument) => c.type.name === 'MRZ'); return new MRZ(child as GenericDocument); } } export namespace DePassport {} /** European driver license, front side */ export class EuropeanDriverLicenseFront { private _document: GenericDocument; get document(): GenericDocument { return this._document; } constructor(document: GenericDocument) { if (document.type.name !== this.requiredDocumentType()) { throw new Error( `Expected document type ${this.requiredDocumentType()}, got ${document.type.name}` ); } this._document = document; } requiredDocumentType(): string { return EuropeanDriverLicenseFrontDocumentType; } /** Address (Field 8.) */ get address(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'Address'); } /** Administrative number (Field 10.) */ get administrativeNumber(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'AdministrativeNumber'); } /** Barcode */ get barcode(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'Barcode'); } /** Birth date (Field 3.) */ get birthDate(): Field { return this.document.fields.find((f: Field) => f.type.name === 'BirthDate') as Field; } /** Birthplace (Field 3.) */ get birthplace(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'Birthplace'); } /** Citizenship (Field 4f.) */ get citizenship(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'Citizenship'); } /** Country of the driver license */ get country(): Field { return this.document.fields.find((f: Field) => f.type.name === 'Country') as Field; } /** Expiry date (Field 4b.) */ get expiryDate(): Field { return this.document.fields.find((f: Field) => f.type.name === 'ExpiryDate') as Field; } /** Gender (Field 4e.) */ get gender(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'Gender'); } /** Given names (Field 2.) */ get givenNames(): Field { return this.document.fields.find((f: Field) => f.type.name === 'GivenNames') as Field; } /** Document ID number (in the top-right corner, Field 5.) */ get id(): Field { return this.document.fields.find((f: Field) => f.type.name === 'ID') as Field; } /** Issue date (Field 4a.) */ get issueDate(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'IssueDate'); } /** Issuing authority (Field 4c.) */ get issuingAuthority(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'IssuingAuthority'); } /** Driver's license categories (Field 9.) */ get licenseCategories(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'LicenseCategories'); } /** MRZ part of the document */ get mrz(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'MRZ'); } /** Photo image */ get photo(): Field { return this.document.fields.find((f: Field) => f.type.name === 'Photo') as Field; } /** Restrictions applied for the driver's license (Field 12.) */ get restrictions(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'Restrictions'); } /** Serial number (Field 5b. on Driver Qualification Card) */ get serialNumber(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'SerialNumber'); } /** Signature image (Field 7.) */ get signature(): Field { return this.document.fields.find((f: Field) => f.type.name === 'Signature') as Field; } /** Surname (Field 1.) */ get surname(): Field { return this.document.fields.find((f: Field) => f.type.name === 'Surname') as Field; } } /** European driver license, back side */ export class EuropeanDriverLicenseBack { private _document: GenericDocument; get document(): GenericDocument { return this._document; } constructor(document: GenericDocument) { if (document.type.name !== this.requiredDocumentType()) { throw new Error( `Expected document type ${this.requiredDocumentType()}, got ${document.type.name}` ); } this._document = document; } requiredDocumentType(): string { return EuropeanDriverLicenseBackDocumentType; } /** Country of the driver license */ get country(): Field { return this.document.fields.find((f: Field) => f.type.name === 'Country') as Field; } /** Restrictions applied for the driver's license (Field 12.) */ get restrictions(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'Restrictions'); } /** The child document of type "Categories". */ get categories(): EuropeanDriverLicenseBack.Categories { const child = this.document.children.find((c: GenericDocument) => c.type.name === 'Categories'); return new EuropeanDriverLicenseBack.Categories(child as GenericDocument); } } export namespace EuropeanDriverLicenseBack { /** A category row from the categories table */ export abstract class Category { private _document: GenericDocument; get document(): GenericDocument { return this._document; } constructor(document: GenericDocument) { if (document.type.name !== this.requiredDocumentType()) { throw new Error( `Expected document type ${this.requiredDocumentType()}, got ${document.type.name}` ); } this._document = document; } abstract requiredDocumentType(): string; /** Restrictions (Column 12.) */ get restrictions(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'Restrictions'); } /** Valid from (Column 10.) */ get validFrom(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'ValidFrom'); } /** Valid until (Column 11.) */ get validUntil(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'ValidUntil'); } } /** Categories table row container */ export class Categories { private _document: GenericDocument; get document(): GenericDocument { return this._document; } constructor(document: GenericDocument) { if (document.type.name !== this.requiredDocumentType()) { throw new Error( `Expected document type ${this.requiredDocumentType()}, got ${document.type.name}` ); } this._document = document; } requiredDocumentType(): string { return EuropeanDriverLicenseBackCategoriesDocumentType; } /** The child document of type "A". */ get a(): EuropeanDriverLicenseBack.Categories.A { const child = this.document.children.find((c: GenericDocument) => c.type.name === 'A'); return new EuropeanDriverLicenseBack.Categories.A(child as GenericDocument); } /** The child document of type "A1". */ get a1(): EuropeanDriverLicenseBack.Categories.A1 { const child = this.document.children.find((c: GenericDocument) => c.type.name === 'A1'); return new EuropeanDriverLicenseBack.Categories.A1(child as GenericDocument); } /** The child document of type "A2". */ get a2(): EuropeanDriverLicenseBack.Categories.A2 { const child = this.document.children.find((c: GenericDocument) => c.type.name === 'A2'); return new EuropeanDriverLicenseBack.Categories.A2(child as GenericDocument); } /** The child document of type "AM". */ get am(): EuropeanDriverLicenseBack.Categories.AM { const child = this.document.children.find((c: GenericDocument) => c.type.name === 'AM'); return new EuropeanDriverLicenseBack.Categories.AM(child as GenericDocument); } /** The child document of type "B". */ get b(): EuropeanDriverLicenseBack.Categories.B { const child = this.document.children.find((c: GenericDocument) => c.type.name === 'B'); return new EuropeanDriverLicenseBack.Categories.B(child as GenericDocument); } /** The child document of type "B1". */ get b1(): EuropeanDriverLicenseBack.Categories.B1 | undefined { const child = this.document.children.find((c: GenericDocument) => c.type.name === 'B1'); return child ? new EuropeanDriverLicenseBack.Categories.B1(child) : undefined; } /** The child document of type "BE". */ get be(): EuropeanDriverLicenseBack.Categories.BE { const child = this.document.children.find((c: GenericDocument) => c.type.name === 'BE'); return new EuropeanDriverLicenseBack.Categories.BE(child as GenericDocument); } /** The child document of type "C". */ get c(): EuropeanDriverLicenseBack.Categories.C { const child = this.document.children.find((c: GenericDocument) => c.type.name === 'C'); return new EuropeanDriverLicenseBack.Categories.C(child as GenericDocument); } /** The child document of type "C1". */ get c1(): EuropeanDriverLicenseBack.Categories.C1 { const child = this.document.children.find((c: GenericDocument) => c.type.name === 'C1'); return new EuropeanDriverLicenseBack.Categories.C1(child as GenericDocument); } /** The child document of type "C1E". */ get c1E(): EuropeanDriverLicenseBack.Categories.C1E { const child = this.document.children.find((c: GenericDocument) => c.type.name === 'C1E'); return new EuropeanDriverLicenseBack.Categories.C1E(child as GenericDocument); } /** The child document of type "CE". */ get ce(): EuropeanDriverLicenseBack.Categories.CE { const child = this.document.children.find((c: GenericDocument) => c.type.name === 'CE'); return new EuropeanDriverLicenseBack.Categories.CE(child as GenericDocument); } /** The child document of type "D". */ get d(): EuropeanDriverLicenseBack.Categories.D { const child = this.document.children.find((c: GenericDocument) => c.type.name === 'D'); return new EuropeanDriverLicenseBack.Categories.D(child as GenericDocument); } /** The child document of type "D1". */ get d1(): EuropeanDriverLicenseBack.Categories.D1 { const child = this.document.children.find((c: GenericDocument) => c.type.name === 'D1'); return new EuropeanDriverLicenseBack.Categories.D1(child as GenericDocument); } /** The child document of type "D1E". */ get d1E(): EuropeanDriverLicenseBack.Categories.D1E { const child = this.document.children.find((c: GenericDocument) => c.type.name === 'D1E'); return new EuropeanDriverLicenseBack.Categories.D1E(child as GenericDocument); } /** The child document of type "DE". */ get de(): EuropeanDriverLicenseBack.Categories.DE { const child = this.document.children.find((c: GenericDocument) => c.type.name === 'DE'); return new EuropeanDriverLicenseBack.Categories.DE(child as GenericDocument); } /** The child document of type "L". */ get l(): EuropeanDriverLicenseBack.Categories.L { const child = this.document.children.find((c: GenericDocument) => c.type.name === 'L'); return new EuropeanDriverLicenseBack.Categories.L(child as GenericDocument); } /** The child document of type "T". */ get t(): EuropeanDriverLicenseBack.Categories.T { const child = this.document.children.find((c: GenericDocument) => c.type.name === 'T'); return new EuropeanDriverLicenseBack.Categories.T(child as GenericDocument); } } export namespace Categories { /** EuropeanDriverLicenseBack.Categories.A */ export class A extends Category { constructor(document: GenericDocument) { super(document); } requiredDocumentType(): string { return EuropeanDriverLicenseBackCategoriesADocumentType; } } /** EuropeanDriverLicenseBack.Categories.A1 */ export class A1 extends Category { constructor(document: GenericDocument) { super(document); } requiredDocumentType(): string { return EuropeanDriverLicenseBackCategoriesA1DocumentType; } } /** EuropeanDriverLicenseBack.Categories.A2 */ export class A2 extends Category { constructor(document: GenericDocument) { super(document); } requiredDocumentType(): string { return EuropeanDriverLicenseBackCategoriesA2DocumentType; } } /** EuropeanDriverLicenseBack.Categories.AM */ export class AM extends Category { constructor(document: GenericDocument) { super(document); } requiredDocumentType(): string { return EuropeanDriverLicenseBackCategoriesAMDocumentType; } } /** EuropeanDriverLicenseBack.Categories.B */ export class B extends Category { constructor(document: GenericDocument) { super(document); } requiredDocumentType(): string { return EuropeanDriverLicenseBackCategoriesBDocumentType; } } /** EuropeanDriverLicenseBack.Categories.B1 */ export class B1 extends Category { constructor(document: GenericDocument) { super(document); } requiredDocumentType(): string { return EuropeanDriverLicenseBackCategoriesB1DocumentType; } } /** EuropeanDriverLicenseBack.Categories.BE */ export class BE extends Category { constructor(document: GenericDocument) { super(document); } requiredDocumentType(): string { return EuropeanDriverLicenseBackCategoriesBEDocumentType; } } /** EuropeanDriverLicenseBack.Categories.C */ export class C extends Category { constructor(document: GenericDocument) { super(document); } requiredDocumentType(): string { return EuropeanDriverLicenseBackCategoriesCDocumentType; } } /** EuropeanDriverLicenseBack.Categories.C1 */ export class C1 extends Category { constructor(document: GenericDocument) { super(document); } requiredDocumentType(): string { return EuropeanDriverLicenseBackCategoriesC1DocumentType; } } /** EuropeanDriverLicenseBack.Categories.C1E */ export class C1E extends Category { constructor(document: GenericDocument) { super(document); } requiredDocumentType(): string { return EuropeanDriverLicenseBackCategoriesC1EDocumentType; } } /** EuropeanDriverLicenseBack.Categories.CE */ export class CE extends Category { constructor(document: GenericDocument) { super(document); } requiredDocumentType(): string { return EuropeanDriverLicenseBackCategoriesCEDocumentType; } } /** EuropeanDriverLicenseBack.Categories.D */ export class D extends Category { constructor(document: GenericDocument) { super(document); } requiredDocumentType(): string { return EuropeanDriverLicenseBackCategoriesDDocumentType; } } /** EuropeanDriverLicenseBack.Categories.D1 */ export class D1 extends Category { constructor(document: GenericDocument) { super(document); } requiredDocumentType(): string { return EuropeanDriverLicenseBackCategoriesD1DocumentType; } } /** EuropeanDriverLicenseBack.Categories.D1E */ export class D1E extends Category { constructor(document: GenericDocument) { super(document); } requiredDocumentType(): string { return EuropeanDriverLicenseBackCategoriesD1EDocumentType; } } /** EuropeanDriverLicenseBack.Categories.DE */ export class DE extends Category { constructor(document: GenericDocument) { super(document); } requiredDocumentType(): string { return EuropeanDriverLicenseBackCategoriesDEDocumentType; } } /** EuropeanDriverLicenseBack.Categories.L */ export class L extends Category { constructor(document: GenericDocument) { super(document); } requiredDocumentType(): string { return EuropeanDriverLicenseBackCategoriesLDocumentType; } } /** EuropeanDriverLicenseBack.Categories.T */ export class T extends Category { constructor(document: GenericDocument) { super(document); } requiredDocumentType(): string { return EuropeanDriverLicenseBackCategoriesTDocumentType; } } } } /** German Residence Permit (Aufenthaltstitel), Front side */ export class DeResidencePermitFront { private _document: GenericDocument; get document(): GenericDocument { return this._document; } constructor(document: GenericDocument) { if (document.type.name !== this.requiredDocumentType()) { throw new Error( `Expected document type ${this.requiredDocumentType()}, got ${document.type.name}` ); } this._document = document; } requiredDocumentType(): string { return DeResidencePermitFrontDocumentType; } /** Birth date (Geburtsdatum) */ get birthDate(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'BirthDate'); } /** Six digit card access number */ get cardAccessNumber(): Field { return this.document.fields.find((f: Field) => f.type.name === 'CardAccessNumber') as Field; } /** Expiry date (Gültig bis) */ get expiryDate(): Field { return this.document.fields.find((f: Field) => f.type.name === 'ExpiryDate') as Field; } /** Gender (Geschlecht) */ get gender(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'Gender'); } /** Given names */ get givenNames(): Field { return this.document.fields.find((f: Field) => f.type.name === 'GivenNames') as Field; } /** Document ID number (in the top-right corner) */ get id(): Field { return this.document.fields.find((f: Field) => f.type.name === 'ID') as Field; } /** Nationality (Staatsangehörigkeit) */ get nationality(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'Nationality'); } /** Photo image */ get photo(): Field { return this.document.fields.find((f: Field) => f.type.name === 'Photo') as Field; } /** Place of issue (Ausstellungsort) */ get placeOfIssue(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'PlaceOfIssue'); } /** Remarks (Anmerkungen) */ get remarks(): Field { return this.document.fields.find((f: Field) => f.type.name === 'Remarks') as Field; } /** Signature image */ get signature(): Field { return this.document.fields.find((f: Field) => f.type.name === 'Signature') as Field; } /** Surname */ get surname(): Field { return this.document.fields.find((f: Field) => f.type.name === 'Surname') as Field; } /** Title type (Art des Titels) */ get titleType(): Field { return this.document.fields.find((f: Field) => f.type.name === 'TitleType') as Field; } /** Valid from date (Gültig ab) */ get validFrom(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'ValidFrom'); } } /** German Residence Permit (Aufenthaltstitel), Back side */ export class DeResidencePermitBack { private _document: GenericDocument; get document(): GenericDocument { return this._document; } constructor(document: GenericDocument) { if (document.type.name !== this.requiredDocumentType()) { throw new Error( `Expected document type ${this.requiredDocumentType()}, got ${document.type.name}` ); } this._document = document; } requiredDocumentType(): string { return DeResidencePermitBackDocumentType; } /** Address (Anschrift) */ get address(): Field { return this.document.fields.find((f: Field) => f.type.name === 'Address') as Field; } /** Birth date (Geburtsdatum) */ get birthDate(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'BirthDate'); } /** Birthplace (Geburtsort) */ get birthplace(): Field { return this.document.fields.find((f: Field) => f.type.name === 'Birthplace') as Field; } /** Eye color (Augenfarbe) */ get eyeColor(): Field { return this.document.fields.find((f: Field) => f.type.name === 'EyeColor') as Field; } /** Gender (Geschlecht) */ get gender(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'Gender'); } /** Height (Größe) */ get height(): Field { return this.document.fields.find((f: Field) => f.type.name === 'Height') as Field; } /** Issuing authority (Ausländerbehörde) */ get issuingAuthority(): Field { return this.document.fields.find((f: Field) => f.type.name === 'IssuingAuthority') as Field; } /** Nationality (Staatsangehörigkeit) */ get nationality(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'Nationality'); } /** Raw MRZ text value */ get rawMRZ(): Field { return this.document.fields.find((f: Field) => f.type.name === 'RawMRZ') as Field; } /** Remarks (Anmerkungen) */ get remarks(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'Remarks'); } /** The child document of type "MRZ". */ get mrz(): MRZ { const child = this.document.children.find((c: GenericDocument) => c.type.name === 'MRZ'); return new MRZ(child as GenericDocument); } /** The child document of type "ParsedDeAddress". */ get parsedDeAddress(): ParsedDeAddress { const child = this.document.children.find( (c: GenericDocument) => c.type.name === 'ParsedDeAddress' ); return new ParsedDeAddress(child as GenericDocument); } } export namespace DeResidencePermitBack {} /** European Health Insurance Card (EHIC). Supports formats with both four and five lines of data. */ export class EuropeanHealthInsuranceCard { private _document: GenericDocument; get document(): GenericDocument { return this._document; } constructor(document: GenericDocument) { if (document.type.name !== this.requiredDocumentType()) { throw new Error( `Expected document type ${this.requiredDocumentType()}, got ${document.type.name}` ); } this._document = document; } requiredDocumentType(): string { return EuropeanHealthInsuranceCardDocumentType; } /** Barcode image (only present in some formats) */ get barcode(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'Barcode'); } /** Birth date */ get birthDate(): Field { return this.document.fields.find((f: Field) => f.type.name === 'BirthDate') as Field; } /** Card number */ get cardNumber(): Field { return this.document.fields.find((f: Field) => f.type.name === 'CardNumber') as Field; } /** Country code (ISO 3166-1 alpha-2) */ get countryCode(): Field { return this.document.fields.find((f: Field) => f.type.name === 'CountryCode') as Field; } /** Expiry date */ get expiryDate(): Field { return this.document.fields.find((f: Field) => f.type.name === 'ExpiryDate') as Field; } /** Given names */ get givenNames(): Field { return this.document.fields.find((f: Field) => f.type.name === 'GivenNames') as Field; } /** Issuer name */ get issuerName(): Field { return this.document.fields.find((f: Field) => f.type.name === 'IssuerName') as Field; } /** Issuer number */ get issuerNumber(): Field { return this.document.fields.find((f: Field) => f.type.name === 'IssuerNumber') as Field; } /** Personal number */ get personalNumber(): Field { return this.document.fields.find((f: Field) => f.type.name === 'PersonalNumber') as Field; } /** Signature image */ get signature(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'Signature'); } /** Surname */ get surname(): Field { return this.document.fields.find((f: Field) => f.type.name === 'Surname') as Field; } } /** Front side of the German health insurance card (elektronische Gesundheitskarte). For the backside, see EuropeanHealthInsuranceCard. */ export class DeHealthInsuranceCardFront { private _document: GenericDocument; get document(): GenericDocument { return this._document; } constructor(document: GenericDocument) { if (document.type.name !== this.requiredDocumentType()) { throw new Error( `Expected document type ${this.requiredDocumentType()}, got ${document.type.name}` ); } this._document = document; } requiredDocumentType(): string { return DeHealthInsuranceCardFrontDocumentType; } /** Six digit card access number */ get cardAccessNumber(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'CardAccessNumber'); } /** Issuer name */ get issuerName(): Field { return this.document.fields.find((f: Field) => f.type.name === 'IssuerName') as Field; } /** Issuer number (Versicherung bzw. Kennnummer des Trägers) */ get issuerNumber(): Field { return this.document.fields.find((f: Field) => f.type.name === 'IssuerNumber') as Field; } /** Full name with title */ get name(): Field { return this.document.fields.find((f: Field) => f.type.name === 'Name') as Field; } /** Personal number (Versichertennummer) */ get personalNumber(): Field { return this.document.fields.find((f: Field) => f.type.name === 'PersonalNumber') as Field; } } /** Brazilian National Identity Card (Registro Geral) */ export class BrIdCardFront { private _document: GenericDocument; get document(): GenericDocument { return this._document; } constructor(document: GenericDocument) { if (document.type.name !== this.requiredDocumentType()) { throw new Error( `Expected document type ${this.requiredDocumentType()}, got ${document.type.name}` ); } this._document = document; } requiredDocumentType(): string { return BrIdCardFrontDocumentType; } /** Código de Barras - Barcode */ get barcode(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'Barcode'); } /** Birth date */ get birthDate(): Field { return this.document.fields.find((f: Field) => f.type.name === 'BirthDate') as Field; } /** Birthplace */ get birthplace(): Field { return this.document.fields.find((f: Field) => f.type.name === 'Birthplace') as Field; } /** Tipo Sanguíneo/Fator RH - Blood type and RH factor */ get bloodType(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'BloodType'); } /** Dados do Registro Civil - Civil Registry Details */ get civilRegistryDetails(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'CivilRegistryDetails'); } /** CNH (Carteira Nacional de Habilitação) - Driver’s license number */ get driverLicenseNumber(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'DriverLicenseNumber'); } /** Expiry date */ get expiryDate(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'ExpiryDate'); } /** Polegar Direito - Right thumbprint */ get fingerprint(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'Fingerprint'); } /** Gender */ get gender(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'Gender'); } /** Given names */ get givenNames(): Field { return this.document.fields.find((f: Field) => f.type.name === 'GivenNames') as Field; } /** CNS (Cartão Nacional de Saúde) - National Health Card number */ get healthCardNumber(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'HealthCardNumber'); } /** DNI (Documento Nacional de Identidade) - National Identity Document number */ get id(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'ID'); } /** Data de Expedição - Date the document was issued */ get issueDate(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'IssueDate'); } /** Órgão Expedidor - Issuing Authority */ get issuingAuthority(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'IssuingAuthority'); } /** Assinatura do Diretor - Signature of the issuing authority */ get issuingAuthoritySignature(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'IssuingAuthoritySignature'); } /** Certificado Militar - Military certificate number */ get militaryCertificateNumber(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'MilitaryCertificateNumber'); } /** Nacionalidade - Nationality */ get nationality(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'Nationality'); } /** Observações - Observations */ get observations(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'Observations'); } /** Pais - Parents */ get parents(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'Parents'); } /** Registro Geral (RG) - General Registration number, main ID number */ get personalNumber(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'PersonalNumber'); } /** Photo image */ get photo(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'Photo'); } /** Local de Emissão - Place of Issue */ get placeOfIssue(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'PlaceOfIssue'); } /** Identidade Profissional - Professional identity number */ get professionalIdentityNumber(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'ProfessionalIdentityNumber'); } /** Assinatura - Signature */ get signature(): Field { return this.document.fields.find((f: Field) => f.type.name === 'Signature') as Field; } /** NIS/PIS/PASEP - Social Security and Employment benefits number */ get socialSecurityNumber(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'SocialSecurityNumber'); } /** UF - Brazilian state code for the Work Card */ get stateCode(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'StateCode'); } /** Surname */ get surname(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'Surname'); } /** CPF (Cadastro de Pessoas Físicas) - Brazilian taxpayer number */ get taxpayerNumber(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'TaxpayerNumber'); } /** Título de Eleitor - Voter registration number */ get voterRegistrationNumber(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'VoterRegistrationNumber'); } /** CTPS (Carteira de Trabalho e Previdência Social) - Work Card number */ get workCardNumber(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'WorkCardNumber'); } /** Série - Series number associated with the Work Card */ get workCardSeries(): Field | undefined { return this.document.fields.find((f: Field) => f.type.name === 'WorkCardSeries'); } } /** Brazilian National Identity Card (Registro Geral), back side */ export class BrIdCardBack { private _document: GenericDocument; get document(): GenericDocument { return this._document; } constructor(document: GenericDocument) { if (document.type.name !== this.requiredDocumentType()) { throw new Error(