/**
 * Core routing types used throughout the routing system
 */

export interface IPathMatchResult {
  matches: boolean;
  params?: Record<string, string>;
  pathMatch?: string;
  pathRemainder?: string;
}

export interface IRouteMatchResult {
  matches: boolean;
  score: number;
  specificity: number;
  matchedCriteria: string[];
}

export interface IDomainMatchOptions {
  allowWildcards?: boolean;
  caseInsensitive?: boolean;
}

export interface IIpMatchOptions {
  allowCidr?: boolean;
  allowRanges?: boolean;
}

export interface IHeaderMatchOptions {
  caseInsensitive?: boolean;
  exactMatch?: boolean;
}

export interface IRouteSpecificity {
  pathSpecificity: number;
  domainSpecificity: number;
  ipSpecificity: number;
  headerSpecificity: number;
  tlsSpecificity: number;
  totalScore: number;
}

export interface IMatcher<T = any, O = any> {
  match(pattern: string, value: string, options?: O): T | boolean;
}

export interface IAsyncMatcher<T = any, O = any> {
  match(pattern: string, value: string, options?: O): Promise<T | boolean>;
}