backend-plugin-api: align opaque type markers
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/backend-plugin-api': patch
|
||||
---
|
||||
|
||||
Aligned opaque type markers to all use a `$$type` property with namespacing.
|
||||
@@ -275,7 +275,7 @@ export type ExtensionPoint<T> = {
|
||||
id: string;
|
||||
T: T;
|
||||
toString(): string;
|
||||
$$ref: 'extension-point';
|
||||
$$type: '@backstage/ExtensionPoint';
|
||||
};
|
||||
|
||||
// @public
|
||||
@@ -490,7 +490,7 @@ export type ServiceRef<
|
||||
scope: TScope;
|
||||
T: TService;
|
||||
toString(): string;
|
||||
$$ref: 'service';
|
||||
$$type: '@backstage/ServiceRef';
|
||||
};
|
||||
|
||||
// @public (undocumented)
|
||||
|
||||
@@ -44,7 +44,7 @@ export type ServiceRef<
|
||||
|
||||
toString(): string;
|
||||
|
||||
$$ref: 'service';
|
||||
$$type: '@backstage/ServiceRef';
|
||||
};
|
||||
|
||||
/** @public */
|
||||
@@ -119,7 +119,7 @@ export function createServiceRef<TService>(
|
||||
toString() {
|
||||
return `serviceRef{${config.id}}`;
|
||||
},
|
||||
$$ref: 'service', // TODO: declare
|
||||
$$type: '@backstage/ServiceRef',
|
||||
__defaultFactory: defaultFactory,
|
||||
} as ServiceRef<TService, typeof scope> & {
|
||||
__defaultFactory?: (
|
||||
|
||||
@@ -48,7 +48,7 @@ describe('createSharedEnvironment', () => {
|
||||
expect(env).toBeDefined();
|
||||
const internalEnv = env() as unknown as InternalSharedBackendEnvironment;
|
||||
expect(internalEnv).toEqual({
|
||||
$$type: 'SharedBackendEnvironment',
|
||||
$$type: '@backstage/SharedBackendEnvironment',
|
||||
version: 'v1',
|
||||
services: undefined,
|
||||
});
|
||||
|
||||
@@ -31,7 +31,7 @@ export interface SharedBackendEnvironmentConfig {
|
||||
* @public
|
||||
*/
|
||||
export interface SharedBackendEnvironment {
|
||||
$$type: 'SharedBackendEnvironment';
|
||||
$$type: '@backstage/SharedBackendEnvironment';
|
||||
|
||||
// NOTE: This type is opaque in order to allow for future API evolution without
|
||||
// cluttering the external API. For example we might want to add support
|
||||
@@ -93,7 +93,7 @@ export function createSharedEnvironment<
|
||||
|
||||
// Here to ensure type safety in this internal implementation.
|
||||
const env: SharedBackendEnvironment & InternalSharedBackendEnvironment = {
|
||||
$$type: 'SharedBackendEnvironment',
|
||||
$$type: '@backstage/SharedBackendEnvironment',
|
||||
version: 'v1',
|
||||
services,
|
||||
};
|
||||
|
||||
@@ -55,7 +55,7 @@ export function createExtensionPoint<T>(
|
||||
toString() {
|
||||
return `extensionPoint{${config.id}}`;
|
||||
},
|
||||
$$ref: 'extension-point', // TODO: declare
|
||||
$$type: '@backstage/ExtensionPoint',
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ export type ExtensionPoint<T> = {
|
||||
|
||||
toString(): string;
|
||||
|
||||
$$ref: 'extension-point';
|
||||
$$type: '@backstage/ExtensionPoint';
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user