Refactor backend-test-utils

Co-authored-by: Fredrik Adelöw <freben@users.noreply.github.com>
Co-authored-by: Patrik Oldsberg <poldsberg@gmail.com>

Signed-off-by: Johan Haals <johan.haals@gmail.com>
This commit is contained in:
Johan Haals
2022-08-12 15:30:24 +02:00
parent 0ef2719b11
commit 0d2e6197d8
9 changed files with 89 additions and 41 deletions
@@ -38,12 +38,14 @@ export type ExtensionPoint<T> = {
/** @public */
export interface BackendRegistrationPoints {
registerExtensionPoint<TExtensionPoint>(
ref: ServiceRef<TExtensionPoint>,
ref: ExtensionPoint<TExtensionPoint>,
impl: TExtensionPoint,
): void;
registerInit<Deps extends { [name in string]: unknown }>(options: {
deps: { [name in keyof Deps]: ServiceRef<Deps[name]> };
init: (deps: Deps) => Promise<void>;
deps: {
[name in keyof Deps]: ServiceRef<Deps[name]> | ExtensionPoint<Deps[name]>;
};
init(deps: Deps): Promise<void>;
}): void;
}