import { RouteMetadata } from "@webpieces/core-util"; /** * Represents a route configuration that can be registered with the router. * Similar to Java WebPieces Routes interface. */ export interface Routes { /** * Configure routes using the provided RouteBuilder. */ configure(routeBuilder: RouteBuilder): void; } /** * Builder for registering routes. * Will be implemented in http-server package. */ export interface RouteBuilder { addRoute(route: RouteDefinition): void; addFilter(filter: FilterDefinition): void; } /** * Definition of a single route. * * Generic type parameter TResult represents the return type of the route handler. * This provides type safety for the entire request/response cycle. */ export declare class RouteDefinition { routeMeta: RouteMetadata; controllerClass: any; controllerFilepath?: string | undefined; apiClass?: unknown | undefined; constructor(routeMeta: RouteMetadata, controllerClass: any, controllerFilepath?: string | undefined, apiClass?: unknown | undefined); } /** * Definition of a filter with priority. * * Use filepathPattern to scope filters to specific controllers: * - 'src/controllers/admin/**' + '/*.ts' - All admin controllers * - '**' + '/admin/**' - Any file in admin directories * - '**' + '/UserController.ts' - Specific controller file * * If filepathPattern is not specified, the filter matches all controllers. * * Every filter runs for BOTH real HTTP requests AND the in-process createApiClient — there is * no transport tier. Transport-boundary auth is a fixed framework filter (AuthFilter) that * reads the transport-neutral HttpRequest, so it runs identically in both. */ export declare class FilterDefinition { priority: number; filterClass: any; filter?: any; /** * Glob pattern to match controller file paths. * If not specified, defaults to matching all controllers. */ filepathPattern: string; constructor(priority: number, filterClass: any, filepathPattern: string); }