-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathindex.d.ts
25 lines (23 loc) · 955 Bytes
/
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
// Type definitions for commons-validator-js 1.0
// Project: https://github.com/wix/commons-validator-js
// Definitions by: Robert Mruczek <https://github.com/rtmruczek>
export class EmailValidator {
/**
* @param allowLocal Should local addresses be considered valid? default = false
* @param allowTld Should TLDs be allowed? default = false
*/
constructor({allowLocal, allowTld}?: {allowLocal: boolean, allowTld: boolean});
isValid: (email: string) => boolean;
}
export class DomainValidator {
/**
* @param allowLocal Should local addresses be considered valid? default = false
*/
constructor({allowLocal}?: {allowLocal: boolean});
isValidCountryCodeTld: (ccTld: string) => boolean;
isValidGenericTld: (gTld: string) => boolean;
isValidInfrastructureTld: (iTld: string) => boolean;
isValidTld: (tld: string) => boolean;
extractTld: (domain: string) => string | null;
isValid: (domain: string) => boolean;
}