import { RouteRef, SubRouteRef, ExternalRouteRef } from '@backstage/frontend-plugin-api'; /** * Extracts a union of the keys in a map whose value extends the given type * * @ignore */ type KeysWithType = { [key in keyof Obj]: Obj[key] extends Type ? key : never; }[keyof Obj]; /** * Takes a map Map required values and makes all keys matching Keys optional * * @ignore */ type PartialKeys = Partial> & Required>; /** * Creates a map of target routes with matching parameters based on a map of external routes. * * @ignore */ type TargetRouteMap = { [name in keyof ExternalRoutes]: ExternalRoutes[name] extends ExternalRouteRef ? RouteRef | SubRouteRef : never; }; /** * A function that can bind from external routes of a given plugin, to concrete * routes of other plugins. See {@link createApp}. * * @public */ export type CreateAppRouteBinder = (externalRoutes: TExternalRoutes, targetRoutes: PartialKeys, KeysWithType>>) => void; export {};