import { AnyRouteRefParams, RouteRef, SubRouteRef, ExternalRouteRef } from '../../routing'; /** * TS magic for handling route parameters. * * @remarks * * The extra TS magic here is to require a single params argument if the RouteRef * had at least one param defined, but require 0 arguments if there are no params defined. * Without this we'd have to pass in empty object to all parameter-less RouteRefs * just to make TypeScript happy, or we would have to make the argument optional in * which case you might forget to pass it in when it is actually required. * * @public */ export type RouteFunc = (...[params]: TParams extends undefined ? readonly [] : readonly [params: TParams]) => string; /** * @public */ export type RouteResolutionApiResolveOptions = { /** * An absolute path to use as a starting point when resolving the route. * If no path is provided the route will be resolved from the root of the app. */ sourcePath?: string; }; /** * @public */ export interface RouteResolutionApi { resolve(anyRouteRef: RouteRef | SubRouteRef | ExternalRouteRef, options?: RouteResolutionApiResolveOptions): RouteFunc | undefined; } /** * The `ApiRef` of {@link RouteResolutionApi}. * * @public */ export declare const routeResolutionApiRef: import("@backstage/core-plugin-api").ApiRef;