inline routeFunc

Signed-off-by: Chris Suich <csuich2@gmail.com>
This commit is contained in:
Chris Suich
2025-05-21 14:36:24 -04:00
parent 5c81e9e165
commit 5476046fc5
3 changed files with 12 additions and 22 deletions
+7 -13
View File
@@ -27,18 +27,6 @@ import {
} from '@backstage/plugin-techdocs-common';
import { RouteFunc } from '@backstage/core-plugin-api';
/**
* The RouteFunc used by buildTechDocsURL() to build the TechDocs link for
* an entity.
*
* @public
*/
export type TechDocsRouteFunc = RouteFunc<{
namespace: string;
kind: string;
name: string;
}>;
/**
* Lower-case entity triplets by default, but allow override.
*
@@ -82,7 +70,13 @@ export function getEntityRootTechDocsPath(entity: Entity): string {
*/
export const buildTechDocsURL = (
entity: Entity,
routeFunc: TechDocsRouteFunc | undefined,
routeFunc:
| RouteFunc<{
namespace: string;
kind: string;
name: string;
}>
| undefined,
) => {
if (!routeFunc) {
return undefined;
-1
View File
@@ -57,4 +57,3 @@ export {
getEntityRootTechDocsPath,
buildTechDocsURL,
} from './helpers';
export type { TechDocsRouteFunc } from './helpers';