import { GenericType } from '@ng-lab/support'; import { ConfiguratorService } from '@ng-lab/configurator'; import { DomainHostType, RouteDescriptorType, RouteResolverType } from './http-url.typing'; /** * @description * Service to register urls simple and with parameters * * @ngModule HttpUrlModule * @publicApi */ export declare class HttpUrlService { private configurator; /** * @description * Property key to find routes in `ConfiguratorService` * * @memberof HttpUrlService */ static OPTION_ENDPOINT_NAME: string; /** * @description * Property key to find domains in `ConfiguratorService` * * @memberof HttpUrlService */ static OPTIONS_DOMAIN_NAME: string; /** * @description * Collection of domains to prefix urls * * @memberof HttpUrlService */ protected prefixes: DomainHostType[]; /** * @description * Collection of routes registered * * @memberof HttpUrlService */ protected routes: Map; /** * @description * Creates an instance of HttpUrlService. * * @param configurator ConfiguratorService instance * @memberof HttpUrlService */ constructor(configurator: ConfiguratorService); /** * @description * Init setup for resolving routes collection. */ private init; /** * @description * Setup regex routing and add it to Map. * * @param name Route name * @param uri Url path */ protected setupRoute(name: string, uri: string): void; /** * @description * Add route to Map. * * @param name Route name/key * @param descriptor Route object properties */ addRoute(name: string, descriptor: RouteDescriptorType): void; /** * @description * Get the route from Map and resolve domain host. Pass parameters * to complete dynamic arguments on route, even overriding domain host is possible. * * @param name Route name/key * @param params Route parameters * @param domain Route mai domain */ get(name: string, params?: GenericType, domain?: string): string; /** * @description * Check if route exist in the collection * * @param name Route name/key * @memberof HttpUrlService */ hasRoute(name: string): boolean; /** * @description * Resolve host domain and route. * * @param descriptor Route object properties * @param args Route arguments * @param host Route host domain */ protected resolve(descriptor: RouteDescriptorType, args: GenericType, host?: string): RouteResolverType; /** * @description * Macth route arguments. * * @param route Route path */ protected expression(route: string): RegExp; }