import { ChacaUtils } from "../../core/utils"; import { PersonModule } from "../person"; import { DatatypeModule } from "../datatype"; import { WordModule } from "../word"; export declare type HttpStatus = { informational: number[]; success: number[]; redirection: number[]; clientError: number[]; serverError: number[]; }; export declare type Emojis = { smiley: string[]; body: string[]; person: string[]; nature: string[]; food: string[]; travel: string[]; activity: string[]; object: string[]; symbol: string[]; }; declare type EmojiProps = { emoji?: keyof Emojis; }; declare type EmailArgs = { firstName?: string; lastName?: string; provider?: string; }; declare type PasswordArgs = { length?: number; memorable?: boolean; prefix?: string; pattern?: RegExp; }; declare type UrlArgs = { secure?: boolean; }; declare type UsernameArgs = { firstName?: string; lastName?: string; }; export declare class InternetModule { private readonly datatypeModule; private readonly utils; private readonly personModule; private readonly wordModule; private readonly passwordCreator; constructor(datatypeModule: DatatypeModule, utils: ChacaUtils, personModule: PersonModule, wordModule: WordModule); readonly constants: { emojis: Emojis; domainSuffixs: string[]; httpStatus: HttpStatus; httpMethods: string[]; protocols: string[]; oauthProviders: string[]; locales: string[]; emailProviders: string[]; browsers: string[]; }; /** * Returns a browser name * * @example * modules.internet.browser() // 'Opera' * * @returns string */ browser(): string; /** * Generate a random OAuth provider * * @example * modules.internet.oauthProvider() // 'Amazon' * * @returns string */ oauthProvider(): string; /** * Returns a random locale * * @example * modules.internet.locale() // 'es_MX' * * @returns string */ locale(): string; /** * Returns a random email provider * * @example * modules.internet.emailProvider() // 'gmail' * * @returns string */ emailProvider(): string; /** * Returns a user email * @param args.firstName owner first name * @param args.lastName owner last name * @param args.provider email provider * * @example * modules.internet.email() // 'juan527120@gmail.com' * modules.internet.email({ firstName: 'pedro', lastName: 'Scott', provider: 'yahoo.com' }) // "pedro_scott@yahoo.com" * * @returns string */ email({ firstName, lastName, provider: iprovider }?: EmailArgs): string; /** * Returns a password. * * @param args.length The length of the password to generate. Defaults to `15`. * @param args.memorable Whether the generated password should be memorable. Defaults to `false`. * @param args.pattern The pattern that all chars should match should match. * This option will be ignored, if `memorable` is `true`. Defaults to `/\w/`. * @param args.prefix The prefix to use. Defaults to `''`. * * @example * modules.internet.password() // '89G1wJuBLbGziIs' * modules.internet.password({ length: 20 }) // 'aF55c_8O9kZaPOrysFB_' * modules.internet.password({ length: 20, memorable: true }) // 'lawetimufozujosodedi' * modules.internet.password({ length: 20, memorable: true, pattern: /[A-Z]/ }) // 'HMAQDFFYLDDUTBKVNFVS' * modules.internet.password({ length: 20, memorable: true, pattern: /[A-Z]/, prefix: 'Hello ' }) // 'Hello IREOXTDWPERQSB' * * @returns string */ password({ length, memorable: imemorable, pattern: ipattern, prefix: iprefix, }?: PasswordArgs): string; /** * Returns a string with a web url * * @example * modules.internet.url() // 'http://words.info.net' * * @param args.secure The url has a secure protocol or not * * @returns */ url({ secure }?: UrlArgs): string; /** * Returns a profile user name * * @param args.firstName owner first name * @param args.lastName owner last name * * @example * modules.internet.username() // 'juan527134' * modules.internet.username({ firstName: 'pedro', lastName: 'Scott' }) // 'pedro_scott' * * @returns string */ username({ firstName: ifirstName, lastName: ilastName, }?: UsernameArgs): string; /** * Returns a http method * @example * modules.internet.httpMethod() // 'GET' * @returns `GET` | `PATCH` | `DELETE` | `POST` | `PUT` */ httpMethod(): string; /** * Returns a IPv6 address * @example modules.internet.ipv6() // '269f:1230:73e3:318d:842b:daab:326d:897b' * @returns string */ ipv6(): string; /** * Returns a IPv4 address. * * @example modules.internet.ipv4() // '245.108.222.0' * * @returns string */ ipv4(): string; /** * Return an emoji * @param args.emoji emoji category * @example modules.internet.emoji() // '🔎' * @returns string */ emoji({ emoji: iemoji }?: EmojiProps): string; /** * Returns a mac address * @example modules.internet.mac() // '32:8e:2e:09:c6:05' * @returns string */ mac(): string; /** * Returns a port number * @example * modules.internet.port() // 8001 * @returns string */ port(): number; /** * Returns a string with a browser user agent * @example modules.internet.userAgent() // 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_8_8) AppleWebKit/536.0.2 (KHTML, like Gecko) Chrome/27.0.849.0 Safari/536.0.2' * @returns string */ userAgent(): string; /** * Returns a web protocol * @example modules.internet.protocol() // 'https' * @returns string */ protocol(): string; /** * Returns a domain suffix * @example modules.internet.domainSuffix() // '.com' * @returns string */ domainSuffix(): string; /** * Returns a domain word * @example modules.internet.domainName() // 'words.info' * @returns string */ domainName(): string; /** * Returns a web http status code * @example modules.internet.httpStatusCode() // 201 * @returns string */ httpStatusCode(): number; /** * Generates a random IPv4 or IPv6 address. * * @example * modules.internet.ip() // '245.108.222.0' * modules.internet.ip() // '4e5:f9c5:4337:abfd:9caf:1135:41ad:d8d3' */ ip(): string; } export {};