From a70b6862e7d6d0043b2e97400ad29c41d48ef980 Mon Sep 17 00:00:00 2001 From: benjdlambert Date: Wed, 6 Aug 2025 10:31:28 +0200 Subject: [PATCH] chore: updating API refs Signed-off-by: benjdlambert --- packages/frontend-plugin-api/report.api.md | 196 +++++++++++++-------- plugins/app/report.api.md | 6 +- 2 files changed, 128 insertions(+), 74 deletions(-) diff --git a/packages/frontend-plugin-api/report.api.md b/packages/frontend-plugin-api/report.api.md index cc2f87112a..1e9bc0fff6 100644 --- a/packages/frontend-plugin-api/report.api.md +++ b/packages/frontend-plugin-api/report.api.md @@ -12,6 +12,7 @@ import { AnyRouteRefParams as AnyRouteRefParams_2 } from '@backstage/frontend-pl import { ApiFactory } from '@backstage/core-plugin-api'; import { ApiHolder } from '@backstage/core-plugin-api'; import { ApiRef } from '@backstage/core-plugin-api'; +import { ApiRef as ApiRef_2 } from '@backstage/core-plugin-api/src/apis/system/types'; import { ApiRefConfig } from '@backstage/core-plugin-api'; import { AppTheme } from '@backstage/core-plugin-api'; import { AppThemeApi } from '@backstage/core-plugin-api'; @@ -24,10 +25,14 @@ import { BackstageIdentityResponse } from '@backstage/core-plugin-api'; import { BackstageUserIdentity } from '@backstage/core-plugin-api'; import { bitbucketAuthApiRef } from '@backstage/core-plugin-api'; import { bitbucketServerAuthApiRef } from '@backstage/core-plugin-api'; +import { ComponentRef as ComponentRef_2 } from '@backstage/frontend-plugin-api'; import { ComponentType } from 'react'; import { ConfigApi } from '@backstage/core-plugin-api'; import { configApiRef } from '@backstage/core-plugin-api'; import { ConfigurableExtensionDataRef as ConfigurableExtensionDataRef_2 } from '@backstage/frontend-plugin-api'; +import { CoreErrorBoundaryFallbackProps as CoreErrorBoundaryFallbackProps_2 } from '@backstage/frontend-plugin-api'; +import { CoreNotFoundErrorPageProps as CoreNotFoundErrorPageProps_2 } from '@backstage/frontend-plugin-api'; +import { CoreProgressProps as CoreProgressProps_2 } from '@backstage/frontend-plugin-api'; import { createApiFactory } from '@backstage/core-plugin-api'; import { createApiRef } from '@backstage/core-plugin-api'; import { createTranslationMessages } from '@backstage/core-plugin-api/alpha'; @@ -94,6 +99,59 @@ import { vmwareCloudAuthApiRef } from '@backstage/core-plugin-api'; import { withApis } from '@backstage/core-plugin-api'; import { z } from 'zod'; +// @public +export const AdaptableComponentBlueprint: ExtensionBlueprint<{ + kind: 'component'; + params: >(params: { + component: Ref extends ComponentRef + ? { + ref: Ref; + } & ((props: IExternalComponentProps) => JSX.Element) + : never; + loader: Ref extends ComponentRef + ? + | (() => (props: IInnerComponentProps) => JSX.Element | null) + | (() => Promise<(props: IInnerComponentProps) => JSX.Element | null>) + : never; + }) => ExtensionBlueprintParams<{ + component: Ref extends ComponentRef + ? { + ref: Ref; + } & ((props: IExternalComponentProps) => JSX.Element) + : never; + loader: Ref extends ComponentRef + ? + | (() => (props: IInnerComponentProps) => JSX.Element | null) + | (() => Promise<(props: IInnerComponentProps) => JSX.Element | null>) + : never; + }>; + output: ExtensionDataRef< + { + ref: ComponentRef; + loader: + | (() => (props: {}) => JSX.Element | null) + | (() => Promise<(props: {}) => JSX.Element | null>); + }, + 'core.component.component', + {} + >; + inputs: {}; + config: {}; + configInput: {}; + dataRefs: { + component: ConfigurableExtensionDataRef< + { + ref: ComponentRef; + loader: + | (() => (props: {}) => JSX.Element | null) + | (() => Promise<(props: {}) => JSX.Element | null>); + }, + 'core.component.component', + {} + >; + }; +}>; + export { AlertApi }; export { alertApiRef }; @@ -351,19 +409,32 @@ export { bitbucketAuthApiRef }; export { bitbucketServerAuthApiRef }; // @public (undocumented) -export type ComponentRef = { +export type ComponentRef< + TInnerComponentProps extends {} = {}, + TExternalComponentProps extends {} = TInnerComponentProps, +> = { id: string; - T: T; + TProps: TInnerComponentProps; + TExternalProps: TExternalComponentProps; + $$type: '@backstage/ComponentRef'; }; // @public export interface ComponentsApi { // (undocumented) - getComponent(ref: ComponentRef): ComponentType; + getComponent< + TInnerComponentProps extends {}, + TExternalComponentProps extends {} = TInnerComponentProps, + >( + ref: ComponentRef, + ): + | (() => (props: TInnerComponentProps) => JSX.Element | null) + | (() => Promise<(props: TInnerComponentProps) => JSX.Element | null>) + | undefined; } // @public -export const componentsApiRef: ApiRef; +export const componentsApiRef: ApiRef_2; export { ConfigApi }; @@ -389,13 +460,6 @@ export interface ConfigurableExtensionDataRef< >; } -// @public (undocumented) -export const coreComponentRefs: { - progress: ComponentRef; - notFoundErrorPage: ComponentRef; - errorBoundaryFallback: ComponentRef; -}; - // @public (undocumented) export type CoreErrorBoundaryFallbackProps = { plugin?: FrontendPlugin; @@ -426,65 +490,35 @@ export type CoreNotFoundErrorPageProps = { // @public (undocumented) export type CoreProgressProps = {}; +// @public +export function createAdaptableComponent< + TInnerComponentProps extends {}, + TExternalComponentProps extends {} = TInnerComponentProps, +>( + options: CreateAdaptableComponentOptions< + TInnerComponentProps, + TExternalComponentProps + >, +): ((props: TExternalComponentProps) => JSX.Element) & { + ref: ComponentRef; +}; + +// @public +export type CreateAdaptableComponentOptions< + TInnerComponentProps extends {}, + TExternalComponentProps extends {} = TInnerComponentProps, +> = { + id: string; + loader?: + | (() => (props: TInnerComponentProps) => JSX.Element | null) + | (() => Promise<(props: TInnerComponentProps) => JSX.Element | null>); + transformProps?: (props: TExternalComponentProps) => TInnerComponentProps; +}; + export { createApiFactory }; export { createApiRef }; -// @public (undocumented) -export function createComponentExtension(options: { - ref: ComponentRef; - name?: string; - disabled?: boolean; - loader: - | { - lazy: () => Promise>; - } - | { - sync: () => ComponentType; - }; -}): ExtensionDefinition<{ - config: {}; - configInput: {}; - output: ExtensionDataRef< - { - ref: ComponentRef; - impl: ComponentType; - }, - 'core.component.component', - {} - >; - inputs: { - [x: string]: ExtensionInput< - ExtensionDataRef, - { - optional: boolean; - singleton: boolean; - } - >; - }; - params: never; - kind: 'component'; - name: string; -}>; - -// @public (undocumented) -export namespace createComponentExtension { - const // (undocumented) - componentDataRef: ConfigurableExtensionDataRef< - { - ref: ComponentRef; - impl: ComponentType; - }, - 'core.component.component', - {} - >; -} - -// @public (undocumented) -export function createComponentRef(options: { - id: string; -}): ComponentRef; - // @public (undocumented) export function createExtension< UOutput extends ExtensionDataRef, @@ -922,6 +956,16 @@ export { ErrorApiErrorContext }; export { errorApiRef }; +// @public (undocumented) +export const ErrorBoundary: (( + props: CoreErrorBoundaryFallbackProps_2, +) => JSX.Element) & { + ref: ComponentRef_2< + CoreErrorBoundaryFallbackProps_2, + CoreErrorBoundaryFallbackProps_2 + >; +}; + // @public (undocumented) export interface Extension { // (undocumented) @@ -1577,6 +1621,16 @@ export const NavItemBlueprint: ExtensionBlueprint<{ }; }>; +// @public (undocumented) +export const NotFoundErrorPage: (( + props: CoreNotFoundErrorPageProps_2, +) => JSX.Element) & { + ref: ComponentRef_2< + CoreNotFoundErrorPageProps_2, + CoreNotFoundErrorPageProps_2 + >; +}; + export { OAuthApi }; export { OAuthRequestApi }; @@ -1661,6 +1715,11 @@ export { ProfileInfo }; export { ProfileInfoApi }; +// @public (undocumented) +export const Progress: ((props: CoreProgressProps_2) => JSX.Element) & { + ref: ComponentRef_2; +}; + // @public export type ResolvedExtensionInput< TExtensionInput extends ExtensionInput, @@ -1929,11 +1988,6 @@ export { useApiHolder }; // @public export function useAppNode(): AppNode | undefined; -// @public -export function useComponentRef( - ref: ComponentRef, -): ComponentType; - // @public export function useRouteRef( routeRef: diff --git a/plugins/app/report.api.md b/plugins/app/report.api.md index 74b8927b44..6b9a4d3a54 100644 --- a/plugins/app/report.api.md +++ b/plugins/app/report.api.md @@ -733,7 +733,7 @@ const appPlugin: FrontendPlugin< name: 'core.components.errorBoundary'; config: {}; configInput: {}; - output: ConfigurableExtensionDataRef< + output: ExtensionDataRef< { ref: ComponentRef; loader: @@ -777,7 +777,7 @@ const appPlugin: FrontendPlugin< name: 'core.components.notFoundErrorPage'; config: {}; configInput: {}; - output: ConfigurableExtensionDataRef< + output: ExtensionDataRef< { ref: ComponentRef; loader: @@ -821,7 +821,7 @@ const appPlugin: FrontendPlugin< name: 'core.components.progress'; config: {}; configInput: {}; - output: ConfigurableExtensionDataRef< + output: ExtensionDataRef< { ref: ComponentRef; loader: