import React from 'react';
import { Request as Request$1, Response as Response$1, NextFunction, Router } from 'express';

type MaliciousComponentType = "protocol" | "hostname" | "path" | "query" | "fragment";

/**
 * Interface defining detection result with detailed information
 */
interface MaliciousPatternResult {
    url?: string;
    isMalicious: boolean;
    detectedPatterns: DetectedPattern[];
    score: number;
    confidence: "low" | "medium" | "high";
    recommendation: string;
    contextAnalysis?: ContextAnalysisResult;
}
/**
 * New interface for contextual analysis results
 */
interface ContextAnalysisResult {
    relatedPatterns: RelatedPatternGroup[];
    entropyScore: number;
    anomalyScore: number;
    encodingLayers: number;
}
/**
 * Interface for related pattern groups
 */
interface RelatedPatternGroup {
    patterns: MaliciousPatternType[];
    description: string;
    riskMultiplier: number;
}
/**
 * Interface defining a detected malicious pattern
 */
interface DetectedPattern {
    type: MaliciousPatternType;
    pattern: string;
    location: string;
    severity: "low" | "medium" | "high";
    confidence: "low" | "medium" | "high";
    description: string;
    matchedValue?: string;
    contextScore?: number;
}
/**
 * Enum defining various malicious pattern types
 */
declare enum MaliciousPatternType {
    SQL_INJECTION = "sql_injection",
    XSS = "cross_site_scripting",
    COMMAND_INJECTION = "command_injection",
    PATH_TRAVERSAL = "path_traversal",
    OPEN_REDIRECT = "open_redirect",
    SSRF = "server_side_request_forgery",
    CRLF_INJECTION = "crlf_injection",
    ENCODED_PAYLOAD = "encoded_payload",
    SERIALIZATION = "serialization_payload",
    TEMPLATE_INJECTION = "template_injection",
    SUSPICIOUS_PARAMETER = "suspicious_parameter",
    DATA_URI = "data_uri",
    SUSPICIOUS_IP = "suspicious_ip",
    SUSPICIOUS_TLD = "suspicious_tld",
    SUSPICIOUS_DOMAIN = "suspicious_domain",
    PROTOCOL_CONFUSION = "protocol_confusion",
    HOMOGRAPH_ATTACK = "homograph_attack",// NEW: Domain spoofing using similar-looking chars
    MULTI_ENCODING = "multi_encoding",// NEW: Multiple encoding layers
    UNICODE_EVASION = "unicode_evasion",// NEW: Unicode character abuse
    FRAGMENT_PAYLOAD = "fragment_payload",// NEW: Payload split across parameters
    HEADER_INJECTION = "header_injection",// NEW: HTTP header injection
    NOSQL_INJECTION = "nosql_injection",// NEW: NoSQL injection patterns
    GRAPHQL_INJECTION = "graphql_injection",// NEW: GraphQL injection
    DOM_BASED_ATTACK = "dom_based_attack",// NEW: DOM-based attacks
    FILE_INCLUSION = "file_inclusion",// NEW: Remote/Local file inclusion
    RFI = "remote_file_inclusion",
    PHISHING = "phishing",//new
    PROTOTYPE_POLLUTION = "prototype_pollution",
    JWT_MANIPULATION = "jwt_manipulation",
    CSS_INJECTION = "css_injection",
    HOST_HEADER_INJECTION = "host_header_injection",
    DESERIALIZATION = "deserialization",
    DOM_CLOBBERING = "dom_clobbering",
    CLICKJACKING = "clickjacking",
    CORS_MISCONFIGURATION = "cors_misconfiguration",
    SUBDOMAIN_TAKEOVER = "subdomain_takeover",
    HTTP_PARAMETER_POLLUTION = "http_parameter_pollution",
    WEB_CACHE_POISONING = "web_cache_poisoning",
    ANOMALY = "anomaly",
    ZERO_DAY = "zero_day",
    RANSOMWARE = "ransomware",
    SUSPICIOUS_BEHAVIOR = "suspicious_behavior",
    PARAMETER_TAMPERING = "parameter_tampering",
    HIGH_ENTROPY = "high_entropy",
    KNOWN_THREAT = "known_threat",
    RCE = "rce",
    ANOMALY_DETECTED = "anomaly_detected",
    SUSPICIOUS_EXTENSION = "SUSPICIOUS_EXTENSION",
    KNOWN_MALICIOUS_URL = "known_malicious_url"
}
/**
 * Interface for malicious pattern detection options
 */
interface MaliciousPatternOptions {
    /**
     * Minimum score required to mark input as malicious (default: 50)
     */
    minScore?: number;
    /**
     * Enable verbose logging for debugging
     */
    debug?: boolean;
    /**
     * List of pattern types to ignore
     */
    ignorePatterns?: MaliciousPatternType[];
    /**
     * Adjust sensitivity for detections (0.1-2.0)
     * Lower values mean less sensitive, higher values mean more sensitive
     */
    sensitivity?: number;
    /**
     * Custom patterns to include in detection
     */
    customPatterns?: Array<{
        pattern: RegExp;
        type: MaliciousPatternType;
        severity: "low" | "medium" | "high";
        description: string;
    }>;
    /**
     * Enable contextual analysis for improved detection
     */
    enableContextualAnalysis?: boolean;
    /**
     * Enable entropy analysis for obfuscated payloads
     */
    enableEntropyAnalysis?: boolean;
    /**
     * Enable statistical analysis
     */
    enableStatisticalAnalysis?: boolean;
    /**
     * Component-specific sensitivity multipliers
     */
    componentSensitivity?: Record<MaliciousComponentType, number>;
    /**
     * Character set to focus on for pattern matching (default: latin)
     */
    characterSet?: "latin" | "unicode" | "all";
}

/**
 * Supported encoding types. This enumeration defines all the encoding schemes
 * that the NehonixURIProcessor can handle. Each type represents a distinct
 * method of representing characters or data in a string format, often used
 * in URLs, web applications, and data transmission.
 */
type ENC_TYPE = "percentEncoding" | "doublepercent" | "base64" | "hex" | "unicode" | "htmlEntity" | "punycode" | "asciihex" | "asciioct" | "rot13" | "base32" | "urlSafeBase64" | "jsEscape" | "cssEscape" | "utf7" | "quotedPrintable" | "decimalHtmlEntity" | "rawHexadecimal" | "jwt" | "url" | "rawHex";
type DEC_FEATURE_TYPE = "url" | "any";
interface PartialEncodingInfo {
    type: string;
    confidence: number;
}
/**
 * Result of encoding detection. This interface describes the outcome of an
 * attempt to identify the encoding scheme used in a given string. It provides
 * an array of all detected encoding types, the most likely type, and a
 * confidence score for that detection.
 */
interface EncodingDetectionResult {
    partialEncodings?: PartialEncodingInfo[];
    /**
     * An array of all encoding types detected in the input string.
     */
    types: string[];
    /**
     * The encoding type that is considered the most likely based on analysis.
     */
    mostLikely: ENC_TYPE | "plainText" | "mixedEncoding";
    /**
     * A numerical value representing the confidence level of the most likely
     * encoding detection, usually between 0 and 1.
     */
    confidence: number;
    /**
     * Indicates whether nested encoding was detected (i.e., one encoding within another).
     */
    isNested?: boolean;
    /**
     * If nested encoding is detected, this array lists the inner encoding types.
     */
    nestedTypes?: (ENC_TYPE | "mixedEncoding")[];
}
/**
 * Result of URL analysis. This interface defines the structure of the output
 * from analyzing a URL, including the base URL, extracted parameters, and
 * any potential vulnerabilities detected.
 */
interface URLAnalysisResult {
    /**
     * The base URL without parameters.
     */
    baseURL: string;
    /**
     * An object containing the extracted URL parameters and their values.
     */
    parameters: {
        [key: string]: string;
    };
    /**
     * An array of strings describing potential security vulnerabilities found in the URL.
     */
    potentialVulnerabilities: string[];
    vulnerabilitieDetails?: DetectedPattern[];
}
/**
 * Result of WAF bypass variants generation. This interface represents the
 * various encoding variants generated for Web Application Firewall (WAF)
 * bypass testing.
 */
interface WAFBypassVariants {
    /**
     * Standard percent-encoded version of the input string.
     */
    percentEncoding: string;
    /**
     * Double percent-encoded version of the input string.
     */
    doublePercentEncoding: string;
    /**
     * A version with mixed encoding types.
     */
    mixedEncoding: string;
    /**
     * A version with alternating character case.
     */
    alternatingCase: string;
    /**
     * A fully hexadecimal-encoded version of the input string.
     */
    fullHexEncoding: string;
    /**
     * A version with unicode character representations.
     */
    unicodeVariant: string;
    /**
     * A version with HTML entity representations.
     */
    htmlEntityVariant: string;
}
/**
 * Result of detectAndDecode operation. This interface describes the result of
 * automatically detecting and decoding a string, including the decoded value,
 * the detected encoding type, and the confidence level.
 */
interface DecodeResult {
    /**
     * The decoded string value.
     */
    val: () => string;
    /**
     * The detected encoding type of the input string.
     */
    encodingType: string;
    /**
     * A numerical value representing the confidence level of the encoding detection.
     */
    confidence: number;
    /**
     * If nested encoding is detected, this array lists the inner encoding types.
     */
    nestedTypes?: string[];
    original?: string;
    attemptedDecode?: string;
    attemptedVal?: string | undefined;
    decodingHistory?: {
        result: string;
        type: string;
        confidence: number;
    }[];
}
/**
 *Real-world application: Encoding user input for various contexts (RWA)
 * Defines the context in which user input will be used,
 * allowing for appropriate encoding selection
 */
type RWA_TYPES = "url" | "urlParam" | "html" | "htmlAttr" | "js" | "jsString" | "css" | "cssSelector" | "email" | "emailSubject" | "command" | "xml" | "json" | "obfuscate" | "idnDomain";
/**
 * Options for URI validation.
 */
interface UrlValidationOptions {
    /**
     * If `true`, requires a leading slash before paths or query parameters (e.g., `/path` or `/?query`).
     * If `false`, allows query parameters without a leading slash (e.g., `?query`).
     * @default false
     */
    strictMode?: boolean;
    /**
     * If `true`, allows Unicode escape sequences (e.g., `\u0068`) in query parameters.
     * If `false`, rejects URIs containing Unicode escape sequences.
     * @default true
     */
    allowUnicodeEscapes?: boolean;
    /**
     * If `true`, rejects URIs with duplicate query parameter keys (e.g., `?p1=a&p1=b`).
     * If `false`, allows duplicate keys.
     * @default true
     */
    rejectDuplicateParams?: boolean;
    /**
     * If `true`, only allows https:// URLs (rejects http://).
     * If `false`, allows both http:// and https:// URLs.
     * @default false
     */
    httpsOnly?: boolean;
    /**
     * Maximum allowed length for the entire URL.
     * Set to 0 to disable length checking.
     * @default 2048
     */
    maxUrlLength?: number | "NO_LIMIT";
    /**
     * List of allowed top-level domains (e.g., ['com', 'org', 'net']).
     * If empty, all TLDs are allowed.
     * @default []
     */
    allowedTLDs?: string[];
    /**
     * List of allowed protocols (e.g., ['https', 'http', 'ftp']).
     * Only relevant if requireProtocol is true.
     * @default ['http', 'https']
     */
    allowedProtocols?: string[];
    /**
     * If `true`, requires the protocol to be explicitly specified in the URL.
     * If `false`, adds https:// if no protocol is specified.
     * @default false
     */
    requireProtocol?: boolean;
    /**
     * If `true`, validates that the URL has a path or query string.
     * If `false`, allows bare domains like 'example.com'.
     * @default false
     */
    requirePathOrQuery?: boolean;
    /**
     * If `true`, validates each parameter value against URI encoding standards.
     * If `false`, performs basic validation only.
     * @default false
     */
    strictParamEncoding?: boolean;
    /**
     *If `true`, it will find keys in "parameters" that map to the same value (e.g.,
     * { param1: "value1", param2: "value1", param3: "value2" }),
     *  then group keys by their values and filter for values with multiple keys
     * @default false
     */
    rejectDuplicatedValues?: boolean;
    /**
     * If `true`, allows localhost URLs (e.g., http://localhost:8080).
     * These would otherwise be rejected due to domain validation rules.
     * @default false
     */
    allowLocalhost?: boolean;
    /**
     * An array of custom validation rules to apply to the URL.
     * Each rule specifies a URL component (e.g., 'hostname', 'pathname') or a literal string,
     * a comparison operator, and a value to compare against. If provided, the URL is validated
     * against each rule, and the results are reported in the UrlCheckResult.
     * @example
     * // Validate that the hostname is 'nehonix.space' and the pathname is '/api'
     * const options: UrlValidationOptions = {
     *   customValidations: [
     *     ['hostname', '===', 'nehonix.space'],
     *     ['pathname', '===', '/api'],
     *     ['literal', '!=', 'nehonix.space'] // Compare a literal value (e.g., URL string)
     *   ]
     * };
     */
    customValidations?: ComparisonRule[];
    /**
     * The value to use as the left operand for 'literal' comparisons in customValidations.
     * Required if any rule uses 'literal' as the component.
     * @example
     * // Compare a custom string to 'nehonix.space'
     * literalValue: 'nehonix.space' // Used for ['literal', '==', 'nehonix.space']
     * output: true
     * With "@this" option, use the URL string itself as the left operand for comparisons.
     * @example
     * input = "https://google.com"
     * literalValue: '@this' // Used for ['literal', '==', 'nehonix.space']
     * output: false
     */
    literalValue?: "@this" | string | number;
    /**
     * If true, enables debug logging for custom validations, printing the actual values
     * of components or literal inputs to aid in troubleshooting.
     * @default false
     */
    debug?: boolean;
    fullCustomValidation?: Record<string, string | number>;
    allowInternationalChars?: boolean;
    allowIPAddresses?: boolean;
    ipv4Only?: boolean;
    allowFragments?: boolean;
    allowCredentials?: boolean;
    maxQueryParams?: number;
    maxPathSegments?: number;
    disallowedKeywords?: string[];
    validationLevel?: UrlValidationLevel;
    disallowEmptyParameterValues?: boolean;
    requireSecureProtocolForNonLocalhost?: boolean;
    allowSubdomains?: boolean;
    allowedDomains?: string[];
    minUrlLength?: number;
    allowDataUrl?: boolean;
    allowMailto?: boolean;
}
type UrlValidationLevel = "strict" | "moderate" | "relaxed";
type AsyncUrlValidationOptions = UrlValidationOptions & AsyncUrlValidationOptFeature;
type AsyncUrlValidationOptFeature = {
    detectMaliciousPatterns?: boolean;
    maliciousPatternSensitivity?: number;
    maliciousPatternMinScore?: number;
    ignoreMaliciousPatternTypes?: MaliciousPatternType[];
    customMaliciousPatterns?: MaliciousPatternOptions["customPatterns"];
};
/**
 * A custom validation rule for URLs, defining a comparison to perform.
 * @typedef {Array<keyof URL | 'literal', comparisonOperator, string>} customValidations
 * @property {keyof URL | 'literal'} 0 - The URL component to compare (e.g., 'hostname', 'pathname') or 'literal' for a direct string comparison.
 * @property {comparisonOperator} 1 - The operator to use for the comparison (e.g., '===', '==').
 * @property {string} 2 - The value to compare against.
 * @example
 * // Rule to check if hostname is 'nehonix.space'
 * const rule: customValidations = ['hostname', '===', 'nehonix.space'];
 * @example
 * // Rule for literal comparison
 * const literalRule: customValidations = ['literal', '!=', 'nehonix.space'];
 */
type ComparisonRule = [
    ValidUrlComponents | custumValidUriComponent,
    comparisonOperator,
    string | number
];
type ValidUrlComponents = "href" | "origin" | "protocol" | "username" | "password" | "host" | "hostname" | "port" | "pathname" | "search" | "hash" | `fullCustomValidation.${string}` | `fcv.${string}`;
type custumValidUriComponent = "literal";
/**
 * Comparison operators for custom validation rules.
 * @type {'===' | '==' | '<=' | '>=' | '!=' | '!==' | '<' | '>'} comparisonOperator
 */
type comparisonOperator = "===" | "==" | "<=" | ">=" | "!=" | "!==" | "<" | ">";
/**
 * Represents the detailed result of a URL validation process.
 * This interface provides a comprehensive breakdown of the validation checks performed
 * on a URL, including overall validity and specific details for each validation step.
 *
 * @interface UrlCheckResult
 */
interface UrlCheckResult {
    /**
     * Indicates whether the URL is valid based on all validation checks.
     * `true` if all checks pass, `false` if any check fails.
     */
    isValid: boolean;
    /**
     * Return the reason of failling
     */
    cause?: string;
    /**
     * Contains detailed results for each validation check performed on the URL.
     * Each property corresponds to a specific validation aspect and is optional,
     * as not all validations may be relevant depending on the provided options.
     */
    validationDetails: {
        /**
         * Results of custom validation rules applied to the URL.
         * @property {boolean} isValid - Whether all custom validation rules passed.
         * @property {string} message - A summary of the validation outcomes, combining messages for each rule.
         * @property {Array} results - Detailed results for each custom validation rule.
         * @property {boolean} results[].isValid - Whether the specific rule passed.
         * @property {string} results[].message - A message describing the rule's outcome (e.g., success or failure details).
         * @property {customValidations} results[].rule - The custom validation rule that was evaluated.
         * @example
         * // Example result for custom validations
         * {
         *   isValid: true,
         *   message: "Validation passed: hostname === nehonix.space; Validation passed: pathname === /api",
         *   results: [
         *     {
         *       isValid: true,
         *       message: "Validation passed: hostname === nehonix.space",
         *       rule: ["hostname", "===", "nehonix.space"]
         *     },
         *     {
         *       isValid: true,
         *       message: "Validation passed: pathname === /api",
         *       rule: ["pathname", "===", "/api"]
         *     }
         *   ]
         * }
         */
        customValidations?: {
            isValid: boolean;
            message: string;
            results: {
                isValid: boolean;
                message: string;
                rule: ComparisonRule;
            }[];
        };
        /**
         * Validation result for the URL length check.
         */
        length?: {
            /** Indicates if the URL length is within the specified limit. */
            isValid: boolean;
            /** Descriptive message about the length validation result. */
            message?: string;
            /** The actual length of the URL in characters. */
            actualLength?: number;
            /** The maximum allowed length as specified in options. */
            maxLength?: number | "NO_LIMIT";
            minLength?: number;
        };
        /**
         * Validation result for checking if the URL is empty or contains only whitespace.
         */
        emptyCheck?: {
            /** Indicates if the URL is non-empty. */
            isValid: boolean;
            /** Descriptive message about the empty check result. */
            message?: string;
        };
        /**
         * Validation result for the URL protocol check.
         */
        protocol?: {
            /** Indicates if the protocol is valid and allowed. */
            isValid: boolean;
            /** Descriptive message about the protocol validation result. */
            message?: string;
            /** The detected protocol in the URL (e.g., 'http', 'https'). */
            detectedProtocol?: string;
            /** The list of allowed protocols specified in options. */
            allowedProtocols?: string[];
        };
        /**
         * Validation result for the HTTPS-only requirement.
         */
        httpsOnly?: {
            /** Indicates if the URL uses HTTPS when required. */
            isValid: boolean;
            /** Descriptive message about the HTTPS-only validation result. */
            message?: string;
        };
        /**
         * Validation result for the domain structure check.
         */
        domain?: {
            /** Indicates if the domain structure is valid. */
            isValid: boolean;
            /** Descriptive message about the domain validation result. */
            message?: string;
            /** The hostname extracted from the URL. */
            hostname?: string;
            error?: string;
            type?: "INV_DOMAIN_ERR" | "INV_STRUCTURE" | "ERR_UNKNOWN";
        };
        /**
         * Validation result for the top-level domain (TLD) check.
         */
        tld?: {
            /** Indicates if the TLD is valid and allowed. */
            isValid: boolean;
            /** Descriptive message about the TLD validation result. */
            message?: string;
            /** The detected TLD in the URL (e.g., 'com', 'org'). */
            detectedTld?: string;
            /** The list of allowed TLDs specified in options. */
            allowedTlds?: string[];
        };
        /**
         * Validation result for the path or query string requirement.
         */
        pathOrQuery?: {
            /** Indicates if the URL satisfies path or query requirements. */
            isValid: boolean;
            /** Descriptive message about the path/query validation result. */
            message?: string;
        };
        /**
         * Validation result for strict mode path requirements.
         */
        strictMode?: {
            /** Indicates if the URL satisfies strict mode path requirements. */
            isValid: boolean;
            /** Descriptive message about the strict mode validation result. */
            message?: string;
        };
        /**
         * Validation result for checking unencoded spaces in the query string.
         */
        querySpaces?: {
            /** Indicates if the query string is free of unencoded spaces. */
            isValid: boolean;
            /** Descriptive message about the query spaces validation result. */
            message?: string;
        };
        /**
         * Validation result for strict parameter encoding check.
         */
        paramEncoding?: {
            /** Indicates if query parameters are properly encoded. */
            isValid: boolean;
            /** Descriptive message about the parameter encoding validation result. */
            message?: string;
            /** List of parameters that failed encoding validation, if any. */
            invalidParams?: string[];
        };
        /**
         * Validation result for duplicate query parameter keys check.
         */
        duplicateParams?: {
            /** Indicates if there are no duplicate query parameter keys. */
            isValid: boolean;
            /** Descriptive message about the duplicate parameters validation result. */
            message?: string;
            /** List of query parameter keys that are duplicated, if any. */
            duplicatedKeys?: string[];
        };
        /**
         * Validation result for duplicate query parameter values check.
         */
        duplicateValues?: {
            /** Indicates if there are no duplicate query parameter values. */
            isValid: boolean;
            /** Descriptive message about the duplicate values validation result. */
            message?: string;
            /** List of query parameter values that are duplicated, if any. */
            duplicatedValues?: string[];
        };
        /**
         * Validation result for Unicode escape sequences check.
         */
        unicodeEscapes?: {
            /** Indicates if the URL is free of disallowed Unicode escape sequences. */
            isValid: boolean;
            /** Descriptive message about the Unicode escapes validation result. */
            message?: string;
        };
        /**
         * Validation result for URL parsing.
         */
        parsing?: {
            /** Indicates if the URL was parsed successfully. */
            isValid: boolean;
            /** Descriptive message about the parsing validation result. */
            message?: string;
        };
        internationalChars?: {
            isValid: boolean;
            message: string;
            containsNonAscii?: boolean;
            containsPunycode?: boolean;
        };
        dataUrl?: {
            isValid: boolean;
            message?: string;
        };
        mailto?: {
            isValid: boolean;
            message?: string;
        };
        disallowedKeywords?: {
            isValid: boolean;
            message?: string;
            foundKeywords?: string[];
        };
        secureNonLocalhost?: {
            isValid: boolean;
            message?: string;
        };
        allowSubdomains?: {
            isValid: boolean;
            message?: string;
        };
        credentials?: {
            isValid: boolean;
            message?: string;
        };
        fragments?: {
            isValid: boolean;
            message?: string;
        };
        allowedDomains?: {
            isValid: boolean;
            message?: string;
            hostname?: string;
            allowedDomains?: string[];
        };
        ipAddress?: {
            isValid: boolean;
            message?: string;
            ipAddress?: string;
            hostname?: string;
            isIPv4?: boolean;
            isIPv6?: boolean;
        };
        pathSegments?: {
            isValid: boolean;
            segmentCount?: number;
            maxSegments?: number;
            message?: string;
        };
        queryParamCount?: {
            isValid: boolean;
            paramCount?: number;
            maxParams?: number;
            message?: string;
        };
        emptyParams?: {
            isValid: boolean;
            message: string;
            emptyParams?: string[];
        };
    };
}
type AsyncUrlCheckResult = Omit<UrlCheckResult, "validationDetails"> & {
    validationDetails: UrlCheckResult["validationDetails"] & AsyncUrlCheckResComponent;
};
type AsyncUrlCheckResComponent = {
    maliciousPatterns?: {
        isValid?: boolean;
        message?: string;
        error?: string;
        detectedPatterns?: DetectedPattern[];
        score?: number;
        confidence?: string;
        recommendation?: string;
    };
};
interface UriHandlerInterface {
    maxIterations?: number;
    output?: {
        encodeUrl?: boolean;
    };
}

type EncodingResult = {
    original: string;
    encoded: string;
    type: ENC_TYPE;
};
type NestedEncodingOptions = {
    /**
     * If true, use each encoding's output as input for the next encoding
     */
    sequential?: boolean;
    /**
     * If true, include all intermediate results in the response
     */
    includeIntermediate?: boolean;
};
type NestedEncodingResponse = {
    input: string;
    results: EncodingResult[];
    finalResult?: string;
};

declare class NES {
    /**
     * Encodes a string according to a specific encoding type
     * @param input The string to encode
     * @param encodingType The encoding type to use
     * @returns The encoded string
     */
    static encode(input: string, encodingType: ENC_TYPE): string;
    /**
     * Encodes with percent encoding (URL)
     */
    static encodePercentEncoding(input: string, encodeSpaces?: boolean): string;
    /**
     * Encodes with double percent encoding
     */
    static encodeDoublePercentEncoding(input: string): string;
    /**
     * Encodes in base64
     */
    static encodeBase64(input: string): string;
    /**
     * Encodes in hexadecimal (format \xXX)
     */
    static encodeHex(input: string): string;
    /**
     * Encodes in Unicode (format \uXXXX)
     */
    static encodeUnicode(input: string): string;
    /**
     * Encodes HTML entities in a string
     */
    static encodeHTMLEntities(input: string): string;
    /**
     * Encodes in punycode
     */
    static encodePunycode(input: string): string;
    /**
     * Encodes in ASCII with hexadecimal representation
     */
    static encodeASCIIWithHex(input: string): string;
    /**
     * Encodes in ASCII with octal representation
     */
    static encodeASCIIWithOct(input: string): string;
    /**
     * Encodes all characters in percent encoding
     */
    static encodeAllChars(input: string): string;
    /**
     * Calculates confidence level for base64 encoding
     */
    static calculateBase64Confidence(input: string): number;
    /**
     * Encodes using ROT13 cipher
     */
    static encodeROT13(input: string): string;
    /**
     * Encodes in Base32
     */
    static encodeBase32(input: string): string;
    /**
     * Encodes in URL-safe Base64
     */
    static encodeURLSafeBase64(input: string): string;
    /**
     * Encodes string with JavaScript escape sequences
     */
    static encodeJavaScriptEscape(input: string): string;
    /**
     * Encodes string with CSS escape sequences
     */
    static encodeCSSEscape(input: string): string;
    /**
     * Encodes in UTF-7
     */
    static encodeUTF7(input: string): string;
    /**
     * Encodes in Quoted-Printable
     */
    static encodeQuotedPrintable(input: string): string;
    /**
     * Encodes in decimal HTML entity format
     */
    static encodeDecimalHTMLEntities(input: string): string;
    /**
     * Encodes in raw hexadecimal (no prefixes)
     */
    static encodeRawHex(input: string): string;
    /**
     * Encodes as a JWT with the input as the payload
     */
    static encodeJWT(input: string): string;
    /**
     * Encodes as a URL (percent-encoding with spaces as %20)
     */
    static encodeUrl(input: string): string;
    /**
     * Performs multiple encodings on an input string synchronously
     * @param input The string to encode
     * @param types Array of encoding types to apply
     * @param options Configuration options for nested encoding
     * @returns Object containing encoding results
     */
    static encodeMultiple(input: string, types: ENC_TYPE[], options?: NestedEncodingOptions): NestedEncodingResponse;
    /**
     * Performs multiple encodings on an input string asynchronously
     * @param input The string to encode
     * @param types Array of encoding types to apply
     * @param options Configuration options for nested encoding
     * @returns Promise resolving to object containing encoding results
     */
    static encodeMultipleAsync(input: string, types: ENC_TYPE[], options?: NestedEncodingOptions): Promise<NestedEncodingResponse>;
}

declare class SecurityRules {
    private static get enc();
    static analyzeMaliciousPatterns(url: string, options?: MaliciousPatternOptions): Promise<MaliciousPatternResult>;
    static analyzeURL(...p: Parameters<typeof SecurityRules.analyzeMaliciousPatterns>): URLAnalysisResult;
    /**
     * Generates encoding variants of a string for WAF bypass testing
     * @param input The string to encode
     * @returns An object containing different encoding variants
     */
    static generateWAFBypassVariants(input: string): WAFBypassVariants;
    /**
     * Generates mixed encoding (different types of encoding combined)
     */
    private static generateMixedEncoding;
    /**
     * Generates a string with alternating upper and lower case
     * Useful for bypassing certain filters
     */
    private static generateAlternatingCase;
}

declare class NDS {
    private static throwError;
    private static default_checkurl_opt;
    static detectMixedEncodings(input: string): string[];
    /**
     * Automatically detects and decodes a URI based on the detected encoding type
     * @param input The URI string to decode
     * @returns The decoded string according to the most probable encoding type
     */
    static detectAndDecode(input: string): DecodeResult;
    static decodeJWT(input: string): string;
    /**
     * Decodes percent encoding (URL)
     */
    static decodePercentEncoding(input: string): string;
    /**
    //  * Decodes double percent encoding
    //  */
    /**
     * Decodes hexadecimal encoding
     */
    /**
     * Fix 1: Proper hex string decoding implementation
     */
    static decodeHex(input: string): string;
    /**
     * Decodes Unicode encoding
     */
    static decodeUnicode(input: string): string;
    /**
     * Decodes HTML entities
     */
    static decodeHTMLEntities(input: string): string;
    /**
     * Decodes punycode
     * Note: Requires the 'punycode' library
     */
    static decodePunycode(input: string): string;
    /**
     * Automatically detects the encoding type(s) of a string (URI or raw text)
     * @param input The string to analyze
     * @param depth Internal recursion depth (default: 0)
     * @returns An object with detected types, confidence scores and the most likely one
     */
    static detectEncoding(input: string, depth?: number): EncodingDetectionResult;
    /**
     * Attempts to decode parts of a string that appear to be encoded
     * @param input The potentially partially encoded string
     * @param encodingType The encoding type to try
     * @returns Object indicating success and decoded parts
     */
    static tryPartialDecode(input: string, encodingType: ENC_TYPE): {
        success: boolean;
        decoded?: string;
    };
    /**
     * Helper function to detect nested encodings
     * @param input The string to analyze
     * @param depth Current recursion depth
     * @returns Information about detected nested encodings
     */
    static detectNestedEncoding(input: string, depth?: number): {
        isNested: boolean;
        outerType?: ENC_TYPE | "mixedEncoding";
        innerType?: ENC_TYPE | "mixedEncoding";
        confidenceScore: number;
    };
    /**
     * Decodes ROT13 encoded text
     */
    static decodeRot13(input: string): string;
    /**
     * Decodes Base32 encoded text
     */
    static decodeBase32(input: string): string;
    /**
     * Decodes URL-safe Base64 encoded text
     */
    static decodeUrlSafeBase64(input: string): string;
    /**
     * Decodes JavaScript escape sequences
     */
    static decodeJsEscape(input: string): string;
    static decodeCharacterEscapes(input: string): string;
    /**
     * Decodes CSS escape sequences
     */
    static decodeCssEscape(input: string): string;
    /**
     * Decodes UTF-7 encoded text
     */
    static decodeUtf7(input: string): string;
    /**
     * Decodes Quoted-Printable encoded text
     */
    static decodeQuotedPrintable(input: string): string;
    /**
     * Decodes decimal HTML entity encoded text
     */
    static decodeDecimalHtmlEntity(input: string): string;
    /**
     * Decodes ASCII hex encoded text (where ASCII values are represented as hex)
     */
    static decodeAsciiHex(input: string): string;
    /**
     * Decodes ASCII octal encoded text
     */
    static decodeAsciiOct(input: string): string;
    /**
     * Auto-detects encoding and recursively decodes until plaintext
     * @param input The encoded string
     * @param maxIterations Maximum number of decoding iterations to prevent infinite loops
     * @returns Fully decoded plaintext
     */
    static decodeAnyToPlaintext(input: string, opt?: UriHandlerInterface): DecodeResult;
    private static handleUriParameters;
    /**
     * Decodes a string based on the specified encoding type
     * @param input The string to decode
     * @param encodingType The encoding type to use for decoding
     * @returns The decoded string
     */
    static decodeSingle(input: string, encodingType: ENC_TYPE | "mixedEncoding" | "plainText"): string;
    /**
     * Decodes a partially encoded string, preserving non-encoded parts
     * @param input The partially encoded string
     * @param baseEncodingType The base encoding type (without "partial" prefix)
     * @returns The decoded string with non-encoded parts preserved
     */
    static decodePartial(input: string, baseEncodingType: ENC_TYPE): string;
    /**
     * Attempts to decode a string with mixed encoding types
     * @param input The string with mixed encodings
     * @returns The decoded string
     */
    static decodeMixed(input: string): string;
    /**
     * Decodes double percent encoding (e.g., %2520 -> %20 -> space)
     * @param input The double percent-encoded string
     * @returns The decoded string
     */
    static decodeDoublePercentEncoding(input: string): string;
    /**
     * Tries various decoding strategies to find the best result
     * @param input The encoded string
     * @returns The best decoded result
     */
    static smartDecode(input: string): string;
    /**
     * Enhanced URL parameter extraction and decoding
     * @param url The URL string to process
     * @returns URL with decoded parameters
     */
    static decodeUrlParameters(url: string): string;
    static decodeMixedContent(input: string): string;
    static detectAndHandleRawHexUrl(input: string): string;
    /**
     * Decodes a raw hexadecimal string (without prefixes)
     * @param input The hexadecimal string to decode
     * @returns The decoded string
     */
    static decodeRawHex(input: string): string;
    /**
     * Main decode method with improved error handling
     */
    static decode(props: {
        input: string;
        encodingType: ENC_TYPE | DEC_FEATURE_TYPE;
        maxRecursionDepth?: number;
        opt?: {
            throwError?: boolean;
        };
    }): string;
    /**
     * Asynchronously decodes any encoded text to plaintext
     * @param input The encoded string to decode
     * @param opt Optional configuration for the decoding process
     * @returns A Promise that resolves to the DecodeResult containing the decoded string
     */
    static asyncDecodeAnyToPlainText(input: string, opt?: UriHandlerInterface): Promise<DecodeResult>;
}

/**
 * Shared utility methods for encoding detection and basic decoding operations
 */
declare class NehonixCommonUtils {
    /**
     * Checks if the string contains hexadecimal encoding
     */
    static hasHexEncoding(input: string): boolean;
    /**
     * Checks if the string contains Unicode encoding
     */
    static hasUnicodeEncoding(input: string): boolean;
    /**
     * Checks if the string contains HTML entities
     */
    static hasHTMLEntityEncoding(input: string): boolean;
    /**
     * Checks if the string contains punycode
     */
    static hasPunycode(input: string): boolean;
    /**
     * Checks if the string contains percent encoding (%)
     */
    static hasPercentEncoding(input: string): boolean;
    /**
     * Checks if the string contains double percent encoding (%%XX)
     */
    static hasDoublePercentEncoding(input: string): boolean;
    /**
     * Decodes raw hexadecimal string (without prefixes)
     */
    static drwp(hexString: string): string;
    /**
     * Basic Base64 decoding
     */
    /**
     * Decodes base64 encoding
     */
    static decodeB64(input: string): string;
    /**
     * Enhanced encoding detection methods to accurately detect various encoding types
     */
    /**
     * Checks if a string is likely to be plain text
     * @param s The string to check
     */
    static isPlainText(s: string): boolean;
    /**
     * Enhanced ROT13 detection that avoids false positives
     * @param s The string to check
     */
    static isRot13(s: string): boolean;
    /**
     * Improved Base64 detection
     * @param s The string to check
     */
    static isBase64(input: string): boolean;
    static decodeBase64(input: string): string;
    /**
     * Base32 detection
     * @param s The string to check
     */
    static isBase32(s: string): boolean;
    /**
     * Improved URL-safe Base64 detection
     * @param s The string to check
     */
    static isUrlSafeBase64(s: string): boolean;
    /**
     * Improved percent encoding detection
     * @param s The string to check
     */
    static isPercentEncoding(s: string): boolean;
    /**
     * Improved double percent encoding detection
     * @param s The string to check
     */
    static isDoublePercent(s: string): boolean;
    /**
     * Improved hexadecimal encoding detection
     * @param s The string to check
     */
    static isHex(s: string): boolean;
    /**
     * Improved raw hexadecimal string detection
     * @param s The string to check
     */
    /**
     * Improved raw hexadecimal string detection
     * @param s The string to check
     */
    static hasRawHexString(s: string): boolean;
    /**
     * Improved ASCII Hex detection
     * @param s The string to check
     */
    static isAsciiHex(s: string): boolean;
    /**
     * Improved ASCII Octal detection
     * @param s The string to check
     */
    static isAsciiOct(s: string): boolean;
    /**
     * Improved Unicode escape detection
     * @param s The string to check
     */
    static isUnicode(s: string): boolean;
    /**
     * Improved HTML entity detection
     * @param s The string to check
     */
    static isHtmlEntity(s: string): boolean;
    /**
     * Improved decimal HTML entity detection
     * @param s The string to check
     */
    static isDecimalHtmlEntity(s: string): boolean;
    /**
     * Improved quoted-printable detection
     * @param s The string to check
     */
    static isQuotedPrintable(s: string): boolean;
    /**
     * Improved Punycode detection
     * @param s The string to check
     */
    static isPunycode(s: string): boolean;
    /**
     * Improved JWT format detection
     * @param s The string to check
     */
    static hasJWTFormat(s: string): boolean;
    /**
     * Improved UTF-7 detection
     * @param s The string to check
     */
    static isUtf7(s: string): boolean;
    /**
     * Improved JavaScript escape sequence detection
     * @param s The string to check
     */
    static isJsEscape(s: string): boolean;
    /**
     * Improved CSS escape sequence detection
     * @param s The string to check
     */
    static isCssEscape(s: string): boolean;
}

declare class NehonixCoreUtils extends NehonixCommonUtils {
    private static defautltValidationOpt;
    /**
     * Checks a URL string and returns detailed validation results.
     * @param url The URL string to check
     * @param options Validation options
     * @returns UrlCheckResult object with detailed validation information
     */
    /**
     * Checks a URL string and returns detailed validation results.
     * @param url The URL string to check
     * @param options Validation options
     * @returns UrlCheckResult object with detailed validation information
     */
    static checkUrl(url: string, options?: UrlValidationOptions): UrlCheckResult;
    /**
     * Validates a URL string according to specified options.
     * @param url The URL string to validate
     * @param options Validation options
     * @returns boolean indicating if the URL is valid
     */
    static isValidUrl(url: string, options?: UrlValidationOptions): boolean;
    static asyncIsUrlValid(...args: Parameters<typeof this.asyncCheckUrl>): Promise<boolean>;
    static asyncCheckUrl(url: string, options?: AsyncUrlValidationOptions): Promise<AsyncUrlCheckResult>;
    /**
     * Analyzes a URL for potential security threats
     * @param url The URL to analyze
     * @param options Detection options
     * @returns Detailed analysis of security threats
     */
    static analyzeMaliciousPatterns(url: string, options?: MaliciousPatternOptions): Promise<MaliciousPatternResult>;
    /**
     * Quick check if a URL contains malicious patterns
     * @param url The URL to check
     * @param options Detection options
     * @returns Boolean indicating if URL contains malicious patterns
     */
    static hasMaliciousPatterns(url: string, options?: MaliciousPatternOptions): Promise<boolean>;
    static detectDuplicatedValues(url: string): {
        duplicatedKeys: string[];
        duplicatedValues: string[];
        params: Record<string, string[]>;
    };
    /**
     * Checks if the string matches base64 pattern
     */
    static hasBase64Pattern(input: string): boolean;
    /**
     * Raw hexadecimal detection
     * @param input
     * @returns
     */
    static hasRawHexString(input: string): boolean;
    static hasJWTFormat(input: string): boolean;
    static getValidationOptionsByLevel(level: UrlValidationLevel, baseOptions?: Partial<UrlValidationOptions>): UrlValidationOptions;
}

/**
 * Enhanced service for detecting various malicious patterns in URLs and general input
 * Nehonix Malicious Parttens Service => NMPS
 * Nehonix Security Service => NSS
 */
declare class NSS {
    private static SQL_INJECTION_PATTERNS;
    private static XSS_PATTERNS;
    private static COMMAND_INJECTION_PATTERNS;
    private static OPEN_REDIRECT_PATTERNS;
    private static PATH_TRAVERSAL_PATTERNS;
    private static SSRF_PATTERNS;
    private static CRLF_INJECTION_PATTERNS;
    private static TEMPLATE_INJECTION_PATTERNS;
    private static NOSQL_INJECTION_PATTERNS;
    private static GRAPHQL_INJECTION_PATTERNS;
    private static ENCODED_PAYLOAD_PATTERNS;
    private static SUSPICIOUS_TLD_PATTERNS;
    private static HOMOGRAPH_ATTACK_PATTERNS;
    private static MULTI_ENCODING_PATTERNS;
    private static SUSPICIOUS_PARAMETER_NAMES;
    private static RFI_PATTERNS;
    private static resultCache;
    private static isSafeHighEntropy;
    /**
     * Analyzes input for malicious patterns and returns detailed detection results
     *
     * @param input - The string to analyze
     * @param options - Configuration options for detection
     * @returns Detailed analysis result
     */
    static detectMaliciousPatterns(receivedInput: string, options?: MaliciousPatternOptions): MaliciousPatternResult;
    /**
     * Analyzes a URL for malicious patterns with specific sensitivity per URL component
     *
     * @param url - The URL to analyze
     * @param options - Configuration options for detection
     * @returns Detailed analysis result
     */
    static analyzeUrl(url: string, options?: MaliciousPatternOptions): Promise<MaliciousPatternResult>;
    /**
     * Generates a recommendation specifically for URLs based on detected patterns
     */
    private static generateUrlRecommendation;
    /**
     * Finds related patterns across different components that might indicate a sophisticated attack
     */
    private static findRelatedPatternGroups;
    /**
     * Checks a string against a set of regex patterns for a specific attack type
     */
    private static checkPatterns;
    /**
     * Checks for suspicious parameter names in a URL
     */
    private static checkSuspiciousParameters;
    /**
     * Calculates confidence level for a pattern match based on match characteristics
     */
    private static calculateConfidence;
    /**
     * Checks if a match is likely a false positive based on context
     */
    private static isLikelyFalsePositive;
    /**
     * Calculates additional context score for pattern matches
     */
    private static calculateContextScore;
    /**
     * Performs contextual analysis on detected patterns to improve detection accuracy
     */
    private static performContextualAnalysis;
    /**
     * Calculates Shannon entropy of a string to detect random or encoded content
     * Higher entropy often indicates encryption or encoding
     */
    private static calculateEntropy;
    /**
     * Detects number of potential encoding layers in a string
     */
    private static detectEncodingLayers;
    /**
     * Calculates statistical anomaly score based on character distribution
     */
    private static calculateAnomalyScore;
    /**
     * Calculates total risk score based on detected patterns
     */
    private static calculateTotalScore;
    /**
     * Determines overall confidence level based on score and pattern count
     */
    static determineConfidence(score: number, patternCount: number): "low" | "medium" | "high";
    /**
     * Generates appropriate recommendation based on detected patterns
     */
    static generateRecommendation(patterns: DetectedPattern[], score: number): string;
    /**
     * Analyzes input for a specific malicious pattern type
     *
     * @param input - The string to analyze
     * @param patternType - The specific pattern type to check for
     * @param options - Configuration options for detection
     * @returns Boolean indicating if pattern was detected
     */
    static detectSpecificPatternType(input: string, patternType: MaliciousPatternType, options?: MaliciousPatternOptions): boolean;
    /**
     * Sanitizes input by removing potentially malicious patterns
     *
     * @param input - The string to sanitize
     * @param options - Additional sanitization options
     * @returns Sanitized string
     */
    /**
     * Sanitizes input by removing potentially malicious patterns
     *
     * @param input - The string to sanitize
     * @param options - Additional sanitization options
     * @returns Sanitized string
     */
    static sanitizeInput(input: string, options?: {
        allowHtml?: boolean;
        allowMarkdown?: boolean;
        strictMode?: boolean;
        preserveLength?: boolean;
        customPatterns?: Array<{
            pattern: RegExp;
            replacement: string;
        }>;
    }): string;
    /**
     * Lightweight check to determine if string needs deep scanning
     * Use as a pre-filter before doing full pattern detection
     *
     * @param input - String to check
     * @returns Whether input needs further scanning
     */
    static needsDeepScan(input: string): boolean;
    /**
     * Checks if content is likely HTML/JavaScript code fragment
     *
     * @param input - String to check
     * @returns boolean indicating if it looks like code
     */
    static isLikelyCode(input: string): boolean;
    /**
     * Checks if a tag is in the allowed safe tags list
     * @param tag - The tag name to check
     * @returns Whether the tag is considered safe
     */
    private static isSafeTag;
    /**
     * Creates a placeholder of specified length to preserve original string length
     * @param type - Type of content being replaced
     * @param length - Length of the original content
     * @returns Placeholder string of approximately the same length
     */
    private static createPlaceholder;
    /**
     * Checks if input appears to be a URL
     * @param input - String to check
     * @returns Whether the input looks like a URL
     */
    private static isUrlLike;
    /**
     * Specialized sanitization for URLs
     * @param url - URL to sanitize
     * @param opts - Sanitization options
     * @returns Sanitized URL
     */
    private static sanitizeUrl;
    /**
     * Handle potential redirect parameters in URLs
     * @param url - URL to check
     * @param opts - Sanitization options
     * @returns Sanitized URL
     */
    private static handlePotentialRedirect;
}

declare class NehonixSafetyLayer {
    /**
     * Encodes user input based on the context in which it will be used
     * Selects the appropriate encoding method for security and compatibility
     *
     * @param input The user input to secure
     * @param context The context where the input will be used
     * @param options Optional configuration for specific encoding behaviors
     * @returns The appropriately encoded string
     */
    static __safeEncode__(input: string, context: RWA_TYPES, options?: {
        doubleEncode?: boolean;
        encodeSpaces?: boolean;
        preserveNewlines?: boolean;
    }): string;
}

/**
 * Interface for the Nehonix Shield configuration
 */
interface NehonixShieldConfig {
    enableBackgroundScanning: boolean;
    scanInterval: number;
    interceptRequests: boolean;
    enableDeepScan: boolean;
    confidenceThreshold: number;
    enableContextAnalysis: boolean;
    scanOptions: {
        analyseOptions: MaliciousPatternOptions;
        global: {
            ignoreCase: boolean;
            checkEncoding: boolean;
            maxEncodingLayers: number;
            analyzeContext: boolean;
            confidence: "low" | "medium" | "high";
        };
    };
    blockMaliciousRequests: boolean;
    blockMaliciousResponses: boolean;
    onDetection?: (result: MaliciousPatternResult) => void;
    onBlock?: (result: MaliciousPatternResult, request: Request) => void;
    blacklistedPatterns?: string[];
    urlUtils: UrlValidationOptions & {
        allowedProtocol?: string[];
        trustedDomains?: string[];
        dynamicWhitelist?: string[];
    };
}
/**
 * Interface for the Shield analysis results
 */
interface ShieldAnalysisResult {
    analysisResults: MaliciousPatternResult[];
    lastScanTimestamp: number;
    totalScanned: number;
    totalBlocked: number;
    activeThreats: DetectedPattern[];
    performanceMetrics: {
        avgScanTime: number;
        totalScanTime: number;
        scanCount: number;
    };
}
/**
 * Interface for the Nehonix Shield Context
 */
interface NehonixShieldContextT {
    config: NehonixShieldConfig;
    updateConfig: (config: Partial<NehonixShieldConfig>) => void;
    analysisResults: ShieldAnalysisResult;
    isScanning: boolean;
    pauseScanning: () => void;
    resumeScanning: () => void;
    forceScan: () => Promise<void>;
    clearResults: () => void;
    addToDynamicWhitelist: (url: string) => void;
}
/**
 * Configuration for the DOM Processor
 */
interface DomProcessorConfig {
    enabled: boolean;
    processingMode: "idle-callback" | "worker" | "chunk";
    chunkSize: number;
    idleTimeout: number;
    throttleInterval: number;
    targetElements: {
        [key: string]: boolean;
        a: boolean;
        script: boolean;
        iframe: boolean;
        img: boolean;
        form: boolean;
        input: boolean;
        button: boolean;
        source: boolean;
        embed: boolean;
        object: boolean;
    };
    attributesToScan: {
        [key: string]: boolean;
        href: boolean;
        src: boolean;
        action: boolean;
        formaction: boolean;
        data: boolean;
        onclick: boolean;
        onload: boolean;
        onerror: boolean;
        style: boolean;
    };
    scanDepth: "light" | "medium" | "deep";
    ignoreInlineContent: boolean;
    scanShadowDOM: boolean;
    ignoreHiddenElements: boolean;
    parseCss: boolean;
    detectObfuscation: boolean;
    iframeSandboxPolicy: "strict" | "moderate" | "permissive";
    scanXSS: boolean;
    scanCSRF: boolean;
    scanClickjacking: boolean;
    whitelistedDomains: string[];
    blacklistedPatterns: string[];
    onDetectionCallbacks: {
        [elementType: string]: (result: ElementDetectionResult) => void;
    };
    analyzeOptions: {
        debug: boolean;
        checkEncoding: boolean;
        ignoreCase: boolean;
        maxEncodingLayers: number;
    };
    enableThreatIntelligence: boolean;
    adaptiveChunkSize: boolean;
    threatIntelligenceApiKey?: string;
    detailedLogging: boolean;
    confidenceThreshold: number;
    urlUtils?: {
        dynamicWhitelist?: string[];
    };
}
/**
 * Statistics for the DOM Processor
 */
interface DomProcessorStats {
    elementsScanned: number;
    threatsDetected: number;
    lastScanTimestamp: number;
    scanDuration: number;
    scanningActive: boolean;
    elementTypeStats: {
        [elementType: string]: number;
    };
    threatsByType: {
        [threatType: string]: number;
    };
    blockedElements: Array<{
        elementType: string;
        timestamp: number;
        threatTypes: string[];
        metadata: {
            domLocation: string;
            elementId?: string;
            className?: string;
            parentElement?: {
                tagName: string;
                id?: string;
                className?: string;
            };
            domPath: string;
            innerTextSnippet?: string;
            attributes: Record<string, string>;
        };
    }>;
    pendingElements: number;
    avgProcessingTimePerElement: number;
    totalProcessingTime: number;
}
/**
 * Detection result for callback functions
 */
interface ElementDetectionResult {
    element: Element;
    results: MaliciousPatternResult[];
    elementType: string;
}
/**
 * DOM Processor Context Type
 */
interface DomProcessorContextT {
    config: DomProcessorConfig;
    updateConfig: (newConfig: Partial<DomProcessorConfig>) => void;
    stats: DomProcessorStats;
    scanDOM: () => void;
    stopScanning: () => void;
    resetStats: () => void;
    getSecurityReport: () => Record<string, any>;
    isScanning: boolean;
    addToDynamicWhitelist: (url: string) => void;
}
/**
 * Combined security suite context
 */
interface SecuritySuiteContext {
    shield: NehonixShieldContextT;
    domProcessor: DomProcessorContextT;
    forceFullScan: () => void;
    resetAllStats: () => void;
    getComprehensiveReport: () => Record<string, any>;
    getSecurityStatus: () => {
        isSecure: boolean;
        activeThreats: Array<any>;
        lastScanTime: number;
        scanning: boolean;
    };
    updateConfig: (shieldConfig?: Partial<NehonixShieldConfig>, domConfig?: Partial<DomProcessorConfig>) => void;
    pauseAllScanning: () => void;
    resumeAllScanning: () => void;
    stats: {
        elementsScanned: number;
        urlsScanned: number;
        threatsDetected: number;
        lastScanTimestamp: number;
        scanDuration: number;
        scanningActive: boolean;
        elementTypeStats: Record<string, number>;
        threatsByType: Record<string, number>;
        blockedElements: Array<any>;
        performance: {
            avgElementScanTime: number;
            avgUrlScanTime: number;
        };
    };
    isScanning: boolean;
}

/**
 * Hook for accessing threat information
 * @returns Object with threat detection information and methods
 */
declare const useThreats: () => {
    activeThreats: DetectedPattern[];
    threatSeverity: "none" | "low" | "medium" | "high";
    threatsByType: Record<string, DetectedPattern[]>;
    recentThreats: DetectedPattern[];
    totalThreatsDetected: number;
    totalThreatsBlocked: number;
    scanNow: () => Promise<void>;
    clearThreatHistory: () => void;
};
/**
 * Interface for shield monitoring data
 */
interface ShieldMonitoringData {
    isActive: boolean;
    lastScanTime: Date | null;
    nextScanTime: Date | null;
    scanCount: number;
    avgScanTime: number;
    isBackgroundScanningEnabled: boolean;
    isInterceptionEnabled: boolean;
    isDeepScanEnabled: boolean;
}
/**
 * Hook for monitoring the shield's status
 * @returns Shield monitoring information
 */
declare const useShieldMonitoring: () => ShieldMonitoringData;
/**
 * Hook for working with shield configuration
 * @returns Configuration objects and update methods
 */
declare const useShieldConfig: () => {
    config: NehonixShieldConfig;
    updateConfig: (config: Partial<NehonixShieldConfig>) => void;
    toggleBackgroundScanning: () => void;
    toggleRequestInterception: () => void;
    toggleDeepScan: () => void;
    setScanInterval: (intervalMs: number) => void;
    pauseScanning: () => void;
    resumeScanning: () => void;
    addTrustedDomain: (domain: string) => void;
    removeTrustedDomain: (domain: string) => void;
    addBlacklistedPattern: (pattern: string) => void;
    removeBlacklistedPattern: (pattern: string) => void;
};
/**
 * Hook for creating a protected fetch that uses Nehonix Shield
 * @returns A secure fetch function that analyzes URLs before fetching
 */
declare const useSecureFetch: () => (url: string | URL | Request, options?: RequestInit, securityOptions?: {
    bypassScan?: boolean;
    customScanOptions?: Record<string, any>;
    onBlock?: (result: MaliciousPatternResult) => void;
}) => Promise<Response>;
/**
 * Hook to use the Nehonix Shield Context
 */
declare const useNehonixShield: () => NehonixShieldContextT;

/**
 * Nehonix Shield Provider Component
 */
declare const NehonixShieldProvider: React.FC<{
    children: React.ReactNode;
    initialConfig?: Partial<NehonixShieldConfig>;
}>;

/**
 * Combined hook for accessing Nehonix security features
 * This hook provides a unified interface to both NehonixShield and NehonixDomProcessor
 *
 * @returns Combined security context with methods and properties from both systems
 */
declare const useNehonixShieldPlugging: () => SecuritySuiteContext;
/**
 * Combined provider component for Nehonix security plugging
 * This is a convenience wrapper that sets up both security contexts
 */
declare const NehonixShieldProviderPlugging: React.FC<{
    children: React.ReactNode;
    shieldConfig?: Partial<NehonixShieldConfig>;
    domProcessorConfig?: Partial<DomProcessorConfig>;
}>;
/**
 * Higher-order component that injects the Nehonix security context
 *
 * @param Component The component to wrap
 * @returns A new component with the security context injected as a prop
 */
declare const withNehonixShieldPlugging: <P extends object>(Component: React.ComponentType<P & {
    security: SecuritySuiteContext;
}>) => React.FC<P>;
/**
 * Security badge component - shows current security status
 */
declare const NehonixShieldPluggingBadge: React.FC<{
    variant?: "minimal" | "standard" | "detailed";
    className?: string;
    style?: React.CSSProperties;
}>;

interface NsbMiddlewareOptions extends MaliciousPatternOptions {
    blockOnMalicious?: boolean;
    logDetails?: boolean;
    automaticBlocking?: boolean;
    customBlockHandler?: (req: Request$1, res: Response$1, result: MaliciousPatternResult) => void;
    scoreThreshold?: number;
    bypassHeader?: string;
    bypassToken?: string;
    enableRateLimit?: boolean;
    rateLimit?: {
        windowMs?: number;
        maxRequests?: number;
        message?: string | object;
    };
    scanComponents?: ("url" | "headers" | "query" | "body")[];
    ipBlacklist?: string[];
    ipWhitelist?: string[];
    transformResponse?: boolean;
    secureHeaders?: boolean;
}
/**
 * Security event interface for logging security-related actions
 */
interface SecurityEvent {
    timestamp: number;
    type: "block" | "warning" | "suspicious" | "rate_limit" | "bypass";
    ip: string;
    url?: string;
    method?: string;
    score?: number;
    patterns?: DetectedPattern[];
    details?: any;
}
/**
 * Database adapter interface for persistent storage
 */
interface SecurityDatabaseAdapterType {
    trackSuspiciousIP: (ip: string, details: any) => Promise<void>;
    getSuspiciousIPs: () => Promise<Array<{
        ip: string;
        count: number;
        lastSeen: number;
        details?: any;
    }>>;
    blockIP: (ip: string, reason: string) => Promise<boolean>;
    isIPBlocked: (ip: string) => Promise<boolean>;
    saveSecurityEvent: (event: SecurityEvent) => Promise<void>;
    getSecurityEvents: (options: {
        startDate: Date;
        endDate: Date;
    }) => Promise<SecurityEvent[]>;
}

/**
 * Enhanced NSB Express middleware for securing incoming requests
 * @param options - Middleware options
 * @returns Express middleware function
 */
declare const nehonixShieldMiddleware: (options?: NsbMiddlewareOptions) => (req: Request$1, res: Response$1, next: NextFunction) => Promise<void | Response$1<any, Record<string, any>>>;
/**
 * Cleans up old suspicious IP records
 */
declare function cleanupSuspiciousIPs(): void;
/**
 *
 * This function aggregates all security events from the database and generates a detailed
 * security report with threat analysis, recommendations, and visualizable timeline data.
 * The report's detail level and included sections are customizable through options.
 *
 * @param options Report generation options
 * @returns Detailed security report
 * @example
 * ```typescript
 * // Generate a basic report for the last 30 days
 * const basicReport = await generateSecurityReport({
 *   days: 30,
 *   detailLevel: 'basic'
 * });
 *
 * // Generate a comprehensive report with all details
 * const fullReport = await generateSecurityReport({
 *   days: 7,
 *   detailLevel: 'comprehensive',
 *   includeIPs: true,
 *   includePatterns: true,
 *   includeRecommendations: true
 * });
 * ```
 */
declare function generateSecurityReport(options?: {
    days?: number;
    includeIPs?: boolean;
    includePatterns?: boolean;
    includeRecommendations?: boolean;
    detailLevel?: "basic" | "detailed" | "comprehensive";
}): Promise<object>;
/**
 * Function to block an IP address with a custom reason
 */
declare function blockIP(ip: string, reason: string): Promise<boolean>;
/**
 * Creates a custom database adapter for specific storage solutions
 * @param implementation The implementation of the database adapter
 * @returns A configured SecurityDatabaseAdapter
 */
declare function createDatabaseAdapter(implementation: Partial<SecurityDatabaseAdapterType>): SecurityDatabaseAdapterType;

/**
 * Security reporting router for analytics dashboard
 */
declare function createSecurityReportingRouter(): Router;

/**
 * Set a custom database adapter
 */
declare function setDatabaseAdapter(adapter: SecurityDatabaseAdapterType): void;
/**
 * Get the current database adapter
 */
declare function getDatabaseAdapter(): SecurityDatabaseAdapterType;

interface ShieldRule {
    id: string;
    type: RuleType;
    priority: number;
    condition: RuleCondition;
    action: RuleAction;
}
declare enum RuleType {
    CSP = "csp",
    CSRF = "csrf",
    COOKIE = "cookie",
    REQUEST = "request",
    IP = "ip",
    HEADER = "header",
    ML = "ml"
}
interface MLPrediction {
    probability: number;
    classification: string;
    confidence: number;
    threat_types: string[];
    top_features: Array<{
        name: string;
        contribution: number;
        value: number;
    }>;
}
interface MLRuleConfig {
    threshold: number;
    action: string;
    model_version?: string;
    threat_types?: string[];
}
interface RuleCondition {
    type: ConditionType;
    value: any;
}
declare enum ConditionType {
    MATCH_PATH = "match_path",
    MATCH_METHOD = "match_method",
    MATCH_IP = "match_ip",
    MATCH_HEADER = "match_header",
    CUSTOM = "custom"
}
interface RuleAction {
    type: ActionType;
    value: any;
}
declare enum ActionType {
    ALLOW = "allow",
    DENY = "deny",
    MODIFY = "modify",
    ADD_HEADER = "add_header",
    REMOVE_HEADER = "remove_header"
}
interface CookieOptions {
    httpOnly?: boolean;
    secure?: boolean;
    sameSite?: 'strict' | 'lax' | 'none';
    domain?: string;
    path?: string;
    maxAge?: number;
}

declare class NSHParser {
    private static readonly RULE_SEPARATOR;
    private static readonly COMMENT_PREFIX;
    private static readonly KNOWN_PROPERTIES;
    private static readonly KNOWN_TYPES;
    private static readonly KNOWN_CONDITION_TYPES;
    private static readonly KNOWN_ACTION_TYPES;
    /**
     * Parse a .nsh file into ShieldRules
     * Example .nsh file format:
     *
     * # CSP Rule
     * type: csp
     * priority: 100
     * condition:
     *   type: match_path
     *   value: /api/*
     * action:
     *   type: modify
     *   value:
     *     directive: script-src
     *     sources: ['https://api.example.com']
     * ---
     * # CSRF Rule
     * type: csrf
     * priority: 90
     * condition:
     *   type: match_path
     *   value: /public/*
     * action:
     *   type: allow
     */
    static parseFile(filePath: string): ShieldRule[];
    static parseContent(content: string, filePath?: string): ShieldRule[];
    private static parseRuleBlock;
    private static parseValue;
    private static validateRule;
    static loadDirectory(dirPath: string): Promise<ShieldRule[]>;
}

declare class NehonixShield {
    private ruleEngine;
    private trustedProxies;
    private bannedIPs;
    private bannedRanges;
    private maxPayloadSize;
    constructor(config: {
        trustedProxies?: string[];
        bannedIPs?: string[];
        bannedRanges?: string[];
        maxPayloadSize?: number;
        customRules?: ShieldRule[];
    });
    setupCSP: (req: Request$1, res: Response$1, next: NextFunction) => void;
    csrfProtection: (req: Request$1, res: Response$1, next: NextFunction) => void | Response$1<any, Record<string, any>>;
    configureTrustedProxy: (req: any, res: Response$1, next: NextFunction) => void;
    secureCoookieSettings: (req: Request$1, res: Response$1, next: NextFunction) => void;
    validateRequest: (req: Request$1, res: Response$1, next: NextFunction) => Promise<Response$1<any, Record<string, any>> | undefined>;
    ipFilter: (req: Request$1, res: Response$1, next: NextFunction) => Response$1<any, Record<string, any>> | undefined;
    additionalSecurityHeaders: (req: Request$1, res: Response$1, next: NextFunction) => void;
    applyMiddleware(app: any): any;
    loadRules(rules: ShieldRule[]): void;
}

/**
 * A comprehensive library for detecting, encoding, and decoding URI strings, designed for security testing and attack analysis.
 * @author nehonix
 * @version 2.1.2
 * @since 12/04/2025
 * The `NehonixURIProcessor` class provides methods to analyze URLs, generate encoding variants for Web Application Firewall (WAF) bypass testing,
 * and automatically detect and decode various URI encodings. It supports a range of encoding types, including percent-encoding, Base64, and hexadecimal,
 * making it suitable for penetration testing, vulnerability assessment, and secure data processing.
 *
 * For detailed documentation on specific methods, see the [changelog](https://lab.nehonix.space/nehonix_viewer/_doc/NehonixUriProcessor/changelog) and method-specific guides.
 *
 * @example
 * ```typescript
 * // Check if a string is a valid URI
 * const isValid = NehonixURIProcessor.isValidUri("https://nehonix.space?test=true");
 * console.log(isValid); // true
 *
 * // Decode a Base64-encoded URI parameter
 * const decoded = NehonixURIProcessor.autoDetectAndDecode("https://nehonix.space?test=dHJ1ZQ==");
 * console.log(decoded); // https://nehonix.space?test=true
 *
 * // Generate WAF bypass variants
 * const variants = NehonixURIProcessor.generateWAFBypassVariants("<script>");
 * console.log(variants); // { percent: "%3Cscript%3E", base64: "PHNjcmlwdD4=", ... }
 * ```
 */
declare class NehonixURIProcessor {
    /**
     * Generates encoding variants of a string for Web Application Firewall (WAF) bypass testing.
     *
     * This method produces multiple encoded versions of the input string (e.g., percent-encoding, Base64, hexadecimal)
     * to test whether a WAF can be bypassed by obfuscating malicious payloads.
     *
     * @param input - The string to encode, typically a potentially malicious payload (e.g., `<script>`).
     * @returns An object containing different encoding variants, where keys are encoding types (e.g., `percent`, `base64`) and values are the encoded strings.
     * @example
     * ```typescript
     * const variants = NehonixURIProcessor.generateWAFBypassVariants("<script>");
     * console.log(variants);
     * // Output: { percent: "%3Cscript%3E", base64: "PHNjcmlwdD4=", hex: "3C7363726970743E", ... }
     * ```
     */
    static generateWAFBypassVariants(input: string): WAFBypassVariants;
    /**
     * Analyzes a URL to identify potentially vulnerable query parameters.
     *
     * This method parses the URL, extracts its query parameters, and evaluates them for common security vulnerabilities,
     * such as parameters commonly used for SQL injection, XSS, or other attacks.
     *
     * @param url - The URL to analyze (e.g., `https://nehonix.space?user=admin&pass=123`).
     * @returns An object containing the URL's components (e.g., domain, path, parameters) and a vulnerability assessment
     *          for each parameter, including potential attack vectors.
     * @example
     * ```typescript
     * const analysis = NehonixURIProcessor.analyzeURL("https://nehonix.space?user=admin");
     * console.log(analysis);
     * // Output: { url: "https://nehonix.space", params: { user: { value: "admin", risks: ["sql_injection", "xss"] } }, ... }
     * ```
     */
    static analyzeURL(...p: Parameters<typeof SecurityRules.analyzeURL>): URLAnalysisResult;
    /**
     * Encodes a string using the specified encoding type.
     *
     * Supports various encoding types defined in `ENC_TYPE`, such as percent-encoding, Base64, and hexadecimal.
     * Useful for preparing test payloads or obfuscating data.
     *
     * @param input - The string to encode (e.g., `hello world`).
     * @param encodingType - The encoding type to apply, as defined in `ENC_TYPE` (e.g., `percentEncoding`, `base64`).
     * @returns The encoded string (e.g., `hello%20world` for percent-encoding).
     * @throws Throws an error if the encoding type is unsupported or the input is invalid.
     * @example
     * ```typescript
     * const encoded = NehonixURIProcessor.encode("hello world", "percentEncoding");
     * console.log(encoded); // hello%20world
     *
     * const base64 = NehonixURIProcessor.encode("true", "base64");
     * console.log(base64); // dHJ1ZQ==
     * ```
     */
    static encode(...p: Parameters<typeof NES.encode>): string;
    /**
     * Detects the encoding type(s) of a URI string.
     *
     * Analyzes the input string to identify potential encodings (e.g., percent-encoding, Base64, hexadecimal) and their likelihood.
     * Supports recursive detection for nested encodings if a depth is specified.
     *
     * @param input - The URI string to analyze (e.g., `hello%20world` or `dHJ1ZQ==`).
     * @param [depth] - Optional recursion depth for detecting nested encodings (e.g., Base64 inside percent-encoding).
     *                  If omitted, performs a single-level analysis.
     * @returns An object containing the most likely encoding type, confidence score, and any detected nested encodings.
     * @example
     * ```typescript
     * const detection = NehonixURIProcessor.detectEncoding("hello%20world");
     * console.log(detection);
     * // Output: { mostLikely: "percentEncoding", confidence: 0.95, nestedTypes: [] }
     *
     * const nested = NehonixURIProcessor.detectEncoding("aHR0cHM6Ly9leGFtcGxlLmNvbQ==", 2);
     * console.log(nested);
     * // Output: { mostLikely: "base64", confidence: 0.9, nestedTypes: ["percentEncoding"], ... }
     * ```
     */
    static detectEncoding(input: string, depth?: number): EncodingDetectionResult;
    /**
     * Automatically detects and decodes a URI string to plaintext.
     *
     * Uses advanced detection to identify the encoding type(s) and iteratively decodes the input until plaintext is reached
     * or the maximum recursion depth is met. Ideal for decoding complex or nested URI encodings.
     *
     * @version 1.1.1
     * @param input - The URI string to decode (e.g., `https://nehonix.space?test=dHJ1ZQ==`).
     * @param [maxIterations=10] - Maximum number of decoding iterations to prevent infinite loops.
     * @returns The decoded string in plaintext (e.g., `https://nehonix.space?test=true`).
     * @example
     * ```typescript
     * const decoded = NehonixURIProcessor.autoDetectAndDecode("https://nehonix.space?test=dHJ1ZQ==");
     * console.log(decoded.val()); // https://nehonix.space?test=true
     *
     * const nested = NehonixURIProcessor.autoDetectAndDecode("aHR0cHM6Ly9leGFtcGxlLmNvbQ==");
     * console.log(nested.val()); // https://nehonix.space
     * ```
     */
    static autoDetectAndDecode(...props: Parameters<typeof NDS.decodeAnyToPlaintext>): DecodeResult;
    /**
     * Automatically detects and decodes a URI string based on its encoding type.
     *
     * @deprecated Use `autoDetectAndDecode` instead for improved precision and performance.
     * @param input - The URI string to decode (e.g., `dHJ1ZQ==`).
     * @returns An object containing the decoded string, detected encoding type, and confidence score.
     * @example
     * ```typescript
     * const result = NehonixURIProcessor.detectAndDecode("dHJ1ZQ==");
     * console.log(result);
     * // Output: { val: "true", encodingType: "base64", confidence: 0.9 }
     * ```
     */
    static detectAndDecode(input: string): DecodeResult;
    /**
     * Validates a URL string according to specified options.
     *
     * This method uses `checkUrl` to perform a comprehensive validation and returns a boolean indicating whether the URL
     * is valid based on the provided options. It supports validation of protocols, domains, TLDs, query parameters, and
     * encoding, with additional support for localhost when enabled.
     *
     * @param url - The URL string to validate (e.g., `https://nehonix.space?test=true`).
     * @param [options] - Optional configuration for validation rules.
     * @param [options.strictMode=false] - If `true`, requires a leading slash before query parameters.
     * @param [options.allowUnicodeEscapes=true] - If `true`, allows Unicode escape sequences in query parameters.
     * @param [options.rejectDuplicateParams=true] - If `true`, rejects URIs with duplicate query parameter keys.
     * @param [options.rejectDuplicatedValues=false] - If `true`, rejects URIs with duplicate query parameter values.
     * @param [options.httpsOnly=false] - If `true`, only allows `https://` URLs.
     * @param [options.maxUrlLength=2048] - Maximum allowed length for the entire URL.
     * @param [options.allowedTLDs=[]] - List of allowed top-level domains.
     * @param [options.allowedProtocols=['http', 'https']] - List of allowed protocols.
     * @param [options.requireProtocol=false] - If `true`, requires an explicit protocol in the URL.
     * @param [options.requirePathOrQuery=false] - If `true`, requires a path or query string.
     * @param [options.strictParamEncoding=false] - If `true`, validates proper URI encoding of query parameters.
     * @param [options.allowLocalhost=false] - If `true`, allows 'localhost' as a valid hostname.
     * @returns `true` if the URL is valid according to the specified options, `false` otherwise.
     * @example
     * ```typescript
     * const isValid = NehonixURIProcessor.isValidUrl("https://nehonix.space?test=true");
     * console.log(isValid); // true
     *
     * const isLocalhostValid = NehonixURIProcessor.isValidUrl("http://localhost:8080", { allowLocalhost: true });
     * console.log(isLocalhostValid); // true
     *
     * const isLocalhostInvalid = NehonixURIProcessor.isValidUrl("http://localhost:8080");
     * console.log(isLocalhostInvalid); // false
     * ```
     * @see checkUrl
     * @see UrlValidationOptions
     */
    static isValidUri(...props: Parameters<typeof NehonixCoreUtils.isValidUrl>): ReturnType<typeof NehonixCoreUtils.isValidUrl>;
    /**
     * Decodes a string using the specified encoding type.
     *
     * Supports various decoding types defined in `ENC_TYPE` or `DEC_FEATURE_TYPE`, such as percent-encoding, Base64,
     * and hexadecimal. Can handle recursive decoding for nested encodings if a depth is specified.
     *
     * @param input - The string to decode (e.g., `hello%20world`).
     * @param encodingType - The encoding type to decode, as defined in `ENC_TYPE` or `DEC_FEATURE_TYPE`
     *                       (e.g., `percentEncoding`, `base64`).
     * @param [maxRecursionDepth] - Optional maximum recursion depth for nested decoding.
     *                              If omitted, performs a single-level decode.
     * @returns The decoded string (e.g., `hello world` for percent-encoding).
     * @throws Throws an error if the encoding type is unsupported or the input is invalid.
     * @example
     * ```typescript
     * const decoded = NehonixURIProcessor.decode("hello%20world", "percentEncoding");
     * console.log(decoded); // hello world
     *
     * const base64 = NehonixURIProcessor.decode("dHJ1ZQ==", "base64");
     * console.log(base64); // true
     *
     * const nested = NehonixURIProcessor.decode("414243", "hex", 2);
     * console.log(nested); // ABC
     * ```
     */
    static decode(input: string, encodingType: ENC_TYPE | DEC_FEATURE_TYPE, maxRecursionDepth?: number): string;
    /**
     * Creates a URL object from a URI string.
     *
     * This method parses the provided URI string using the native `URL` API, returning a `URL` object that provides
     * structured access to the URL's components (e.g., protocol, hostname, pathname, search parameters). It is useful
     * for further URL manipulation or analysis within the `NehonixURIProcessor` ecosystem.
     *
     * @param uri - The URI string to parse (e.g., `https://nehonix.space?test=true`).
     * @returns A `URL` object representing the parsed URI.
     * @throws Throws a `TypeError` if the URI string is invalid or cannot be parsed by the `URL` constructor.
     * @example
     * ```typescript
     * const urlObj = NehonixURIProcessor.createUrl("https://nehonix.space?test=true");
     * console.log(urlObj.href); // https://nehonix.space?test=true
     * console.log(urlObj.hostname); // nehonix.space
     * console.log(urlObj.searchParams.get("test")); // true
     *
     * // Handling invalid URI
     * try {
     *   const invalidUrl = NehonixURIProcessor.createUrl("not-a-valid-url");
     * } catch (error) {
     *   console.log(error.message); // Failed to construct 'URL': Invalid URL
     * }
     * ```
     */
    static createUrl(uri: string): URL;
    /**
     * Checks a URL string and returns detailed validation results.
     *
     * This method performs a comprehensive validation of a URL string against configurable rules, similar to `isValidUri`,
     * but instead of returning a boolean, it provides an object with detailed results for each validation step. It checks
     * aspects such as URL length, protocol, domain structure, top-level domains (TLDs), query parameters, and encoding.
     * The returned object includes an overall validity flag and specific details about each check, making it ideal for
     * debugging, security analysis, or detailed URL validation reporting.
     *
     * @param url - The URL string to check (e.g., `https://nehonix.space?test=true`).
     * @param [options] - Optional configuration for validation rules.
     * @param [options.strictMode=false] - If `true`, requires a leading slash before query parameters (e.g., `/?query`).
     *                                    If `false`, allows query parameters without a leading slash (e.g., `?query`).
     * @param [options.allowUnicodeEscapes=true] - If `true`, allows Unicode escape sequences (e.g., `\u0068`) in query
     *                                            parameters. If `false`, rejects such sequences.
     * @param [options.rejectDuplicateParams=true] - If `true`, rejects URIs with duplicate query parameter keys
     *                                              (e.g., `?p1=a&p1=b`). If `false`, allows duplicates.
     * @param [options.rejectDuplicatedValues=false] - If `true`, rejects URIs with duplicate query parameter values
     *                                                (e.g., `?p1=a&p2=a`). If `false`, allows duplicates.
     * @param [options.httpsOnly=false] - If `true`, only allows `https://` URLs (rejects `http://`). If `false`, allows
     *                                   both `http://` and `https://` URLs.
     * @param [options.maxUrlLength=2048] - Maximum allowed length for the entire URL. Set to 0 to disable length checking.
     * @param [options.allowedTLDs=[]] - List of allowed top-level domains (e.g., `['com', 'org', 'net']`). If empty,
     *                                   all TLDs are allowed.
     * @param [options.allowedProtocols=['http', 'https']] - List of allowed protocols (e.g., `['http', 'https']`).
     *                                                      Only enforced if `requireProtocol` is `true`.
     * @param [options.requireProtocol=false] - If `true`, requires an explicit protocol in the URL (e.g., `https://`).
     *                                         If `false`, adds `https://` to URLs without a protocol.
     * @param [options.requirePathOrQuery=false] - If `true`, requires a path or query string (rejects bare domains like
     *                                            `example.com`). If `false`, allows bare domains.
     * @param [options.strictParamEncoding=false] - If `true`, validates that query parameter keys and values are properly
     *                                             URI-encoded (e.g., no invalid percent-encoding). If `false`, performs
     *                                             basic validation.
     * @returns A `UrlCheckResult` object containing:
     *          - `isValid`: A boolean indicating overall validity.
     *          - `validationDetails`: An object with details for each validation check (e.g., length, protocol, domain),
     *            including validity status, descriptive messages, and relevant metadata (e.g., detected protocol, invalid parameters).
     * @throws Does not throw errors; instead, parsing errors are reported in the `validationDetails.parsing` property.
     * @example
     * ```typescript
     * const result = NehonixURIProcessor.checkUrl("https://nehonix.space?test=true");
     * console.log(result);
     * // Output: {
     * //   isValid: true,
     * //   validationDetails: {
     * //     length: { isValid: true, message: "URL length is within limits", actualLength: 29, maxLength: 2048 },
     * //     emptyCheck: { isValid: true, message: "URL is not empty" },
     * //     protocol: { isValid: true, message: "Protocol 'https' is valid", detectedProtocol: "https", allowedProtocols: ["http", "https"] },
     * //     ...
     * //   }
     * // }
     *
     * // Invalid URL with unencoded spaces
     * const invalidResult = NehonixURIProcessor.checkUrl("https://nehonix.space?test=thank you");
     * console.log(invalidResult);
     * // Output: {
     * //   isValid: false,
     * //   validationDetails: {
     * //     length: { isValid: true, message: "URL length is within limits", actualLength: 35, maxLength: 2048 },
     * //     emptyCheck: { isValid: true, message: "URL is not empty" },
     * //     querySpaces: { isValid: false, message: "Query string contains unencoded spaces" },
     * //     ...
     * //   }
     * // }
     *
     * // URL with duplicate parameters
     * const duplicateResult = NehonixURIProcessor.checkUrl(
     *   "https://nehonix.space?p1=a&p1=b",
     *   { rejectDuplicateParams: true }
     * );
     * console.log(duplicateResult);
     * // Output: {
     * //   isValid: false,
     * //   validationDetails: {
     * //     duplicateParams: { isValid: false, message: "Duplicate query parameter keys detected", duplicatedKeys: ["p1"] },
     * //     ...
     * //   }
     * // }
     *
     * // URL with strict encoding violation
     * const encodingResult = NehonixURIProcessor.checkUrl(
     *   "https://nehonix.space?test=%25",
     *   { strictParamEncoding: true }
     * );
     * console.log(encodingResult);
     * // Output: {
     * //   isValid: false,
     * //   validationDetails: {
     * //     paramEncoding: { isValid: false, message: "Invalid parameter encoding detected", invalidParams: ["%25"] },
     * //     ...
     * //   }
     * // }
     * ```
     * @see UrlCheckResult for the structure of the returned object.
     * @see isValidUri for a boolean-based URL validation method.
     */
    static checkUrl: (...p: Parameters<typeof NehonixCoreUtils.checkUrl>) => ReturnType<typeof NehonixCoreUtils.checkUrl>;
    /**
     * Analyzes input for malicious patterns and returns detailed detection results
  
  @param input — The string to analyze
  
  @param options — Configuration options for detection
  
  @returns — Detailed analysis result
  */
    static detectMaliciousPatterns(...arg: Parameters<typeof NSS.detectMaliciousPatterns>): ReturnType<typeof NSS.detectMaliciousPatterns>;
    /**
     * Analyzes a URL for malicious patterns with specific sensitivity per URL component
     * @param url — The URL to analyze
     * @param options — Configuration options for detection
     * @returns — Detailed analysis result
     */
    static scanUrl(...arg: Parameters<typeof NSS.analyzeUrl>): ReturnType<typeof NSS.analyzeUrl>;
    /**
     *Lightweight check to
      determine if string needs deep scanning Use as a pre-filter before doing full pattern detection
     *@param input — String to check
    * @returns — Whether input needs further scanning
     */
    static needsDeepScan: (...p: Parameters<typeof NSS.needsDeepScan>) => ReturnType<typeof NSS.needsDeepScan>;
    /**
     * Sanitizes input by removing potentially malicious patterns
     * @param input — The string to sanitize
     * @param options — Additional sanitization options
     * @returns — Sanitized string
     */
    static sanitizeInput: (...p: Parameters<typeof NSS.sanitizeInput>) => ReturnType<typeof NSS.sanitizeInput>;
    static asyncAutoDetectAndDecode(...p: Parameters<typeof NDS.asyncDecodeAnyToPlainText>): ReturnType<typeof NDS.asyncDecodeAnyToPlainText>;
    static asyncCheckUrl(...p: Parameters<typeof NehonixCoreUtils.asyncCheckUrl>): ReturnType<typeof NehonixCoreUtils.asyncCheckUrl>;
    static asyncIsUrlValid(...p: Parameters<typeof NehonixCoreUtils.asyncIsUrlValid>): Promise<boolean>;
    /**
     * Performs multiple encodings on an input string asynchronously
     * @param input The string to encode
     * @param types Array of encoding types to apply
     * @param options Configuration options for nested encoding
     * @returns Promise resolving to object containing encoding results
     */
    static encodeMultipleAsync(...p: Parameters<typeof NES.encodeMultipleAsync>): Promise<NestedEncodingResponse>;
    /**
     * Performs multiple encodings on an input string synchronously
     * @param input The string to encode
     * @param types Array of encoding types to apply
     * @param options Configuration options for nested encoding
     * @returns Object containing encoding results
     */
    static encodeMultiple(...p: Parameters<typeof NES.encodeMultiple>): NestedEncodingResponse;
}

/**
 * Encodes user input based on the context in which it will be used
 * Selects the appropriate encoding method for security and compatibility
 *
 * @param input The user input to secure
 * @param context The context where the input will be used
 * @param options Optional configuration for specific encoding behaviors
 * @returns The appropriately encoded string
 */
declare const __safeEncode__: typeof NehonixSafetyLayer.__safeEncode__;

declare const decodeB64: (input: string) => string;

declare const detectDuplicateUrlParams: typeof NehonixCoreUtils.detectDuplicatedValues;

export { ActionType, ConditionType, MaliciousPatternType, NSHParser, NehonixShield, NehonixShieldPluggingBadge, NehonixShieldProvider, NehonixShieldProviderPlugging, NehonixURIProcessor, RuleType, NehonixURIProcessor as __processor__, __safeEncode__, blockIP, cleanupSuspiciousIPs, createDatabaseAdapter, createSecurityReportingRouter, decodeB64, detectDuplicateUrlParams, generateSecurityReport, getDatabaseAdapter, nehonixShieldMiddleware, setDatabaseAdapter, useNehonixShield, useNehonixShieldPlugging, useSecureFetch, useShieldConfig, useShieldMonitoring, useThreats, withNehonixShieldPlugging };
export type { CookieOptions, DetectedPattern, MLPrediction, MLRuleConfig, MaliciousPatternResult, NsbMiddlewareOptions, RuleAction, RuleCondition, SecurityDatabaseAdapterType, SecurityEvent, ShieldRule };
