-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.d.ts
67 lines (53 loc) · 1.61 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
declare module 'machine-readable-zone' {
/* tslint:disable variable-name */
export interface UserInfo {
firstName: string;
lastName: string;
passportNumber: string;
countryCode: string;
nationality: string;
birthday: string;
gender: string;
validUntilDay: string;
personalNumber: string;
}
export type CommandLineArgs = string[];
export interface MRZGeneratorArgs {
user: UserInfo;
}
export interface MRZCommandLineArgs extends MRZGeneratorArgs {
version: boolean;
help: boolean;
countries: boolean;
}
export type MRZGenerationResult = string;
type CommandLineArgsMRZGenerator = (args: CommandLineArgs) => void;
type MRZGenerator = (args: MRZGeneratorArgs) => MRZGenerationResult;
interface FieldError {
fieldName: string;
error: string;
}
interface ArgsValidationResult {
isValid: boolean;
errors: FieldError[];
}
type SchemaValidator = (args: MRZGeneratorArgs) => ArgsValidationResult;
type OptionalString = string | null;
type FieldValidationResult = OptionalString;
type Validator = (value: any) => FieldValidationResult;
interface ValidationSchema {
firstName: Validator;
lastName: Validator;
passportNumber: Validator;
countryCode: Validator;
nationality: Validator;
birthday: Validator;
gender: Validator;
validUntilDay: Validator;
personalNumber: Validator;
}
export const generateMRZFromCommandLineArgs: CommandLineArgsMRZGenerator;
export const generateMRZ: MRZGenerator;
export const validateData: SchemaValidator;
export const ParamsValidationSchema: ValidationSchema;
}