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<Obj extends {
    [key in string]: any;
}, Type> = {
    [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<Map extends {
    [name in string]: any;
}, Keys extends keyof Map> = Partial<Pick<Map, Keys>> & Required<Omit<Map, Keys>>;
/**
 * Creates a map of target routes with matching parameters based on a map of external routes.
 *
 * @ignore
 */
type TargetRouteMap<ExternalRoutes extends {
    [name: string]: ExternalRouteRef;
}> = {
    [name in keyof ExternalRoutes]: ExternalRoutes[name] extends ExternalRouteRef<infer Params> ? RouteRef<Params> | SubRouteRef<Params> | false : never;
};
/**
 * A function that can bind from external routes of a given plugin, to concrete
 * routes of other plugins. See {@link @backstage/frontend-defaults#createApp}.
 *
 * @public
 */
export type CreateAppRouteBinder = <TExternalRoutes extends {
    [name: string]: ExternalRouteRef;
}>(externalRoutes: TExternalRoutes, targetRoutes: PartialKeys<TargetRouteMap<TExternalRoutes>, KeysWithType<TExternalRoutes, ExternalRouteRef<any>>>) => void;
export {};
