import { Type } from '../common/cli-types'; import { CommandRoute } from './command-routes'; import { ConfiguredModule } from '../module/module-models'; import { Provider } from '../dependency-injection/providers'; import { Command } from './command-models'; import { RegisteredRoute } from './registered-route'; /** * A set of utility functions that assist working with routes and registered routes */ export declare class RouteUtils { /** * Determines whether a module export is a route * @param value type of export */ static isRoute(value: Type | CommandRoute | ConfiguredModule | Provider): boolean; /** * Checks for duplicate routes within a array by ensuring that there are no duplicate routes by name or by alias. Throws an error when * duplicates are found * @param routes List of routes to validate * @param moduleName The name of the module that has declared or exported the routes * @param isExports Whether the routes have are in the module's export metadata */ static checkForDuplicates(routes: RegisteredRoute[], moduleName: string, isExports?: boolean): RegisteredRoute[]; /** * Gets the command class from a command route * @param route route */ static getCommand(route: CommandRoute): Type; /** * Gets the module class from a command route * @param route route */ static getModule(route: CommandRoute): Type; /** * Determines whether a route is a command route or a sub command route * @param route route */ static isCommand(route: CommandRoute): boolean; /** * Gets the routes path * @param route route */ static getPath(route: CommandRoute): string; /** * Gets the routes data property * @param route route */ static getData(route: CommandRoute): any; /** * Get the routes alias * @param route route */ static getAlias(route: CommandRoute): string; /** * Gets the routes description * @param route route */ static getDescription(route: CommandRoute): string; /** * Determines if two routes equal by comparing their modules and or commands * @param route1 Route to compare * @param route2 Route to compare */ static equal(route1: CommandRoute, route2: CommandRoute): boolean; }