rename to CreateAppRouteBinder
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/frontend-app-api': patch
|
||||
---
|
||||
|
||||
Renamed `AppRouteBinder` to `CreateAppRouteBinder`
|
||||
@@ -13,8 +13,20 @@ import { JSX as JSX_2 } from 'react';
|
||||
import { RouteRef } from '@backstage/frontend-plugin-api';
|
||||
import { SubRouteRef } from '@backstage/frontend-plugin-api';
|
||||
|
||||
// @public (undocumented)
|
||||
export function createApp(options?: {
|
||||
features?: (BackstagePlugin | ExtensionOverrides)[];
|
||||
configLoader?: () => Promise<ConfigApi>;
|
||||
bindRoutes?(context: { bind: CreateAppRouteBinder }): void;
|
||||
featureLoader?: (ctx: {
|
||||
config: ConfigApi;
|
||||
}) => Promise<(BackstagePlugin | ExtensionOverrides)[]>;
|
||||
}): {
|
||||
createRoot(): JSX_2.Element;
|
||||
};
|
||||
|
||||
// @public
|
||||
export type AppRouteBinder = <
|
||||
export type CreateAppRouteBinder = <
|
||||
TExternalRoutes extends {
|
||||
[name: string]: ExternalRouteRef;
|
||||
},
|
||||
@@ -26,18 +38,6 @@ export type AppRouteBinder = <
|
||||
>,
|
||||
) => void;
|
||||
|
||||
// @public (undocumented)
|
||||
export function createApp(options?: {
|
||||
features?: (BackstagePlugin | ExtensionOverrides)[];
|
||||
configLoader?: () => Promise<ConfigApi>;
|
||||
bindRoutes?(context: { bind: AppRouteBinder }): void;
|
||||
featureLoader?: (ctx: {
|
||||
config: ConfigApi;
|
||||
}) => Promise<(BackstagePlugin | ExtensionOverrides)[]>;
|
||||
}): {
|
||||
createRoot(): JSX_2.Element;
|
||||
};
|
||||
|
||||
// @public (undocumented)
|
||||
export function createExtensionTree(options: { config: Config }): ExtensionTree;
|
||||
|
||||
@@ -45,7 +45,7 @@ export function createExtensionTree(options: { config: Config }): ExtensionTree;
|
||||
export function createSpecializedApp(options?: {
|
||||
features?: (BackstagePlugin | ExtensionOverrides)[];
|
||||
config?: ConfigApi;
|
||||
bindRoutes?(context: { bind: AppRouteBinder }): void;
|
||||
bindRoutes?(context: { bind: CreateAppRouteBinder }): void;
|
||||
}): {
|
||||
createRoot(): JSX_2.Element;
|
||||
};
|
||||
|
||||
@@ -14,4 +14,4 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export { type AppRouteBinder } from './resolveRouteBindings';
|
||||
export { type CreateAppRouteBinder } from './resolveRouteBindings';
|
||||
|
||||
@@ -64,7 +64,7 @@ type TargetRouteMap<
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export type AppRouteBinder = <
|
||||
export type CreateAppRouteBinder = <
|
||||
TExternalRoutes extends { [name: string]: ExternalRouteRef },
|
||||
>(
|
||||
externalRoutes: TExternalRoutes,
|
||||
@@ -76,14 +76,14 @@ export type AppRouteBinder = <
|
||||
|
||||
/** @internal */
|
||||
export function resolveRouteBindings(
|
||||
bindRoutes: ((context: { bind: AppRouteBinder }) => void) | undefined,
|
||||
bindRoutes: ((context: { bind: CreateAppRouteBinder }) => void) | undefined,
|
||||
config: Config,
|
||||
routesById: RouteRefsById,
|
||||
): Map<ExternalRouteRef, RouteRef | SubRouteRef> {
|
||||
const result = new Map<ExternalRouteRef, RouteRef | SubRouteRef>();
|
||||
|
||||
if (bindRoutes) {
|
||||
const bind: AppRouteBinder = (
|
||||
const bind: CreateAppRouteBinder = (
|
||||
externalRoutes,
|
||||
targetRoutes: { [name: string]: RouteRef | SubRouteRef },
|
||||
) => {
|
||||
|
||||
@@ -80,7 +80,7 @@ import {
|
||||
appLanguageApiRef,
|
||||
translationApiRef,
|
||||
} from '@backstage/core-plugin-api/alpha';
|
||||
import { AppRouteBinder } from '../routing';
|
||||
import { CreateAppRouteBinder } from '../routing';
|
||||
import { RoutingProvider } from '../routing/RoutingProvider';
|
||||
import { resolveRouteBindings } from '../routing/resolveRouteBindings';
|
||||
import { collectRouteIds } from '../routing/collectRouteIds';
|
||||
@@ -239,7 +239,7 @@ function deduplicateFeatures(
|
||||
export function createApp(options?: {
|
||||
features?: (BackstagePlugin | ExtensionOverrides)[];
|
||||
configLoader?: () => Promise<ConfigApi>;
|
||||
bindRoutes?(context: { bind: AppRouteBinder }): void;
|
||||
bindRoutes?(context: { bind: CreateAppRouteBinder }): void;
|
||||
featureLoader?: (ctx: {
|
||||
config: ConfigApi;
|
||||
}) => Promise<(BackstagePlugin | ExtensionOverrides)[]>;
|
||||
@@ -289,7 +289,7 @@ export function createApp(options?: {
|
||||
export function createSpecializedApp(options?: {
|
||||
features?: (BackstagePlugin | ExtensionOverrides)[];
|
||||
config?: ConfigApi;
|
||||
bindRoutes?(context: { bind: AppRouteBinder }): void;
|
||||
bindRoutes?(context: { bind: CreateAppRouteBinder }): void;
|
||||
}): { createRoot(): JSX.Element } {
|
||||
const {
|
||||
features: duplicatedFeatures = [],
|
||||
|
||||
Reference in New Issue
Block a user