/** * Route definition interface */ export interface RouteDefinition { name: string; path: string; route: unknown; } /** * Mount options interface */ export interface MountOptions { ignoreDuplicate?: boolean; returnResults?: boolean; } /** * Duplicate detection result */ export interface DuplicateInfo { path?: string; route?: unknown; count: number; routeNames: string[]; } /** * Mount result interface */ export interface MountResult { mounted: Array<{ name: string; path: string }>; total: number; errors: Array; duplicates: { paths: Array; routes: Array; }; } /** * # Mounts routes on an Express router * Mounts an array of route definitions on a given Express router. * @param {Array<{ name: string; path: string; route: unknown }>} routes - Array of route definitions. * @param {import("express").Router} router - Express router to mount the routes on. * @param {MountOptions} [options] - Optional configuration for mounting routes. * @throws {Error} If there are validation errors, duplicate routes, or mounting errors. * @returns {MountResult} Results of the mounting operation. * @example * mountRoutes( * [ * { name: 'User Routes', path: '/users', route: userRoutes }, * { name: 'Product Routes', path: '/products', route: productRoutes } * ], * expressRouter, * { ignoreDuplicate: true, returnResults: true } * ); */ declare function mountRoutes( routes: Array, router: import("express").Router, options?: MountOptions ): MountResult; export default mountRoutes;