aamva-parser
Version:
Parse AAMVA PDF417 barcode data from driver's licenses and ID cards
103 lines (94 loc) • 2.51 kB
TypeScript
declare enum IssuingCountry {
UnitedStates = "United States",
Canada = "Canada",
Unknown = "Unknown"
}
declare enum Gender {
Male = "Male",
Female = "Female",
Other = "Other",
Unknown = "Unknown"
}
declare enum EyeColor {
Black = "Black",
Blue = "Blue",
Brown = "Brown",
Gray = "Gray",
Green = "Green",
Hazel = "Hazel",
Maroon = "Maroon",
Pink = "Pink",
Dichromatic = "Dichromatic",
Unknown = "Unknown"
}
declare enum HairColor {
Bald = "Bald",
Black = "Black",
Blond = "Blond",
Brown = "Brown",
Grey = "Grey",
Red = "Red",
Sandy = "Sandy",
White = "White",
Unknown = "Unknown"
}
declare enum Truncation {
Truncated = "Truncated",
None = "None",
Unknown = "Unknown"
}
declare enum NameSuffix {
Junior = "Junior",
Senior = "Senior",
First = "First",
Second = "Second",
Third = "Third",
Fourth = "Fourth",
Fifth = "Fifth",
Sixth = "Sixth",
Seventh = "Seventh",
Eighth = "Eighth",
Ninth = "Ninth",
Unknown = "Unknown"
}
interface ParsedLicense {
firstName?: string | null;
lastName?: string | null;
middleName?: string | null;
expirationDate?: Date | null;
issueDate?: Date | null;
dateOfBirth?: Date | null;
gender?: Gender;
eyeColor?: EyeColor;
height?: number | null;
streetAddress?: string | null;
city?: string | null;
state?: string | null;
postalCode?: string | null;
driversLicenseId?: string | null;
documentId?: string | null;
country?: IssuingCountry;
middleNameTruncation?: Truncation;
firstNameTruncation?: Truncation;
lastNameTruncation?: Truncation;
streetAddressSupplement?: string | null;
hairColor?: HairColor;
placeOfBirth?: string | null;
auditInformation?: string | null;
inventoryControlNumber?: string | null;
lastNameAlias?: string | null;
firstNameAlias?: string | null;
suffixAlias?: string | null;
suffix?: NameSuffix;
version?: string | null;
pdf417?: string | null;
isExpired(): boolean;
expired?: boolean;
hasBeenIssued(): boolean;
isAcceptable(): boolean;
weight?: string;
}
declare function Parse(barcode: string): ParsedLicense;
declare function GetVersion(barcode: string): string;
declare function IsExpired(barcode: string): boolean;
export { EyeColor, Gender, GetVersion, HairColor, IsExpired, IssuingCountry, NameSuffix, Parse, type ParsedLicense, Truncation };