From ebe5538d55d56786f680bbeaa496b3799af0d2fa Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Sat, 22 Nov 2025 18:07:09 +0100 Subject: [PATCH] update API reports for core/frontend inversion Signed-off-by: Patrik Oldsberg --- packages/core-plugin-api/report-alpha.api.md | 263 +----- packages/core-plugin-api/report.api.md | 514 +++--------- packages/frontend-plugin-api/report.api.md | 771 ++++++++++++++---- plugins/api-docs/report-alpha.api.md | 2 +- plugins/app-visualizer/report.api.md | 2 +- plugins/app/report.api.md | 5 +- plugins/catalog-react/report-alpha.api.md | 2 +- .../report-alpha.api.md | 2 +- plugins/catalog/report-alpha.api.md | 2 +- plugins/devtools/report-alpha.api.md | 2 +- plugins/scaffolder/report-alpha.api.md | 2 +- plugins/scaffolder/report.api.md | 2 +- plugins/techdocs/report-alpha.api.md | 2 +- plugins/user-settings/report-alpha.api.md | 2 +- 14 files changed, 791 insertions(+), 782 deletions(-) diff --git a/packages/core-plugin-api/report-alpha.api.md b/packages/core-plugin-api/report-alpha.api.md index 6243c76cff..b0aea73868 100644 --- a/packages/core-plugin-api/report-alpha.api.md +++ b/packages/core-plugin-api/report-alpha.api.md @@ -3,253 +3,54 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { ApiRef } from '@backstage/core-plugin-api'; -import { Expand } from '@backstage/types'; -import { ExpandRecursive } from '@backstage/types'; -import { JSX as JSX_2 } from 'react'; -import { Observable } from '@backstage/types'; -import { TranslationMessages as TranslationMessages_2 } from '@backstage/core-plugin-api/alpha'; -import { TranslationRef as TranslationRef_2 } from '@backstage/core-plugin-api/alpha'; +import { AppLanguageApi } from '@backstage/frontend-plugin-api'; +import { appLanguageApiRef } from '@backstage/frontend-plugin-api'; +import { createTranslationMessages } from '@backstage/frontend-plugin-api'; +import { createTranslationRef } from '@backstage/frontend-plugin-api'; +import { createTranslationResource } from '@backstage/frontend-plugin-api'; +import { TranslationApi } from '@backstage/frontend-plugin-api'; +import { translationApiRef } from '@backstage/frontend-plugin-api'; +import { TranslationFunction } from '@backstage/frontend-plugin-api'; +import { TranslationMessages } from '@backstage/frontend-plugin-api'; +import { TranslationMessagesOptions } from '@backstage/frontend-plugin-api'; +import { TranslationRef } from '@backstage/frontend-plugin-api'; +import { TranslationRefOptions } from '@backstage/frontend-plugin-api'; +import { TranslationResource } from '@backstage/frontend-plugin-api'; +import { TranslationResourceOptions } from '@backstage/frontend-plugin-api'; +import { TranslationSnapshot } from '@backstage/frontend-plugin-api'; +import { useTranslationRef } from '@backstage/frontend-plugin-api'; -// @alpha (undocumented) -export type AppLanguageApi = { - getAvailableLanguages(): { - languages: string[]; - }; - setLanguage(language?: string): void; - getLanguage(): { - language: string; - }; - language$(): Observable<{ - language: string; - }>; -}; +export { AppLanguageApi }; -// @alpha (undocumented) -export const appLanguageApiRef: ApiRef; +export { appLanguageApiRef }; -// @alpha -export function createTranslationMessages< - TId extends string, - TMessages extends { - [key in string]: string; - }, - TFull extends boolean, ->( - options: TranslationMessagesOptions, -): TranslationMessages; +export { createTranslationMessages }; -// @alpha (undocumented) -export function createTranslationRef< - TId extends string, - const TNestedMessages extends AnyNestedMessages, - TTranslations extends { - [language in string]: () => Promise<{ - default: { - [key in keyof FlattenedMessages]: string | null; - }; - }>; - }, ->( - config: TranslationRefOptions, -): TranslationRef>; +export { createTranslationRef }; -// @alpha (undocumented) -export function createTranslationResource< - TId extends string, - TMessages extends { - [key in string]: string; - }, - TTranslations extends { - [language in string]: () => Promise<{ - default: - | TranslationMessages_2 - | { - [key in keyof TMessages]: string | null; - }; - }>; - }, ->( - options: TranslationResourceOptions, -): TranslationResource; +export { createTranslationResource }; -// @alpha (undocumented) -export type TranslationApi = { - getTranslation< - TMessages extends { - [key in string]: string; - }, - >( - translationRef: TranslationRef, - ): TranslationSnapshot; - translation$< - TMessages extends { - [key in string]: string; - }, - >( - translationRef: TranslationRef, - ): Observable>; -}; +export { TranslationApi }; -// @alpha (undocumented) -export const translationApiRef: ApiRef; +export { translationApiRef }; -// @alpha (undocumented) -export type TranslationFunction< - TMessages extends { - [key in string]: string; - }, -> = CollapsedMessages extends infer IMessages extends { - [key in string]: string; -} - ? { - ( - key: TKey, - ...[args]: TranslationFunctionOptions< - NestedMessageKeys, - PluralKeys, - IMessages, - string - > - ): IMessages[TKey]; - ( - key: TKey, - ...[args]: TranslationFunctionOptions< - NestedMessageKeys, - PluralKeys, - IMessages, - string | JSX_2.Element - > - ): JSX_2.Element; - } - : never; +export { TranslationFunction }; -// @alpha -export interface TranslationMessages< - TId extends string = string, - TMessages extends { - [key in string]: string; - } = { - [key in string]: string; - }, - TFull extends boolean = boolean, -> { - // (undocumented) - $$type: '@backstage/TranslationMessages'; - full: TFull; - id: TId; - messages: TMessages; -} +export { TranslationMessages }; -// @alpha -export interface TranslationMessagesOptions< - TId extends string, - TMessages extends { - [key in string]: string; - }, - TFull extends boolean, -> { - // (undocumented) - full?: TFull; - // (undocumented) - messages: false extends TFull - ? { - [key in keyof TMessages]?: string | null; - } - : { - [key in keyof TMessages]: string | null; - }; - // (undocumented) - ref: TranslationRef_2; -} +export { TranslationMessagesOptions }; -// @alpha (undocumented) -export interface TranslationRef< - TId extends string = string, - TMessages extends { - [key in string]: string; - } = { - [key in string]: string; - }, -> { - // (undocumented) - $$type: '@backstage/TranslationRef'; - // (undocumented) - id: TId; - // (undocumented) - T: TMessages; -} +export { TranslationRef }; -// @alpha (undocumented) -export interface TranslationRefOptions< - TId extends string, - TNestedMessages extends AnyNestedMessages, - TTranslations extends { - [language in string]: () => Promise<{ - default: { - [key in keyof FlattenedMessages]: string | null; - }; - }>; - }, -> { - // (undocumented) - id: TId; - // (undocumented) - messages: TNestedMessages; - // (undocumented) - translations?: TTranslations; -} +export { TranslationRefOptions }; -// @alpha (undocumented) -export interface TranslationResource { - // (undocumented) - $$type: '@backstage/TranslationResource'; - // (undocumented) - id: TId; -} +export { TranslationResource }; -// @alpha (undocumented) -export interface TranslationResourceOptions< - TId extends string, - TMessages extends { - [key in string]: string; - }, - TTranslations extends { - [language in string]: () => Promise<{ - default: - | TranslationMessages_2 - | { - [key in keyof TMessages]: string | null; - }; - }>; - }, -> { - // (undocumented) - ref: TranslationRef_2; - // (undocumented) - translations: TTranslations; -} +export { TranslationResourceOptions }; -// @alpha (undocumented) -export type TranslationSnapshot< - TMessages extends { - [key in string]: string; - }, -> = - | { - ready: false; - } - | { - ready: true; - t: TranslationFunction; - }; +export { TranslationSnapshot }; -// @alpha (undocumented) -export const useTranslationRef: ( - translationRef: TranslationRef, -) => { - t: TranslationFunction; -}; +export { useTranslationRef }; // (No @packageDocumentation comment for this package) ``` diff --git a/packages/core-plugin-api/report.api.md b/packages/core-plugin-api/report.api.md index 1e31cc5eb8..dc5a042488 100644 --- a/packages/core-plugin-api/report.api.md +++ b/packages/core-plugin-api/report.api.md @@ -3,33 +3,87 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts +import { AlertApi } from '@backstage/frontend-plugin-api'; +import { alertApiRef } from '@backstage/frontend-plugin-api'; +import { AlertMessage } from '@backstage/frontend-plugin-api'; +import { AnyApiFactory } from '@backstage/frontend-plugin-api'; +import { AnyApiRef } from '@backstage/frontend-plugin-api'; +import { ApiFactory } from '@backstage/frontend-plugin-api'; +import { ApiHolder } from '@backstage/frontend-plugin-api'; +import { ApiRef } from '@backstage/frontend-plugin-api'; +import { ApiRefConfig } from '@backstage/frontend-plugin-api'; +import { AppTheme } from '@backstage/frontend-plugin-api'; +import { AppThemeApi } from '@backstage/frontend-plugin-api'; +import { appThemeApiRef } from '@backstage/frontend-plugin-api'; +import { atlassianAuthApiRef } from '@backstage/frontend-plugin-api'; +import { AuthProviderInfo } from '@backstage/frontend-plugin-api'; +import { AuthRequestOptions } from '@backstage/frontend-plugin-api'; +import { BackstageIdentityApi } from '@backstage/frontend-plugin-api'; +import { BackstageIdentityResponse } from '@backstage/frontend-plugin-api'; import { BackstagePlugin as BackstagePlugin_2 } from '@backstage/core-plugin-api'; +import { BackstageUserIdentity } from '@backstage/frontend-plugin-api'; +import { bitbucketAuthApiRef } from '@backstage/frontend-plugin-api'; +import { bitbucketServerAuthApiRef } from '@backstage/frontend-plugin-api'; import { ComponentType } from 'react'; -import { Config } from '@backstage/config'; +import { ConfigApi } from '@backstage/frontend-plugin-api'; +import { configApiRef } from '@backstage/frontend-plugin-api'; +import { createApiFactory } from '@backstage/frontend-plugin-api'; +import { createApiRef } from '@backstage/frontend-plugin-api'; +import { DiscoveryApi } from '@backstage/frontend-plugin-api'; +import { discoveryApiRef } from '@backstage/frontend-plugin-api'; +import { ErrorApi } from '@backstage/frontend-plugin-api'; +import { ErrorApiError } from '@backstage/frontend-plugin-api'; +import { ErrorApiErrorContext } from '@backstage/frontend-plugin-api'; +import { errorApiRef } from '@backstage/frontend-plugin-api'; +import { FeatureFlag } from '@backstage/frontend-plugin-api'; +import { FeatureFlagsApi } from '@backstage/frontend-plugin-api'; +import { featureFlagsApiRef } from '@backstage/frontend-plugin-api'; +import { FeatureFlagsSaveOptions } from '@backstage/frontend-plugin-api'; +import { FeatureFlagState } from '@backstage/frontend-plugin-api'; +import { FetchApi } from '@backstage/frontend-plugin-api'; +import { fetchApiRef } from '@backstage/frontend-plugin-api'; +import { githubAuthApiRef } from '@backstage/frontend-plugin-api'; +import { gitlabAuthApiRef } from '@backstage/frontend-plugin-api'; +import { googleAuthApiRef } from '@backstage/frontend-plugin-api'; +import { IconComponent } from '@backstage/frontend-plugin-api'; import { IconComponent as IconComponent_2 } from '@backstage/core-plugin-api'; +import { IdentityApi } from '@backstage/frontend-plugin-api'; import { IdentityApi as IdentityApi_2 } from '@backstage/core-plugin-api'; -import { JsonValue } from '@backstage/types'; +import { identityApiRef } from '@backstage/frontend-plugin-api'; import { JSX as JSX_2 } from 'react/jsx-runtime'; -import { Observable } from '@backstage/types'; +import { microsoftAuthApiRef } from '@backstage/frontend-plugin-api'; +import { OAuthApi } from '@backstage/frontend-plugin-api'; +import { OAuthRequestApi } from '@backstage/frontend-plugin-api'; +import { oauthRequestApiRef } from '@backstage/frontend-plugin-api'; +import { OAuthRequester } from '@backstage/frontend-plugin-api'; +import { OAuthRequesterOptions } from '@backstage/frontend-plugin-api'; +import { OAuthScope } from '@backstage/frontend-plugin-api'; +import { oktaAuthApiRef } from '@backstage/frontend-plugin-api'; +import { oneloginAuthApiRef } from '@backstage/frontend-plugin-api'; +import { OpenIdConnectApi } from '@backstage/frontend-plugin-api'; +import { openshiftAuthApiRef } from '@backstage/frontend-plugin-api'; +import { PendingOAuthRequest } from '@backstage/frontend-plugin-api'; +import { ProfileInfo } from '@backstage/frontend-plugin-api'; +import { ProfileInfoApi } from '@backstage/frontend-plugin-api'; import { PropsWithChildren } from 'react'; import { ReactElement } from 'react'; import { ReactNode } from 'react'; +import { SessionApi } from '@backstage/frontend-plugin-api'; +import { SessionState } from '@backstage/frontend-plugin-api'; +import { StorageApi } from '@backstage/frontend-plugin-api'; +import { storageApiRef } from '@backstage/frontend-plugin-api'; +import { StorageValueSnapshot } from '@backstage/frontend-plugin-api'; +import { TypesToApiRefs } from '@backstage/frontend-plugin-api'; +import { useApi } from '@backstage/frontend-plugin-api'; +import { useApiHolder } from '@backstage/frontend-plugin-api'; +import { vmwareCloudAuthApiRef } from '@backstage/frontend-plugin-api'; +import { withApis } from '@backstage/frontend-plugin-api'; -// @public -export type AlertApi = { - post(alert: AlertMessage): void; - alert$(): Observable; -}; +export { AlertApi }; -// @public -export const alertApiRef: ApiRef; +export { alertApiRef }; -// @public -export type AlertMessage = { - message: string; - severity?: 'success' | 'info' | 'warning' | 'error'; - display?: 'permanent' | 'transient'; -}; +export { AlertMessage }; // @public export type AnalyticsApi = { @@ -76,17 +130,9 @@ export type AnalyticsTracker = { ) => void; }; -// @public -export type AnyApiFactory = ApiFactory< - unknown, - unknown, - { - [key in string]: unknown; - } ->; +export { AnyApiFactory }; -// @public -export type AnyApiRef = ApiRef; +export { AnyApiRef }; // @public export type AnyExternalRoutes = { @@ -108,34 +154,13 @@ export type AnyRoutes = { [name: string]: RouteRef | SubRouteRef; }; -// @public -export type ApiFactory< - Api, - Impl extends Api, - Deps extends { - [name in string]: unknown; - }, -> = { - api: ApiRef; - deps: TypesToApiRefs; - factory(deps: Deps): Impl; -}; +export { ApiFactory }; -// @public -export type ApiHolder = { - get(api: ApiRef): T | undefined; -}; +export { ApiHolder }; -// @public -export type ApiRef = { - id: string; - T: T; -}; +export { ApiRef }; -// @public -export type ApiRefConfig = { - id: string; -}; +export { ApiRefConfig }; // @public export type AppComponents = { @@ -160,30 +185,13 @@ export type AppContext = { getComponents(): AppComponents; }; -// @public -export type AppTheme = { - id: string; - title: string; - variant: 'light' | 'dark'; - icon?: React.ReactElement; - Provider(props: { children: ReactNode }): JSX.Element | null; -}; +export { AppTheme }; -// @public -export type AppThemeApi = { - getInstalledThemes(): AppTheme[]; - activeThemeId$(): Observable; - getActiveThemeId(): string | undefined; - setActiveThemeId(themeId?: string): void; -}; +export { AppThemeApi }; -// @public -export const appThemeApiRef: ApiRef; +export { appThemeApiRef }; -// @public -export const atlassianAuthApiRef: ApiRef< - OAuthApi & ProfileInfoApi & BackstageIdentityApi & SessionApi ->; +export { atlassianAuthApiRef }; // @public export function attachComponentData

( @@ -192,33 +200,13 @@ export function attachComponentData

( data: unknown, ): void; -// @public -export type AuthProviderInfo = { - id: string; - title: string; - icon: IconComponent; - message?: string; -}; +export { AuthProviderInfo }; -// @public -export type AuthRequestOptions = { - optional?: boolean; - instantPopup?: boolean; -}; +export { AuthRequestOptions }; -// @public -export type BackstageIdentityApi = { - getBackstageIdentity( - options?: AuthRequestOptions, - ): Promise; -}; +export { BackstageIdentityApi }; -// @public -export type BackstageIdentityResponse = { - token: string; - expiresAt?: Date; - identity: BackstageUserIdentity; -}; +export { BackstageIdentityResponse }; // @public export type BackstagePlugin< @@ -234,22 +222,11 @@ export type BackstagePlugin< externalRoutes: ExternalRoutes; }; -// @public -export type BackstageUserIdentity = { - type: 'user'; - userEntityRef: string; - ownershipEntityRefs: string[]; -}; +export { BackstageUserIdentity }; -// @public -export const bitbucketAuthApiRef: ApiRef< - OAuthApi & ProfileInfoApi & BackstageIdentityApi & SessionApi ->; +export { bitbucketAuthApiRef }; -// @public -export const bitbucketServerAuthApiRef: ApiRef< - OAuthApi & ProfileInfoApi & BackstageIdentityApi & SessionApi ->; +export { bitbucketServerAuthApiRef }; // @public export type BootErrorPageProps = PropsWithChildren<{ @@ -273,29 +250,13 @@ export type ComponentLoader = sync: T; }; -// @public -export type ConfigApi = Config; +export { ConfigApi }; -// @public -export const configApiRef: ApiRef; +export { configApiRef }; -// @public -export function createApiFactory< - Api, - Impl extends Api, - Deps extends { - [name in string]: unknown; - }, ->(factory: ApiFactory): ApiFactory; +export { createApiFactory }; -// @public -export function createApiFactory( - api: ApiRef, - instance: Impl, -): ApiFactory; - -// @public -export function createApiRef(config: ApiRefConfig): ApiRef; +export { createApiRef }; // @public export function createComponentExtension< @@ -363,13 +324,9 @@ export function createSubRouteRef< parent: RouteRef; }): MakeSubRouteRef, ParentParams>; -// @public -export type DiscoveryApi = { - getBaseUrl(pluginId: string): Promise; -}; +export { DiscoveryApi }; -// @public -export const discoveryApiRef: ApiRef; +export { discoveryApiRef }; // @public export interface ElementCollection { @@ -385,29 +342,13 @@ export interface ElementCollection { }): ElementCollection; } -// @public -export type ErrorApi = { - post(error: ErrorApiError, context?: ErrorApiErrorContext): void; - error$(): Observable<{ - error: ErrorApiError; - context?: ErrorApiErrorContext; - }>; -}; +export { ErrorApi }; -// @public -export type ErrorApiError = { - name: string; - message: string; - stack?: string; -}; +export { ErrorApiError }; -// @public -export type ErrorApiErrorContext = { - hidden?: boolean; -}; +export { ErrorApiErrorContext }; -// @public -export const errorApiRef: ApiRef; +export { errorApiRef }; // @public export type ErrorBoundaryFallbackProps = PropsWithChildren<{ @@ -433,60 +374,24 @@ export type ExternalRouteRef< readonly T: Params; }; -// @public -export type FeatureFlag = { - name: string; - pluginId: string; - description?: string; -}; +export { FeatureFlag }; -// @public -export interface FeatureFlagsApi { - getRegisteredFlags(): FeatureFlag[]; - isActive(name: string): boolean; - registerFlag(flag: FeatureFlag): void; - save(options: FeatureFlagsSaveOptions): void; -} +export { FeatureFlagsApi }; -// @public -export const featureFlagsApiRef: ApiRef; +export { featureFlagsApiRef }; // @public export type FeatureFlagsHooks = { register(name: string): void; }; -// @public -export type FeatureFlagsSaveOptions = { - states: Record; - merge?: boolean; -}; +export { FeatureFlagsSaveOptions }; -// @public -export const FeatureFlagState: { - readonly None: 0; - readonly Active: 1; -}; +export { FeatureFlagState }; -// @public (undocumented) -export type FeatureFlagState = - (typeof FeatureFlagState)[keyof typeof FeatureFlagState]; +export { FetchApi }; -// @public (undocumented) -export namespace FeatureFlagState { - // (undocumented) - export type Active = typeof FeatureFlagState.Active; - // (undocumented) - export type None = typeof FeatureFlagState.None; -} - -// @public -export type FetchApi = { - fetch: typeof fetch; -}; - -// @public -export const fetchApiRef: ApiRef; +export { fetchApiRef }; // @public export function getComponentData( @@ -494,46 +399,17 @@ export function getComponentData( type: string, ): T | undefined; -// @public -export const githubAuthApiRef: ApiRef< - OAuthApi & ProfileInfoApi & BackstageIdentityApi & SessionApi ->; +export { githubAuthApiRef }; -// @public -export const gitlabAuthApiRef: ApiRef< - OAuthApi & - OpenIdConnectApi & - ProfileInfoApi & - BackstageIdentityApi & - SessionApi ->; +export { gitlabAuthApiRef }; -// @public -export const googleAuthApiRef: ApiRef< - OAuthApi & - OpenIdConnectApi & - ProfileInfoApi & - BackstageIdentityApi & - SessionApi ->; +export { googleAuthApiRef }; -// @public -export type IconComponent = ComponentType<{ - fontSize?: 'medium' | 'large' | 'small' | 'inherit'; -}>; +export { IconComponent }; -// @public -export type IdentityApi = { - getProfileInfo(): Promise; - getBackstageIdentity(): Promise; - getCredentials(): Promise<{ - token?: string; - }>; - signOut(): Promise; -}; +export { IdentityApi }; -// @public -export const identityApiRef: ApiRef; +export { identityApiRef }; // @public @deprecated export type MakeSubRouteRef< @@ -553,75 +429,27 @@ export type MergeParams< P2 extends AnyParams, > = (P1[keyof P1] extends never ? {} : P1) & (P2 extends undefined ? {} : P2); -// @public -export const microsoftAuthApiRef: ApiRef< - OAuthApi & - OpenIdConnectApi & - ProfileInfoApi & - BackstageIdentityApi & - SessionApi ->; +export { microsoftAuthApiRef }; -// @public -export type OAuthApi = { - getAccessToken( - scope?: OAuthScope, - options?: AuthRequestOptions, - ): Promise; -}; +export { OAuthApi }; -// @public -export type OAuthRequestApi = { - createAuthRequester( - options: OAuthRequesterOptions, - ): OAuthRequester; - authRequest$(): Observable; -}; +export { OAuthRequestApi }; -// @public -export const oauthRequestApiRef: ApiRef; +export { oauthRequestApiRef }; -// @public -export type OAuthRequester = ( - scopes: Set, -) => Promise; +export { OAuthRequester }; -// @public -export type OAuthRequesterOptions = { - provider: AuthProviderInfo; - onAuthRequest(scopes: Set): Promise; -}; +export { OAuthRequesterOptions }; -// @public -export type OAuthScope = string | string[]; +export { OAuthScope }; -// @public -export const oktaAuthApiRef: ApiRef< - OAuthApi & - OpenIdConnectApi & - ProfileInfoApi & - BackstageIdentityApi & - SessionApi ->; +export { oktaAuthApiRef }; -// @public -export const oneloginAuthApiRef: ApiRef< - OAuthApi & - OpenIdConnectApi & - ProfileInfoApi & - BackstageIdentityApi & - SessionApi ->; +export { oneloginAuthApiRef }; -// @public -export type OpenIdConnectApi = { - getIdToken(options?: AuthRequestOptions): Promise; -}; +export { OpenIdConnectApi }; -// @public -export const openshiftAuthApiRef: ApiRef< - OAuthApi & ProfileInfoApi & BackstageIdentityApi & SessionApi ->; +export { openshiftAuthApiRef }; // @public @deprecated export type OptionalParams< @@ -655,12 +483,7 @@ export type PathParams = { [name in ParamNames]: string; }; -// @public -export type PendingOAuthRequest = { - provider: AuthProviderInfo; - reject(): void; - trigger(): Promise; -}; +export { PendingOAuthRequest }; // @public export type PluginConfig< @@ -679,17 +502,9 @@ export type PluginFeatureFlagConfig = { name: string; }; -// @public -export type ProfileInfo = { - email?: string; - displayName?: string; - picture?: string; -}; +export { ProfileInfo }; -// @public -export type ProfileInfoApi = { - getProfile(options?: AuthRequestOptions): Promise; -}; +export { ProfileInfoApi }; // @public export type RouteFunc = ( @@ -704,61 +519,20 @@ export type RouteRef = { readonly T: Params; }; -// @public -export type SessionApi = { - signIn(): Promise; - signOut(): Promise; - sessionState$(): Observable; -}; +export { SessionApi }; -// @public -export const SessionState: { - readonly SignedIn: 'SignedIn'; - readonly SignedOut: 'SignedOut'; -}; - -// @public (undocumented) -export type SessionState = (typeof SessionState)[keyof typeof SessionState]; - -// @public (undocumented) -export namespace SessionState { - // (undocumented) - export type SignedIn = typeof SessionState.SignedIn; - // (undocumented) - export type SignedOut = typeof SessionState.SignedOut; -} +export { SessionState }; // @public export type SignInPageProps = PropsWithChildren<{ onSignInSuccess(identityApi: IdentityApi_2): void; }>; -// @public -export interface StorageApi { - forBucket(name: string): StorageApi; - observe$( - key: string, - ): Observable>; - remove(key: string): Promise; - set(key: string, data: T): Promise; - snapshot(key: string): StorageValueSnapshot; -} +export { StorageApi }; -// @public -export const storageApiRef: ApiRef; +export { storageApiRef }; -// @public -export type StorageValueSnapshot = - | { - key: string; - presence: 'unknown' | 'absent'; - value?: undefined; - } - | { - key: string; - presence: 'present'; - value: TValue; - }; +export { StorageValueSnapshot }; // @public export type SubRouteRef = { @@ -770,19 +544,14 @@ export type SubRouteRef = { readonly T: Params; }; -// @public -export type TypesToApiRefs = { - [key in keyof T]: ApiRef; -}; +export { TypesToApiRefs }; // @public export function useAnalytics(): AnalyticsTracker; -// @public -export function useApi(apiRef: ApiRef): T; +export { useApi }; -// @public -export function useApiHolder(): ApiHolder; +export { useApiHolder }; // @public export const useApp: () => AppContext; @@ -809,22 +578,7 @@ export function useRouteRefParams( _routeRef: RouteRef | SubRouteRef, ): Params; -// @public -export const vmwareCloudAuthApiRef: ApiRef< - OAuthApi & - OpenIdConnectApi & - ProfileInfoApi & - BackstageIdentityApi & - SessionApi ->; +export { vmwareCloudAuthApiRef }; -// @public -export function withApis( - apis: TypesToApiRefs, -): ( - WrappedComponent: ComponentType, -) => { - (props: PropsWithChildren>): JSX_2.Element; - displayName: string; -}; +export { withApis }; ``` diff --git a/packages/frontend-plugin-api/report.api.md b/packages/frontend-plugin-api/report.api.md index 370e86727b..17ef32131c 100644 --- a/packages/frontend-plugin-api/report.api.md +++ b/packages/frontend-plugin-api/report.api.md @@ -3,103 +3,41 @@ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). ```ts -import { AlertApi } from '@backstage/core-plugin-api'; -import { alertApiRef } from '@backstage/core-plugin-api'; -import { AlertMessage } from '@backstage/core-plugin-api'; -import { AnyApiFactory } from '@backstage/core-plugin-api'; -import { AnyApiRef } from '@backstage/core-plugin-api'; import { AnyRouteRefParams as AnyRouteRefParams_2 } from '@backstage/frontend-plugin-api'; -import { ApiFactory } from '@backstage/core-plugin-api'; -import { ApiHolder } from '@backstage/core-plugin-api'; -import { ApiRef } from '@backstage/core-plugin-api'; -import { ApiRefConfig } from '@backstage/core-plugin-api'; -import { AppTheme } from '@backstage/core-plugin-api'; -import { AppThemeApi } from '@backstage/core-plugin-api'; -import { appThemeApiRef } from '@backstage/core-plugin-api'; -import { atlassianAuthApiRef } from '@backstage/core-plugin-api'; -import { AuthProviderInfo } from '@backstage/core-plugin-api'; -import { AuthRequestOptions } from '@backstage/core-plugin-api'; -import { BackstageIdentityApi } from '@backstage/core-plugin-api'; -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 { ComponentType } from 'react'; -import { ConfigApi } from '@backstage/core-plugin-api'; -import { configApiRef } from '@backstage/core-plugin-api'; +import { Config } from '@backstage/config'; import { ConfigurableExtensionDataRef as ConfigurableExtensionDataRef_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'; -import { createTranslationRef } from '@backstage/core-plugin-api/alpha'; -import { createTranslationResource } from '@backstage/core-plugin-api/alpha'; -import { DiscoveryApi } from '@backstage/core-plugin-api'; -import { discoveryApiRef } from '@backstage/core-plugin-api'; -import { ErrorApi } from '@backstage/core-plugin-api'; -import { ErrorApiError } from '@backstage/core-plugin-api'; -import { ErrorApiErrorContext } from '@backstage/core-plugin-api'; -import { errorApiRef } from '@backstage/core-plugin-api'; import { Expand } from '@backstage/types'; +import { ExpandRecursive } from '@backstage/types'; import { ExtensionBlueprint as ExtensionBlueprint_2 } from '@backstage/frontend-plugin-api'; import { ExtensionDataRef as ExtensionDataRef_2 } from '@backstage/frontend-plugin-api'; -import { FeatureFlag } from '@backstage/core-plugin-api'; -import { FeatureFlagsApi } from '@backstage/core-plugin-api'; -import { featureFlagsApiRef } from '@backstage/core-plugin-api'; -import { FeatureFlagsSaveOptions } from '@backstage/core-plugin-api'; -import { FeatureFlagState } from '@backstage/core-plugin-api'; -import { FetchApi } from '@backstage/core-plugin-api'; -import { fetchApiRef } from '@backstage/core-plugin-api'; -import { githubAuthApiRef } from '@backstage/core-plugin-api'; -import { gitlabAuthApiRef } from '@backstage/core-plugin-api'; -import { googleAuthApiRef } from '@backstage/core-plugin-api'; import { IconComponent as IconComponent_2 } from '@backstage/frontend-plugin-api'; -import { IconComponent as IconComponent_3 } from '@backstage/core-plugin-api'; -import { IdentityApi } from '@backstage/core-plugin-api'; -import { identityApiRef } from '@backstage/core-plugin-api'; import { JsonObject } from '@backstage/types'; +import { JsonValue } from '@backstage/types'; import { JSX as JSX_2 } from 'react/jsx-runtime'; import { JSX as JSX_3 } from 'react'; -import { microsoftAuthApiRef } from '@backstage/core-plugin-api'; -import { OAuthApi } from '@backstage/core-plugin-api'; -import { OAuthRequestApi } from '@backstage/core-plugin-api'; -import { oauthRequestApiRef } from '@backstage/core-plugin-api'; -import { OAuthRequester } from '@backstage/core-plugin-api'; -import { OAuthRequesterOptions } from '@backstage/core-plugin-api'; -import { OAuthScope } from '@backstage/core-plugin-api'; -import { oktaAuthApiRef } from '@backstage/core-plugin-api'; -import { oneloginAuthApiRef } from '@backstage/core-plugin-api'; -import { OpenIdConnectApi } from '@backstage/core-plugin-api'; -import { openshiftAuthApiRef } from '@backstage/core-plugin-api'; -import { PendingOAuthRequest } from '@backstage/core-plugin-api'; -import { ProfileInfo } from '@backstage/core-plugin-api'; -import { ProfileInfoApi } from '@backstage/core-plugin-api'; +import { Observable } from '@backstage/types'; +import { PropsWithChildren } from 'react'; import { ReactNode } from 'react'; import { RouteRef as RouteRef_2 } from '@backstage/frontend-plugin-api'; -import { SessionApi } from '@backstage/core-plugin-api'; -import { SessionState } from '@backstage/core-plugin-api'; import { SignInPageProps } from '@backstage/core-plugin-api'; -import { StorageApi } from '@backstage/core-plugin-api'; -import { storageApiRef } from '@backstage/core-plugin-api'; -import { StorageValueSnapshot } from '@backstage/core-plugin-api'; -import { TranslationMessages } from '@backstage/core-plugin-api/alpha'; -import { TranslationMessagesOptions } from '@backstage/core-plugin-api/alpha'; -import { TranslationRef } from '@backstage/core-plugin-api/alpha'; -import { TranslationRefOptions } from '@backstage/core-plugin-api/alpha'; -import { TranslationResource } from '@backstage/core-plugin-api/alpha'; -import { TranslationResourceOptions } from '@backstage/core-plugin-api/alpha'; -import { TypesToApiRefs } from '@backstage/core-plugin-api'; -import { useApi } from '@backstage/core-plugin-api'; -import { useApiHolder } from '@backstage/core-plugin-api'; -import { useTranslationRef } from '@backstage/core-plugin-api/alpha'; -import { vmwareCloudAuthApiRef } from '@backstage/core-plugin-api'; -import { withApis } from '@backstage/core-plugin-api'; import { z } from 'zod'; -export { AlertApi }; +// @public +export type AlertApi = { + post(alert: AlertMessage): void; + alert$(): Observable; +}; -export { alertApiRef }; +// @public +export const alertApiRef: ApiRef; -export { AlertMessage }; +// @public +export type AlertMessage = { + message: string; + severity?: 'success' | 'info' | 'warning' | 'error'; + display?: 'permanent' | 'transient'; +}; // @public export type AnalyticsApi = { @@ -187,9 +125,17 @@ export type AnalyticsTracker = { ) => void; }; -export { AnyApiFactory }; +// @public +export type AnyApiFactory = ApiFactory< + unknown, + unknown, + { + [key in string]: unknown; + } +>; -export { AnyApiRef }; +// @public +export type AnyApiRef = ApiRef; // @public @deprecated (undocumented) export type AnyExtensionDataRef = ExtensionDataRef; @@ -224,13 +170,51 @@ export const ApiBlueprint: ExtensionBlueprint<{ }; }>; -export { ApiFactory }; +// @public +export type ApiFactory< + Api, + Impl extends Api, + Deps extends { + [name in string]: unknown; + }, +> = { + api: ApiRef; + deps: TypesToApiRefs; + factory(deps: Deps): Impl; +}; -export { ApiHolder }; +// @public +export type ApiHolder = { + get(api: ApiRef): T | undefined; +}; -export { ApiRef }; +// @public +export type ApiRef = { + id: string; + T: T; +}; -export { ApiRefConfig }; +// @public +export type ApiRefConfig = { + id: string; +}; + +// @public (undocumented) +export type AppLanguageApi = { + getAvailableLanguages(): { + languages: string[]; + }; + setLanguage(language?: string): void; + getLanguage(): { + language: string; + }; + language$(): Observable<{ + language: string; + }>; +}; + +// @public (undocumented) +export const appLanguageApiRef: ApiRef; // @public export interface AppNode { @@ -278,7 +262,7 @@ export const AppRootElementBlueprint: ExtensionBlueprint<{ params: { element: JSX.Element; }; - output: ExtensionDataRef; + output: ExtensionDataRef; inputs: {}; config: {}; configInput: {}; @@ -309,11 +293,25 @@ export const AppRootWrapperBlueprint: ExtensionBlueprint<{ }; }>; -export { AppTheme }; +// @public +export type AppTheme = { + id: string; + title: string; + variant: 'light' | 'dark'; + icon?: React.ReactElement; + Provider(props: { children: ReactNode }): JSX.Element | null; +}; -export { AppThemeApi }; +// @public +export type AppThemeApi = { + getInstalledThemes(): AppTheme[]; + activeThemeId$(): Observable; + getActiveThemeId(): string | undefined; + setActiveThemeId(themeId?: string): void; +}; -export { appThemeApiRef }; +// @public +export const appThemeApiRef: ApiRef; // @public export interface AppTree { @@ -335,25 +333,61 @@ export interface AppTreeApi { // @public export const appTreeApiRef: ApiRef; -export { atlassianAuthApiRef }; +// @public +export const atlassianAuthApiRef: ApiRef< + OAuthApi & ProfileInfoApi & BackstageIdentityApi & SessionApi +>; -export { AuthProviderInfo }; +// @public +export type AuthProviderInfo = { + id: string; + title: string; + icon: IconComponent; + message?: string; +}; -export { AuthRequestOptions }; +// @public +export type AuthRequestOptions = { + optional?: boolean; + instantPopup?: boolean; +}; -export { BackstageIdentityApi }; +// @public +export type BackstageIdentityApi = { + getBackstageIdentity( + options?: AuthRequestOptions, + ): Promise; +}; -export { BackstageIdentityResponse }; +// @public +export type BackstageIdentityResponse = { + token: string; + expiresAt?: Date; + identity: BackstageUserIdentity; +}; -export { BackstageUserIdentity }; +// @public +export type BackstageUserIdentity = { + type: 'user'; + userEntityRef: string; + ownershipEntityRefs: string[]; +}; -export { bitbucketAuthApiRef }; +// @public +export const bitbucketAuthApiRef: ApiRef< + OAuthApi & ProfileInfoApi & BackstageIdentityApi & SessionApi +>; -export { bitbucketServerAuthApiRef }; +// @public +export const bitbucketServerAuthApiRef: ApiRef< + OAuthApi & ProfileInfoApi & BackstageIdentityApi & SessionApi +>; -export { ConfigApi }; +// @public +export type ConfigApi = Config; -export { configApiRef }; +// @public +export const configApiRef: ApiRef; // @public (undocumented) export interface ConfigurableExtensionDataRef< @@ -391,9 +425,23 @@ export const coreExtensionData: { >; }; -export { createApiFactory }; +// @public +export function createApiFactory< + Api, + Impl extends Api, + Deps extends { + [name in string]: unknown; + }, +>(factory: ApiFactory): ApiFactory; -export { createApiRef }; +// @public +export function createApiFactory( + api: ApiRef, + instance: Impl, +): ApiFactory; + +// @public +export function createApiRef(config: ApiRefConfig): ApiRef; // @public export function createExtension< @@ -769,11 +817,50 @@ export type CreateSwappableComponentOptions< transformProps?: (props: TExternalComponentProps) => TInnerComponentProps; }; -export { createTranslationMessages }; +// @public +export function createTranslationMessages< + TId extends string, + TMessages extends { + [key in string]: string; + }, + TFull extends boolean, +>( + options: TranslationMessagesOptions, +): TranslationMessages; -export { createTranslationRef }; +// @public (undocumented) +export function createTranslationRef< + TId extends string, + const TNestedMessages extends AnyNestedMessages, + TTranslations extends { + [language in string]: () => Promise<{ + default: { + [key in keyof FlattenedMessages]: string | null; + }; + }>; + }, +>( + config: TranslationRefOptions, +): TranslationRef>; -export { createTranslationResource }; +// @public (undocumented) +export function createTranslationResource< + TId extends string, + TMessages extends { + [key in string]: string; + }, + TTranslations extends { + [language in string]: () => Promise<{ + default: + | TranslationMessages + | { + [key in keyof TMessages]: string | null; + }; + }>; + }, +>( + options: TranslationResourceOptions, +): TranslationResource; // @public export interface DialogApi { @@ -807,17 +894,37 @@ export interface DialogApiDialog { // @public export const dialogApiRef: ApiRef; -export { DiscoveryApi }; +// @public +export type DiscoveryApi = { + getBaseUrl(pluginId: string): Promise; +}; -export { discoveryApiRef }; +// @public +export const discoveryApiRef: ApiRef; -export { ErrorApi }; +// @public +export type ErrorApi = { + post(error: ErrorApiError, context?: ErrorApiErrorContext): void; + error$(): Observable<{ + error: ErrorApiError; + context?: ErrorApiErrorContext; + }>; +}; -export { ErrorApiError }; +// @public +export type ErrorApiError = { + name: string; + message: string; + stack?: string; +}; -export { ErrorApiErrorContext }; +// @public +export type ErrorApiErrorContext = { + hidden?: boolean; +}; -export { errorApiRef }; +// @public +export const errorApiRef: ApiRef; // @public (undocumented) export const ErrorDisplay: { @@ -1201,24 +1308,60 @@ export interface ExternalRouteRef< readonly T: TParams; } -export { FeatureFlag }; +// @public +export type FeatureFlag = { + name: string; + pluginId: string; + description?: string; +}; // @public export type FeatureFlagConfig = { name: string; }; -export { FeatureFlagsApi }; +// @public +export interface FeatureFlagsApi { + getRegisteredFlags(): FeatureFlag[]; + isActive(name: string): boolean; + registerFlag(flag: FeatureFlag): void; + save(options: FeatureFlagsSaveOptions): void; +} -export { featureFlagsApiRef }; +// @public +export const featureFlagsApiRef: ApiRef; -export { FeatureFlagsSaveOptions }; +// @public +export type FeatureFlagsSaveOptions = { + states: Record; + merge?: boolean; +}; -export { FeatureFlagState }; +// @public +export const FeatureFlagState: { + readonly None: 0; + readonly Active: 1; +}; -export { FetchApi }; +// @public (undocumented) +export type FeatureFlagState = + (typeof FeatureFlagState)[keyof typeof FeatureFlagState]; -export { fetchApiRef }; +// @public (undocumented) +export namespace FeatureFlagState { + // (undocumented) + export type Active = typeof FeatureFlagState.Active; + // (undocumented) + export type None = typeof FeatureFlagState.None; +} + +// @public +export type FetchApi = { + fetch: typeof fetch; +}; + +// @public +export const fetchApiRef: ApiRef; // @public (undocumented) export type FrontendFeature = FrontendPlugin | FrontendModule; @@ -1283,11 +1426,28 @@ export type FrontendPluginInfoOptions = { manifest?: () => Promise; }; -export { githubAuthApiRef }; +// @public +export const githubAuthApiRef: ApiRef< + OAuthApi & ProfileInfoApi & BackstageIdentityApi & SessionApi +>; -export { gitlabAuthApiRef }; +// @public +export const gitlabAuthApiRef: ApiRef< + OAuthApi & + OpenIdConnectApi & + ProfileInfoApi & + BackstageIdentityApi & + SessionApi +>; -export { googleAuthApiRef }; +// @public +export const googleAuthApiRef: ApiRef< + OAuthApi & + OpenIdConnectApi & + ProfileInfoApi & + BackstageIdentityApi & + SessionApi +>; // @public (undocumented) export const IconBundleBlueprint: ExtensionBlueprint<{ @@ -1332,11 +1492,27 @@ export interface IconsApi { // @public export const iconsApiRef: ApiRef; -export { IdentityApi }; +// @public +export type IdentityApi = { + getProfileInfo(): Promise; + getBackstageIdentity(): Promise; + getCredentials(): Promise<{ + token?: string; + }>; + signOut(): Promise; +}; -export { identityApiRef }; +// @public +export const identityApiRef: ApiRef; -export { microsoftAuthApiRef }; +// @public +export const microsoftAuthApiRef: ApiRef< + OAuthApi & + OpenIdConnectApi & + ProfileInfoApi & + BackstageIdentityApi & + SessionApi +>; // @public export const NavContentBlueprint: ExtensionBlueprint_2<{ @@ -1382,13 +1558,13 @@ export const NavItemBlueprint: ExtensionBlueprint<{ kind: 'nav-item'; params: { title: string; - icon: IconComponent_3; + icon: IconComponent; routeRef: RouteRef; }; output: ExtensionDataRef< { title: string; - icon: IconComponent_3; + icon: IconComponent; routeRef: RouteRef; }, 'core.nav-item.target', @@ -1401,7 +1577,7 @@ export const NavItemBlueprint: ExtensionBlueprint<{ target: ConfigurableExtensionDataRef< { title: string; - icon: IconComponent_3; + icon: IconComponent; routeRef: RouteRef; }, 'core.nav-item.target', @@ -1421,25 +1597,66 @@ export type NotFoundErrorPageProps = { children?: ReactNode; }; -export { OAuthApi }; +// @public +export type OAuthApi = { + getAccessToken( + scope?: OAuthScope, + options?: AuthRequestOptions, + ): Promise; +}; -export { OAuthRequestApi }; +// @public +export type OAuthRequestApi = { + createAuthRequester( + options: OAuthRequesterOptions, + ): OAuthRequester; + authRequest$(): Observable; +}; -export { oauthRequestApiRef }; +// @public +export const oauthRequestApiRef: ApiRef; -export { OAuthRequester }; +// @public +export type OAuthRequester = ( + scopes: Set, +) => Promise; -export { OAuthRequesterOptions }; +// @public +export type OAuthRequesterOptions = { + provider: AuthProviderInfo; + onAuthRequest(scopes: Set): Promise; +}; -export { OAuthScope }; +// @public +export type OAuthScope = string | string[]; -export { oktaAuthApiRef }; +// @public +export const oktaAuthApiRef: ApiRef< + OAuthApi & + OpenIdConnectApi & + ProfileInfoApi & + BackstageIdentityApi & + SessionApi +>; -export { oneloginAuthApiRef }; +// @public +export const oneloginAuthApiRef: ApiRef< + OAuthApi & + OpenIdConnectApi & + ProfileInfoApi & + BackstageIdentityApi & + SessionApi +>; -export { OpenIdConnectApi }; +// @public +export type OpenIdConnectApi = { + getIdToken(options?: AuthRequestOptions): Promise; +}; -export { openshiftAuthApiRef }; +// @public +export const openshiftAuthApiRef: ApiRef< + OAuthApi & ProfileInfoApi & BackstageIdentityApi & SessionApi +>; // @public (undocumented) export interface OverridableExtensionDefinition< @@ -1593,7 +1810,7 @@ export const PageBlueprint: ExtensionBlueprint<{ }; output: | ExtensionDataRef - | ExtensionDataRef + | ExtensionDataRef | ExtensionDataRef< RouteRef, 'core.routing.ref', @@ -1611,7 +1828,12 @@ export const PageBlueprint: ExtensionBlueprint<{ dataRefs: never; }>; -export { PendingOAuthRequest }; +// @public +export type PendingOAuthRequest = { + provider: AuthProviderInfo; + reject(): void; + trigger(): Promise; +}; // @public (undocumented) export interface PluginOptions< @@ -1644,9 +1866,17 @@ export type PortableSchema = { schema: JsonObject; }; -export { ProfileInfo }; +// @public +export type ProfileInfo = { + email?: string; + displayName?: string; + picture?: string; +}; -export { ProfileInfoApi }; +// @public +export type ProfileInfoApi = { + getProfile(options?: AuthRequestOptions): Promise; +}; // @public (undocumented) export const Progress: { @@ -1736,9 +1966,29 @@ export interface RouteResolutionApi { // @public export const routeResolutionApiRef: ApiRef; -export { SessionApi }; +// @public +export type SessionApi = { + signIn(): Promise; + signOut(): Promise; + sessionState$(): Observable; +}; -export { SessionState }; +// @public +export const SessionState: { + readonly SignedIn: 'SignedIn'; + readonly SignedOut: 'SignedOut'; +}; + +// @public (undocumented) +export type SessionState = (typeof SessionState)[keyof typeof SessionState]; + +// @public (undocumented) +export namespace SessionState { + // (undocumented) + export type SignedIn = typeof SessionState.SignedIn; + // (undocumented) + export type SignedOut = typeof SessionState.SignedOut; +} // @public export const SignInPageBlueprint: ExtensionBlueprint<{ @@ -1763,11 +2013,32 @@ export const SignInPageBlueprint: ExtensionBlueprint<{ }; }>; -export { StorageApi }; +// @public +export interface StorageApi { + forBucket(name: string): StorageApi; + observe$( + key: string, + ): Observable>; + remove(key: string): Promise; + set(key: string, data: T): Promise; + snapshot(key: string): StorageValueSnapshot; +} -export { storageApiRef }; +// @public +export const storageApiRef: ApiRef; -export { StorageValueSnapshot }; +// @public +export type StorageValueSnapshot = + | { + key: string; + presence: 'unknown' | 'absent'; + value?: undefined; + } + | { + key: string; + presence: 'present'; + value: TValue; + }; // @public export interface SubRouteRef< @@ -1880,6 +2151,27 @@ export const ThemeBlueprint: ExtensionBlueprint<{ }; }>; +// @public (undocumented) +export type TranslationApi = { + getTranslation< + TMessages extends { + [key in string]: string; + }, + >( + translationRef: TranslationRef, + ): TranslationSnapshot; + translation$< + TMessages extends { + [key in string]: string; + }, + >( + translationRef: TranslationRef, + ): Observable>; +}; + +// @public (undocumented) +export const translationApiRef: ApiRef; + // @public export const TranslationBlueprint: ExtensionBlueprint<{ kind: 'translation'; @@ -1917,26 +2209,169 @@ export const TranslationBlueprint: ExtensionBlueprint<{ }; }>; -export { TranslationMessages }; +// @public (undocumented) +export type TranslationFunction< + TMessages extends { + [key in string]: string; + }, +> = CollapsedMessages extends infer IMessages extends { + [key in string]: string; +} + ? { + ( + key: TKey, + ...[args]: TranslationFunctionOptions< + NestedMessageKeys, + PluralKeys, + IMessages, + string + > + ): IMessages[TKey]; + ( + key: TKey, + ...[args]: TranslationFunctionOptions< + NestedMessageKeys, + PluralKeys, + IMessages, + string | JSX_3.Element + > + ): JSX_3.Element; + } + : never; -export { TranslationMessagesOptions }; +// @public +export interface TranslationMessages< + TId extends string = string, + TMessages extends { + [key in string]: string; + } = { + [key in string]: string; + }, + TFull extends boolean = boolean, +> { + // (undocumented) + $$type: '@backstage/TranslationMessages'; + full: TFull; + id: TId; + messages: TMessages; +} -export { TranslationRef }; +// @public +export interface TranslationMessagesOptions< + TId extends string, + TMessages extends { + [key in string]: string; + }, + TFull extends boolean, +> { + // (undocumented) + full?: TFull; + // (undocumented) + messages: false extends TFull + ? { + [key in keyof TMessages]?: string | null; + } + : { + [key in keyof TMessages]: string | null; + }; + // (undocumented) + ref: TranslationRef; +} -export { TranslationRefOptions }; +// @public (undocumented) +export interface TranslationRef< + TId extends string = string, + TMessages extends { + [key in string]: string; + } = { + [key in string]: string; + }, +> { + // (undocumented) + $$type: '@backstage/TranslationRef'; + // (undocumented) + id: TId; + // (undocumented) + T: TMessages; +} -export { TranslationResource }; +// @public (undocumented) +export interface TranslationRefOptions< + TId extends string, + TNestedMessages extends AnyNestedMessages, + TTranslations extends { + [language in string]: () => Promise<{ + default: { + [key in keyof FlattenedMessages]: string | null; + }; + }>; + }, +> { + // (undocumented) + id: TId; + // (undocumented) + messages: TNestedMessages; + // (undocumented) + translations?: TTranslations; +} -export { TranslationResourceOptions }; +// @public (undocumented) +export interface TranslationResource { + // (undocumented) + $$type: '@backstage/TranslationResource'; + // (undocumented) + id: TId; +} -export { TypesToApiRefs }; +// @public (undocumented) +export interface TranslationResourceOptions< + TId extends string, + TMessages extends { + [key in string]: string; + }, + TTranslations extends { + [language in string]: () => Promise<{ + default: + | TranslationMessages + | { + [key in keyof TMessages]: string | null; + }; + }>; + }, +> { + // (undocumented) + ref: TranslationRef; + // (undocumented) + translations: TTranslations; +} + +// @public (undocumented) +export type TranslationSnapshot< + TMessages extends { + [key in string]: string; + }, +> = + | { + ready: false; + } + | { + ready: true; + t: TranslationFunction; + }; + +// @public +export type TypesToApiRefs = { + [key in keyof T]: ApiRef; +}; // @public export function useAnalytics(): AnalyticsTracker; -export { useApi }; +// @public +export function useApi(apiRef: ApiRef): T; -export { useApiHolder }; +// @public +export function useApiHolder(): ApiHolder; // @public export function useAppNode(): AppNode | undefined; @@ -1954,9 +2389,29 @@ export function useRouteRefParams( _routeRef: RouteRef | SubRouteRef, ): Params; -export { useTranslationRef }; +// @public (undocumented) +export const useTranslationRef: ( + translationRef: TranslationRef, +) => { + t: TranslationFunction; +}; -export { vmwareCloudAuthApiRef }; +// @public +export const vmwareCloudAuthApiRef: ApiRef< + OAuthApi & + OpenIdConnectApi & + ProfileInfoApi & + BackstageIdentityApi & + SessionApi +>; -export { withApis }; +// @public +export function withApis( + apis: TypesToApiRefs, +): ( + WrappedComponent: ComponentType, +) => { + (props: PropsWithChildren>): JSX_2.Element; + displayName: string; +}; ``` diff --git a/plugins/api-docs/report-alpha.api.md b/plugins/api-docs/report-alpha.api.md index ae09605cfc..e969afd777 100644 --- a/plugins/api-docs/report-alpha.api.md +++ b/plugins/api-docs/report-alpha.api.md @@ -14,7 +14,7 @@ import { ExtensionBlueprintParams } from '@backstage/frontend-plugin-api'; import { ExtensionDataRef } from '@backstage/frontend-plugin-api'; import { ExtensionInput } from '@backstage/frontend-plugin-api'; import { ExternalRouteRef } from '@backstage/frontend-plugin-api'; -import { IconComponent } from '@backstage/core-plugin-api'; +import { IconComponent } from '@backstage/frontend-plugin-api'; import { JSX as JSX_2 } from 'react'; import { OverridableExtensionDefinition } from '@backstage/frontend-plugin-api'; import { OverridableFrontendPlugin } from '@backstage/frontend-plugin-api'; diff --git a/plugins/app-visualizer/report.api.md b/plugins/app-visualizer/report.api.md index f3b7e6ae61..180507677e 100644 --- a/plugins/app-visualizer/report.api.md +++ b/plugins/app-visualizer/report.api.md @@ -5,7 +5,7 @@ ```ts import { AnyRouteRefParams } from '@backstage/frontend-plugin-api'; import { ExtensionDataRef } from '@backstage/frontend-plugin-api'; -import { IconComponent } from '@backstage/core-plugin-api'; +import { IconComponent } from '@backstage/frontend-plugin-api'; import { JSX as JSX_2 } from 'react'; import { OverridableExtensionDefinition } from '@backstage/frontend-plugin-api'; import { OverridableFrontendPlugin } from '@backstage/frontend-plugin-api'; diff --git a/plugins/app/report.api.md b/plugins/app/report.api.md index bd8c05bfe4..2bcd7550a3 100644 --- a/plugins/app/report.api.md +++ b/plugins/app/report.api.md @@ -13,8 +13,7 @@ import { ConfigurableExtensionDataRef } from '@backstage/frontend-plugin-api'; import { ExtensionBlueprintParams } from '@backstage/frontend-plugin-api'; import { ExtensionDataRef } from '@backstage/frontend-plugin-api'; import { ExtensionInput } from '@backstage/frontend-plugin-api'; -import { IconComponent } from '@backstage/core-plugin-api'; -import { IconComponent as IconComponent_2 } from '@backstage/frontend-plugin-api'; +import { IconComponent } from '@backstage/frontend-plugin-api'; import { JSX as JSX_2 } from 'react'; import { NavContentComponent } from '@backstage/frontend-plugin-api'; import { OverridableExtensionDefinition } from '@backstage/frontend-plugin-api'; @@ -458,7 +457,7 @@ const appPlugin: OverridableFrontendPlugin< icons: ExtensionInput< ConfigurableExtensionDataRef< { - [x: string]: IconComponent_2; + [x: string]: IconComponent; }, 'core.icons', {} diff --git a/plugins/catalog-react/report-alpha.api.md b/plugins/catalog-react/report-alpha.api.md index 4b4a0a9a18..166aa7aaaa 100644 --- a/plugins/catalog-react/report-alpha.api.md +++ b/plugins/catalog-react/report-alpha.api.md @@ -112,8 +112,8 @@ export const catalogReactTranslationRef: TranslationRef< readonly 'entityTableColumnTitle.description': 'Description'; readonly 'entityTableColumnTitle.domain': 'Domain'; readonly 'entityTableColumnTitle.system': 'System'; - readonly 'entityTableColumnTitle.tags': 'Tags'; readonly 'entityTableColumnTitle.namespace': 'Namespace'; + readonly 'entityTableColumnTitle.tags': 'Tags'; readonly 'entityTableColumnTitle.lifecycle': 'Lifecycle'; readonly 'entityTableColumnTitle.owner': 'Owner'; readonly 'entityTableColumnTitle.targets': 'Targets'; diff --git a/plugins/catalog-unprocessed-entities/report-alpha.api.md b/plugins/catalog-unprocessed-entities/report-alpha.api.md index 5518f6d273..96827c78f6 100644 --- a/plugins/catalog-unprocessed-entities/report-alpha.api.md +++ b/plugins/catalog-unprocessed-entities/report-alpha.api.md @@ -8,7 +8,7 @@ import { AnyRouteRefParams } from '@backstage/frontend-plugin-api'; import { ApiFactory } from '@backstage/frontend-plugin-api'; import { ExtensionBlueprintParams } from '@backstage/frontend-plugin-api'; import { ExtensionDataRef } from '@backstage/frontend-plugin-api'; -import { IconComponent } from '@backstage/core-plugin-api'; +import { IconComponent } from '@backstage/frontend-plugin-api'; import { JSX as JSX_2 } from 'react'; import { OverridableExtensionDefinition } from '@backstage/frontend-plugin-api'; import { OverridableFrontendPlugin } from '@backstage/frontend-plugin-api'; diff --git a/plugins/catalog/report-alpha.api.md b/plugins/catalog/report-alpha.api.md index 6f63f50b0b..abf66113c7 100644 --- a/plugins/catalog/report-alpha.api.md +++ b/plugins/catalog/report-alpha.api.md @@ -17,7 +17,7 @@ import { ExtensionBlueprintParams } from '@backstage/frontend-plugin-api'; import { ExtensionDataRef } from '@backstage/frontend-plugin-api'; import { ExtensionInput } from '@backstage/frontend-plugin-api'; import { ExternalRouteRef } from '@backstage/frontend-plugin-api'; -import { IconComponent } from '@backstage/core-plugin-api'; +import { IconComponent } from '@backstage/frontend-plugin-api'; import { IconLinkVerticalProps } from '@backstage/core-components'; import { JSX as JSX_2 } from 'react'; import { OverridableExtensionDefinition } from '@backstage/frontend-plugin-api'; diff --git a/plugins/devtools/report-alpha.api.md b/plugins/devtools/report-alpha.api.md index c114924f4a..c9a538be0b 100644 --- a/plugins/devtools/report-alpha.api.md +++ b/plugins/devtools/report-alpha.api.md @@ -8,7 +8,7 @@ import { AnyRouteRefParams } from '@backstage/frontend-plugin-api'; import { ApiFactory } from '@backstage/frontend-plugin-api'; import { ExtensionBlueprintParams } from '@backstage/frontend-plugin-api'; import { ExtensionDataRef } from '@backstage/frontend-plugin-api'; -import { IconComponent } from '@backstage/core-plugin-api'; +import { IconComponent } from '@backstage/frontend-plugin-api'; import { JSX as JSX_2 } from 'react'; import { OverridableExtensionDefinition } from '@backstage/frontend-plugin-api'; import { OverridableFrontendPlugin } from '@backstage/frontend-plugin-api'; diff --git a/plugins/scaffolder/report-alpha.api.md b/plugins/scaffolder/report-alpha.api.md index b6c5af9f17..80c0054882 100644 --- a/plugins/scaffolder/report-alpha.api.md +++ b/plugins/scaffolder/report-alpha.api.md @@ -20,7 +20,7 @@ import { FormField } from '@backstage/plugin-scaffolder-react/alpha'; import { formFieldsApiRef } from '@backstage/plugin-scaffolder-react/alpha'; import type { FormProps as FormProps_2 } from '@rjsf/core'; import { FormProps as FormProps_3 } from '@backstage/plugin-scaffolder-react'; -import { IconComponent } from '@backstage/core-plugin-api'; +import { IconComponent } from '@backstage/frontend-plugin-api'; import { IconLinkVerticalProps } from '@backstage/core-components'; import { JSX as JSX_2 } from 'react'; import { LayoutOptions } from '@backstage/plugin-scaffolder-react'; diff --git a/plugins/scaffolder/report.api.md b/plugins/scaffolder/report.api.md index 27fa47a184..2e9c6be1ef 100644 --- a/plugins/scaffolder/report.api.md +++ b/plugins/scaffolder/report.api.md @@ -4,7 +4,7 @@ ```ts import { ApiHolder } from '@backstage/core-plugin-api'; -import { ApiRef } from '@backstage/core-plugin-api'; +import { ApiRef } from '@backstage/frontend-plugin-api'; import { BackstagePlugin } from '@backstage/core-plugin-api'; import { ComponentType } from 'react'; import { createScaffolderFieldExtension as createScaffolderFieldExtension_2 } from '@backstage/plugin-scaffolder-react'; diff --git a/plugins/techdocs/report-alpha.api.md b/plugins/techdocs/report-alpha.api.md index 8a17625ac2..f950670f22 100644 --- a/plugins/techdocs/report-alpha.api.md +++ b/plugins/techdocs/report-alpha.api.md @@ -13,7 +13,7 @@ import { EntityPredicate } from '@backstage/plugin-catalog-react/alpha'; import { ExtensionBlueprintParams } from '@backstage/frontend-plugin-api'; import { ExtensionDataRef } from '@backstage/frontend-plugin-api'; import { ExtensionInput } from '@backstage/frontend-plugin-api'; -import { IconComponent } from '@backstage/core-plugin-api'; +import { IconComponent } from '@backstage/frontend-plugin-api'; import { IconLinkVerticalProps } from '@backstage/core-components'; import { JSX as JSX_2 } from 'react'; import { OverridableExtensionDefinition } from '@backstage/frontend-plugin-api'; diff --git a/plugins/user-settings/report-alpha.api.md b/plugins/user-settings/report-alpha.api.md index a900e5600c..e9f05fe3f9 100644 --- a/plugins/user-settings/report-alpha.api.md +++ b/plugins/user-settings/report-alpha.api.md @@ -7,7 +7,7 @@ import { AnyRouteRefParams } from '@backstage/frontend-plugin-api'; import { ConfigurableExtensionDataRef } from '@backstage/frontend-plugin-api'; import { ExtensionDataRef } from '@backstage/frontend-plugin-api'; import { ExtensionInput } from '@backstage/frontend-plugin-api'; -import { IconComponent } from '@backstage/core-plugin-api'; +import { IconComponent } from '@backstage/frontend-plugin-api'; import { JSX as JSX_2 } from 'react'; import { OverridableExtensionDefinition } from '@backstage/frontend-plugin-api'; import { OverridableFrontendPlugin } from '@backstage/frontend-plugin-api';