import type { JourneyState } from './types'; /** Per-endpoint request policy (app-wide or per-journey). Longest matching prefix wins. */ export interface EndpointPolicy { /** * Path/host prefix against the request key (`"/path"` same-origin, `"host/path"` cross-domain). * Match requires an exact hit or a `/` boundary after the prefix — `/api/user` matches * `/api/user` and `/api/user/42`, but not `/api/user-preferences`. A trailing `/` on * `match` already supplies the boundary. */ match: string; /** Custom slow-request threshold in ms; omit to fall through. `0` disables latency scoring for this prefix. */ slowRequestMs?: number; /** When true, this endpoint never changes the journey verdict (errors, latency, aborts, 4xx). */ ignore?: boolean; } /** App-wide slow-request threshold fallback (not an axios abort). */ export interface SlowRequestConfig { /** Fallback threshold when no endpoint or journey override applies. */ defaultMs: number; /** App-wide endpoint overrides; journey-specific ones belong on JourneyDef.endpoints. */ endpoints?: readonly EndpointPolicy[]; } export interface ResolvedEndpointPolicy { ignore: boolean; slowRequestMs: number; } /** Copy sorted longest-match-first so lookup can return on the first hit. */ export declare function sortEndpointsByLongestMatch(endpoints: readonly EndpointPolicy[] | undefined): EndpointPolicy[] | undefined; /** * Longest-prefix match of an endpoint list against a request key. * Expects `endpoints` sorted longest-match-first (see `sortEndpointsByLongestMatch`). */ export declare function longestEndpointMatch(endpoints: readonly EndpointPolicy[] | undefined, key: string): EndpointPolicy | undefined; /** * Resolve ignore + latency threshold with longest-prefix matching. * Journey overrides win over app defaults for slow thresholds. */ export declare function resolveEndpointPolicy(journey: JourneyState, appSlow: SlowRequestConfig, requestKey: string): ResolvedEndpointPolicy; //# sourceMappingURL=endpoint-policy.d.ts.map