import { AlLocationContext, AlLocationDescriptor } from '../abstract'; declare class UriMappingItem { location: AlLocationDescriptor; aliasBaseUrl?: string; protected _url: string; protected _prefix: string; protected _matcher?: RegExp; get url(): string; get matcher(): RegExp; get prefix(): string; constructor(location: AlLocationDescriptor, aliasBaseUrl?: string); /** * Escapes a domain pattern. * * All normal regex characters are escaped; * is converted to [a-zA-Z0-9_]+; and the whole expression is wrapped in ^....*$. */ protected escapeLocationPattern(uri: string): string; } /** * @public * * This class accepts a list of location descriptors, an acting URL, and an optional context specification, and provides the ability * to calculate environment- and residency- specific target URLs. */ export declare class AlLocatorServiceInstance { private actingUrl; private actor; private knownLocations; private nodeDictionary; private locTypeMap; private nodeCache; private byPrefix; private uriMap; private context; constructor(nodes?: AlLocationDescriptor[], actingUrl?: string | boolean, context?: AlLocationContext); /** * Resets locator state to its "factory presets" */ reset(): void; /** * Retrieves the ID of the environment associated with the current acting URL. */ getCurrentEnvironment(): string; /** * Retrieves the current residency (US or EMEA) */ getCurrentResidency(): string; /** * Retrieves the current path, or returns empty string if we are executing in the context of the root document */ getCurrentPath(): string; /** * Arguably the only important general-purpose functionality of this service. * Calculates a URL from a location identifier, an optional path fragment, and an optional context. * * @returns The resulting URL. */ resolveURL(locTypeId: string, path?: string, context?: AlLocationContext): string; /** * Resolves a literal URI to a service node. Note that the order of `this.byPrefix` from highest-to-lowest prefix complexity is necessary for * this to work properly. */ getMappingByURI(targetURI: string): UriMappingItem | undefined; getNodeByURI(targetURI: string): AlLocationDescriptor | undefined; /** * Gets the currently acting node. */ getActingNode(): AlLocationDescriptor | undefined; /** * @deprecated * * Nested nodes (e.g., an application living inside another application) are official dead, making this method */ resolveNodeURI(node: AlLocationDescriptor): string; /** * Updates the locator matrix model with a set of service node descriptors. * * @param nodes - A list of service node descriptors. */ setLocations(nodes: AlLocationDescriptor[]): void; indexLocation(location: AlLocationDescriptor): void; indexMapping(mapping: UriMappingItem): void; remapLocationToURI(locTypeId: string, uri: string, environment?: string, residency?: string): void; setActingUrl(actingUrl: string | boolean | undefined, forceRefresh?: boolean): void; search(filter: { (node: AlLocationDescriptor): boolean; }): AlLocationDescriptor[]; findOne(filter: { (node: AlLocationDescriptor): boolean; }): AlLocationDescriptor | undefined; /** * Sets the acting context (preferred environment, data residency, location attributes). * This acts as a merge against existing context, so the caller can provide only fragmentary information without borking things. */ setContext(context?: AlLocationContext): void; getContext(): AlLocationContext; /** * Gets a service node by ID, optionally using a context to refine its selection logic. The context defaults * to the locator matrix instance's current context; if the default is used, the result of the lookup will be stored * for performance optimization. * * @param locTypeId - The ID of the service node to select. See al-service-identity.ts for constant values. * @param context - Additional context to shape the selection logic. * * @returns A node descriptor (or null, if no node matches). */ getNode(locTypeId: string, context?: AlLocationContext): AlLocationDescriptor | null; /** * Traps the pathname portion of a URI */ protected extractUrlPath(url: string): string | undefined; /** * Chops off fragments, query strings, and any trailing slashes, and returns what *should* be just the base URL. * I make no promises about the quality of this code when confronted with incorrect or incomplete inputs. */ protected getBaseUrl(uri: string): string; /** * This method normalizes the current context. In practice, this means mapping an insight location ID to the correct defender datacenter. * In other words, it is "black magic." Or at least, dark gray. */ protected normalizeContext(): void; } export declare const AlLocatorService: AlLocatorServiceInstance; export {};