core-api: avoid exporting AnyRoutes, AnyExternalRoutes, and ExternalRouteRef constructor
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
|
||||
import { ComponentType } from 'react';
|
||||
import { IconComponent, SystemIconKey, SystemIcons } from '../icons';
|
||||
import { BackstagePlugin, AnyExternalRoutes } from '../plugin';
|
||||
import { BackstagePlugin, AnyExternalRoutes } from '../plugin/types';
|
||||
import { RouteRef } from '../routing';
|
||||
import { AnyApiFactory } from '../apis';
|
||||
import { AppTheme, ProfileInfo } from '../apis/definitions';
|
||||
|
||||
@@ -15,4 +15,19 @@
|
||||
*/
|
||||
|
||||
export { createPlugin } from './Plugin';
|
||||
export * from './types';
|
||||
export type {
|
||||
BackstagePlugin,
|
||||
Extension,
|
||||
FeatureFlagOutput,
|
||||
FeatureFlagsHooks,
|
||||
LegacyRedirectRouteOutput,
|
||||
LegacyRouteOutput,
|
||||
PluginConfig,
|
||||
PluginHooks,
|
||||
PluginOutput,
|
||||
RedirectRouteOutput,
|
||||
RouteOptions,
|
||||
RouteOutput,
|
||||
RoutePath,
|
||||
RouterHooks,
|
||||
} from './types';
|
||||
|
||||
@@ -54,12 +54,20 @@ export function createRouteRef<
|
||||
return new AbsoluteRouteRef<Params>(config);
|
||||
}
|
||||
|
||||
const create = Symbol('create-external-route-ref');
|
||||
|
||||
export class ExternalRouteRef {
|
||||
static [create]() {
|
||||
return new ExternalRouteRef();
|
||||
}
|
||||
|
||||
private constructor() {}
|
||||
|
||||
toString() {
|
||||
return `externalRouteRef{}`;
|
||||
}
|
||||
}
|
||||
|
||||
export function createExternalRouteRef(): ExternalRouteRef {
|
||||
return new ExternalRouteRef();
|
||||
return ExternalRouteRef[create]();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user