backend-plugin-api: simplified ServiceFactory type

Co-authored-by: Fredrik Adelöw <freben@gmail.com>
Co-authored-by: Johan Haals <johan.haals@gmail.com>
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2022-08-17 18:11:41 +02:00
parent 70343d6813
commit eef91a2558
12 changed files with 70 additions and 108 deletions
@@ -16,7 +16,7 @@
import { createSpecializedBackend } from '@backstage/backend-app-api';
import {
AnyServiceFactory,
ServiceFactory,
ServiceRef,
createServiceFactory,
BackendFeature,
@@ -31,7 +31,7 @@ export interface TestBackendOptions<
services?: readonly [
...{
[index in keyof TServices]:
| AnyServiceFactory
| ServiceFactory<TServices[index]>
| [ServiceRef<TServices[index]>, Partial<TServices[index]>];
},
];
@@ -68,7 +68,7 @@ export async function startTestBackend<
factory: async () => async () => serviceDef[1],
});
}
return serviceDef as AnyServiceFactory;
return serviceDef as ServiceFactory;
});
const backend = createSpecializedBackend({