diff --git a/.changeset/unlucky-lemons-sip.md b/.changeset/unlucky-lemons-sip.md new file mode 100644 index 0000000000..585d091e65 --- /dev/null +++ b/.changeset/unlucky-lemons-sip.md @@ -0,0 +1,5 @@ +--- +'@backstage/core-api': patch +--- + +Made the `RouteRef*` types compatible with the ones exported from `@backstage/core-plugin-api`. diff --git a/packages/core-api/package.json b/packages/core-api/package.json index 6ecb942c28..99a9cd2b0f 100644 --- a/packages/core-api/package.json +++ b/packages/core-api/package.json @@ -30,6 +30,7 @@ }, "dependencies": { "@backstage/config": "^0.1.4", + "@backstage/core-plugin-api": "^0.1.0", "@backstage/theme": "^0.2.6", "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", diff --git a/packages/core-api/src/routing/types.ts b/packages/core-api/src/routing/types.ts index 0089e29e4b..e88b2f748c 100644 --- a/packages/core-api/src/routing/types.ts +++ b/packages/core-api/src/routing/types.ts @@ -16,6 +16,7 @@ import { IconComponent } from '../icons/types'; import { getOrCreateGlobalSingleton } from '../lib/globalObject'; +import { RouteRef as NewRouteRef } from '@backstage/core-plugin-api'; export type AnyParams = { [param in string]: string } | undefined; export type ParamKeys = keyof Params extends never @@ -34,7 +35,11 @@ export type RouteFunc = ( ...[params]: Params extends undefined ? readonly [] : readonly [Params] ) => string; -export const routeRefType: unique symbol = getOrCreateGlobalSingleton( +type RouteRefType = Exclude< + keyof NewRouteRef, + 'params' | 'path' | 'title' | 'icon' +>; +export const routeRefType: RouteRefType = getOrCreateGlobalSingleton( 'route-ref-type', () => Symbol('route-ref-type'), );