frontend-plugin-api: TsDoc for createFrontendPlugin

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2025-08-07 13:45:31 +02:00
parent f416e9f499
commit 5a29c86a92
@@ -135,7 +135,36 @@ export interface PluginOptions<
info?: FrontendPluginInfoOptions;
}
/** @public */
/**
* Creates a new plugin instance that can be installed in a Backstage app.
*
* @remarks
*
* Every plugin instance is created with a unique ID and a set of extensions
* that are installed as part of the plugin.
*
* For more information on how plugins work, see the
* {@link https://backstage.io/docs/frontend-system/building-plugins/index | documentation for plugins}
* in the frontend system documentation.
*
* @example
*
* ```tsx
* import { createFrontendPlugin } from '@backstage/frontend-plugin-api';
*
* export const examplePlugin = createFrontendPlugin({
* pluginId: 'example',
* extensions: [
* PageBlueprint.make({
* path: '/example',
* loader: () => import('./ExamplePage').then(m => <m.ExamplePage />),
* }),
* ],
* });
* ```
*
* @public
*/
export function createFrontendPlugin<
TId extends string,
TRoutes extends { [name in string]: RouteRef | SubRouteRef } = {},