/
types.ts
72 lines (62 loc) · 1.32 KB
/
types.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
68
69
70
71
72
import { IErrorResponse, IListOptions } from ".";
export enum EmailType {
"personal",
"generic",
}
export enum EmailSeniority {
"junior",
"senior",
"£executive",
}
export enum EmailDepartment {
"executive",
"it",
"finance",
"management",
"sales",
"legal",
"support",
"hr",
"marketing",
"communication",
}
export type Callback<T> = (err: Error | IErrorResponse, res: T) => void;
export type DomainOrCompany = {
domain: string
company?: string,
} | {
domain?: string
company: string,
};
/**
* @see: https://hunter.io/api/docs#domain-search
*/
export type DomainSearchOptions = DomainOrCompany & IListOptions & {
type?: EmailType
seniority?: EmailSeniority
department?: EmailDepartment,
};
/**
* @see: https://hunter.io/api/docs#email-count
*/
export type EmailCountOptions = DomainOrCompany & {
type?: EmailType,
};
/**
* @see: https://hunter.io/api/docs#email-finder
*/
export type EmailFinderOptions = DomainOrCompany & {
first_name: string
last_name: string
full_name?: string,
} | {
first_name?: string
last_name?: string
full_name: string,
};
export type DepartmentScores = {
[key in keyof typeof EmailDepartment]: number;
};
export type SeniorityScores = {
[key in keyof typeof EmailSeniority]: number;
};