/** * @typedef {Object} UrlRegexOptions - Configuration options for customizing the generated URL regular expression. * @property {string} [protocol='https?'] - The protocol scheme (e.g., 'http', 'https'). * @property {string} [subDomain=''] - The subdomain string to match. * @property {boolean} [subDomainOptional=true] - Whether the subdomain is required or optional. * @property {[number, number]} [nameMaxLength=[1, 256]] - An array containing the minimum and maximum length for the domain name. * @property {[number, number]} [topLevelDomainLength=[1, 6]] - An array containing the minimum and maximum length for the TLD. */ export type UrlRegexOptions = { /** * - The protocol scheme (e.g., 'http', 'https'). */ protocol?: string; /** * - The subdomain string to match. */ subDomain?: string; /** * - Whether the subdomain is required or optional. */ subDomainOptional?: boolean; /** * - An array containing the minimum and maximum length for the domain name. */ nameMaxLength?: [number, number]; /** * - An array containing the minimum and maximum length for the TLD. */ topLevelDomainLength?: [number, number]; }; /** * Constructs a URL regular expression pattern string based on the provided configuration options. * @param {UrlRegexOptions} [options] - The configuration options. * @returns {string} The generated regex pattern string. */ export declare const urlStringRegexBuilder: (options?: UrlRegexOptions) => string; /** * Creates a RegExp object anchored to the start and end of the string using the provided configuration. * @param {UrlRegexOptions} [options] - The configuration options. * @returns {RegExp} The resulting RegExp object. */ export declare function urlRegex(options?: UrlRegexOptions): RegExp; /** * Validates whether a given string matches the specified URL pattern. * @param {string} s - The string to validate. * @param {UrlRegexOptions} [options] - The configuration options. * @param {RegExp} [regex] - The regex used to execute the function. * @returns {boolean} True if the string is a valid URL according to the pattern, false otherwise. * @throws {TypeError} If the input string is not a string. */ export declare function isValidUrl(s: string, options?: UrlRegexOptions, regex?: RegExp): boolean; /** * Generates a global RegExp object used to find all occurrences of URLs within a text. * @param {UrlRegexOptions} [options] - The configuration options. * @returns {RegExp} The resulting global RegExp object. */ export declare function findUrlRegex(options?: UrlRegexOptions): RegExp; /** * Extracts all matching URL strings from a given text using the provided configuration. * @param {string} text - The text to search. * @param {UrlRegexOptions} [options] - The configuration options. * @param {RegExp} [regex] - The regex used to execute the function. * @returns {string[]} An array of matches or null if no matches are found. * @throws {TypeError} If the input text is not a string. */ export declare function extractUrls(text: string, options?: UrlRegexOptions, regex?: RegExp): string[]; //# sourceMappingURL=UrlDetector.d.mts.map