UNPKG

@push.rocks/smartproxy

Version:

A powerful proxy package with unified route-based configuration for high traffic management. Features include SSL/TLS support, flexible routing patterns, WebSocket handling, advanced security options, and automatic ACME certificate management.

31 lines (30 loc) 1.16 kB
import type { IRouteConfig } from '../../proxies/smart-proxy/models/route-types.js'; import type { IRouteSpecificity } from './types.js'; /** * Unified route specificity calculator * Provides consistent specificity scoring across all routing components */ export declare class RouteSpecificity { /** * Calculate the total specificity score for a route * Higher scores indicate more specific routes that should match first */ static calculate(route: IRouteConfig): IRouteSpecificity; /** * Compare two routes and determine which is more specific * @returns positive if route1 is more specific, negative if route2 is more specific, 0 if equal */ static compare(route1: IRouteConfig, route2: IRouteConfig): number; /** * Sort routes by specificity (most specific first) */ static sort(routes: IRouteConfig[]): IRouteConfig[]; /** * Find the most specific route from a list */ static findMostSpecific(routes: IRouteConfig[]): IRouteConfig | null; /** * Check if a route has any matching criteria */ static hasMatchCriteria(route: IRouteConfig): boolean; }