@@ -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;
|
||||
|
||||
@@ -57,4 +57,3 @@ export {
|
||||
getEntityRootTechDocsPath,
|
||||
buildTechDocsURL,
|
||||
} from './helpers';
|
||||
export type { TechDocsRouteFunc } from './helpers';
|
||||
|
||||
Reference in New Issue
Block a user