core-app-api: avoid dependency on core-plugin-api/alpha

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2023-09-18 21:01:12 +02:00
parent e3f62dc619
commit 7034eb790e
2 changed files with 22 additions and 8 deletions
+12 -3
View File
@@ -64,8 +64,6 @@ import { SessionState } from '@backstage/core-plugin-api';
import { StorageApi } from '@backstage/core-plugin-api';
import { StorageValueSnapshot } from '@backstage/core-plugin-api';
import { SubRouteRef } from '@backstage/core-plugin-api';
import { TranslationMessages } from '@backstage/core-plugin-api/alpha';
import { TranslationResource } from '@backstage/core-plugin-api/alpha';
// @public
export class AlertApiForwarder implements AlertApi {
@@ -225,7 +223,18 @@ export type AppOptions = {
__experimentalTranslations?: {
defaultLanguage?: string;
availableLanguages?: string[];
resources?: Array<TranslationMessages | TranslationResource>;
resources?: Array<
| {
$$type: '@backstage/TranslationResource';
id: string;
}
| {
$$type: '@backstage/TranslationMessages';
id: string;
full: boolean;
messages: Record<string, string>;
}
>;
};
};
+10 -5
View File
@@ -27,10 +27,6 @@ import {
FeatureFlag,
} from '@backstage/core-plugin-api';
import { AppConfig } from '@backstage/config';
import {
TranslationMessages,
TranslationResource,
} from '@backstage/core-plugin-api/alpha';
/**
* Props for the `BootErrorPage` component of {@link AppComponents}.
@@ -286,7 +282,16 @@ export type AppOptions = {
__experimentalTranslations?: {
defaultLanguage?: string;
availableLanguages?: string[];
resources?: Array<TranslationMessages | TranslationResource>;
resources?: Array<
// Separate declaration for now to avoid dependency on core-plugin-api/alpha and TS 5.0
| { $$type: '@backstage/TranslationResource'; id: string }
| {
$$type: '@backstage/TranslationMessages';
id: string;
full: boolean;
messages: Record<string, string>;
}
>;
};
};