import { type IOptiGraphClient, OptiCmsSchema } from '../../client/index.js'; import { type OptimizelyGraphConfig } from '../../types.js'; import type { Route, IRouteResolver } from "./types.js"; import type { ContentLinkWithLocale } from '../types.js'; /** * Default router implementation for Optimizely CMS */ export declare class RouteResolver implements IRouteResolver { private _cgClient; private _defaultUrlBase; private _resolverMode; private _resolver; protected get client(): IOptiGraphClient; protected get urlBase(): string | URL; protected get schema(): OptiCmsSchema; /** * Create a new Route Resolver * * @param clientOrConfig The Optimizely Graph client or configuration to * use. If omitted, the paramterless factory method * used to create a new instance. * @param urlBase The value for the base parameter of the URL * constructor when reading routes from Optimizely * Graph */ constructor(clientOrConfig?: IOptiGraphClient | OptimizelyGraphConfig, urlBase?: string | URL, resolverMode?: OptiCmsSchema); enablePreview(changeset?: string): void; disablePreview(): void; private getResolver; /** * Retrieve all registered routes for the provided domain - all domains if none specified * * @param domain The domain to filter on * @param onlyWithDomain If set/kept to `undefined` will only filter by domain. When set * to `true`, requires the domain (CMS SaaS/13 only) to be set. This * allows to get all routes bound to a domain. * @returns The list of routes */ getRoutes(domain?: string, onlyWithDomain?: boolean): Promise; /** * Resolve a path to route information, either from string or from URL * object. * * @param path The path to resolve for * @param domain The domain to filter the results by * @returns The route information for the path */ getContentInfoByPath(path: URL): Promise; getContentInfoByPath(path: string, domain?: string): Promise; getContentInfoById(key: string, locale?: string, version?: string | number): Promise; /** * Extract a content link from a route definition * * @param route The route to parse * @returns The ContentLink, with locale information */ routeToContentLink(route: Route): ContentLinkWithLocale; } export default RouteResolver;