Incorporated the feedback.
Signed-off-by: bnechyporenko <bnechyporenko@bol.com>
This commit is contained in:
@@ -65,7 +65,7 @@ export function validateRouteParameters(
|
||||
// Validates that all non-optional external routes have been bound
|
||||
export function validateRouteBindings(
|
||||
routeBindings: Map<ExternalRouteRef, RouteRef | SubRouteRef>,
|
||||
plugins: Iterable<BackstagePlugin<{}, {}, Record<string, ExternalRouteRef>>>,
|
||||
plugins: Iterable<BackstagePlugin<{}, Record<string, ExternalRouteRef>>>,
|
||||
) {
|
||||
for (const plugin of plugins) {
|
||||
if (!plugin.externalRoutes) {
|
||||
|
||||
@@ -28,16 +28,16 @@ import { AnyApiFactory } from '../apis';
|
||||
* @internal
|
||||
*/
|
||||
export class PluginImpl<
|
||||
PluginInputOptions extends {},
|
||||
Routes extends AnyRoutes,
|
||||
ExternalRoutes extends AnyExternalRoutes,
|
||||
> implements BackstagePlugin<PluginInputOptions, Routes, ExternalRoutes>
|
||||
PluginInputOptions extends {},
|
||||
> implements BackstagePlugin<Routes, ExternalRoutes, PluginInputOptions>
|
||||
{
|
||||
constructor(
|
||||
private readonly config: PluginConfig<
|
||||
PluginInputOptions,
|
||||
Routes,
|
||||
ExternalRoutes
|
||||
ExternalRoutes,
|
||||
PluginInputOptions
|
||||
>,
|
||||
) {}
|
||||
|
||||
@@ -92,11 +92,11 @@ export class PluginImpl<
|
||||
* @public
|
||||
*/
|
||||
export function createPlugin<
|
||||
PluginInputOptions extends {},
|
||||
Routes extends AnyRoutes = {},
|
||||
ExternalRoutes extends AnyExternalRoutes = {},
|
||||
PluginInputOptions extends {} = {},
|
||||
>(
|
||||
config: PluginConfig<PluginInputOptions, Routes, ExternalRoutes>,
|
||||
): BackstagePlugin<PluginInputOptions, Routes, ExternalRoutes> {
|
||||
config: PluginConfig<Routes, ExternalRoutes, PluginInputOptions>,
|
||||
): BackstagePlugin<Routes, ExternalRoutes, PluginInputOptions> {
|
||||
return new PluginImpl(config);
|
||||
}
|
||||
|
||||
@@ -50,9 +50,9 @@ export type AnyExternalRoutes = { [name: string]: ExternalRouteRef };
|
||||
* @public
|
||||
*/
|
||||
export type BackstagePlugin<
|
||||
PluginInputOptions extends {} = {},
|
||||
Routes extends AnyRoutes = {},
|
||||
ExternalRoutes extends AnyExternalRoutes = {},
|
||||
PluginInputOptions extends {} = {},
|
||||
> = {
|
||||
getId(): string;
|
||||
getApis(): Iterable<AnyApiFactory>;
|
||||
@@ -82,9 +82,9 @@ export type PluginFeatureFlagConfig = {
|
||||
* @public
|
||||
*/
|
||||
export type PluginConfig<
|
||||
PluginInputOptions extends {},
|
||||
Routes extends AnyRoutes,
|
||||
ExternalRoutes extends AnyExternalRoutes,
|
||||
PluginInputOptions extends {},
|
||||
> = {
|
||||
id: string;
|
||||
apis?: Iterable<AnyApiFactory>;
|
||||
|
||||
Reference in New Issue
Block a user