Fix exports and api reports

Signed-off-by: Johan Haals <johan.haals@gmail.com>
This commit is contained in:
Johan Haals
2023-09-13 15:34:36 +02:00
parent 5d4c45580c
commit 0edd307a69
6 changed files with 33 additions and 5 deletions
+4
View File
@@ -26,6 +26,10 @@ export interface ExtensionTree {
getExtension(id: string): ExtensionTreeNode | undefined;
// (undocumented)
getExtensionAttachments(id: string, inputName: string): ExtensionTreeNode[];
// (undocumented)
getRootRoutes(): JSX_2.Element[];
// (undocumented)
getSidebarItems(): JSX_2.Element[];
}
// @public (undocumented)
@@ -7,6 +7,7 @@
import { AnyApiFactory } from '@backstage/core-plugin-api';
import { AnyApiRef } from '@backstage/core-plugin-api';
import { IconComponent } from '@backstage/core-plugin-api';
import { JsonObject } from '@backstage/types';
import { JSX as JSX_2 } from 'react';
import { default as React_2 } from 'react';
@@ -53,6 +54,7 @@ export const coreExtensionData: {
routePath: ConfigurableExtensionDataRef<string, {}>;
apiFactory: ConfigurableExtensionDataRef<AnyApiFactory, {}>;
routeRef: ConfigurableExtensionDataRef<RouteRef<any>, {}>;
navTarget: ConfigurableExtensionDataRef<NavTarget, {}>;
};
// @public (undocumented)
@@ -133,6 +135,16 @@ export interface CreateExtensionOptions<
output: TOutput;
}
// @public
export function createNavItemExtension(options: {
id: string;
routeRef: RouteRef;
title: string;
icon: IconComponent;
}): Extension<{
title: string;
}>;
// @public
export function createPageExtension<
TConfig extends {
@@ -271,6 +283,13 @@ export type ExtensionDataRef<
$$type: '@backstage/ExtensionDataRef';
};
// @public (undocumented)
export type NavTarget = {
title: string;
icon: IconComponent;
routeRef: RouteRef<{}>;
};
// @public (undocumented)
export interface PluginOptions {
// (undocumented)
@@ -18,6 +18,10 @@ import { IconComponent, RouteRef } from '@backstage/core-plugin-api';
import { createSchemaFromZod } from '../schema/createSchemaFromZod';
import { coreExtensionData, createExtension } from '../wiring';
/**
* Helper for creating extensions for a nav item.
* @public
*/
export function createNavItemExtension(options: {
id: string;
routeRef: RouteRef;
+5
View File
@@ -30,5 +30,10 @@ export const GraphiqlPage: Extension<{
path: string;
}>;
// @alpha (undocumented)
export const graphiqlPageSidebarItem: Extension<{
title: string;
}>;
// (No @packageDocumentation comment for this package)
```
-5
View File
@@ -7,7 +7,6 @@
import { ApiRef } from '@backstage/core-plugin-api';
import { BackstagePlugin } from '@backstage/core-plugin-api';
import { BackstagePlugin as BackstagePlugin_2 } from '@backstage/frontend-plugin-api';
import { ErrorApi } from '@backstage/core-plugin-api';
import { FetchApi } from '@backstage/core-plugin-api';
import { IconComponent } from '@backstage/core-plugin-api';
@@ -16,10 +15,6 @@ import { OAuthApi } from '@backstage/core-plugin-api';
import { default as React_2 } from 'react';
import { RouteRef } from '@backstage/core-plugin-api';
// @alpha (undocumented)
const _default: BackstagePlugin_2;
export default _default;
// @public
export type EndpointConfig = {
id: string;
+1
View File
@@ -47,6 +47,7 @@ export const GraphiqlPage = createPageExtension({
loader: () => import('./components').then(m => <m.GraphiQLPage />),
});
/** @alpha */
export const graphiqlPageSidebarItem = createNavItemExtension({
id: 'plugin.graphiql.nav.index',
title: 'GraphiQL',